bluetooth: Register an endpoint according to encode or decode support
authorSanchayan Maity <sanchayan@asymptotic.io>
Thu, 7 Jan 2021 12:22:22 +0000 (17:52 +0530)
committerSanchayan Maity <sanchayan@asymptotic.io>
Tue, 19 Jan 2021 08:13:42 +0000 (13:43 +0530)
commited44fa1856729483077dd02d417dbfebea0417f7
treed28c7d342c3608fafe2d96dbea3ae0a9481be110
parent366bd5615c99b7e8f09e9320095a0203bcf56639
bluetooth: Register an endpoint according to encode or decode support

As we now support codecs other than SBC, we might have codec which does
not have an encode or a decode capability. Specifically, in the case of
LDAC there isn't a known decoder implementation available. For such a
case, we should not register the corresponding endpoint.

In case of LDAC, as decoding cannot be supported, we should not register
a sink endpoint or vice versa in the other scenario.

To do this, we check if encode_buffer or decode_buffer entry for a codec
has been set in pa_a2dp_codec and accordingly prevent or allow it's
registration.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/440>
src/modules/bluetooth/a2dp-codec-util.c
src/modules/bluetooth/a2dp-codec-util.h
src/modules/bluetooth/bluez5-util.c