mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-17 08:56:49 -05:00
bluez5: implement HFP codec switching
Implement switching HFP codecs in bluez5-devices, currently only for backend-native. Codecs are exposed via profiles similarly as for A2DP. Some hardware appears to not properly reply to the +BCS message. Catch these cases with a timeout, in which case we fall back to previously existing transports.
This commit is contained in:
parent
e18df4e344
commit
79e098bdf2
4 changed files with 348 additions and 71 deletions
|
|
@ -2206,6 +2206,26 @@ int spa_bt_device_ensure_a2dp_codec(struct spa_bt_device *device, const struct a
|
|||
return 0;
|
||||
}
|
||||
|
||||
int spa_bt_device_ensure_hfp_codec(struct spa_bt_device *device, unsigned int codec)
|
||||
{
|
||||
struct spa_bt_monitor *monitor = device->monitor;
|
||||
if (monitor->backend_hsphfpd_registered)
|
||||
return spa_bt_backend_ensure_codec(monitor->backend_hsphfpd, device, codec);
|
||||
if (monitor->backend_ofono_registered)
|
||||
return spa_bt_backend_ensure_codec(monitor->backend_ofono, device, codec);
|
||||
return spa_bt_backend_ensure_codec(monitor->backend_native, device, codec);
|
||||
}
|
||||
|
||||
int spa_bt_device_supports_hfp_codec(struct spa_bt_device *device, unsigned int codec)
|
||||
{
|
||||
struct spa_bt_monitor *monitor = device->monitor;
|
||||
if (monitor->backend_hsphfpd_registered)
|
||||
return spa_bt_backend_supports_codec(monitor->backend_hsphfpd, device, codec);
|
||||
if (monitor->backend_ofono_registered)
|
||||
return spa_bt_backend_supports_codec(monitor->backend_ofono, device, codec);
|
||||
return spa_bt_backend_supports_codec(monitor->backend_native, device, codec);
|
||||
}
|
||||
|
||||
static DBusHandlerResult endpoint_set_configuration(DBusConnection *conn,
|
||||
const char *path, DBusMessage *m, void *userdata)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue