mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-13 13:29:58 -05:00
bluetooth: Name BlueZ 4 symbols accordingly
We need diferent symbol prefixing for the current BlueZ 4 support and the new BlueZ 5 support which is about to enter the codebase, to avoid symbol clashing and crashing the daemon in the case both modules are loaded at the same time. This commit replaces all pa_bluetooth_ and pa_bt_ (for consistency) prefixes with pa_bluez4_, for both lower-case and upper-case, what was done with the following sed commands: $ sed -i s/pa_bluetooth_/pa_bluez4_/g src/modules/bluetooth/*bluez4* $ sed -i s/PA_BLUETOOTH_/PA_BLUEZ4_/g src/modules/bluetooth/*bluez4* $ sed -i s/pa_bt_/pa_bluez4_/g src/modules/bluetooth/*bluez4* $ sed -i s/PA_BT_/PA_BLUEZ4_/g src/modules/bluetooth/*bluez4*
This commit is contained in:
parent
438094baa4
commit
0f84fef04d
4 changed files with 300 additions and 300 deletions
|
|
@ -27,7 +27,7 @@
|
|||
#include <pulsecore/llist.h>
|
||||
#include <pulsecore/macro.h>
|
||||
|
||||
#define PA_BLUETOOTH_ERROR_NOT_SUPPORTED "org.bluez.Error.NotSupported"
|
||||
#define PA_BLUEZ4_ERROR_NOT_SUPPORTED "org.bluez.Error.NotSupported"
|
||||
|
||||
/* UUID copied from bluez/audio/device.h */
|
||||
#define GENERIC_AUDIO_UUID "00001203-0000-1000-8000-00805f9b34fb"
|
||||
|
|
@ -45,16 +45,16 @@
|
|||
|
||||
#define HSP_MAX_GAIN 15
|
||||
|
||||
typedef struct pa_bluetooth_uuid pa_bluetooth_uuid;
|
||||
typedef struct pa_bluetooth_device pa_bluetooth_device;
|
||||
typedef struct pa_bluetooth_discovery pa_bluetooth_discovery;
|
||||
typedef struct pa_bluetooth_transport pa_bluetooth_transport;
|
||||
typedef struct pa_bluez4_uuid pa_bluez4_uuid;
|
||||
typedef struct pa_bluez4_device pa_bluez4_device;
|
||||
typedef struct pa_bluez4_discovery pa_bluez4_discovery;
|
||||
typedef struct pa_bluez4_transport pa_bluez4_transport;
|
||||
|
||||
struct userdata;
|
||||
|
||||
struct pa_bluetooth_uuid {
|
||||
struct pa_bluez4_uuid {
|
||||
char *uuid;
|
||||
PA_LLIST_FIELDS(pa_bluetooth_uuid);
|
||||
PA_LLIST_FIELDS(pa_bluez4_uuid);
|
||||
};
|
||||
|
||||
enum profile {
|
||||
|
|
@ -65,32 +65,32 @@ enum profile {
|
|||
PROFILE_OFF
|
||||
};
|
||||
|
||||
#define PA_BLUETOOTH_PROFILE_COUNT PROFILE_OFF
|
||||
#define PA_BLUEZ4_PROFILE_COUNT PROFILE_OFF
|
||||
|
||||
struct pa_bluetooth_hook_uuid_data {
|
||||
pa_bluetooth_device *device;
|
||||
struct pa_bluez4_hook_uuid_data {
|
||||
pa_bluez4_device *device;
|
||||
const char *uuid;
|
||||
};
|
||||
|
||||
/* Hook data: pa_bluetooth_discovery pointer. */
|
||||
typedef enum pa_bluetooth_hook {
|
||||
PA_BLUETOOTH_HOOK_DEVICE_CONNECTION_CHANGED, /* Call data: pa_bluetooth_device */
|
||||
PA_BLUETOOTH_HOOK_DEVICE_UUID_ADDED, /* Call data: pa_bluetooth_hook_uuid_data */
|
||||
PA_BLUETOOTH_HOOK_TRANSPORT_STATE_CHANGED, /* Call data: pa_bluetooth_transport */
|
||||
PA_BLUETOOTH_HOOK_TRANSPORT_NREC_CHANGED, /* Call data: pa_bluetooth_transport */
|
||||
PA_BLUETOOTH_HOOK_TRANSPORT_MICROPHONE_GAIN_CHANGED, /* Call data: pa_bluetooth_transport */
|
||||
PA_BLUETOOTH_HOOK_TRANSPORT_SPEAKER_GAIN_CHANGED, /* Call data: pa_bluetooth_transport */
|
||||
PA_BLUETOOTH_HOOK_MAX
|
||||
} pa_bluetooth_hook_t;
|
||||
/* Hook data: pa_bluez4_discovery pointer. */
|
||||
typedef enum pa_bluez4_hook {
|
||||
PA_BLUEZ4_HOOK_DEVICE_CONNECTION_CHANGED, /* Call data: pa_bluez4_device */
|
||||
PA_BLUEZ4_HOOK_DEVICE_UUID_ADDED, /* Call data: pa_bluez4_hook_uuid_data */
|
||||
PA_BLUEZ4_HOOK_TRANSPORT_STATE_CHANGED, /* Call data: pa_bluez4_transport */
|
||||
PA_BLUEZ4_HOOK_TRANSPORT_NREC_CHANGED, /* Call data: pa_bluez4_transport */
|
||||
PA_BLUEZ4_HOOK_TRANSPORT_MICROPHONE_GAIN_CHANGED, /* Call data: pa_bluez4_transport */
|
||||
PA_BLUEZ4_HOOK_TRANSPORT_SPEAKER_GAIN_CHANGED, /* Call data: pa_bluez4_transport */
|
||||
PA_BLUEZ4_HOOK_MAX
|
||||
} pa_bluez4_hook_t;
|
||||
|
||||
typedef enum pa_bluetooth_transport_state {
|
||||
PA_BLUETOOTH_TRANSPORT_STATE_DISCONNECTED,
|
||||
PA_BLUETOOTH_TRANSPORT_STATE_IDLE, /* Connected but not playing */
|
||||
PA_BLUETOOTH_TRANSPORT_STATE_PLAYING
|
||||
} pa_bluetooth_transport_state_t;
|
||||
typedef enum pa_bluez4_transport_state {
|
||||
PA_BLUEZ4_TRANSPORT_STATE_DISCONNECTED,
|
||||
PA_BLUEZ4_TRANSPORT_STATE_IDLE, /* Connected but not playing */
|
||||
PA_BLUEZ4_TRANSPORT_STATE_PLAYING
|
||||
} pa_bluez4_transport_state_t;
|
||||
|
||||
struct pa_bluetooth_transport {
|
||||
pa_bluetooth_device *device;
|
||||
struct pa_bluez4_transport {
|
||||
pa_bluez4_device *device;
|
||||
char *owner;
|
||||
char *path;
|
||||
enum profile profile;
|
||||
|
|
@ -98,23 +98,23 @@ struct pa_bluetooth_transport {
|
|||
uint8_t *config;
|
||||
int config_size;
|
||||
|
||||
pa_bluetooth_transport_state_t state;
|
||||
pa_bluez4_transport_state_t state;
|
||||
bool nrec;
|
||||
uint16_t microphone_gain; /* Used for HSP/HFP */
|
||||
uint16_t speaker_gain; /* Used for HSP/HFP */
|
||||
};
|
||||
|
||||
/* This enum is shared among Audio, Headset, AudioSink, and AudioSource, although not all values are acceptable in all profiles */
|
||||
typedef enum pa_bt_audio_state {
|
||||
PA_BT_AUDIO_STATE_INVALID = -1,
|
||||
PA_BT_AUDIO_STATE_DISCONNECTED,
|
||||
PA_BT_AUDIO_STATE_CONNECTING,
|
||||
PA_BT_AUDIO_STATE_CONNECTED,
|
||||
PA_BT_AUDIO_STATE_PLAYING
|
||||
} pa_bt_audio_state_t;
|
||||
typedef enum pa_bluez4_audio_state {
|
||||
PA_BLUEZ4_AUDIO_STATE_INVALID = -1,
|
||||
PA_BLUEZ4_AUDIO_STATE_DISCONNECTED,
|
||||
PA_BLUEZ4_AUDIO_STATE_CONNECTING,
|
||||
PA_BLUEZ4_AUDIO_STATE_CONNECTED,
|
||||
PA_BLUEZ4_AUDIO_STATE_PLAYING
|
||||
} pa_bluez4_audio_state_t;
|
||||
|
||||
struct pa_bluetooth_device {
|
||||
pa_bluetooth_discovery *discovery;
|
||||
struct pa_bluez4_device {
|
||||
pa_bluez4_discovery *discovery;
|
||||
bool dead;
|
||||
|
||||
int device_info_valid; /* 0: no results yet; 1: good results; -1: bad results ... */
|
||||
|
|
@ -122,57 +122,57 @@ struct pa_bluetooth_device {
|
|||
/* Device information */
|
||||
char *name;
|
||||
char *path;
|
||||
pa_bluetooth_transport *transports[PA_BLUETOOTH_PROFILE_COUNT];
|
||||
pa_bluez4_transport *transports[PA_BLUEZ4_PROFILE_COUNT];
|
||||
int paired;
|
||||
char *alias;
|
||||
PA_LLIST_HEAD(pa_bluetooth_uuid, uuids);
|
||||
PA_LLIST_HEAD(pa_bluez4_uuid, uuids);
|
||||
char *address;
|
||||
int class;
|
||||
int trusted;
|
||||
|
||||
/* Audio state */
|
||||
pa_bt_audio_state_t audio_state;
|
||||
pa_bluez4_audio_state_t audio_state;
|
||||
|
||||
/* AudioSink, AudioSource, Headset and HandsfreeGateway states */
|
||||
pa_bt_audio_state_t profile_state[PA_BLUETOOTH_PROFILE_COUNT];
|
||||
pa_bluez4_audio_state_t profile_state[PA_BLUEZ4_PROFILE_COUNT];
|
||||
};
|
||||
|
||||
pa_bluetooth_discovery* pa_bluetooth_discovery_get(pa_core *core);
|
||||
pa_bluetooth_discovery* pa_bluetooth_discovery_ref(pa_bluetooth_discovery *y);
|
||||
void pa_bluetooth_discovery_unref(pa_bluetooth_discovery *d);
|
||||
pa_bluez4_discovery* pa_bluez4_discovery_get(pa_core *core);
|
||||
pa_bluez4_discovery* pa_bluez4_discovery_ref(pa_bluez4_discovery *y);
|
||||
void pa_bluez4_discovery_unref(pa_bluez4_discovery *d);
|
||||
|
||||
pa_bluetooth_device* pa_bluetooth_discovery_get_by_path(pa_bluetooth_discovery *d, const char* path);
|
||||
pa_bluetooth_device* pa_bluetooth_discovery_get_by_address(pa_bluetooth_discovery *d, const char* address);
|
||||
pa_bluez4_device* pa_bluez4_discovery_get_by_path(pa_bluez4_discovery *d, const char* path);
|
||||
pa_bluez4_device* pa_bluez4_discovery_get_by_address(pa_bluez4_discovery *d, const char* address);
|
||||
|
||||
bool pa_bluetooth_device_any_audio_connected(const pa_bluetooth_device *d);
|
||||
bool pa_bluez4_device_any_audio_connected(const pa_bluez4_device *d);
|
||||
|
||||
int pa_bluetooth_transport_acquire(pa_bluetooth_transport *t, bool optional, size_t *imtu, size_t *omtu);
|
||||
void pa_bluetooth_transport_release(pa_bluetooth_transport *t);
|
||||
int pa_bluez4_transport_acquire(pa_bluez4_transport *t, bool optional, size_t *imtu, size_t *omtu);
|
||||
void pa_bluez4_transport_release(pa_bluez4_transport *t);
|
||||
|
||||
void pa_bluetooth_transport_set_microphone_gain(pa_bluetooth_transport *t, uint16_t value);
|
||||
void pa_bluetooth_transport_set_speaker_gain(pa_bluetooth_transport *t, uint16_t value);
|
||||
void pa_bluez4_transport_set_microphone_gain(pa_bluez4_transport *t, uint16_t value);
|
||||
void pa_bluez4_transport_set_speaker_gain(pa_bluez4_transport *t, uint16_t value);
|
||||
|
||||
pa_hook* pa_bluetooth_discovery_hook(pa_bluetooth_discovery *y, pa_bluetooth_hook_t hook);
|
||||
pa_hook* pa_bluez4_discovery_hook(pa_bluez4_discovery *y, pa_bluez4_hook_t hook);
|
||||
|
||||
typedef enum pa_bt_form_factor {
|
||||
PA_BT_FORM_FACTOR_UNKNOWN,
|
||||
PA_BT_FORM_FACTOR_HEADSET,
|
||||
PA_BT_FORM_FACTOR_HANDSFREE,
|
||||
PA_BT_FORM_FACTOR_MICROPHONE,
|
||||
PA_BT_FORM_FACTOR_SPEAKER,
|
||||
PA_BT_FORM_FACTOR_HEADPHONE,
|
||||
PA_BT_FORM_FACTOR_PORTABLE,
|
||||
PA_BT_FORM_FACTOR_CAR,
|
||||
PA_BT_FORM_FACTOR_HIFI,
|
||||
PA_BT_FORM_FACTOR_PHONE,
|
||||
} pa_bt_form_factor_t;
|
||||
typedef enum pa_bluez4_form_factor {
|
||||
PA_BLUEZ4_FORM_FACTOR_UNKNOWN,
|
||||
PA_BLUEZ4_FORM_FACTOR_HEADSET,
|
||||
PA_BLUEZ4_FORM_FACTOR_HANDSFREE,
|
||||
PA_BLUEZ4_FORM_FACTOR_MICROPHONE,
|
||||
PA_BLUEZ4_FORM_FACTOR_SPEAKER,
|
||||
PA_BLUEZ4_FORM_FACTOR_HEADPHONE,
|
||||
PA_BLUEZ4_FORM_FACTOR_PORTABLE,
|
||||
PA_BLUEZ4_FORM_FACTOR_CAR,
|
||||
PA_BLUEZ4_FORM_FACTOR_HIFI,
|
||||
PA_BLUEZ4_FORM_FACTOR_PHONE,
|
||||
} pa_bluez4_form_factor_t;
|
||||
|
||||
pa_bt_form_factor_t pa_bluetooth_get_form_factor(uint32_t class);
|
||||
const char *pa_bt_form_factor_to_string(pa_bt_form_factor_t ff);
|
||||
pa_bluez4_form_factor_t pa_bluez4_get_form_factor(uint32_t class);
|
||||
const char *pa_bluez4_form_factor_to_string(pa_bluez4_form_factor_t ff);
|
||||
|
||||
char *pa_bluetooth_cleanup_name(const char *name);
|
||||
char *pa_bluez4_cleanup_name(const char *name);
|
||||
|
||||
bool pa_bluetooth_uuid_has(pa_bluetooth_uuid *uuids, const char *uuid);
|
||||
const char *pa_bt_profile_to_string(enum profile profile);
|
||||
bool pa_bluez4_uuid_has(pa_bluez4_uuid *uuids, const char *uuid);
|
||||
const char *pa_bluez4_profile_to_string(enum profile profile);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue