mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-07-05 00:06:16 -04:00
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 |
||
|---|---|---|
| .. | ||
| g722 | ||
| a2dp-codec-aac.c | ||
| a2dp-codec-aptx.c | ||
| a2dp-codec-caps.h | ||
| a2dp-codec-faststream.c | ||
| a2dp-codec-lc3plus.c | ||
| a2dp-codec-ldac.c | ||
| a2dp-codec-opus-g.c | ||
| a2dp-codec-opus.c | ||
| a2dp-codec-sbc.c | ||
| asha-codec-g722.c | ||
| backend-hsphfpd.c | ||
| backend-native.c | ||
| backend-ofono.c | ||
| bap-codec-caps.h | ||
| bap-codec-lc3.c | ||
| bluez-hardware.conf | ||
| bluez5-dbus.c | ||
| bluez5-device.c | ||
| bt-latency.h | ||
| codec-loader.c | ||
| codec-loader.h | ||
| dbus-monitor.c | ||
| dbus-monitor.h | ||
| decode-buffer.h | ||
| defs.h | ||
| hci.c | ||
| hfp-codec-caps.h | ||
| hfp-codec-cvsd.c | ||
| hfp-codec-lc3-a127.c | ||
| hfp-codec-lc3-swb.c | ||
| hfp-codec-msbc.c | ||
| hfp-h2.h | ||
| iso-io.c | ||
| iso-io.h | ||
| media-codecs.c | ||
| media-codecs.h | ||
| media-sink.c | ||
| media-source.c | ||
| meson.build | ||
| midi-enum.c | ||
| midi-node.c | ||
| midi-parser.c | ||
| midi-server.c | ||
| midi.h | ||
| modemmanager.c | ||
| modemmanager.h | ||
| org.bluez.xml | ||
| player.c | ||
| player.h | ||
| plc.h | ||
| plugin.c | ||
| quirks.c | ||
| rate-control.h | ||
| README-MIDI.md | ||
| README-OPUS-A2DP.md | ||
| README-SBC-XQ.md | ||
| README-Telephony.md | ||
| rtp.h | ||
| sco-io.c | ||
| telephony.c | ||
| telephony.h | ||
| test-midi.c | ||
| upower.c | ||
| upower.h | ||