bluetooth: Fix bluetooth.nrec property not updated
authorFrédéric Danis <frederic.danis@linux.intel.com>
Tue, 12 Jun 2012 13:49:50 +0000 (15:49 +0200)
committerJaska Uimonen <jaska.uimonen@intel.com>
Thu, 24 Jan 2013 07:29:35 +0000 (09:29 +0200)
commit244c25622197169a2a5dcc55f93913f1b59da60e
tree30d4156ada6326bc618427f46f9a902889fb4094
parent45dac36c4df54b19b9b0e4f02e836a11681a347a
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.
src/modules/bluetooth/bluetooth-util.c
src/modules/bluetooth/bluetooth-util.h
src/modules/bluetooth/module-bluetooth-device.c