RDK Documentation (Open Sourced RDK Components)
btrMgr_streamOut.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_streamOut.h
21  *
22  * @defgroup Stream_Out StreamOut Interface
23  * This file defines bluetooth manager's data streaming interfaces to external Bluetooth devices.
24  * @ingroup BTR_MGR
25  *
26  */
27 
28 #ifndef __BTR_MGR_STREAMOUT_H__
29 #define __BTR_MGR_STREAMOUT_H__
30 
31 typedef void* tBTRMgrSoHdl;
32 
33 /**
34  * @addtogroup Stream_Out
35  * @{
36  *
37  */
38 
39 /* Public macros */
40 #define BTRMGR_SO_MAX_VOLUME 255
41 
42 
43 /* Fptr Callbacks types */
44 typedef eBTRMgrRet (*fPtr_BTRMgr_SO_StatusCb) (stBTRMgrMediaStatus* apstBtrMgrSoStatus, void *apvUserData);
45 
46 
47 /* Interfaces */
48 /**
49  * @brief This API invokes BTRMgr_SO_GstInit() and also set the state as initialized.
50  *
51  * @param[in] phBTRMgrSoHdl Handle to the stream out interface.
52  * @param[in] afpcBSoStatus Callback function.
53  * @param[in] apvUserData Data for the callback function.
54  *
55  * @return Returns the status of the operation.
56  * @retval eBTRMgrSOGstSuccess on success, appropriate error code otherwise.
57  */
58 eBTRMgrRet BTRMgr_SO_Init (tBTRMgrSoHdl* phBTRMgrSoHdl, fPtr_BTRMgr_SO_StatusCb afpcBSoStatus, void* apvUserData);
59 
60 /**
61  * @brief This API invokes BTRMgr_SO_GstDeInit() for the deinitializations.
62  *
63  * It also set the state as deinitialized.
64  *
65  * @param[in] hBTRMgrSoHdl Handle to the stream out interface.
66  *
67  * @return Returns the status of the operation.
68  * @retval eBTRMgrSOGstSuccess on success, appropriate error code otherwise.
69  */
70 eBTRMgrRet BTRMgr_SO_DeInit (tBTRMgrSoHdl hBTRMgrSoHdl);
71 
72 /**
73  * @brief This API is used to load the default settings used by this interface.
74  *
75  * @param[in] hBTRMgrSoHdl Handle to the stream out interface.
76  *
77  * @return Returns the status of the operation.
78  * @retval eBTRMgrSOGstSuccess on success, appropriate error code otherwise.
79  */
80 eBTRMgrRet BTRMgr_SO_GetDefaultSettings (tBTRMgrSoHdl hBTRMgrSoHdl);
81 
82 /**
83  * @brief This API will fetch the current settings used by this interface.
84  *
85  * @param[in] hBTRMgrSoHdl Handle to the bluetooth manager stream out interface.
86  *
87  * @return Returns the status of the operation.
88  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
89  */
90 eBTRMgrRet BTRMgr_SO_GetCurrentSettings (tBTRMgrSoHdl hBTRMgrSoHdl);
91 
92 /**
93  * @brief This API fetches the media file status.
94  *
95  * @param[in] hBTRMgrSoHdl Handle to the bluetooth manager stream out interface.
96  * @param[out] apstBtrMgrSoStatus Structure which holds the status.
97  *
98  * @return Returns the status of the operation.
99  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
100  */
101 eBTRMgrRet BTRMgr_SO_GetStatus (tBTRMgrSoHdl hBTRMgrSoHdl, stBTRMgrMediaStatus* apstBtrMgrSoStatus);
102 
103 /**
104  * @brief This API will set the current settings used by this interface.
105  *
106  * @param[in] hBTRMgrSoHdl Handle to the bluetooth manager stream out interface.
107  * @param[in] pstBtrMgrSoStatus Status of media device that has to be fetched.
108  *
109  * @return Returns the status of the operation.
110  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
111  */
112 eBTRMgrRet BTRMgr_SO_SetStatus (tBTRMgrSoHdl hBTRMgrSoHdl, stBTRMgrMediaStatus* apstBtrMgrSoStatus);
113 
114 /**
115  * @brief This API will set the current volume used by this interface.
116  *
117  * @param[in] hBTRMgrSoHdl Handle to the bluetooth manager stream out interface.
118  * @param[in] ui8Volume Volume of media device that has to be set.
119  *
120  * @return Returns the status of the operation.
121  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
122  */
123 eBTRMgrRet BTRMgr_SO_SetVolume (tBTRMgrSoHdl hBTRMgrSoHdl, unsigned char ui8Volume);
124 
125 /**
126  * @brief This API will fetches the current volume used by this interface.
127  *
128  * @param[in] hBTRMgrSoHdl Handle to the bluetooth manager stream out interface.
129  * @param[in] ui8Volume Volume of media device that has to be fetched.
130  *
131  * @return Returns the status of the operation.
132  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
133  */
134 eBTRMgrRet BTRMgr_SO_GetVolume (tBTRMgrSoHdl hBTRMgrSoHdl, unsigned char* ui8Volume);
135 
136 /**
137  * @brief This API will set the Mute used by this interface.
138  *
139  * @param[in] hBTRMgrSoHdl Handle to the bluetooth manager stream out interface.
140  * @param[in] Mute Mute of media device that has to be set.
141  *
142  * @return Returns the status of the operation.
143  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
144  */
145 eBTRMgrRet BTRMgr_SO_SetMute (tBTRMgrSoHdl hBTRMgrSoHdl, gboolean Mute);
146 
147 /**
148  * @brief This API will fetches the Mute used by this interface.
149  *
150  * @param[in] hBTRMgrSoHdl Handle to the bluetooth manager stream out interface.
151  * @param[in] Mute Mute of media device that has to be fetched.
152  *
153  * @return Returns the status of the operation.
154  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
155  */
156 eBTRMgrRet BTRMgr_SO_GetMute (tBTRMgrSoHdl hBTRMgrSoHdl, gboolean* Mute);
157 
158 /**
159  * @brief This API fetches the maximum transmission rate.
160  *
161  * @param[in] hBTRMgrSoHdl Handle to the bluetooth manager stream out interface.
162  * @param[in] apstBtrMgrSoInASettings Structure which holds the audio input settings.
163  * @param[out] apstBtrMgrSoOutASettings Saves the MTU information.
164  *
165  * @return Returns the status of the operation.
166  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
167  */
168 eBTRMgrRet BTRMgr_SO_GetEstimatedInABufSize (tBTRMgrSoHdl hBTRMgrSoHdl, stBTRMgrInASettings* apstBtrMgrSoInASettings, stBTRMgrOutASettings* apstBtrMgrSoOutASettings);
169 /**
170  * @brief This API uses BTRMgr_SO_GstStart(), starts the pipeline.
171  *
172  * It also sets the state as playing.
173  *
174  * @param[in] hBTRMgrSoHdl Handle to the bluetooth manager stream out interface.
175  * @param[in] apstBtrMgrSoInASettings Structure which holds the audio input settings.
176  * @param[in] apstBtrMgrSoOutASettings Structure which holds the audio output settings.
177  *
178  * @return Returns the status of the operation.
179  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
180  */
181 eBTRMgrRet BTRMgr_SO_Start (tBTRMgrSoHdl hBTRMgrSoHdl, stBTRMgrInASettings* apstBtrMgrSoInASettings, stBTRMgrOutASettings* apstBtrMgrSoOutASettings);
182 
183 /**
184  * @brief This API uses BTRMgr_SO_GstStop() for closing the pipeline.
185  *
186  * Sets the Bluetooth manager state as stopped.
187  *
188  * @param[in] hBTRMgrSoHdl Handle to the bluetooth manager stream out interface.
189  *
190  * @return Returns the status of the operation.
191  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
192  */
193 eBTRMgrRet BTRMgr_SO_Stop (tBTRMgrSoHdl hBTRMgrSoHdl);
194 
195 /**
196  * @brief This API uses BTRMgr_SO_GstPause() for pausing the current operation.
197  *
198  * @param[in] hBTRMgrSoHdl Handle to the bluetooth manager stream out interface.
199  *
200  * @return Returns the status of the operation.
201  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
202  */
203 eBTRMgrRet BTRMgr_SO_Pause (tBTRMgrSoHdl hBTRMgrSoHdl);
204 
205 /**
206  * @brief This API uses BTRMgr_SO_GstResume() to resume the status.
207  *
208  * @param[in] hBTRMgrSoHdl Handle to the bluetooth manager stream out interface.
209  *
210  * @return Returns the status of the operation.
211  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
212  */
213 eBTRMgrRet BTRMgr_SO_Resume (tBTRMgrSoHdl hBTRMgrSoHdl);
214 
215 /**
216  * @brief Invokes BTRMgr_SO_GstSendBuffer() to add the buffer to the queue.
217  *
218  * @param[in] hBTRMgrSoHdl Handle to the bluetooth manager stream outinterface.
219  * @param[in] pcInBuf The buffer to be added to the queue.
220  * @param[in] aiInBufSize Buffer size.
221  *
222  * @return Returns the status of the operation.
223  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
224  */
225 eBTRMgrRet BTRMgr_SO_SendBuffer (tBTRMgrSoHdl hBTRMgrSoHdl, char* pcInBuf, int aiInBufSize);
226 
227 /**
228  * @brief This API is used to indicate the End of stream.
229  *
230  * Invokes the BTRMgr_SO_GstSendEOS() to push the end of stream.
231  * Also sets the bluetooth manager status as completed.
232  *
233  * @param[in] hBTRMgrSoHdl Handle to the bluetooth manager stream out interface.
234  *
235  * @return Returns the status of the operation.
236  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
237  */
238 eBTRMgrRet BTRMgr_SO_SendEOS (tBTRMgrSoHdl hBTRMgrSoHdl);
239 /** @} */
240 
241 #endif /* __BTR_MGR_STREAMOUT_H__ */
BTRMgr_SO_SetMute
eBTRMgrRet BTRMgr_SO_SetMute(tBTRMgrSoHdl hBTRMgrSoHdl, gboolean Mute)
This API will set the Mute used by this interface.
Definition: btrMgr_streamOut.c:325
BTRMgr_SO_GetDefaultSettings
eBTRMgrRet BTRMgr_SO_GetDefaultSettings(tBTRMgrSoHdl hBTRMgrSoHdl)
This API is used to load the default settings used by this interface.
Definition: btrMgr_streamOut.c:160
_stBTRMgrInASettings
Represents the audio input settings.
Definition: btrMgr_mediaTypes.h:142
BTRMgr_SO_Pause
eBTRMgrRet BTRMgr_SO_Pause(tBTRMgrSoHdl hBTRMgrSoHdl)
This API uses BTRMgr_SO_GstPause() for pausing the current operation.
Definition: btrMgr_streamOut.c:753
BTRMgr_SO_SetVolume
eBTRMgrRet BTRMgr_SO_SetVolume(tBTRMgrSoHdl hBTRMgrSoHdl, unsigned char ui8Volume)
This API will set the current volume used by this interface.
Definition: btrMgr_streamOut.c:277
BTRMgr_SO_Init
eBTRMgrRet BTRMgr_SO_Init(tBTRMgrSoHdl *phBTRMgrSoHdl, fPtr_BTRMgr_SO_StatusCb afpcBSoStatus, void *apvUserData)
This API invokes BTRMgr_SO_GstInit() and also set the state as initialized.
Definition: btrMgr_streamOut.c:77
BTRMgr_SO_Resume
eBTRMgrRet BTRMgr_SO_Resume(tBTRMgrSoHdl hBTRMgrSoHdl)
This API uses BTRMgr_SO_GstResume() to resume the status.
Definition: btrMgr_streamOut.c:783
_stBTRMgrMediaStatus
Represents the media file status.
Definition: btrMgr_mediaTypes.h:165
BTRMgr_SO_SendEOS
eBTRMgrRet BTRMgr_SO_SendEOS(tBTRMgrSoHdl hBTRMgrSoHdl)
This API is used to indicate the End of stream.
Definition: btrMgr_streamOut.c:844
BTRMgr_SO_GetStatus
eBTRMgrRet BTRMgr_SO_GetStatus(tBTRMgrSoHdl hBTRMgrSoHdl, stBTRMgrMediaStatus *apstBtrMgrSoStatus)
This API fetches the media file status.
Definition: btrMgr_streamOut.c:200
_stBTRMgrOutASettings
Represents the audio output settings.
Definition: btrMgr_mediaTypes.h:153
eBTRMgrRet
enum _eBTRMgrRet eBTRMgrRet
Represents the bluetooth manager return values.
BTRMgr_SO_Start
eBTRMgrRet BTRMgr_SO_Start(tBTRMgrSoHdl hBTRMgrSoHdl, stBTRMgrInASettings *apstBtrMgrSoInASettings, stBTRMgrOutASettings *apstBtrMgrSoOutASettings)
This API uses BTRMgr_SO_GstStart(), starts the pipeline.
Definition: btrMgr_streamOut.c:507
BTRMgr_SO_Stop
eBTRMgrRet BTRMgr_SO_Stop(tBTRMgrSoHdl hBTRMgrSoHdl)
This API uses BTRMgr_SO_GstStop() for closing the pipeline.
Definition: btrMgr_streamOut.c:721
BTRMgr_SO_SetStatus
eBTRMgrRet BTRMgr_SO_SetStatus(tBTRMgrSoHdl hBTRMgrSoHdl, stBTRMgrMediaStatus *apstBtrMgrSoStatus)
This API will set the current settings used by this interface.
Definition: btrMgr_streamOut.c:221
BTRMgr_SO_GetEstimatedInABufSize
eBTRMgrRet BTRMgr_SO_GetEstimatedInABufSize(tBTRMgrSoHdl hBTRMgrSoHdl, stBTRMgrInASettings *apstBtrMgrSoInASettings, stBTRMgrOutASettings *apstBtrMgrSoOutASettings)
This API fetches the maximum transmission rate.
Definition: btrMgr_streamOut.c:368
BTRMgr_SO_SendBuffer
eBTRMgrRet BTRMgr_SO_SendBuffer(tBTRMgrSoHdl hBTRMgrSoHdl, char *pcInBuf, int aiInBufSize)
Invokes BTRMgr_SO_GstSendBuffer() to add the buffer to the queue.
Definition: btrMgr_streamOut.c:813
BTRMgr_SO_DeInit
eBTRMgrRet BTRMgr_SO_DeInit(tBTRMgrSoHdl hBTRMgrSoHdl)
This API invokes BTRMgr_SO_GstDeInit() for the deinitializations.
Definition: btrMgr_streamOut.c:125
BTRMgr_SO_GetCurrentSettings
eBTRMgrRet BTRMgr_SO_GetCurrentSettings(tBTRMgrSoHdl hBTRMgrSoHdl)
This API will fetch the current settings used by this interface.
Definition: btrMgr_streamOut.c:180
BTRMgr_SO_GetVolume
eBTRMgrRet BTRMgr_SO_GetVolume(tBTRMgrSoHdl hBTRMgrSoHdl, unsigned char *ui8Volume)
This API will fetches the current volume used by this interface.
Definition: btrMgr_streamOut.c:298
BTRMgr_SO_GetMute
eBTRMgrRet BTRMgr_SO_GetMute(tBTRMgrSoHdl hBTRMgrSoHdl, gboolean *Mute)
This API will fetches the Mute used by this interface.
Definition: btrMgr_streamOut.c:343