[pulseaudio-discuss] [PATCH next v0 10/11] bluetooth: Remove deprecated transport hooks

Mikel Astiz mikel.astiz.oss at gmail.com
Thu Dec 6 06:55:35 PST 2012


From: Mikel Astiz <mikel.astiz at bmw-carit.de>

All code has migrated to the new centralized hooks listed in
pa_bluetooth_hook_t so the old transport-specific hooks can be removed.
---
 src/modules/bluetooth/bluetooth-util.c | 12 ------------
 src/modules/bluetooth/bluetooth-util.h |  9 ---------
 2 files changed, 21 deletions(-)

diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c
index 20d2217..3939d2d 100644
--- a/src/modules/bluetooth/bluetooth-util.c
+++ b/src/modules/bluetooth/bluetooth-util.c
@@ -175,13 +175,8 @@ static pa_bluetooth_device* device_new(pa_bluetooth_discovery *discovery, const
 }
 
 static void transport_free(pa_bluetooth_transport *t) {
-    unsigned i;
-
     pa_assert(t);
 
-    for (i = 0; i < PA_BLUETOOTH_TRANSPORT_HOOK_MAX; i++)
-        pa_hook_done(&t->hooks[i]);
-
     pa_xfree(t->owner);
     pa_xfree(t->path);
     pa_xfree(t->config);
@@ -203,7 +198,6 @@ static void device_free(pa_bluetooth_device *d) {
         pa_hashmap_remove(d->discovery->transports, t->path);
         t->state = PA_BLUETOOTH_TRANSPORT_STATE_DISCONNECTED;
         pa_hook_fire(&d->discovery->hooks[PA_BLUETOOTH_HOOK_TRANSPORT_STATE_CHANGED], t);
-        pa_hook_fire(&t->hooks[PA_BLUETOOTH_TRANSPORT_HOOK_REMOVED], NULL);
         transport_free(t);
     }
 
@@ -819,7 +813,6 @@ static int pa_bluetooth_transport_parse_property(pa_bluetooth_transport *t, DBus
                 t->nrec = value;
                 pa_log_debug("Transport %s: Property 'NREC' changed to %s.", t->path, t->nrec ? "True" : "False");
                 pa_hook_fire(&t->device->discovery->hooks[PA_BLUETOOTH_HOOK_TRANSPORT_NREC_CHANGED], t);
-                pa_hook_fire(&t->hooks[PA_BLUETOOTH_TRANSPORT_HOOK_NREC_CHANGED], NULL);
             }
 
             break;
@@ -1116,7 +1109,6 @@ static int setup_dbus(pa_bluetooth_discovery *y) {
 static pa_bluetooth_transport *transport_new(pa_bluetooth_device *d, const char *owner, const char *path, enum profile p,
                                              const uint8_t *config, int size) {
     pa_bluetooth_transport *t;
-    unsigned i;
 
     t = pa_xnew0(pa_bluetooth_transport, 1);
     t->device = d;
@@ -1132,9 +1124,6 @@ static pa_bluetooth_transport *transport_new(pa_bluetooth_device *d, const char
 
     t->state = pa_bt_audio_state_to_transport_state(d->profile_state[p]);
 
-    for (i = 0; i < PA_BLUETOOTH_TRANSPORT_HOOK_MAX; i++)
-        pa_hook_init(&t->hooks[i], t);
-
     return t;
 }
 
@@ -1265,7 +1254,6 @@ static DBusMessage *endpoint_clear_configuration(DBusConnection *c, DBusMessage
         pa_hashmap_remove(y->transports, t->path);
         t->state = PA_BLUETOOTH_TRANSPORT_STATE_DISCONNECTED;
         pa_hook_fire(&y->hooks[PA_BLUETOOTH_HOOK_TRANSPORT_STATE_CHANGED], t);
-        pa_hook_fire(&t->hooks[PA_BLUETOOTH_TRANSPORT_HOOK_REMOVED], NULL);
         transport_free(t);
     }
 
diff --git a/src/modules/bluetooth/bluetooth-util.h b/src/modules/bluetooth/bluetooth-util.h
index b35e533..254eded 100644
--- a/src/modules/bluetooth/bluetooth-util.h
+++ b/src/modules/bluetooth/bluetooth-util.h
@@ -79,13 +79,6 @@ typedef enum pa_bluetooth_hook {
     PA_BLUETOOTH_HOOK_MAX
 } pa_bluetooth_hook_t;
 
-/* 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_REMOVED, /* Call data: NULL. */
-    PA_BLUETOOTH_TRANSPORT_HOOK_MAX
-} pa_bluetooth_transport_hook_t;
-
 typedef enum pa_bluetooth_transport_state {
     PA_BLUETOOTH_TRANSPORT_STATE_DISCONNECTED,
     PA_BLUETOOTH_TRANSPORT_STATE_IDLE, /* Connected but not playing */
@@ -103,8 +96,6 @@ struct pa_bluetooth_transport {
 
     pa_bluetooth_transport_state_t state;
     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 */
-- 
1.7.11.7



More information about the pulseaudio-discuss mailing list