RDK Documentation (Open Sourced RDK Components)
btrMgr_streamIn.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_streamIn.h
21  *
22  * @defgroup Stream_In Stream In 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_STREAMIN_H__
29 #define __BTR_MGR_STREAMIN_H__
30 
31 typedef void* tBTRMgrSiHdl;
32 
33 /**
34  * @addtogroup Stream_In
35  * @{
36  *
37  */
38 
39 /* Fptr Callbacks types */
40 typedef eBTRMgrRet (*fPtr_BTRMgr_SI_StatusCb) (stBTRMgrMediaStatus* apstBtrMgrSiStatus, void *apvUserData);
41 
42 
43 /* Interfaces */
44 /**
45  * @brief This API invokes BTRMgr_SI_GstInit() for the stream in initializations.
46  *
47  * @param[in] phBTRMgrSiHdl Handle to the stream in interface.
48  * @param[in] afpcBSiStatus Stream In callback function.
49  * @param[in] apvUserData Data for the callback function.
50  *
51  * @return Returns the status of the operation.
52  * @retval eBTRMgrSIGstSuccess on success, appropriate error code otherwise.
53  */
54 eBTRMgrRet BTRMgr_SI_Init (tBTRMgrSiHdl* phBTRMgrSiHdl, fPtr_BTRMgr_SI_StatusCb afpcBSiStatus, void* apvUserData);
55 
56 /**
57  * @brief This API invokes BTRMgr_SI_GstDeInit() for the deinitializations.
58  *
59  * @param[in] hBTRMgrSiHdl Handle to the stream in interface.
60  *
61  * @return Returns the status of the operation.
62  * @retval eBTRMgrSIGstSuccess on success, appropriate error code otherwise.
63  */
64 eBTRMgrRet BTRMgr_SI_DeInit (tBTRMgrSiHdl hBTRMgrSiHdl);
65 
66 /**
67  * @brief This API is used to load the default settings used by this interface.
68  *
69  * @param[in] hBTRMgrSiHdl Handle to the stream in interface.
70  *
71  * @return Returns the status of the operation.
72  * @retval eBTRMgrSIGstSuccess on success, appropriate error code otherwise.
73  */
74 eBTRMgrRet BTRMgr_SI_GetDefaultSettings (tBTRMgrSiHdl hBTRMgrSiHdl);
75 
76 /**
77  * @brief This API will fetch the current settings used by this interface.
78  *
79  * @param[in] hBTRMgrSiHdl Handle to the bluetooth manager stream in interface.
80  *
81  * @return Returns the status of the operation.
82  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
83  */
84 eBTRMgrRet BTRMgr_SI_GetCurrentSettings (tBTRMgrSiHdl hBTRMgrSiHdl);
85 
86 /**
87  * @brief This API will fetch the current settings used by this interface.
88  *
89  * @param[in] hBTRMgrSiHdl Handle to the bluetooth manager stream in interface.
90  * @param[in] pstBtrMgrSiStatus Status of media device that has to be fetched.
91  *
92  * @return Returns the status of the operation.
93  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
94  */
95 eBTRMgrRet BTRMgr_SI_GetStatus (tBTRMgrSiHdl hBTRMgrSiHdl, stBTRMgrMediaStatus* apstBtrMgrSiStatus);
96 
97 /**
98  * @brief This API will set the current settings used by this interface.
99  *
100  * @param[in] hBTRMgrSiHdl Handle to the bluetooth manager stream in interface.
101  * @param[in] pstBtrMgrSiStatus Status of media device that has to be fetched.
102  *
103  * @return Returns the status of the operation.
104  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
105  */
106 eBTRMgrRet BTRMgr_SI_SetStatus (tBTRMgrSiHdl hBTRMgrSiHdl, stBTRMgrMediaStatus* apstBtrMgrSiStatus);
107 
108 /**
109  * @brief This API uses BTRMgr_SI_GstStart(), starts the pipeline.
110  *
111  * @param[in] hBTRMgrSiHdl Handle to the bluetooth manager stream in interface.
112  * @param[in] aiInBufMaxSize Maximum buffer size.
113  * @param[in] aiBTDevFd Input file descriptor.
114  * @param[in] aiBTDevMTU Block size to read.
115  * @param[in] aiBTDevSFreq The Clock rate.
116  *
117  * @return Returns the status of the operation.
118  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
119  */
120 eBTRMgrRet BTRMgr_SI_Start (tBTRMgrSiHdl hBTRMgrSiHdl, int aiInBufMaxSize, stBTRMgrInASettings* apstBtrMgrSiInASettings);
121 
122 /**
123  * @brief This API uses BTRMgr_SI_GstStop() for closing the pipeline.
124  *
125  * @param[in] hBTRMgrSiHdl Handle to the bluetooth manager stream in interface.
126  *
127  * @return Returns the status of the operation.
128  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
129  */
130 eBTRMgrRet BTRMgr_SI_Stop (tBTRMgrSiHdl hBTRMgrSiHdl);
131 
132 /**
133  * @brief This API uses BTRMgr_SI_GstPause() for pausing the current operation.
134  *
135  * @param[in] hBTRMgrSiHdl Handle to the bluetooth manager audio capture interface.
136  *
137  * @return Returns the status of the operation.
138  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
139  */
140 eBTRMgrRet BTRMgr_SI_Pause (tBTRMgrSiHdl hBTRMgrSiHdl);
141 
142 /**
143  * @brief This API uses BTRMgr_SI_GstResume() to resume the status.
144  *
145  * @param[in] hBTRMgrSiHdl Handle to the bluetooth manager audio capture interface.
146  *
147  * @return Returns the status of the operation.
148  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
149  */
150 eBTRMgrRet BTRMgr_SI_Resume (tBTRMgrSiHdl hBTRMgrSiHdl);
151 
152 /**
153  * @brief Invokes BTRMgr_SI_GstSendBuffer() to add the buffer to the queue.
154  *
155  * @param[in] hBTRMgrSiHdl Handle to the bluetooth manager audio capture interface.
156  * @param[in] pcInBuf The buffer to be added to the queue.
157  * @param[in] aiInBufSize Buffer size.
158  *
159  * @return Returns the status of the operation.
160  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
161  */
162 eBTRMgrRet BTRMgr_SI_SendBuffer (tBTRMgrSiHdl hBTRMgrSiHdl, char* pcInBuf, int aiInBufSize);
163 
164 /**
165  * @brief This API is used to indicate the End of stream.
166  *
167  * Invokes the BTRMgr_SI_GstSendEOS() to push the end of stream.
168  * Also sets the bluetooth manager status as completed.
169  *
170  * @param[in] hBTRMgrSiHdl Handle to the bluetooth manager audio capture interface.
171  *
172  * @return Returns the status of the operation.
173  * @retval eBTRMgrSuccess on success, appropriate error code otherwise.
174  */
175 eBTRMgrRet BTRMgr_SI_SendEOS (tBTRMgrSiHdl hBTRMgrSiHdl);
176 
177 /** @} */
178 #endif /* __BTR_MGR_STREAMOUT_H__ */
BTRMgr_SI_Start
eBTRMgrRet BTRMgr_SI_Start(tBTRMgrSiHdl hBTRMgrSiHdl, int aiInBufMaxSize, stBTRMgrInASettings *apstBtrMgrSiInASettings)
This API uses BTRMgr_SI_GstStart(), starts the pipeline.
Definition: btrMgr_streamIn.c:272
_stBTRMgrInASettings
Represents the audio input settings.
Definition: btrMgr_mediaTypes.h:142
BTRMgr_SI_Init
eBTRMgrRet BTRMgr_SI_Init(tBTRMgrSiHdl *phBTRMgrSiHdl, fPtr_BTRMgr_SI_StatusCb afpcBSiStatus, void *apvUserData)
This API invokes BTRMgr_SI_GstInit() for the stream in initializations.
Definition: btrMgr_streamIn.c:75
BTRMgr_SI_GetStatus
eBTRMgrRet BTRMgr_SI_GetStatus(tBTRMgrSiHdl hBTRMgrSiHdl, stBTRMgrMediaStatus *apstBtrMgrSiStatus)
This API will fetch the current settings used by this interface.
Definition: btrMgr_streamIn.c:195
_stBTRMgrMediaStatus
Represents the media file status.
Definition: btrMgr_mediaTypes.h:165
BTRMgr_SI_Stop
eBTRMgrRet BTRMgr_SI_Stop(tBTRMgrSiHdl hBTRMgrSiHdl)
This API uses BTRMgr_SI_GstStop() for closing the pipeline.
Definition: btrMgr_streamIn.c:434
BTRMgr_SI_Pause
eBTRMgrRet BTRMgr_SI_Pause(tBTRMgrSiHdl hBTRMgrSiHdl)
This API uses BTRMgr_SI_GstPause() for pausing the current operation.
Definition: btrMgr_streamIn.c:466
BTRMgr_SI_GetCurrentSettings
eBTRMgrRet BTRMgr_SI_GetCurrentSettings(tBTRMgrSiHdl hBTRMgrSiHdl)
This API will fetch the current settings used by this interface.
Definition: btrMgr_streamIn.c:175
BTRMgr_SI_SetStatus
eBTRMgrRet BTRMgr_SI_SetStatus(tBTRMgrSiHdl hBTRMgrSiHdl, stBTRMgrMediaStatus *apstBtrMgrSiStatus)
This API will set the current settings used by this interface.
Definition: btrMgr_streamIn.c:216
BTRMgr_SI_GetDefaultSettings
eBTRMgrRet BTRMgr_SI_GetDefaultSettings(tBTRMgrSiHdl hBTRMgrSiHdl)
This API is used to load the default settings used by this interface.
Definition: btrMgr_streamIn.c:155
eBTRMgrRet
enum _eBTRMgrRet eBTRMgrRet
Represents the bluetooth manager return values.
BTRMgr_SI_SendEOS
eBTRMgrRet BTRMgr_SI_SendEOS(tBTRMgrSiHdl hBTRMgrSiHdl)
This API is used to indicate the End of stream.
Definition: btrMgr_streamIn.c:557
BTRMgr_SI_Resume
eBTRMgrRet BTRMgr_SI_Resume(tBTRMgrSiHdl hBTRMgrSiHdl)
This API uses BTRMgr_SI_GstResume() to resume the status.
Definition: btrMgr_streamIn.c:496
BTRMgr_SI_DeInit
eBTRMgrRet BTRMgr_SI_DeInit(tBTRMgrSiHdl hBTRMgrSiHdl)
This API invokes BTRMgr_SI_GstDeInit() for the deinitializations.
Definition: btrMgr_streamIn.c:121
BTRMgr_SI_SendBuffer
eBTRMgrRet BTRMgr_SI_SendBuffer(tBTRMgrSiHdl hBTRMgrSiHdl, char *pcInBuf, int aiInBufSize)
Invokes BTRMgr_SI_GstSendBuffer() to add the buffer to the queue.
Definition: btrMgr_streamIn.c:526