mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
bluetooth: add HFP Gateway support
Create the 'Handsfree Gateway' profile for bluetooth cards and add filters for 'org.bluez.HandsfreeGateway' to the discover module so module-bluetooth-device is loaded with the correct profile when a Handsfree Gateway connects to bluetoothd (in this case bluetoothd is acting as the headset).
This commit is contained in:
parent
edf5f5be6b
commit
342e06498f
4 changed files with 72 additions and 20 deletions
|
|
@ -83,8 +83,10 @@ static pa_hook_result_t load_module_for_device(pa_bluetooth_discovery *y, const
|
|||
|
||||
mi = pa_hashmap_get(u->hashmap, d->path);
|
||||
|
||||
if (!d->dead &&
|
||||
d->device_connected > 0 && (d->audio_state >= PA_BT_AUDIO_STATE_CONNECTED || d->audio_source_state >= PA_BT_AUDIO_STATE_CONNECTED)) {
|
||||
if (!d->dead && d->device_connected > 0 &&
|
||||
(d->audio_state >= PA_BT_AUDIO_STATE_CONNECTED ||
|
||||
d->audio_source_state >= PA_BT_AUDIO_STATE_CONNECTED ||
|
||||
d->hfgw_state > PA_BT_AUDIO_STATE_CONNECTED)) {
|
||||
|
||||
if (!mi) {
|
||||
pa_module *m = NULL;
|
||||
|
|
@ -119,6 +121,9 @@ static pa_hook_result_t load_module_for_device(pa_bluetooth_discovery *y, const
|
|||
if (d->audio_source_state >= PA_BT_AUDIO_STATE_CONNECTED)
|
||||
args = pa_sprintf_malloc("%s profile=\"a2dp_source\" auto_connect=no", args);
|
||||
|
||||
if (d->hfgw_state > PA_BT_AUDIO_STATE_CONNECTED)
|
||||
args = pa_sprintf_malloc("%s profile=\"hfgw\"", args);
|
||||
|
||||
pa_log_debug("Loading module-bluetooth-device %s", args);
|
||||
m = pa_module_load(u->module->core, "module-bluetooth-device", args);
|
||||
pa_xfree(args);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue