From 63ba9f98ba2f494cf650f7c74dac2a7a16e2dac9 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Wed, 25 Aug 2021 20:39:18 +0300 Subject: [PATCH] bluez5: don't create aptx-ll/faststream sink endpoints We don't currently implement encoding for the duplex channel for these codecs, so they are not fully functional as A2DP sinks, and their main use is anyway with headphones. Also, the number of endpoints in BlueZ appears to be limited, and appears to be counted across all adapters. Unclear whether this comes from AVDTP limitation, but currently plugging in a second BT adapter causes the second media application registration to fail. This change reduces the number of endpoints enough so that registration succeeds for two adapters. --- spa/plugins/bluez5/a2dp-codec-aptx.c | 2 -- spa/plugins/bluez5/a2dp-codec-faststream.c | 6 ++---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/spa/plugins/bluez5/a2dp-codec-aptx.c b/spa/plugins/bluez5/a2dp-codec-aptx.c index f8d7d6dd8..4eb0088f8 100644 --- a/spa/plugins/bluez5/a2dp-codec-aptx.c +++ b/spa/plugins/bluez5/a2dp-codec-aptx.c @@ -661,8 +661,6 @@ const struct a2dp_codec a2dp_codec_aptx_hd = { .abr_process = codec_abr_process, \ .start_encode = codec_start_encode, \ .encode = codec_encode, \ - .start_decode = codec_start_decode, \ - .decode = codec_decode, \ .reduce_bitpool = codec_reduce_bitpool, \ .increase_bitpool = codec_increase_bitpool diff --git a/spa/plugins/bluez5/a2dp-codec-faststream.c b/spa/plugins/bluez5/a2dp-codec-faststream.c index fe2daa9eb..544e279e2 100644 --- a/spa/plugins/bluez5/a2dp-codec-faststream.c +++ b/spa/plugins/bluez5/a2dp-codec-faststream.c @@ -318,7 +318,7 @@ static int codec_encode(void *data, return res; } -static int codec_start_decode (void *data, +static SPA_UNUSED int codec_start_decode (void *data, const void *src, size_t src_size, uint16_t *seqnum, uint32_t *timestamp) { return 0; @@ -355,7 +355,7 @@ static int do_decode(sbc_t *sbc, return processed; } -static int codec_decode(void *data, +static SPA_UNUSED int codec_decode(void *data, const void *src, size_t src_size, void *dst, size_t dst_size, size_t *dst_out) @@ -609,8 +609,6 @@ static const struct a2dp_codec duplex_codec = { .abr_process = codec_abr_process, \ .start_encode = codec_start_encode, \ .encode = codec_encode, \ - .start_decode = codec_start_decode, \ - .decode = codec_decode, \ .reduce_bitpool = codec_reduce_bitpool, \ .increase_bitpool = codec_increase_bitpool