mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-20 00:22:39 +00:00
refactor(bt/bluedroid): Refactor a2dp audio data path
- Refactor audio APIs, optimize audio data path, reduce memory copy operations - Support using external codec in application layer - The internal codec will not be compiled if not use
This commit is contained in:
@@ -264,6 +264,37 @@ UINT16 AVDT_CreateStream(UINT8 *p_handle, tAVDT_CS *p_cs)
|
||||
return result;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function AVDT_UpdateCodecInfo
|
||||
**
|
||||
** Description Update codec capability for a stream endpoint.
|
||||
**
|
||||
**
|
||||
** Returns AVDT_SUCCESS if successful, otherwise error.
|
||||
**
|
||||
*******************************************************************************/
|
||||
UINT16 AVDT_UpdateCodecInfo(UINT8 handle, UINT8 num_codec, UINT8 *codec_info, UINT16 codec_info_len)
|
||||
{
|
||||
UINT16 result = AVDT_SUCCESS;
|
||||
tAVDT_SCB *p_scb;
|
||||
|
||||
/* look up scb */
|
||||
if ((p_scb = avdt_scb_by_hdl(handle)) == NULL) {
|
||||
result = AVDT_BAD_HANDLE;
|
||||
}
|
||||
else if (num_codec != 1 || codec_info == NULL || codec_info_len != AVDT_CODEC_SIZE) {
|
||||
/* currently, only allow one codec info */
|
||||
result = AVDT_BAD_PARAMS;
|
||||
}
|
||||
else {
|
||||
/* update codec info */
|
||||
p_scb->cs.cfg.num_codec = num_codec;
|
||||
memcpy(p_scb->cs.cfg.codec_info, codec_info, codec_info_len);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function AVDT_RemoveStream
|
||||
|
Reference in New Issue
Block a user