summaryrefslogtreecommitdiff
path: root/src/modules/bluetooth/bluetooth-util.h
diff options
context:
space:
mode:
authorFrédéric Danis <frederic.danis@linux.intel.com>2012-06-12 15:49:50 +0200
committerJaska Uimonen <jaska.uimonen@intel.com>2013-01-24 09:29:35 +0200
commit244c25622197169a2a5dcc55f93913f1b59da60e (patch)
tree30d4156ada6326bc618427f46f9a902889fb4094 /src/modules/bluetooth/bluetooth-util.h
parent45dac36c4df54b19b9b0e4f02e836a11681a347a (diff)
downloadpulseaudio-panda-244c25622197169a2a5dcc55f93913f1b59da60e.tar.gz
pulseaudio-panda-244c25622197169a2a5dcc55f93913f1b59da60e.tar.bz2
pulseaudio-panda-244c25622197169a2a5dcc55f93913f1b59da60e.zip
bluetooth: Fix bluetooth.nrec property not updated
PropertyChanged signal of org.BlueZ.MediaTransport is processed in pa_bluetooth_transport_parse_property() which updates t->nrec. This is called by : - First by filter_cb() of bluetooth-util.c - Then by filter_cb() of module-bluetooth-device.c which retrieve value of t->nrec before calling parse function, then it checks if t->nrec has changed before updating bluetooth.nrec property. As t->nrec has alreday been changed during first process, property update is never performed. This patch creates a new hook in pa_bluetooth_transport called PA_BLUETOOTH_TRANSPORT_HOOK_NREC_CHANGED. The hook is fired by bluetooth-util.c when the transport's NREC property changes. module-bluetooth-device.c won't listen the PropertyChanged signal of MediaTransport anymore. Instead, it will use the hook in pa_bluetooth_transport to get a notification when the NREC property changes, and update the sink or source proplist accordingly. const qualifier for returned pointer of pa_bluetooth_discovery_get_transport() is removed.
Diffstat (limited to 'src/modules/bluetooth/bluetooth-util.h')
-rw-r--r--src/modules/bluetooth/bluetooth-util.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/modules/bluetooth/bluetooth-util.h b/src/modules/bluetooth/bluetooth-util.h
index 2752a69c..a2ad9aa0 100644
--- a/src/modules/bluetooth/bluetooth-util.h
+++ b/src/modules/bluetooth/bluetooth-util.h
@@ -63,6 +63,12 @@ enum profile {
PROFILE_OFF
};
+/* Hook data: pa_bluetooth_transport pointer. */
+typedef enum pa_bluetooth_transport_hook {
+ PA_BLUETOOTH_TRANSPORT_HOOK_NREC_CHANGED, /* Call data: NULL. */
+ PA_BLUETOOTH_TRANSPORT_HOOK_MAX
+} pa_bluetooth_transport_hook_t;
+
struct pa_bluetooth_transport {
pa_bluetooth_discovery *y;
char *path;
@@ -71,6 +77,8 @@ struct pa_bluetooth_transport {
uint8_t *config;
int config_size;
pa_bool_t nrec;
+
+ pa_hook hooks[PA_BLUETOOTH_TRANSPORT_HOOK_MAX];
};
/* This enum is shared among Audio, Headset, AudioSink, and AudioSource, although not all values are acceptable in all profiles */
@@ -124,7 +132,7 @@ void pa_bluetooth_discovery_sync(pa_bluetooth_discovery *d);
const pa_bluetooth_device* pa_bluetooth_discovery_get_by_path(pa_bluetooth_discovery *d, const char* path);
const pa_bluetooth_device* pa_bluetooth_discovery_get_by_address(pa_bluetooth_discovery *d, const char* address);
-const pa_bluetooth_transport* pa_bluetooth_discovery_get_transport(pa_bluetooth_discovery *y, const char *path);
+pa_bluetooth_transport* pa_bluetooth_discovery_get_transport(pa_bluetooth_discovery *y, const char *path);
const pa_bluetooth_transport* pa_bluetooth_device_get_transport(const pa_bluetooth_device *d, enum profile profile);
int pa_bluetooth_transport_acquire(const pa_bluetooth_transport *t, const char *accesstype, size_t *imtu, size_t *omtu);