1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
|
/******************************************************************************
*
* Copyright 2003-2012 Broadcom Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************/
/******************************************************************************
*
* This is the interface file for advanced audio call-out functions.
*
******************************************************************************/
#ifndef BTA_AV_CO_H
#define BTA_AV_CO_H
#include <cstdint>
#include "bta/include/bta_av_api.h"
#include "include/hardware/bt_av.h"
#include "stack/include/a2dp_error_codes.h"
#include "stack/include/avdt_api.h"
#include "stack/include/bt_hdr.h"
#include "types/raw_address.h"
/*****************************************************************************
* Constants and data types
****************************************************************************/
/*******************************************************************************
*
* Function bta_av_co_audio_init
*
* Description This callout function is executed by AV when it is
* started by calling BTA_AvEnable(). This function can be
* used by the phone to initialize audio paths or for other
* initialization purposes.
*
*
* Returns Stream codec and content protection capabilities info.
*
******************************************************************************/
bool bta_av_co_audio_init(btav_a2dp_codec_index_t codec_index,
AvdtpSepConfig* p_cfg);
/*******************************************************************************
*
* Function bta_av_co_audio_disc_res
*
* Description This callout function is executed by AV to report the
* number of stream end points (SEP) were found during the
* AVDT stream discovery process.
*
*
* Returns void.
*
******************************************************************************/
void bta_av_co_audio_disc_res(tBTA_AV_HNDL bta_av_handle,
const RawAddress& peer_address, uint8_t num_seps,
uint8_t num_sinks, uint8_t num_sources,
uint16_t uuid_local);
/*******************************************************************************
*
* Function bta_av_co_audio_getconfig
*
* Description This callout function is executed by AV to retrieve the
* desired codec and content protection configuration for the
* audio stream.
*
*
* Returns Stream codec and content protection configuration info.
*
******************************************************************************/
tA2DP_STATUS bta_av_co_audio_getconfig(tBTA_AV_HNDL bta_av_handle,
const RawAddress& peer_address,
uint8_t* p_codec_info,
uint8_t* p_sep_info_idx, uint8_t seid,
uint8_t* p_num_protect,
uint8_t* p_protect_info);
/*******************************************************************************
*
* Function bta_av_co_audio_setconfig
*
* Description This callout function is executed by AV to set the
* codec and content protection configuration of the audio
* stream.
*
*
* Returns void
*
******************************************************************************/
void bta_av_co_audio_setconfig(tBTA_AV_HNDL bta_av_handle,
const RawAddress& peer_address,
const uint8_t* p_codec_info, uint8_t seid,
uint8_t num_protect,
const uint8_t* p_protect_info,
uint8_t t_local_sep, uint8_t avdt_handle);
/*******************************************************************************
*
* Function bta_av_co_audio_open
*
* Description This function is called by AV when the audio stream
* connection is opened.
* BTA-AV maintains the MTU of A2DP streams.
* If this is the 2nd audio stream, mtu is the smaller of the 2
* streams.
*
* Returns void
*
******************************************************************************/
void bta_av_co_audio_open(tBTA_AV_HNDL bta_av_handle,
const RawAddress& peer_address, uint16_t mtu);
/*******************************************************************************
*
* Function bta_av_co_audio_close
*
* Description This function is called by AV when the audio stream
* connection is closed.
* BTA-AV maintains the MTU of A2DP streams.
* When one stream is closed and no other audio stream is open,
* mtu is reported as 0.
* Otherwise, the MTU remains open is reported.
*
* Returns void
*
******************************************************************************/
void bta_av_co_audio_close(tBTA_AV_HNDL bta_av_handle,
const RawAddress& peer_address);
/*******************************************************************************
*
* Function bta_av_co_audio_start
*
* Description This function is called by AV when the audio streaming data
* transfer is started.
*
*
* Returns void
*
******************************************************************************/
void bta_av_co_audio_start(tBTA_AV_HNDL bta_av_handle,
const RawAddress& peer_address,
const uint8_t* p_codec_info, bool* p_no_rtp_header);
/*******************************************************************************
*
* Function bta_av_co_audio_stop
*
* Description This function is called by AV when the audio streaming data
* transfer is stopped.
*
*
* Returns void
*
******************************************************************************/
void bta_av_co_audio_stop(tBTA_AV_HNDL bta_av_handle,
const RawAddress& peer_address);
/*******************************************************************************
*
* Function bta_av_co_audio_source_data_path
*
* Description This function is called to get the next data buffer from
* the audio codec
*
* Returns NULL if data is not ready.
* Otherwise, a buffer (BT_HDR*) containing the audio data.
*
******************************************************************************/
BT_HDR* bta_av_co_audio_source_data_path(const uint8_t* p_codec_info,
uint32_t* p_timestamp);
/*******************************************************************************
*
* Function bta_av_co_audio_drop
*
* Description An Audio packet is dropped.
* It's very likely that the connected headset with this handle
* is moved far away. The implementation may want to reduce
* the encoder bit rate setting to reduce the packet size.
*
* Returns void
*
******************************************************************************/
void bta_av_co_audio_drop(tBTA_AV_HNDL bta_av_handle,
const RawAddress& peer_address);
/*******************************************************************************
*
* Function bta_av_co_audio_delay
*
* Description This function is called by AV when the audio stream
* connection needs to send the initial delay report to the
* connected SRC.
*
*
* Returns void
*
******************************************************************************/
void bta_av_co_audio_delay(tBTA_AV_HNDL bta_av_handle,
const RawAddress& peer_address, uint16_t delay);
/*******************************************************************************
*
* Function bta_av_co_audio_update_mtu
*
* Description This function is called by AV when the audio stream
* connection MTU needs to be updated.
* BTA-AV maintains the MTU of A2DP streams.
* If this is the 2nd audio stream, mtu is the smaller of the 2
* streams.
*
* Returns void
*
******************************************************************************/
void bta_av_co_audio_update_mtu(tBTA_AV_HNDL bta_av_handle,
const RawAddress& peer_address, uint16_t mtu);
/*******************************************************************************
**
** Function bta_av_co_get_scmst_info
**
** Description Get the SCMS-T information for the specific peer
**
** Returns btav_a2dp_scmst_info_t.
** It contains the information of SCMS-T which are the SCMS-T
** enable status for the specific peer and the SCMS-T header
** if SCMS-T is enabled.
**
******************************************************************************/
btav_a2dp_scmst_info_t bta_av_co_get_scmst_info(const RawAddress& peer_address);
#endif /* BTA_AV_CO_H */
|