diff options
author | Marijn Suijten <marijns95@gmail.com> | 2022-08-02 12:05:17 +0200 |
---|---|---|
committer | Tanu Kaskinen <tanuk@iki.fi> | 2022-08-16 08:16:24 +0300 |
commit | 6ec084e2b3d941c5fb098ddbd83e734be7a500c3 (patch) | |
tree | b3fcace13075f508c665f7708db4fb3afed880b4 | |
parent | 391dac58a970867e15ff894cdb6d9a8f682e9aef (diff) | |
download | pulseaudio-6ec084e2b3d941c5fb098ddbd83e734be7a500c3.tar.gz |
Revert "bluez5-util: move pa_bluetooth_discovery to header"
This reverts commit b05e34e092d5f40ff9a305fea181bd2308829824.
Now that backend-native uses a different way to get to its own
`native_backend` instance - without going through
`pa_bluetooth_discovery` - this patch can be reverted again, as nothing
outside bluez5-util is supposed to know the internals of this struct.
That's what the many functions are for which all take pointers to this
(at that point) opaque struct instead.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/740>
-rw-r--r-- | src/modules/bluetooth/bluez5-util.c | 23 | ||||
-rw-r--r-- | src/modules/bluetooth/bluez5-util.h | 24 | ||||
-rw-r--r-- | src/modules/meson.build | 2 |
3 files changed, 24 insertions, 25 deletions
diff --git a/src/modules/bluetooth/bluez5-util.c b/src/modules/bluetooth/bluez5-util.c index b72f5e52f..2431b3831 100644 --- a/src/modules/bluetooth/bluez5-util.c +++ b/src/modules/bluetooth/bluez5-util.c @@ -31,6 +31,7 @@ #include <pulsecore/core.h> #include <pulsecore/core-error.h> #include <pulsecore/core-util.h> +#include <pulsecore/dbus-shared.h> #include <pulsecore/log.h> #include <pulsecore/macro.h> #include <pulsecore/refcnt.h> @@ -127,6 +128,28 @@ static uint16_t volume_to_a2dp_gain(pa_volume_t volume) { return gain; } +struct pa_bluetooth_discovery { + PA_REFCNT_DECLARE; + + pa_core *core; + pa_dbus_connection *connection; + bool filter_added; + bool matches_added; + bool objects_listed; + pa_hook hooks[PA_BLUETOOTH_HOOK_MAX]; + pa_hashmap *adapters; + pa_hashmap *devices; + pa_hashmap *transports; + pa_bluetooth_profile_status_t profiles_status[PA_BLUETOOTH_PROFILE_COUNT]; + + int headset_backend; + pa_bluetooth_backend *ofono_backend, *native_backend; + PA_LLIST_HEAD(pa_dbus_pending, pending); + bool enable_native_hsp_hs; + bool enable_native_hfp_hf; + bool enable_msbc; +}; + static pa_dbus_pending* send_and_add_to_pending(pa_bluetooth_discovery *y, DBusMessage *m, DBusPendingCallNotifyFunction func, void *call_data) { pa_dbus_pending *p; diff --git a/src/modules/bluetooth/bluez5-util.h b/src/modules/bluetooth/bluez5-util.h index c169edd8d..fff3d573c 100644 --- a/src/modules/bluetooth/bluez5-util.h +++ b/src/modules/bluetooth/bluez5-util.h @@ -22,7 +22,6 @@ ***/ #include <pulsecore/core.h> -#include <pulsecore/dbus-shared.h> #include "a2dp-codec-util.h" @@ -137,29 +136,6 @@ struct pa_bluetooth_transport { void *userdata; }; -struct pa_bluetooth_discovery { - PA_REFCNT_DECLARE; - - pa_core *core; - pa_dbus_connection *connection; - bool filter_added; - bool matches_added; - bool objects_listed; - pa_hook hooks[PA_BLUETOOTH_HOOK_MAX]; - pa_hashmap *adapters; - pa_hashmap *devices; - pa_hashmap *transports; - pa_bluetooth_profile_status_t profiles_status[PA_BLUETOOTH_PROFILE_COUNT]; - - int headset_backend; - pa_bluetooth_backend *ofono_backend, *native_backend; - PA_LLIST_HEAD(pa_dbus_pending, pending); - bool enable_native_hsp_hs; - bool enable_native_hfp_hf; - bool enable_msbc; -}; - - struct pa_bluetooth_device { pa_bluetooth_discovery *discovery; pa_bluetooth_adapter *adapter; diff --git a/src/modules/meson.build b/src/modules/meson.build index c4e53d6d9..1e12569dc 100644 --- a/src/modules/meson.build +++ b/src/modules/meson.build @@ -123,7 +123,7 @@ if cdata.has('HAVE_BLUEZ_5') all_modules += [ [ 'module-bluetooth-discover', 'bluetooth/module-bluetooth-discover.c' ], [ 'module-bluetooth-policy', 'bluetooth/module-bluetooth-policy.c', [], [], [dbus_dep] ], - [ 'module-bluez5-device', 'bluetooth/module-bluez5-device.c', [], [], [dbus_dep], libbluez5_util ], + [ 'module-bluez5-device', 'bluetooth/module-bluez5-device.c', [], [], [], libbluez5_util ], [ 'module-bluez5-discover', 'bluetooth/module-bluez5-discover.c', [], [], [dbus_dep], libbluez5_util ], ] endif |