[pulseaudio-commits] 3 commits - configure.ac src/modules

Colin Guthrie colin at kemper.freedesktop.org
Wed Sep 7 13:16:22 PDT 2011


 configure.ac                           |    4 +-
 src/modules/alsa/alsa-sink.c           |    2 -
 src/modules/alsa/alsa-source.c         |    2 -
 src/modules/alsa/module-alsa-card.c    |    4 +-
 src/modules/alsa/module-alsa-sink.c    |    2 -
 src/modules/alsa/module-alsa-source.c  |    2 -
 src/modules/bluetooth/bluetooth-util.c |   18 ------------
 src/modules/module-loopback.c          |   46 +++++++++++++++++----------------
 8 files changed, 32 insertions(+), 48 deletions(-)

New commits:
commit db704130d6536548fec13ab0b779eef71d1b3102
Author: Colin Guthrie <colin at mageia.org>
Date:   Wed Sep 7 21:11:58 2011 +0100

    alsa: Tidy up argument descriptions

diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index 2394455..7d205bf 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -2108,7 +2108,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
      * variable is impossible. */
     namereg_fail = data.namereg_fail;
     if (pa_modargs_get_value_boolean(ma, "namereg_fail", &namereg_fail) < 0) {
-        pa_log("Failed to parse boolean argument namereg_fail.");
+        pa_log("Failed to parse namereg_fail argument.");
         pa_sink_new_data_done(&data);
         goto fail;
     }
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index fa8d892..fa500a1 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -1809,7 +1809,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
      * variable is impossible. */
     namereg_fail = data.namereg_fail;
     if (pa_modargs_get_value_boolean(ma, "namereg_fail", &namereg_fail) < 0) {
-        pa_log("Failed to parse boolean argument namereg_fail.");
+        pa_log("Failed to parse namereg_fail argument.");
         pa_source_new_data_done(&data);
         goto fail;
     }
diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c
index 8b19d42..7c6b778 100644
--- a/src/modules/alsa/module-alsa-card.c
+++ b/src/modules/alsa/module-alsa-card.c
@@ -53,7 +53,7 @@ PA_MODULE_USAGE(
         "sink_properties=<properties for the sink> "
         "source_name=<name for the source> "
         "source_properties=<properties for the source> "
-        "namereg_fail=<pa_namereg_register() fail parameter value> "
+        "namereg_fail=<when false attempt to synthesise new names if they are already taken> "
         "device_id=<ALSA card index> "
         "format=<sample format> "
         "rate=<sample rate> "
@@ -360,7 +360,7 @@ int pa__init(pa_module *m) {
      * variable is impossible. */
     namereg_fail = data.namereg_fail;
     if (pa_modargs_get_value_boolean(ma, "namereg_fail", &namereg_fail) < 0) {
-        pa_log("Failed to parse boolean argument namereg_fail.");
+        pa_log("Failed to parse namereg_fail argument.");
         pa_card_new_data_done(&data);
         goto fail;
     }
diff --git a/src/modules/alsa/module-alsa-sink.c b/src/modules/alsa/module-alsa-sink.c
index 6e64ab3..800fd83 100644
--- a/src/modules/alsa/module-alsa-sink.c
+++ b/src/modules/alsa/module-alsa-sink.c
@@ -40,7 +40,7 @@ PA_MODULE_USAGE(
         "name=<name of the sink, to be prefixed> "
         "sink_name=<name for the sink> "
         "sink_properties=<properties for the sink> "
-        "namereg_fail=<pa_namereg_register() fail parameter value> "
+        "namereg_fail=<when false attempt to synthesise new sink_name if it is already taken> "
         "device=<ALSA device> "
         "device_id=<ALSA card index> "
         "format=<sample format> "
diff --git a/src/modules/alsa/module-alsa-source.c b/src/modules/alsa/module-alsa-source.c
index 5ecd1e3..46c1176 100644
--- a/src/modules/alsa/module-alsa-source.c
+++ b/src/modules/alsa/module-alsa-source.c
@@ -49,7 +49,7 @@ PA_MODULE_USAGE(
         "name=<name for the source, to be prefixed> "
         "source_name=<name for the source> "
         "source_properties=<properties for the source> "
-        "namereg_fail=<pa_namereg_register() fail parameter value> "
+        "namereg_fail=<when false attempt to synthesise new source_name if it is already taken> "
         "device=<ALSA device> "
         "device_id=<ALSA card index> "
         "format=<sample format> "

commit 69fe26206f9ce204db58c0cedd87a6063810c179
Author: Colin Guthrie <colin at mageia.org>
Date:   Wed Sep 7 20:19:44 2011 +0100

    bluetooth: Bump DBus version to 1.3.0 and drop conditional code.
    
    We used to support older DBus versions but 1.3.0 is two years old
    now and by requiring it we cut down of deviated code paths at
    runtime and thus have less support issues.
    
    fdo#40635

diff --git a/configure.ac b/configure.ac
index b1118c7..64bed09 100644
--- a/configure.ac
+++ b/configure.ac
@@ -908,11 +908,11 @@ AC_ARG_ENABLE([dbus],
     AS_HELP_STRING([--disable-dbus],[Disable optional D-Bus support]))
 
 AS_IF([test "x$enable_dbus" != "xno"],
-    [PKG_CHECK_MODULES(DBUS, [ dbus-1 >= 1.0.0 ], HAVE_DBUS=1, HAVE_DBUS=0)],
+    [PKG_CHECK_MODULES(DBUS, [ dbus-1 >= 1.3.0 ], HAVE_DBUS=1, HAVE_DBUS=0)],
     HAVE_DBUS=0)
 
 AS_IF([test "x$enable_dbus" = "xyes" && test "x$HAVE_DBUS" = "x0"],
-    [AC_MSG_ERROR([*** D-Bus support not found])])
+    [AC_MSG_ERROR([*** D-Bus (1.3.0+) support not found])])
 
 AS_IF([test "x$HAVE_DBUS" = "x1"],
     [
diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c
index 4b85ce9..1c93ca9 100644
--- a/src/modules/bluetooth/bluetooth-util.c
+++ b/src/modules/bluetooth/bluetooth-util.c
@@ -519,7 +519,6 @@ static pa_dbus_pending* send_and_add_to_pending(pa_bluetooth_discovery *y, DBusM
     return p;
 }
 
-#ifdef DBUS_TYPE_UNIX_FD
 static void register_endpoint_reply(DBusPendingCall *pending, void *userdata) {
     DBusError e;
     DBusMessage *r;
@@ -560,7 +559,6 @@ finish:
 
     pa_xfree(endpoint);
 }
-#endif
 
 static void list_devices_reply(DBusPendingCall *pending, void *userdata) {
     DBusError e;
@@ -609,7 +607,6 @@ finish:
     pa_dbus_pending_free(p);
 }
 
-#ifdef DBUS_TYPE_UNIX_FD
 static void register_endpoint(pa_bluetooth_discovery *y, const char *path, const char *endpoint, const char *uuid) {
     DBusMessage *m;
     DBusMessageIter i, d;
@@ -655,7 +652,6 @@ static void register_endpoint(pa_bluetooth_discovery *y, const char *path, const
 
     send_and_add_to_pending(y, m, register_endpoint_reply, pa_xstrdup(endpoint));
 }
-#endif
 
 static void found_adapter(pa_bluetooth_discovery *y, const char *path) {
     DBusMessage *m;
@@ -663,11 +659,9 @@ static void found_adapter(pa_bluetooth_discovery *y, const char *path) {
     pa_assert_se(m = dbus_message_new_method_call("org.bluez", path, "org.bluez.Adapter", "ListDevices"));
     send_and_add_to_pending(y, m, list_devices_reply, NULL);
 
-#ifdef DBUS_TYPE_UNIX_FD
     register_endpoint(y, path, HFP_AG_ENDPOINT, HFP_AG_UUID);
     register_endpoint(y, path, A2DP_SOURCE_ENDPOINT, A2DP_SOURCE_UUID);
     register_endpoint(y, path, A2DP_SINK_ENDPOINT, A2DP_SINK_UUID);
-#endif
 }
 
 static void list_adapters_reply(DBusPendingCall *pending, void *userdata) {
@@ -1029,14 +1023,12 @@ int pa_bluetooth_transport_acquire(const pa_bluetooth_transport *t, const char *
         return -1;
     }
 
-#ifdef DBUS_TYPE_UNIX_FD
     if (!dbus_message_get_args(r, &err, DBUS_TYPE_UNIX_FD, &ret, DBUS_TYPE_UINT16, &i, DBUS_TYPE_UINT16, &o, DBUS_TYPE_INVALID)) {
         pa_log("Failed to parse org.bluez.MediaTransport.Acquire(): %s", err.message);
         ret = -1;
         dbus_error_free(&err);
         goto fail;
     }
-#endif
 
     if (imtu)
         *imtu = i;
@@ -1044,9 +1036,7 @@ int pa_bluetooth_transport_acquire(const pa_bluetooth_transport *t, const char *
     if (omtu)
         *omtu = o;
 
-#ifdef DBUS_TYPE_UNIX_FD
 fail:
-#endif
     dbus_message_unref(r);
     return ret;
 }
@@ -1087,7 +1077,6 @@ static int setup_dbus(pa_bluetooth_discovery *y) {
     return 0;
 }
 
-#ifdef DBUS_TYPE_UNIX_FD
 static pa_bluetooth_transport *transport_new(pa_bluetooth_discovery *y, const char *path, enum profile p, const uint8_t *config, int size) {
     pa_bluetooth_transport *t;
 
@@ -1440,16 +1429,13 @@ static DBusHandlerResult endpoint_handler(DBusConnection *c, DBusMessage *m, voi
 
     return DBUS_HANDLER_RESULT_HANDLED;
 }
-#endif /* DBUS_TYPE_UNIX_FD */
 
 pa_bluetooth_discovery* pa_bluetooth_discovery_get(pa_core *c) {
     DBusError err;
     pa_bluetooth_discovery *y;
-#ifdef DBUS_TYPE_UNIX_FD
     static const DBusObjectPathVTable vtable_endpoint = {
         .message_function = endpoint_handler,
     };
-#endif
 
     pa_assert(c);
 
@@ -1495,11 +1481,9 @@ pa_bluetooth_discovery* pa_bluetooth_discovery_get(pa_core *c) {
         goto fail;
     }
 
-#ifdef DBUS_TYPE_UNIX_FD
     pa_assert_se(dbus_connection_register_object_path(pa_dbus_connection_get(y->connection), HFP_AG_ENDPOINT, &vtable_endpoint, y));
     pa_assert_se(dbus_connection_register_object_path(pa_dbus_connection_get(y->connection), A2DP_SOURCE_ENDPOINT, &vtable_endpoint, y));
     pa_assert_se(dbus_connection_register_object_path(pa_dbus_connection_get(y->connection), A2DP_SINK_ENDPOINT, &vtable_endpoint, y));
-#endif
 
     list_adapters(y);
 
@@ -1539,11 +1523,9 @@ void pa_bluetooth_discovery_unref(pa_bluetooth_discovery *y) {
     }
 
     if (y->connection) {
-#ifdef DBUS_TYPE_UNIX_FD
         dbus_connection_unregister_object_path(pa_dbus_connection_get(y->connection), HFP_AG_ENDPOINT);
         dbus_connection_unregister_object_path(pa_dbus_connection_get(y->connection), A2DP_SOURCE_ENDPOINT);
         dbus_connection_unregister_object_path(pa_dbus_connection_get(y->connection), A2DP_SINK_ENDPOINT);
-#endif
         pa_dbus_remove_matches(pa_dbus_connection_get(y->connection),
                                "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='org.bluez'",
                                "type='signal',sender='org.bluez',interface='org.bluez.Manager',member='AdapterAdded'",

commit badc32adb9f338d7e33a01fd171b0aeb8e8c2ef2
Author: Tanu Kaskinen <tanuk at iki.fi>
Date:   Tue Sep 6 20:33:42 2011 +0300

    loopback: New modargs: sink_input_properties and source_output_properties.
    
    The new modargs replace sink_input_name, sink_input_role,
    source_output_name and source_output_role.

diff --git a/src/modules/module-loopback.c b/src/modules/module-loopback.c
index cf88267..627a16f 100644
--- a/src/modules/module-loopback.c
+++ b/src/modules/module-loopback.c
@@ -53,10 +53,8 @@ PA_MODULE_USAGE(
         "rate=<sample rate> "
         "channels=<number of channels> "
         "channel_map=<channel map> "
-        "sink_input_name=<custom name for the sink input> "
-        "source_output_name=<custom name for the source output> "
-        "sink_input_role=<media.role for the sink input> "
-        "source_output_role=<media.role for the source output> "
+        "sink_input_properties=<proplist> "
+        "source_output_properties=<proplist> "
         "source_dont_move=<boolean> "
         "sink_dont_move=<boolean> "
         "remix=<remix channels?> ");
@@ -114,10 +112,8 @@ static const char* const valid_modargs[] = {
     "rate",
     "channels",
     "channel_map",
-    "sink_input_name",
-    "source_output_name",
-    "sink_input_role",
-    "source_output_role",
+    "sink_input_properties",
+    "source_output_properties",
     "source_dont_move",
     "sink_dont_move",
     "remix",
@@ -704,18 +700,21 @@ int pa__init(pa_module *m) {
     sink_input_data.module = m;
     pa_sink_input_new_data_set_sink(&sink_input_data, sink, FALSE);
 
-    if ((n = pa_modargs_get_value(ma, "sink_input_name", NULL)))
-        pa_proplist_sets(sink_input_data.proplist, PA_PROP_MEDIA_NAME, n);
-    else
+    if (pa_modargs_get_proplist(ma, "sink_input_properties", sink_input_data.proplist, PA_UPDATE_REPLACE) < 0) {
+        pa_log("Failed to parse the sink_input_properties value.");
+        pa_sink_input_new_data_done(&sink_input_data);
+        goto fail;
+    }
+
+    if (!pa_proplist_contains(sink_input_data.proplist, PA_PROP_MEDIA_NAME))
         pa_proplist_setf(sink_input_data.proplist, PA_PROP_MEDIA_NAME, "Loopback from %s",
                          pa_strnull(pa_proplist_gets(source->proplist, PA_PROP_DEVICE_DESCRIPTION)));
 
-    if ((n = pa_modargs_get_value(ma, "sink_input_role", NULL)))
-        pa_proplist_sets(sink_input_data.proplist, PA_PROP_MEDIA_ROLE, n);
-    else
+    if (!pa_proplist_contains(sink_input_data.proplist, PA_PROP_MEDIA_ROLE))
         pa_proplist_sets(sink_input_data.proplist, PA_PROP_MEDIA_ROLE, "abstract");
 
-    if ((n = pa_proplist_gets(source->proplist, PA_PROP_DEVICE_ICON_NAME)))
+    if (!pa_proplist_contains(sink_input_data.proplist, PA_PROP_MEDIA_ICON_NAME)
+            && (n = pa_proplist_gets(source->proplist, PA_PROP_DEVICE_ICON_NAME)))
         pa_proplist_sets(sink_input_data.proplist, PA_PROP_MEDIA_ICON_NAME, n);
 
     pa_sink_input_new_data_set_sample_spec(&sink_input_data, &ss);
@@ -756,18 +755,21 @@ int pa__init(pa_module *m) {
     source_output_data.module = m;
     pa_source_output_new_data_set_source(&source_output_data, source, FALSE);
 
-    if ((n = pa_modargs_get_value(ma, "source_output_name", NULL)))
-        pa_proplist_sets(source_output_data.proplist, PA_PROP_MEDIA_NAME, n);
-    else
+    if (pa_modargs_get_proplist(ma, "source_output_properties", source_output_data.proplist, PA_UPDATE_REPLACE) < 0) {
+        pa_log("Failed to parse the source_output_properties value.");
+        pa_source_output_new_data_done(&source_output_data);
+        goto fail;
+    }
+
+    if (!pa_proplist_contains(source_output_data.proplist, PA_PROP_MEDIA_NAME))
         pa_proplist_setf(source_output_data.proplist, PA_PROP_MEDIA_NAME, "Loopback to %s",
                          pa_strnull(pa_proplist_gets(sink->proplist, PA_PROP_DEVICE_DESCRIPTION)));
 
-    if ((n = pa_modargs_get_value(ma, "source_output_role", NULL)))
-        pa_proplist_sets(source_output_data.proplist, PA_PROP_MEDIA_ROLE, n);
-    else
+    if (!pa_proplist_contains(source_output_data.proplist, PA_PROP_MEDIA_ROLE))
         pa_proplist_sets(source_output_data.proplist, PA_PROP_MEDIA_ROLE, "abstract");
 
-    if ((n = pa_proplist_gets(sink->proplist, PA_PROP_DEVICE_ICON_NAME)))
+    if (!pa_proplist_contains(source_output_data.proplist, PA_PROP_MEDIA_ICON_NAME)
+            && (n = pa_proplist_gets(sink->proplist, PA_PROP_DEVICE_ICON_NAME)))
         pa_proplist_sets(source_output_data.proplist, PA_PROP_MEDIA_ICON_NAME, n);
 
     pa_source_output_new_data_set_sample_spec(&source_output_data, &ss);



More information about the pulseaudio-commits mailing list