bluez5-util: move pa_bluetooth_discovery to header

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/631>
This commit is contained in:
Dylan Van Assche 2022-04-06 08:15:13 +02:00 committed by PulseAudio Marge Bot
parent ff6010b80f
commit b05e34e092
3 changed files with 25 additions and 24 deletions

View file

@ -31,7 +31,6 @@
#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>
@ -128,28 +127,6 @@ 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;

View file

@ -22,6 +22,7 @@
***/
#include <pulsecore/core.h>
#include <pulsecore/dbus-shared.h>
#include "a2dp-codec-util.h"
@ -134,6 +135,29 @@ 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;

View file

@ -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', [], [], [], libbluez5_util ],
[ 'module-bluez5-device', 'bluetooth/module-bluez5-device.c', [], [], [dbus_dep], libbluez5_util ],
[ 'module-bluez5-discover', 'bluetooth/module-bluez5-discover.c', [], [], [dbus_dep], libbluez5_util ],
]
endif