a2dp source: fix api for create stream endpoint

This commit is contained in:
Milanka Ringwald 2018-04-13 17:24:01 +02:00
parent 94d9af0cbe
commit b60d3b4722
2 changed files with 9 additions and 8 deletions

View File

@ -433,20 +433,21 @@ void a2dp_source_init(void){
l2cap_register_service(&packet_handler, BLUETOOTH_PROTOCOL_AVDTP, 0xffff, LEVEL_0);
}
avdtp_stream_endpoint_t * a2dp_source_create_stream_endpoint(avdtp_media_type_t media_type, avdtp_media_codec_type_t media_codec_type,
uint8_t a2dp_source_create_stream_endpoint(avdtp_media_type_t media_type, avdtp_media_codec_type_t media_codec_type,
uint8_t * codec_capabilities, uint16_t codec_capabilities_len,
uint8_t * media_codec_info, uint16_t media_codec_info_len){
uint8_t * media_codec_info, uint16_t media_codec_info_len, uint8_t * local_seid){
*local_seid = 0;
avdtp_stream_endpoint_t * local_stream_endpoint = avdtp_source_create_stream_endpoint(AVDTP_SOURCE, media_type);
if (!local_stream_endpoint){
return NULL;
return BTSTACK_MEMORY_ALLOC_FAILED;
}
*local_seid = avdtp_local_seid(local_stream_endpoint);
avdtp_source_register_media_transport_category(avdtp_stream_endpoint_seid(local_stream_endpoint));
avdtp_source_register_media_codec_category(avdtp_stream_endpoint_seid(local_stream_endpoint), media_type, media_codec_type,
codec_capabilities, codec_capabilities_len);
local_stream_endpoint->remote_configuration.media_codec.media_codec_information = media_codec_info;
local_stream_endpoint->remote_configuration.media_codec.media_codec_information_len = media_codec_info_len;
sc.local_stream_endpoint = local_stream_endpoint;
return local_stream_endpoint;
return ERROR_CODE_SUCCESS;
}
uint8_t a2dp_source_establish_stream(bd_addr_t remote_addr, uint8_t loc_seid, uint16_t * a2dp_cid){

View File

@ -81,9 +81,9 @@ void a2dp_source_init(void);
*
* @return status ERROR_CODE_SUCCESS if sucessful.
*/
avdtp_stream_endpoint_t * a2dp_source_create_stream_endpoint(avdtp_media_type_t media_type, avdtp_media_codec_type_t media_codec_type,
uint8_t * codec_capabilities, uint16_t codec_capabilities_len,
uint8_t * codec_configuration, uint16_t codec_configuration_len);
uint8_t a2dp_source_create_stream_endpoint(avdtp_media_type_t media_type, avdtp_media_codec_type_t media_codec_type,
uint8_t * codec_capabilities, uint16_t codec_capabilities_len,
uint8_t * media_codec_info, uint16_t media_codec_info_len, uint8_t * local_seid);
/**
* @brief Register callback for the A2DP Source client. It will receive following subevents of HCI_EVENT_A2DP_META HCI event type: