mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-03-24 09:05:54 -04:00
bluez: Discard latency and quality codecs worse than SBC for A2DP auto profiles.
Since SBC is mandatory in all devices that support A2DP, we dont need to inclide them in the priority tables. This change also increases the priority of OPUS_G codec as it has better latency and quality than SBC.
This commit is contained in:
parent
e1f53b7f39
commit
4f56442249
1 changed files with 5 additions and 29 deletions
|
|
@ -230,29 +230,17 @@ static size_t get_media_codec_quality_priority (const struct media_codec *mc)
|
|||
/* From lowest quality to highest quality */
|
||||
static const enum spa_bluetooth_audio_codec quality_priorities[] = {
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_START,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_OPUS_05_DUPLEX,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_OPUS_05,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_OPUS_05_51,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_OPUS_05_71,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_OPUS_G,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_OPUS_05_PRO,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_FASTSTREAM_DUPLEX,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_FASTSTREAM,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_MPEG,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_APTX_LL_DUPLEX,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_APTX_LL,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_SBC,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_APTX,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_SBC_XQ,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_AAC_ELD,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_AAC,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_OPUS_G,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_LC3PLUS_HR,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_APTX_HD,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_LDAC
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_LDAC,
|
||||
};
|
||||
size_t i;
|
||||
|
||||
for (i = 0; SPA_N_ELEMENTS(quality_priorities); ++i) {
|
||||
for (i = 0; i < SPA_N_ELEMENTS(quality_priorities); ++i) {
|
||||
if (quality_priorities[i] == mc->id)
|
||||
return i;
|
||||
}
|
||||
|
|
@ -265,21 +253,9 @@ static size_t get_media_codec_latency_priority (const struct media_codec *mc)
|
|||
/* From highest latency to lowest latency */
|
||||
static const enum spa_bluetooth_audio_codec latency_priorities[] = {
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_START,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_OPUS_05_71,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_OPUS_05_51,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_OPUS_05_PRO,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_OPUS_G,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_OPUS_05,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_OPUS_05_DUPLEX,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_MPEG,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_AAC,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_AAC_ELD,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_APTX_HD,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_LDAC,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_LC3PLUS_HR,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_SBC,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_APTX,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_SBC_XQ,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_OPUS_G,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_FASTSTREAM_DUPLEX,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_FASTSTREAM,
|
||||
SPA_BLUETOOTH_AUDIO_CODEC_APTX_LL_DUPLEX,
|
||||
|
|
@ -287,7 +263,7 @@ static size_t get_media_codec_latency_priority (const struct media_codec *mc)
|
|||
};
|
||||
size_t i;
|
||||
|
||||
for (i = 0; SPA_N_ELEMENTS(latency_priorities); ++i) {
|
||||
for (i = 0; i < SPA_N_ELEMENTS(latency_priorities); ++i) {
|
||||
if (latency_priorities[i] == mc->id)
|
||||
return i;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue