Commit 6c03c79e authored by pali's avatar pali Committed by Marijn Suijten
Browse files

fixup! bluetooth: Add A2DP FastStream codec support

parent 0a375e52
......@@ -76,15 +76,18 @@ static bool can_accept_capabilities_mic(const uint8_t *capabilities_buffer, uint
static int cmp_endpoints_common(const uint8_t *capabilities1_buffer, uint8_t capabilities1_size, const uint8_t *capabilities2_buffer, uint8_t capabilities2_size, const pa_sample_spec *default_sample_spec, bool for_encoding, bool with_mic) {
const a2dp_faststream_t *capabilities1 = (const a2dp_faststream_t *) capabilities1_buffer;
const a2dp_faststream_t *capabilities2 = (const a2dp_faststream_t *) capabilities2_buffer;
bool cap1_has_mic = (capabilities1->direction & FASTSTREAM_DIRECTION_SOURCE);
bool cap2_has_mic = (capabilities2->direction & FASTSTREAM_DIRECTION_SOURCE);
bool cap1_has_freq_44100 = (capabilities1->sink_frequency & FASTSTREAM_SINK_SAMPLING_FREQ_44100);
bool cap2_has_freq_44100 = (capabilities2->sink_frequency & FASTSTREAM_SINK_SAMPLING_FREQ_44100);
bool cap1_has_freq_48000 = (capabilities1->sink_frequency & FASTSTREAM_SINK_SAMPLING_FREQ_48000);
bool cap2_has_freq_48000 = (capabilities2->sink_frequency & FASTSTREAM_SINK_SAMPLING_FREQ_48000);
pa_assert(capabilities1_size == sizeof(a2dp_faststream_t));
pa_assert(capabilities2_size == sizeof(a2dp_faststream_t));
bool cap1_has_mic, cap1_has_freq_44100, cap1_has_freq_48000;
bool cap2_has_mic, cap2_has_freq_44100, cap2_has_freq_48000;
pa_assert(capabilities1_size == sizeof(*capabilities1));
pa_assert(capabilities2_size == sizeof(*capabilities2));
cap1_has_mic = (capabilities1->direction & FASTSTREAM_DIRECTION_SOURCE);
cap2_has_mic = (capabilities2->direction & FASTSTREAM_DIRECTION_SOURCE);
cap1_has_freq_44100 = (capabilities1->sink_frequency & FASTSTREAM_SINK_SAMPLING_FREQ_44100);
cap2_has_freq_44100 = (capabilities2->sink_frequency & FASTSTREAM_SINK_SAMPLING_FREQ_44100);
cap1_has_freq_48000 = (capabilities1->sink_frequency & FASTSTREAM_SINK_SAMPLING_FREQ_48000);
cap2_has_freq_48000 = (capabilities2->sink_frequency & FASTSTREAM_SINK_SAMPLING_FREQ_48000);
/* Prefer endpoint which frequency is near to default sample rate */
if (default_sample_spec->rate <= 44100) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment