RDK Documentation (Open Sourced RDK Components)
btrMgr_audioCap.h
Go to the documentation of this file.
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 /**
20  * @file btrMgr_audioCap.h
21  *
22  * @defgroup Audio_Cap AudioCaptureInterface
23  * This file defines bluetooth manager's audio capture interfaces to receiver
24  * data from audio capture modules.
25  * @ingroup BTR_MGR
26  *
27  */
28 
29 #ifndef __BTR_MGR_AUDIOCAP_H__
30 #define __BTR_MGR_AUDIOCAP_H__
31 
32 #include "btrMgr_Types.h"
33 
34 typedef void* tBTRMgrAcHdl;
35 
36 typedef char* tBTRMgrAcType;
37 
38 
39 const tBTRMgrAcType BTRMGR_AC_TYPE_PRIMARY = "primary";
40 const tBTRMgrAcType BTRMGR_AC_TYPE_AUXILIARY = "auxiliary";
41 
42 
43 /* Fptr Callbacks types */
44 typedef eBTRMgrRet (*fPtr_BTRMgr_AC_DataReadyCb) (void* apvAcDataBuf, unsigned int aui32AcDataLen, void *apvUserData);
45 typedef eBTRMgrRet (*fPtr_BTRMgr_AC_StatusCb) (stBTRMgrMediaStatus* apstBtrMgrSoStatus, void *apvUserData);
46 
47 /* Interfaces */
48 /**
49  * @addtogroup Audio_Cap
50  * @{
51  *
52  */
53 
54 /**
55  * @brief This API initializes the bluetooth manager audio capture interface.
56  *
57  * @param[in] phBTRMgrAcHdl Handle to the bluetooth manager audio capture interface.
58  *
59  * @return Returns the status of the operation.
60  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
61  */
62 eBTRMgrRet BTRMgr_AC_Init (tBTRMgrAcHdl* phBTRMgrAcHdl, tBTRMgrAcType api8BTRMgrAcType);
63 
64 /**
65  * @brief This API deinitializes the bluetooth manager audio capture interface.
66  *
67  * @param[in] hBTRMgrAcHdl Handle to the bluetooth manager audio capture interface.
68  *
69  * @return Returns the status of the operation.
70  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
71  */
72 eBTRMgrRet BTRMgr_AC_DeInit (tBTRMgrAcHdl hBTRMgrAcHdl);
73 
74 /**
75  * @brief This API will fetch default RMF AudioCapture Settings.
76  *
77  * Once AudioCaptureStart gets called with RMF_AudioCapture_Status, this API will
78  * continue to return the default capture settings.
79  *
80  * @param[in] hBTRMgrAcHdl Handle to the bluetooth manager audio capture interface.
81  * @param[out] apstBtrMgrAcOutASettings Structure which holds the output settings.
82  *
83  * @return Returns the status of the operation.
84  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
85  */
86 eBTRMgrRet BTRMgr_AC_GetDefaultSettings (tBTRMgrAcHdl hBTRMgrAcHdl, stBTRMgrOutASettings* apstBtrMgrAcOutASettings);
87 
88 /**
89  * @brief This API fetches the current settings to capture data as part of the specific Audio capture context.
90  *
91  * RMF_AudioCapture_Settings has been successfully set for the context.
92  *
93  * @param[in] hBTRMgrAcHdl Handle to the bluetooth manager audio capture interface.
94  * @param[out] apstBtrMgrAcOutASettings Structure which holds the output settings.
95  *
96  * @return Returns the status of the operation.
97  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
98  */
99 eBTRMgrRet BTRMgr_AC_GetCurrentSettings (tBTRMgrAcHdl hBTRMgrAcHdl, stBTRMgrOutASettings* apstBtrMgrAcOutASettings);
100 
101 /**
102  * @brief This API fetches the status of the operation.
103  *
104  * @param[in] hBTRMgrAcHdl Handle to the bluetooth manager audio capture interface.
105  * @param[out] apstBtrMgrAcStatus Status of the operation.
106  *
107  * @return Returns the status of the operation.
108  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
109  */
110 eBTRMgrRet BTRMgr_AC_GetStatus (tBTRMgrAcHdl hBTRMgrAcHdl, stBTRMgrMediaStatus* apstBtrMgrAcStatus);
111 
112 /**
113  * @brief This function will start the Audio capture with the default capture settings.
114  *
115  * If RMF_AudioCapture_Settings is NULL, This function will start the Audio capture.
116  * If a RMF_AudioCapture_Settings is NOT NULL then will reconfigure with the provided capture
117  * settings as part of RMF_AudioCapture_Settings and start audio capture.
118  *
119  * @param[in] hBTRMgrAcHdl Handle to the bluetooth manager audio capture interface.
120  * @param[out] apstBtrMgrAcOutASettings Audio capture settings.
121  * @param[in] afpcBBtrMgrAcDataReady Call back to notify AC data ready.
122  * @param[in] apvUserData User data of audio capture.
123  *
124  * @return Returns the status of the operation.
125  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
126  */
127 eBTRMgrRet BTRMgr_AC_Start (tBTRMgrAcHdl hBTRMgrAcHdl, stBTRMgrOutASettings* apstBtrMgrAcOutASettings, fPtr_BTRMgr_AC_DataReadyCb afpcBBtrMgrAcDataReady, fPtr_BTRMgr_AC_StatusCb afpcBBtrMgrAcStatus, void* apvUserData);
128 
129 /**
130  * @brief This function will stop the audio capture.
131  *
132  * Start can be called again after a Stop, as long as Close has not been called.
133  *
134  * @param[in] hBTRMgrAcHdl Handle to the audio capture interface.
135  *
136  * @return Returns the status of the operation.
137  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
138  */
139 eBTRMgrRet BTRMgr_AC_Stop (tBTRMgrAcHdl hBTRMgrAcHdl);
140 
141 /**
142  * @brief This API pauses the state of audio capture.
143  *
144  * @param[in] hBTRMgrAcHdl Handle to the audio capture interface.
145  *
146  * @return Returns the status of the operation.
147  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
148  */
149 eBTRMgrRet BTRMgr_AC_Pause (tBTRMgrAcHdl hBTRMgrAcHdl);
150 
151 /**
152  * @brief This API resumes the state of audio capture.
153  *
154  * @param[in] hBTRMgrAcHdl Handle to the audio capture interface.
155  *
156  * @return Returns the status of the operation.
157  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
158  */
159 eBTRMgrRet BTRMgr_AC_Resume (tBTRMgrAcHdl hBTRMgrAcHdl);
160 
161 /** @} */
162 
163 #endif /* __BTR_MGR_AUDIOCAP_H__ */
164 
btrMgr_Types.h
BTRMgr_AC_DeInit
eBTRMgrRet BTRMgr_AC_DeInit(tBTRMgrAcHdl hBTRMgrAcHdl)
This API deinitializes the bluetooth manager audio capture interface.
Definition: btrMgr_audioCap.c:465
BTRMgr_AC_Resume
eBTRMgrRet BTRMgr_AC_Resume(tBTRMgrAcHdl hBTRMgrAcHdl)
This API resumes the state of audio capture.
Definition: btrMgr_audioCap.c:1577
BTRMgr_AC_GetDefaultSettings
eBTRMgrRet BTRMgr_AC_GetDefaultSettings(tBTRMgrAcHdl hBTRMgrAcHdl, stBTRMgrOutASettings *apstBtrMgrAcOutASettings)
This API will fetch default RMF AudioCapture Settings.
Definition: btrMgr_audioCap.c:580
BTRMgr_AC_GetCurrentSettings
eBTRMgrRet BTRMgr_AC_GetCurrentSettings(tBTRMgrAcHdl hBTRMgrAcHdl, stBTRMgrOutASettings *apstBtrMgrAcOutASettings)
This API fetches the current settings to capture data as part of the specific Audio capture context.
Definition: btrMgr_audioCap.c:863
_stBTRMgrMediaStatus
Represents the media file status.
Definition: btrMgr_mediaTypes.h:165
_stBTRMgrOutASettings
Represents the audio output settings.
Definition: btrMgr_mediaTypes.h:153
eBTRMgrRet
enum _eBTRMgrRet eBTRMgrRet
Represents the bluetooth manager return values.
BTRMgr_AC_Stop
eBTRMgrRet BTRMgr_AC_Stop(tBTRMgrAcHdl hBTRMgrAcHdl)
This function will stop the audio capture.
Definition: btrMgr_audioCap.c:1508
BTRMgr_AC_Pause
eBTRMgrRet BTRMgr_AC_Pause(tBTRMgrAcHdl hBTRMgrAcHdl)
This API pauses the state of audio capture.
Definition: btrMgr_audioCap.c:1567
BTRMgr_AC_GetStatus
eBTRMgrRet BTRMgr_AC_GetStatus(tBTRMgrAcHdl hBTRMgrAcHdl, stBTRMgrMediaStatus *apstBtrMgrAcStatus)
This API fetches the status of the operation.
Definition: btrMgr_audioCap.c:1148
BTRMgr_AC_Init
eBTRMgrRet BTRMgr_AC_Init(tBTRMgrAcHdl *phBTRMgrAcHdl, tBTRMgrAcType api8BTRMgrAcType)
This API initializes the bluetooth manager audio capture interface.
Definition: btrMgr_audioCap.c:357
BTRMgr_AC_Start
eBTRMgrRet BTRMgr_AC_Start(tBTRMgrAcHdl hBTRMgrAcHdl, stBTRMgrOutASettings *apstBtrMgrAcOutASettings, fPtr_BTRMgr_AC_DataReadyCb afpcBBtrMgrAcDataReady, fPtr_BTRMgr_AC_StatusCb afpcBBtrMgrAcStatus, void *apvUserData)
This function will start the Audio capture with the default capture settings.
Definition: btrMgr_audioCap.c:1159