mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-10 15:44:32 +00:00
a2dp_source_demo: expect avdtp_channel_mode_t in A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
This commit is contained in:
parent
fd027dabec
commit
25459311ce
@ -30,6 +30,7 @@ GATT Client: Skip MTU exchange after MTU exchange on ATT Server
|
|||||||
AVDTP Source: `avdtp_source_stream_send_media_payload` includes SBC Header and was deprecated
|
AVDTP Source: `avdtp_source_stream_send_media_payload` includes SBC Header and was deprecated
|
||||||
Ports: STM32-F103RB Nucleo + CC256x port removed
|
Ports: STM32-F103RB Nucleo + CC256x port removed
|
||||||
A2DP: fix events and use `a2dp_cid`, `local_seid,` `remote_seid` in A2DP subevents
|
A2DP: fix events and use `a2dp_cid`, `local_seid,` `remote_seid` in A2DP subevents
|
||||||
|
AVDTP/A2DP: use `avdtp_channel_mode_t` in `A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION`
|
||||||
|
|
||||||
## Release v1.2.1
|
## Release v1.2.1
|
||||||
|
|
||||||
|
@ -558,7 +558,7 @@ static void a2dp_source_packet_handler(uint8_t packet_type, uint16_t channel, ui
|
|||||||
bd_addr_t address;
|
bd_addr_t address;
|
||||||
uint16_t cid;
|
uint16_t cid;
|
||||||
|
|
||||||
uint8_t channel_mode;
|
avdtp_channel_mode_t channel_mode;
|
||||||
uint8_t allocation_method;
|
uint8_t allocation_method;
|
||||||
|
|
||||||
if (packet_type != HCI_EVENT_PACKET) return;
|
if (packet_type != HCI_EVENT_PACKET) return;
|
||||||
@ -595,7 +595,7 @@ static void a2dp_source_packet_handler(uint8_t packet_type, uint16_t channel, ui
|
|||||||
sbc_configuration.min_bitpool_value = a2dp_subevent_signaling_media_codec_sbc_configuration_get_min_bitpool_value(packet);
|
sbc_configuration.min_bitpool_value = a2dp_subevent_signaling_media_codec_sbc_configuration_get_min_bitpool_value(packet);
|
||||||
sbc_configuration.max_bitpool_value = a2dp_subevent_signaling_media_codec_sbc_configuration_get_max_bitpool_value(packet);
|
sbc_configuration.max_bitpool_value = a2dp_subevent_signaling_media_codec_sbc_configuration_get_max_bitpool_value(packet);
|
||||||
|
|
||||||
channel_mode = a2dp_subevent_signaling_media_codec_sbc_configuration_get_channel_mode(packet);
|
channel_mode = (avdtp_channel_mode_t) a2dp_subevent_signaling_media_codec_sbc_configuration_get_channel_mode(packet);
|
||||||
allocation_method = a2dp_subevent_signaling_media_codec_sbc_configuration_get_allocation_method(packet);
|
allocation_method = a2dp_subevent_signaling_media_codec_sbc_configuration_get_allocation_method(packet);
|
||||||
|
|
||||||
printf("A2DP Source: Received SBC codec configuration, sampling frequency %u, a2dp_cid 0x%02x, local seid 0x%02x, remote seid 0x%02x.\n",
|
printf("A2DP Source: Received SBC codec configuration, sampling frequency %u, a2dp_cid 0x%02x, local seid 0x%02x, remote seid 0x%02x.\n",
|
||||||
@ -605,20 +605,18 @@ static void a2dp_source_packet_handler(uint8_t packet_type, uint16_t channel, ui
|
|||||||
|
|
||||||
// Adapt Bluetooth spec definition to SBC Encoder expected input
|
// Adapt Bluetooth spec definition to SBC Encoder expected input
|
||||||
sbc_configuration.allocation_method = (btstack_sbc_allocation_method_t)(allocation_method - 1);
|
sbc_configuration.allocation_method = (btstack_sbc_allocation_method_t)(allocation_method - 1);
|
||||||
sbc_configuration.num_channels = SBC_CHANNEL_MODE_STEREO;
|
|
||||||
switch (channel_mode){
|
switch (channel_mode){
|
||||||
case AVDTP_SBC_JOINT_STEREO:
|
case AVDTP_CHANNEL_MODE_JOINT_STEREO:
|
||||||
sbc_configuration.channel_mode = SBC_CHANNEL_MODE_JOINT_STEREO;
|
sbc_configuration.channel_mode = SBC_CHANNEL_MODE_JOINT_STEREO;
|
||||||
break;
|
break;
|
||||||
case AVDTP_SBC_STEREO:
|
case AVDTP_CHANNEL_MODE_STEREO:
|
||||||
sbc_configuration.channel_mode = SBC_CHANNEL_MODE_STEREO;
|
sbc_configuration.channel_mode = SBC_CHANNEL_MODE_STEREO;
|
||||||
break;
|
break;
|
||||||
case AVDTP_SBC_DUAL_CHANNEL:
|
case AVDTP_CHANNEL_MODE_DUAL_CHANNEL:
|
||||||
sbc_configuration.channel_mode = SBC_CHANNEL_MODE_DUAL_CHANNEL;
|
sbc_configuration.channel_mode = SBC_CHANNEL_MODE_DUAL_CHANNEL;
|
||||||
break;
|
break;
|
||||||
case AVDTP_SBC_MONO:
|
case AVDTP_CHANNEL_MODE_MONO:
|
||||||
sbc_configuration.channel_mode = SBC_CHANNEL_MODE_MONO;
|
sbc_configuration.channel_mode = SBC_CHANNEL_MODE_MONO;
|
||||||
sbc_configuration.num_channels = 1;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
btstack_assert(false);
|
btstack_assert(false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user