mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-03-29 07:58:06 -04:00
bluez: Set initial profile to quality A2DP
This commit is contained in:
parent
2e7aee3573
commit
e1f53b7f39
1 changed files with 28 additions and 6 deletions
|
|
@ -2121,15 +2121,37 @@ static void set_initial_profile(struct impl *this)
|
||||||
|
|
||||||
t = find_transport(this, i);
|
t = find_transport(this, i);
|
||||||
if (t) {
|
if (t) {
|
||||||
if (i == SPA_BT_PROFILE_A2DP_SOURCE || i == SPA_BT_PROFILE_BAP_SOURCE)
|
if (i == SPA_BT_PROFILE_A2DP_SOURCE || i == SPA_BT_PROFILE_BAP_SOURCE) {
|
||||||
this->profile = DEVICE_PROFILE_AG;
|
this->profile = DEVICE_PROFILE_AG;
|
||||||
else if (i == SPA_BT_PROFILE_BAP_SINK)
|
this->props.codec = t->media_codec->id;
|
||||||
|
} else if (i == SPA_BT_PROFILE_BAP_SINK) {
|
||||||
this->profile = DEVICE_PROFILE_BAP;
|
this->profile = DEVICE_PROFILE_BAP;
|
||||||
else if (i == SPA_BT_PROFILE_ASHA_SINK)
|
this->props.codec = t->media_codec->id;
|
||||||
|
} else if (i == SPA_BT_PROFILE_ASHA_SINK) {
|
||||||
this->profile = DEVICE_PROFILE_ASHA;
|
this->profile = DEVICE_PROFILE_ASHA;
|
||||||
else
|
this->props.codec = t->media_codec->id;
|
||||||
this->profile = DEVICE_PROFILE_A2DP;
|
} else {
|
||||||
this->props.codec = t->media_codec->id;
|
const struct media_codec *codecs[64];
|
||||||
|
const struct media_codec *quality_codec = NULL;
|
||||||
|
int j;
|
||||||
|
|
||||||
|
get_media_codecs(this, CODEC_ORDER_QUALITY, 0, codecs, SPA_N_ELEMENTS(codecs));
|
||||||
|
for (j = 0; codecs[j] != NULL; ++j) {
|
||||||
|
if (codecs[j]->kind == MEDIA_CODEC_A2DP) {
|
||||||
|
quality_codec = codecs[j];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (quality_codec) {
|
||||||
|
this->profile = DEVICE_PROFILE_A2DP_AUTO_PREFER_QUALITY;
|
||||||
|
this->props.codec = quality_codec->id;
|
||||||
|
} else {
|
||||||
|
this->profile = DEVICE_PROFILE_A2DP;
|
||||||
|
this->props.codec = t->media_codec->id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
spa_log_debug(this->log, "initial profile media profile:%d codec:%d",
|
spa_log_debug(this->log, "initial profile media profile:%d codec:%d",
|
||||||
this->profile, this->props.codec);
|
this->profile, this->props.codec);
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue