pipewire/spa/plugins
George Kiagiadakis 4e46489964 bluez5: fix shared A2DP endpoint caps including disabled companion codecs
Codecs that share an A2DP endpoint (e.g. aac + aac_eld) previously used
an asymmetric pattern: one codec (the "owner") had fill_caps and quietly
advertised the union of all siblings' capability bits; companions had
fill_caps = NULL.

This caused a bug: when aac_eld is absent from bluez5.codecs, the "aac"
endpoint still advertised the ELD object-type bit because a2dp_codec_aac's
fill_caps emitted it unconditionally (gated only by eld_supported(), never
by enabled_codecs). A remote could then select ELD; SetConfiguration
resolved the transport to a2dp_codec_aac (the only fill_caps holder for "aac")

Refactor to a symmetric, composable model:

- Add bool endpoint_companion to struct media_codec (default false = owner).
  Companion codec objects set this flag instead of fill_caps = NULL.
- Add combine_caps() function to struct media_codec. Owners that share
  an endpoint implement this to union two capability blobs of the same
  codec_id.
- Each codec's fill_caps now describes only its own bits. AAC LC advertises
  only LC object types; AAC ELD advertises only the ELD type (or returns
  -ENOTSUP when FDK-AAC lacks ELD support).
- Bump SPA_VERSION_BLUEZ5_CODEC_MEDIA 16 -> 17.

On the monitor side (bluez5-dbus.c):
- New media_codec_fill_endpoint_caps() helper fills the owner's caps then
  walks enabled companions on the same endpoint and merges each via
  combine_caps. All five endpoint-registration fill_caps call sites are
  routed through this helper.
- endpoint_should_be_registered() gates on !endpoint_companion (not on
  fill_caps != NULL), so companions correctly skip endpoint registration.
- media_endpoint_to_codec() now filters by is_media_codec_enabled and
  prefers owners as a tiebreaker.
- New media_endpoint_to_codec_for_config() resolves SetConfiguration by
  calling each enabled candidate's validate_config against the negotiated
  config bytes. This ensures that an "aac" endpoint carrying ELD bytes is
  mapped to a2dp_codec_aac_eld (not a2dp_codec_aac).
- AAC validate_config and codec_init are id-gated so a stale ELD config
  can never be decoded by the LC codec object.

Assisted-by: Claude Opus 4.7
2026-06-30 21:21:24 +03:00
..
aec Please replace the comma operator with the correct semicolon when setting aec.name and aec.latency. This will help avoid syntax errors and improve readability. 2026-06-22 17:40:01 +08:00
alsa compress-offload: fix fragment count validation in set_params 2026-06-16 09:38:19 +00:00
audioconvert filter-graph: pass context to plugins 2026-06-30 12:24:54 +02:00
audiomixer mixer-dsp: fade-in/out on xrun as well 2026-06-18 11:06:44 +02:00
audiotestsrc plugins: handle some fd allocation errors 2026-05-05 11:36:45 +02:00
avb avb: use safer strbuf to construct strings 2026-05-06 13:09:03 +02:00
bluez5 bluez5: fix shared A2DP endpoint caps including disabled companion codecs 2026-06-30 21:21:24 +03:00
control test: update copyright 2026-06-23 09:33:23 +02:00
ffmpeg spa: use log topics everywhere 2024-03-11 18:45:21 +02:00
filter-graph filter-graph: pass context to plugins 2026-06-30 12:24:54 +02:00
jack *: don't include standard C headers inside of extern "C" 2025-05-30 09:48:28 +01:00
libcamera spa: {libcamera,v4l2}: device: remove params 2026-06-25 12:05:04 +02:00
support node-driver: Add sync.force-tracking property 2026-06-11 20:34:22 +02:00
test plugins: handle some fd allocation errors 2026-05-05 11:36:45 +02:00
v4l2 spa: {libcamera,v4l2}: device: remove params 2026-06-25 12:05:04 +02:00
videoconvert modules: handle allocation errors gracefully 2026-05-05 13:10:21 +02:00
videotestsrc spa: do not use SPA_PROP_live 2026-03-27 18:03:24 +01:00
volume treewide: access the position information using helpers 2025-10-21 13:06:25 +02:00
vulkan vulkan: check for fcntl errors 2026-05-06 12:45:37 +02:00
meson.build spa/plugins: revert "Disable alsa plugin on !Linux platforms." 2026-03-12 09:20:05 +00:00