[pulseaudio-commits] 2 commits - src/modules
Tanu Kaskinen
tanuk at kemper.freedesktop.org
Wed Sep 10 03:27:21 PDT 2014
src/modules/bluetooth/backend-null.c | 2 +-
src/modules/bluetooth/backend-ofono.c | 4 +++-
src/modules/bluetooth/bluez5-util.c | 8 +++++++-
src/modules/bluetooth/bluez5-util.h | 2 +-
4 files changed, 12 insertions(+), 4 deletions(-)
New commits:
commit f508b34b8bec101b20e454e6852e57eb9dec5a0c
Author: Luiz Augusto von Dentz <luiz.von.dentz at intel.com>
Date: Wed Sep 10 11:48:23 2014 +0200
bluetooth: Add discovery to pa_bluetooth_backend_new
diff --git a/src/modules/bluetooth/backend-null.c b/src/modules/bluetooth/backend-null.c
index f8a145b..6e621a7 100644
--- a/src/modules/bluetooth/backend-null.c
+++ b/src/modules/bluetooth/backend-null.c
@@ -27,7 +27,7 @@
#include "bluez5-util.h"
-pa_bluetooth_backend *pa_bluetooth_backend_new(pa_core *c) {
+pa_bluetooth_backend *pa_bluetooth_backend_new(pa_core *c, pa_bluetooth_discovery *y) {
pa_log_debug("Bluetooth Headset Backend API support disabled");
return NULL;
}
diff --git a/src/modules/bluetooth/backend-ofono.c b/src/modules/bluetooth/backend-ofono.c
index bf0db47..99ff09d 100644
--- a/src/modules/bluetooth/backend-ofono.c
+++ b/src/modules/bluetooth/backend-ofono.c
@@ -54,6 +54,7 @@
struct pa_bluetooth_backend {
pa_core *core;
+ pa_bluetooth_discovery *discovery;
pa_dbus_connection *connection;
};
@@ -104,7 +105,7 @@ static DBusHandlerResult hf_audio_agent_handler(DBusConnection *c, DBusMessage *
return DBUS_HANDLER_RESULT_HANDLED;
}
-pa_bluetooth_backend *pa_bluetooth_backend_new(pa_core *c) {
+pa_bluetooth_backend *pa_bluetooth_backend_new(pa_core *c, pa_bluetooth_discovery *y) {
pa_bluetooth_backend *backend;
DBusError err;
static const DBusObjectPathVTable vtable_hf_audio_agent = {
@@ -115,6 +116,7 @@ pa_bluetooth_backend *pa_bluetooth_backend_new(pa_core *c) {
backend = pa_xnew0(pa_bluetooth_backend, 1);
backend->core = c;
+ backend->discovery = y;
dbus_error_init(&err);
diff --git a/src/modules/bluetooth/bluez5-util.c b/src/modules/bluetooth/bluez5-util.c
index 97862d5..8bb57f4 100644
--- a/src/modules/bluetooth/bluez5-util.c
+++ b/src/modules/bluetooth/bluez5-util.c
@@ -896,7 +896,7 @@ static void get_managed_objects_reply(DBusPendingCall *pending, void *userdata)
y->objects_listed = true;
if (!y->backend)
- y->backend = pa_bluetooth_backend_new(y->core);
+ y->backend = pa_bluetooth_backend_new(y->core, y);
finish:
dbus_message_unref(r);
diff --git a/src/modules/bluetooth/bluez5-util.h b/src/modules/bluetooth/bluez5-util.h
index d41bf28..8db4a17 100644
--- a/src/modules/bluetooth/bluez5-util.h
+++ b/src/modules/bluetooth/bluez5-util.h
@@ -106,7 +106,7 @@ struct pa_bluetooth_adapter {
bool valid;
};
-pa_bluetooth_backend *pa_bluetooth_backend_new(pa_core *c);
+pa_bluetooth_backend *pa_bluetooth_backend_new(pa_core *c, pa_bluetooth_discovery *y);
void pa_bluetooth_backend_free(pa_bluetooth_backend *b);
pa_bluetooth_transport *pa_bluetooth_transport_new(pa_bluetooth_device *d, const char *owner, const char *path,
commit 5c2ed8abedd55141101829c4b2069ad5aa5498f4
Author: Luiz Augusto von Dentz <luiz.von.dentz at intel.com>
Date: Mon Sep 8 13:35:33 2014 +0300
bluetooth: Only create backend instance once objects are listed
This makes sure the devices are discovered before the backend start
creating new transports.
diff --git a/src/modules/bluetooth/bluez5-util.c b/src/modules/bluetooth/bluez5-util.c
index efe87d3..97862d5 100644
--- a/src/modules/bluetooth/bluez5-util.c
+++ b/src/modules/bluetooth/bluez5-util.c
@@ -895,6 +895,9 @@ static void get_managed_objects_reply(DBusPendingCall *pending, void *userdata)
y->objects_listed = true;
+ if (!y->backend)
+ y->backend = pa_bluetooth_backend_new(y->core);
+
finish:
dbus_message_unref(r);
@@ -947,6 +950,10 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *m, void *us
pa_hashmap_remove_all(y->devices);
pa_hashmap_remove_all(y->adapters);
y->objects_listed = false;
+ if (y->backend) {
+ pa_bluetooth_backend_free(y->backend);
+ y->backend = NULL;
+ }
}
if (new_owner && *new_owner) {
@@ -1597,7 +1604,6 @@ pa_bluetooth_discovery* pa_bluetooth_discovery_get(pa_core *c) {
endpoint_init(y, PA_BLUETOOTH_PROFILE_A2DP_SINK);
endpoint_init(y, PA_BLUETOOTH_PROFILE_A2DP_SOURCE);
- y->backend = pa_bluetooth_backend_new(c);
get_managed_objects(y);
More information about the pulseaudio-commits
mailing list