mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
bluez: make sco nodes dynamic when the remote end is an AG
This commit is contained in:
parent
8a106c79a0
commit
34425a8027
1 changed files with 22 additions and 12 deletions
|
|
@ -117,6 +117,8 @@ struct impl {
|
||||||
size_t supported_codec_count;
|
size_t supported_codec_count;
|
||||||
|
|
||||||
struct dynamic_node dyn_a2dp_source;
|
struct dynamic_node dyn_a2dp_source;
|
||||||
|
struct dynamic_node dyn_sco_source;
|
||||||
|
struct dynamic_node dyn_sco_sink;
|
||||||
|
|
||||||
#define MAX_SETTINGS 32
|
#define MAX_SETTINGS 32
|
||||||
struct spa_dict_item setting_items[MAX_SETTINGS];
|
struct spa_dict_item setting_items[MAX_SETTINGS];
|
||||||
|
|
@ -308,19 +310,25 @@ static int emit_nodes(struct impl *this)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (this->bt_dev->connected_profiles &
|
if (this->bt_dev->connected_profiles & SPA_BT_PROFILE_HEADSET_AUDIO_GATEWAY) {
|
||||||
(SPA_BT_PROFILE_HEADSET_HEAD_UNIT | SPA_BT_PROFILE_HEADSET_AUDIO_GATEWAY) ) {
|
t = find_transport(this, SPA_BT_PROFILE_HFP_AG, NULL);
|
||||||
int i;
|
if (!t)
|
||||||
|
t = find_transport(this, SPA_BT_PROFILE_HSP_AG, NULL);
|
||||||
for (i = SPA_BT_PROFILE_HSP_HS ; i <= SPA_BT_PROFILE_HFP_AG ; i <<= 1) {
|
if (t) {
|
||||||
t = find_transport(this, i, NULL);
|
emit_dynamic_node(&this->dyn_sco_source, this, t,
|
||||||
if (t)
|
DEVICE_ID_SOURCE, SPA_NAME_API_BLUEZ5_SCO_SOURCE);
|
||||||
break;
|
emit_dynamic_node(&this->dyn_sco_sink, this, t,
|
||||||
|
DEVICE_ID_SINK, SPA_NAME_API_BLUEZ5_SCO_SINK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (this->bt_dev->connected_profiles & SPA_BT_PROFILE_HEADSET_HEAD_UNIT) {
|
||||||
|
t = find_transport(this, SPA_BT_PROFILE_HFP_HF, NULL);
|
||||||
|
if (!t)
|
||||||
|
t = find_transport(this, SPA_BT_PROFILE_HSP_HS, NULL);
|
||||||
|
if (t) {
|
||||||
|
emit_node(this, t, DEVICE_ID_SOURCE, SPA_NAME_API_BLUEZ5_SCO_SOURCE);
|
||||||
|
emit_node(this, t, DEVICE_ID_SINK, SPA_NAME_API_BLUEZ5_SCO_SINK);
|
||||||
}
|
}
|
||||||
if (t == NULL)
|
|
||||||
break;
|
|
||||||
emit_node(this, t, DEVICE_ID_SOURCE, SPA_NAME_API_BLUEZ5_SCO_SOURCE);
|
|
||||||
emit_node(this, t, DEVICE_ID_SINK, SPA_NAME_API_BLUEZ5_SCO_SINK);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
@ -352,6 +360,8 @@ static void emit_remove_nodes(struct impl *this)
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
|
||||||
remove_dynamic_node (&this->dyn_a2dp_source);
|
remove_dynamic_node (&this->dyn_a2dp_source);
|
||||||
|
remove_dynamic_node (&this->dyn_sco_source);
|
||||||
|
remove_dynamic_node (&this->dyn_sco_sink);
|
||||||
|
|
||||||
for (i = 0; i < 2; i++) {
|
for (i = 0; i < 2; i++) {
|
||||||
if (this->nodes[i].active) {
|
if (this->nodes[i].active) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue