pipewire-pulse: Expose bluetooth headset autoswitch config as a message

Makes it easier for libpulse-based clients to modify this setting if
they want.
This commit is contained in:
Arun Raghavan 2026-01-26 14:44:30 -08:00
parent 703380d62d
commit ed59342d28
4 changed files with 69 additions and 8 deletions

View file

@ -984,10 +984,22 @@ static void manager_metadata(void *data, struct pw_manager_object *o,
else
client->default_force_mono_audio = spa_streq(default_, "true");
}
if (spa_streq(key, METADATA_BLUETOOTH_HEADSET_AUTOSWITCH)) {
client->have_bluetooth_headset_autoswitch = true;
if (spa_json_str_object_find(value, strlen(value),
"default", default_, sizeof(default_)) < 0)
client->default_bluetooth_headset_autoswitch = false;
else
client->default_bluetooth_headset_autoswitch = spa_streq(default_, "true");
}
}
if (subject == PW_ID_CORE && o == client->metadata_sm_settings) {
if (spa_streq(key, METADATA_FEATURES_AUDIO_MONO))
client->force_mono_audio = spa_streq(value, "true");
if (spa_streq(key, METADATA_BLUETOOTH_HEADSET_AUTOSWITCH))
client->bluetooth_headset_autoswitch = spa_streq(value, "true");
}
}