summaryrefslogtreecommitdiffstats
path: root/src/modules/bluetooth/module-bluetooth-discover.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2009-02-03 17:15:41 +0200
committerMarc-André Lureau <marcandre.lureau@gmail.com>2009-02-09 22:14:45 +0200
commitc8a240cddd23eba83c4d3fc901fe2e42a871823f (patch)
treeb5612dd673c0aaac612383313264d88758ae63cc /src/modules/bluetooth/module-bluetooth-discover.c
parentb35ae7f53116949d0cf5d991883e3b54f2c48aa5 (diff)
bluetooth: SCO over PCM
Diffstat (limited to 'src/modules/bluetooth/module-bluetooth-discover.c')
-rw-r--r--src/modules/bluetooth/module-bluetooth-discover.c21
1 files changed, 20 insertions, 1 deletions
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=<Asynchronous initialization?>");
+PA_MODULE_USAGE("sco_sink=<name of sink> "
+ "sco_source=<name of source>"
+ "async=<Asynchronous initialization?>");
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);
}