mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-08 13:30:08 -05:00
bluez5: allow codecs to share endpoints
AVDTP in principle allows 62 endpoints, but in practice it appears some devices (Samsung Galaxy Buds2 Pro, Redmi Buds 3 Lite, probably others) fail to connect A2DP when the number is somewhere above 24. A2DP connection works when initiated from the Central, but not when the device itself does it, so these devices are not fully broken. We should reduce the number of registered A2DP endpoints to avoid running into problems with such broken devices. Some of our source codecs are the same actual codec with the same configuration, and don't need separate source endpoints. Allow codecs to not have a registered endpoint (fill_caps == NULL), and tolerate codecs with the same endpoint name. In codec switch, keep track separately which of the codecs with the same endpoint name the local endpoint is currently associated with.
This commit is contained in:
parent
99406aefea
commit
d94832942e
4 changed files with 100 additions and 52 deletions
|
|
@ -45,7 +45,7 @@
|
|||
|
||||
#define SPA_TYPE_INTERFACE_Bluez5CodecMedia SPA_TYPE_INFO_INTERFACE_BASE "Bluez5:Codec:Media:Private"
|
||||
|
||||
#define SPA_VERSION_BLUEZ5_CODEC_MEDIA 6
|
||||
#define SPA_VERSION_BLUEZ5_CODEC_MEDIA 7
|
||||
|
||||
struct spa_bluez5_codec_a2dp {
|
||||
struct spa_interface iface;
|
||||
|
|
@ -98,8 +98,10 @@ struct media_codec {
|
|||
|
||||
struct spa_log *log;
|
||||
|
||||
/** If fill_caps is NULL, no endpoint is registered (for sharing with another codec). */
|
||||
int (*fill_caps) (const struct media_codec *codec, uint32_t flags,
|
||||
uint8_t caps[A2DP_MAX_CAPS_SIZE]);
|
||||
|
||||
int (*select_config) (const struct media_codec *codec, uint32_t flags,
|
||||
const void *caps, size_t caps_size,
|
||||
const struct media_codec_audio_info *info,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue