mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-10 15:44:32 +00:00
avdtp: skip stream endpoints that are currently in use, mark when selected
This commit is contained in:
parent
855fce2d38
commit
7982528c77
@ -413,6 +413,7 @@ static void a2dp_source_packet_handler_internal(uint8_t packet_type, uint16_t ch
|
|||||||
configuration.min_bitpool_value = avdtp_choose_sbc_min_bitpool_value(stream_endpoint, avdtp_subevent_signaling_media_codec_sbc_capability_get_min_bitpool_value(packet));
|
configuration.min_bitpool_value = avdtp_choose_sbc_min_bitpool_value(stream_endpoint, avdtp_subevent_signaling_media_codec_sbc_capability_get_min_bitpool_value(packet));
|
||||||
|
|
||||||
// and pre-select this endpoint
|
// and pre-select this endpoint
|
||||||
|
stream_endpoint->sep.in_use = 1;
|
||||||
local_seid = avdtp_stream_endpoint_seid(stream_endpoint);
|
local_seid = avdtp_stream_endpoint_seid(stream_endpoint);
|
||||||
remote_seid = avdtp_subevent_signaling_media_codec_sbc_capability_get_remote_seid(packet);
|
remote_seid = avdtp_subevent_signaling_media_codec_sbc_capability_get_remote_seid(packet);
|
||||||
a2dp_source_set_config_sbc(cid, local_seid, remote_seid, &configuration);
|
a2dp_source_set_config_sbc(cid, local_seid, remote_seid, &configuration);
|
||||||
|
@ -150,6 +150,7 @@ avdtp_stream_endpoint_t * avdtp_get_source_stream_endpoint_for_media_codec(avdtp
|
|||||||
if (stream_endpoint->sep.type != AVDTP_SOURCE) continue;
|
if (stream_endpoint->sep.type != AVDTP_SOURCE) continue;
|
||||||
if (stream_endpoint->sep.media_type != AVDTP_AUDIO) continue;
|
if (stream_endpoint->sep.media_type != AVDTP_AUDIO) continue;
|
||||||
if (stream_endpoint->sep.capabilities.media_codec.media_codec_type != codec_type) continue;
|
if (stream_endpoint->sep.capabilities.media_codec.media_codec_type != codec_type) continue;
|
||||||
|
if (stream_endpoint->sep.in_use) continue;
|
||||||
return stream_endpoint;
|
return stream_endpoint;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -162,6 +163,7 @@ avdtp_stream_endpoint_t * avdtp_get_source_stream_endpoint_for_media_codec_other
|
|||||||
avdtp_stream_endpoint_t * stream_endpoint = (avdtp_stream_endpoint_t *)btstack_linked_list_iterator_next(&it);
|
avdtp_stream_endpoint_t * stream_endpoint = (avdtp_stream_endpoint_t *)btstack_linked_list_iterator_next(&it);
|
||||||
if (stream_endpoint->sep.type != AVDTP_SOURCE) continue;
|
if (stream_endpoint->sep.type != AVDTP_SOURCE) continue;
|
||||||
if (stream_endpoint->sep.media_type != AVDTP_AUDIO) continue;
|
if (stream_endpoint->sep.media_type != AVDTP_AUDIO) continue;
|
||||||
|
if (stream_endpoint->sep.in_use) continue;
|
||||||
if (stream_endpoint->sep.capabilities.media_codec.media_codec_type != AVDTP_CODEC_NON_A2DP) continue;
|
if (stream_endpoint->sep.capabilities.media_codec.media_codec_type != AVDTP_CODEC_NON_A2DP) continue;
|
||||||
if (stream_endpoint->sep.capabilities.media_codec.media_codec_information_len < 6) continue;
|
if (stream_endpoint->sep.capabilities.media_codec.media_codec_information_len < 6) continue;
|
||||||
if (little_endian_read_32(stream_endpoint->sep.capabilities.media_codec.media_codec_information, 0) != vendor_id) continue;
|
if (little_endian_read_32(stream_endpoint->sep.capabilities.media_codec.media_codec_information, 0) != vendor_id) continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user