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>
Mon, 10 Dec 2012 20:43:57 +0000 (22:43 +0200)
commite4411e9a83e9db96c80c442bac2decf3c6721d42
tree59ebf3567ee2a11e6eb313abc6d9e9770fb74341
parent3b334ea33f073aafd069463dd5d8fa03a4fa603b
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