From c8a240cddd23eba83c4d3fc901fe2e42a871823f Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Tue, 3 Feb 2009 17:15:41 +0200 Subject: bluetooth: SCO over PCM --- src/modules/bluetooth/module-bluetooth-discover.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/modules/bluetooth/module-bluetooth-discover.c') diff --git a/src/modules/bluetooth/module-bluetooth-discover.c b/src/modules/bluetooth/module-bluetooth-discover.c index 05236486..3f8a7511 100644 --- a/src/modules/bluetooth/module-bluetooth-discover.c +++ b/src/modules/bluetooth/module-bluetooth-discover.c @@ -42,15 +42,20 @@ PA_MODULE_AUTHOR("Joao Paulo Rechi Vita"); PA_MODULE_DESCRIPTION("Detect available bluetooth audio devices and load bluetooth audio drivers"); PA_MODULE_VERSION(PACKAGE_VERSION); -PA_MODULE_USAGE("async="); +PA_MODULE_USAGE("sco_sink= " + "sco_source=" + "async="); static const char* const valid_modargs[] = { + "sco_sink", + "sco_source", "async", NULL }; struct userdata { pa_module *module; + pa_modargs *ma; pa_core *core; pa_dbus_connection *connection; pa_bluetooth_discovery *discovery; @@ -71,6 +76,16 @@ static void load_module_for_device(struct userdata *u, pa_bluetooth_device *d, p /* Oh, awesome, a new device has shown up and been connected! */ args = pa_sprintf_malloc("address=\"%s\" path=\"%s\"", d->address, d->path); + + if (pa_modargs_get_value(u->ma, "sco_sink", NULL) && + pa_modargs_get_value(u->ma, "sco_source", NULL)) { + char *tmp; + + tmp = pa_sprintf_malloc("%s sco_sink=\"%s\" sco_source=\"%s\"", args, pa_modargs_get_value(u->ma, "sco_sink", NULL), pa_modargs_get_value(u->ma, "sco_source", NULL)); + pa_xfree(args); + args = tmp; + } + pa_log_debug("Loading module-bluetooth-device %s", args); m = pa_module_load(u->module->core, "module-bluetooth-device", args); pa_xfree(args); @@ -130,6 +145,7 @@ int pa__init(pa_module* m) { m->userdata = u = pa_xnew0(struct userdata, 1); u->module = m; u->core = m->core; + u->ma = ma; if (setup_dbus(u) < 0) goto fail; @@ -162,5 +178,8 @@ void pa__done(pa_module* m) { if (u->connection) pa_dbus_connection_unref(u->connection); + if (u->ma) + pa_modargs_free(u->ma); + pa_xfree(u); } -- cgit