bluez5-util: Add support for using RegisterApplication D-Bus API
authorSanchayan Maity <sanchayan@asymptotic.io>
Tue, 15 Dec 2020 11:21:11 +0000 (16:51 +0530)
committerSanchayan Maity <sanchayan@asymptotic.io>
Tue, 19 Jan 2021 08:13:42 +0000 (13:43 +0530)
commit5284b450e74d65d127dc248cea3aeec50554a170
treecc16036f04b1434f1295e50d384b16ef4ca79a17
parentfca6a2fd68ade78a82ebd96b9bad2410086bb3e2
bluez5-util: Add support for using RegisterApplication D-Bus API

A2DP codec switching needs new version of bluez as older version does not
provide needed org.freedesktop.DBus.ObjectManager and RegisterApplication
DBus APIs. As a preparation for the next step of adding codecs and then
codec switching, add support for using the new API.

Getting list of supported codecs by remote device is supported only by new
version of bluez daemon. If the RegisterApplication API fails, we
fallback to the older RegisterEndpoint API and only register the SBC
codec.

For more information, see
https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager
https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/media-api.txt

This changeset has been taken from Pali Rohár's A2DP codec patch
series but separated out to only include the D-Bus specific changes.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/440>
src/modules/bluetooth/bluez5-util.c
src/modules/bluetooth/bluez5-util.h