]> code.delx.au - pulseaudio/commitdiff
modules: add {sink|source|card}_properties argument to all modules
authorLennart Poettering <lennart@poettering.net>
Thu, 28 May 2009 00:39:22 +0000 (02:39 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 28 May 2009 00:39:22 +0000 (02:39 +0200)
20 files changed:
src/modules/alsa/alsa-sink.c
src/modules/alsa/alsa-source.c
src/modules/alsa/module-alsa-card.c
src/modules/alsa/module-alsa-sink.c
src/modules/alsa/module-alsa-source.c
src/modules/bluetooth/module-bluetooth-device.c
src/modules/jack/module-jack-sink.c
src/modules/jack/module-jack-source.c
src/modules/module-combine.c
src/modules/module-esound-sink.c
src/modules/module-ladspa-sink.c
src/modules/module-null-sink.c
src/modules/module-pipe-sink.c
src/modules/module-pipe-source.c
src/modules/module-raop-sink.c
src/modules/module-remap-sink.c
src/modules/module-sine-source.c
src/modules/module-solaris.c
src/modules/module-tunnel.c
src/modules/oss/module-oss.c

index 784a8dd51c83926d184dc985e946d9cd4beb24cb..59f531105f00a6029e8d06f4df7c2ec1b9ac888c 100644 (file)
@@ -1693,6 +1693,12 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
         pa_xfree(control_device);
     }
 
+    if (pa_modargs_get_proplist(ma, "sink_properties", data.proplist, PA_UPDATE_REPLACE) < 0) {
+        pa_log("Invalid properties");
+        pa_sink_new_data_done(&data);
+        goto fail;
+    }
+
     u->sink = pa_sink_new(m->core, &data, PA_SINK_HARDWARE|PA_SINK_LATENCY|(u->use_tsched ? PA_SINK_DYNAMIC_LATENCY : 0));
     pa_sink_new_data_done(&data);
 
index 780da83178e4d4d9608f022f5902012f8e9b021d..f1c18196b8618cfb8816a0b5e81b03a0ad25db0d 100644 (file)
@@ -1548,6 +1548,12 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
         pa_xfree(control_device);
     }
 
+    if (pa_modargs_get_proplist(ma, "source_properties", data.proplist, PA_UPDATE_REPLACE) < 0) {
+        pa_log("Invalid properties");
+        pa_source_new_data_done(&data);
+        goto fail;
+    }
+
     u->source = pa_source_new(m->core, &data, PA_SOURCE_HARDWARE|PA_SOURCE_LATENCY|(u->use_tsched ? PA_SOURCE_DYNAMIC_LATENCY : 0));
     pa_source_new_data_done(&data);
 
index d894b9ce620baa2c1b1af6b71e91ab52177d6610..ad52f5e33a7e695022ed7cbcd48a06ba6dad5d63 100644 (file)
@@ -43,9 +43,12 @@ PA_MODULE_VERSION(PACKAGE_VERSION);
 PA_MODULE_LOAD_ONCE(FALSE);
 PA_MODULE_USAGE(
         "name=<name for the card/sink/source, to be prefixed> "
-        "card_name=<name for card> "
-        "sink_name=<name for sink> "
-        "source_name=<name for source> "
+        "card_name=<name for the card> "
+        "card_properties=<properties for the card> "
+        "sink_name=<name for the sink> "
+        "sink_properties=<properties for the sink> "
+        "source_name=<name for the source> "
+        "source_properties=<properties for the source> "
         "device_id=<ALSA card index> "
         "format=<sample format> "
         "rate=<sample rate> "
@@ -61,8 +64,11 @@ PA_MODULE_USAGE(
 static const char* const valid_modargs[] = {
     "name",
     "card_name",
+    "card_properties",
     "sink_name",
+    "sink_properties",
     "source_name",
+    "source_properties",
     "device_id",
     "format",
     "rate",
@@ -340,6 +346,12 @@ int pa__init(pa_module *m) {
 
     add_disabled_profile(data.profiles);
 
+    if (pa_modargs_get_proplist(ma, "card_properties", data.proplist, PA_UPDATE_REPLACE) < 0) {
+        pa_log("Invalid properties");
+        pa_card_new_data_done(&data);
+        goto fail;
+    }
+
     u->card = pa_card_new(m->core, &data);
     pa_card_new_data_done(&data);
 
index 8e600ab870242aac7e9177d6f70efa20585a1d13..058ea205c937989e4f8dd224d4b3ffb24492c1a8 100644 (file)
@@ -40,6 +40,7 @@ PA_MODULE_LOAD_ONCE(FALSE);
 PA_MODULE_USAGE(
         "name=<name of the sink, to be prefixed> "
         "sink_name=<name for the sink> "
+        "sink_properities=<properties for the sink> "
         "device=<ALSA device> "
         "device_id=<ALSA card index> "
         "format=<sample format> "
@@ -58,6 +59,7 @@ PA_MODULE_USAGE(
 static const char* const valid_modargs[] = {
     "name",
     "sink_name",
+    "sink_properties",
     "device",
     "device_id",
     "format",
index e6b27b3dce947af8a71a72f2ee02d278de33226a..3bd1b4512fb85864cb1b4dcc3360cb661f2096d2 100644 (file)
@@ -64,6 +64,7 @@ PA_MODULE_LOAD_ONCE(FALSE);
 PA_MODULE_USAGE(
         "name=<name for the source, to be prefixed> "
         "source_name=<name for the source> "
+        "source_properties=<properties for the source> "
         "device=<ALSA device> "
         "device_id=<ALSA card index> "
         "format=<sample format> "
@@ -82,6 +83,7 @@ PA_MODULE_USAGE(
 static const char* const valid_modargs[] = {
     "name",
     "source_name",
+    "source_properties",
     "device",
     "device_id",
     "format",
index 812b0baef3e6ec9577a222b20cd2e15f60bfd50b..dbec00d4658c06d04151d5dbaef241323cefe47b 100644 (file)
@@ -64,8 +64,11 @@ PA_MODULE_LOAD_ONCE(FALSE);
 PA_MODULE_USAGE(
         "name=<name for the card/sink/source, to be prefixed> "
         "card_name=<name for the card> "
+        "card_properties=<properties for the card> "
         "sink_name=<name for the sink> "
+        "sink_properties=<properties for the sink> "
         "source_name=<name for the source> "
+        "source_properties=<properties for the source> "
         "address=<address of the device> "
         "profile=<a2dp|hsp> "
         "rate=<sample rate> "
@@ -84,8 +87,11 @@ PA_MODULE_USAGE(
 static const char* const valid_modargs[] = {
     "name",
     "card_name",
+    "card_properties",
     "sink_name",
+    "sink_properties",
     "source_name",
+    "source_properties",
     "address",
     "profile",
     "rate",
@@ -1620,6 +1626,12 @@ static int add_sink(struct userdata *u) {
         data.name = get_name("sink", u->modargs, u->address, &b);
         data.namereg_fail = b;
 
+        if (pa_modargs_get_proplist(u->modargs, "sink_properties", data.proplist, PA_UPDATE_REPLACE) < 0) {
+            pa_log("Invalid properties");
+            pa_sink_new_data_done(&data);
+            return -1;
+        }
+
         u->sink = pa_sink_new(u->core, &data, PA_SINK_HARDWARE|PA_SINK_LATENCY | (u->profile == PROFILE_HSP ? PA_SINK_HW_VOLUME_CTRL : 0));
         pa_sink_new_data_done(&data);
 
@@ -1672,6 +1684,12 @@ static int add_source(struct userdata *u) {
         data.name = get_name("source", u->modargs, u->address, &b);
         data.namereg_fail = b;
 
+        if (pa_modargs_get_proplist(u->modargs, "source_properties", data.proplist, PA_UPDATE_REPLACE) < 0) {
+            pa_log("Invalid properties");
+            pa_source_new_data_done(&data);
+            return -1;
+        }
+
         u->source = pa_source_new(u->core, &data, PA_SOURCE_HARDWARE|PA_SOURCE_LATENCY | (u->profile == PROFILE_HSP ? PA_SOURCE_HW_VOLUME_CTRL : 0));
         pa_source_new_data_done(&data);
 
@@ -1963,13 +1981,17 @@ static int card_set_profile(pa_card *c, pa_card_profile *new_profile) {
 }
 
 /* Run from main thread */
-static int add_card(struct userdata *u, const char *default_profile, const pa_bluetooth_device *device) {
+static int add_card(struct userdata *u, const pa_bluetooth_device *device) {
     pa_card_new_data data;
     pa_bool_t b;
     pa_card_profile *p;
     enum profile *d;
     const char *ff;
     char *n;
+    const char *default_profile;
+
+    pa_assert(u);
+    pa_assert(device);
 
     pa_card_new_data_init(&data);
     data.driver = __FILE__;
@@ -1990,6 +2012,12 @@ static int add_card(struct userdata *u, const char *default_profile, const pa_bl
     data.name = get_name("card", u->modargs, device->address, &b);
     data.namereg_fail = b;
 
+    if (pa_modargs_get_proplist(u->modargs, "card_properties", data.proplist, PA_UPDATE_REPLACE) < 0) {
+        pa_log("Invalid properties");
+        pa_card_new_data_done(&data);
+        return -1;
+    }
+
     data.profiles = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
 
     /* we base hsp/a2dp availability on UUIDs.
@@ -2032,7 +2060,7 @@ static int add_card(struct userdata *u, const char *default_profile, const pa_bl
     *d = PROFILE_OFF;
     pa_hashmap_put(data.profiles, p->name, p);
 
-    if (default_profile) {
+    if ((default_profile = pa_modargs_get_value(u->modargs, "profile", NULL))) {
         if (pa_hashmap_get(data.profiles, default_profile))
             pa_card_new_data_set_profile(&data, default_profile);
         else
@@ -2178,7 +2206,7 @@ int pa__init(pa_module* m) {
         goto fail;
 
     /* Add the card structure. This will also initialize the default profile */
-    if (add_card(u, pa_modargs_get_value(ma, "profile", NULL), device) < 0)
+    if (add_card(u, device) < 0)
         goto fail;
 
     /* Connect to the BT service and query capabilities */
index 31b8a96e0c10efdb7dabef661b59b3f9f197eb22..290038e72973d946926e81b28655431270175f21 100644 (file)
@@ -67,12 +67,13 @@ PA_MODULE_DESCRIPTION("JACK Sink");
 PA_MODULE_LOAD_ONCE(TRUE);
 PA_MODULE_VERSION(PACKAGE_VERSION);
 PA_MODULE_USAGE(
-        "sink_name=<name of sink> "
+        "sink_name=<name for the sink> "
+        "sink_properties=<properties  for the card> "
         "server_name=<jack server name> "
         "client_name=<jack client name> "
         "channels=<number of channels> "
-        "connect=<connect ports?> "
-        "channel_map=<channel map>");
+        "channel_map=<channel map> "
+        "connect=<connect ports?>");
 
 #define DEFAULT_SINK_NAME "jack_out"
 
@@ -102,11 +103,12 @@ struct userdata {
 
 static const char* const valid_modargs[] = {
     "sink_name",
+    "sink_properties",
     "server_name",
     "client_name",
     "channels",
-    "connect",
     "channel_map",
+    "connect",
     NULL
 };
 
@@ -386,6 +388,12 @@ int pa__init(pa_module*m) {
     pa_proplist_setf(data.proplist, PA_PROP_DEVICE_DESCRIPTION, "Jack sink (%s)", jack_get_client_name(u->client));
     pa_proplist_sets(data.proplist, "jack.client_name", jack_get_client_name(u->client));
 
+    if (pa_modargs_get_proplist(ma, "sink_properties", data.proplist, PA_UPDATE_REPLACE) < 0) {
+        pa_log("Invalid properties");
+        pa_sink_new_data_done(&data);
+        goto fail;
+    }
+
     u->sink = pa_sink_new(m->core, &data, PA_SINK_LATENCY);
     pa_sink_new_data_done(&data);
 
index 9a215c5451237d38af73c25b4a8747ff84d1752a..ef89a98e5633d3d3c1bf91527fbcc41e24bab484 100644 (file)
@@ -57,12 +57,13 @@ PA_MODULE_DESCRIPTION("JACK Source");
 PA_MODULE_VERSION(PACKAGE_VERSION);
 PA_MODULE_LOAD_ONCE(TRUE);
 PA_MODULE_USAGE(
-        "source_name=<name of source> "
+        "source_name=<name for the source> "
+        "source_properties=<properties for the source> "
         "server_name=<jack server name> "
         "client_name=<jack client name> "
         "channels=<number of channels> "
-        "connect=<connect ports?>"
-        "channel_map=<channel map>");
+        "channel_map=<channel map> "
+        "connect=<connect ports?>");
 
 #define DEFAULT_SOURCE_NAME "jack_in"
 
@@ -89,11 +90,12 @@ struct userdata {
 
 static const char* const valid_modargs[] = {
     "source_name",
+    "source_properties",
     "server_name",
     "client_name",
     "channels",
-    "connect",
     "channel_map",
+    "connect",
     NULL
 };
 
@@ -338,6 +340,12 @@ int pa__init(pa_module*m) {
     pa_proplist_setf(data.proplist, PA_PROP_DEVICE_DESCRIPTION, "Jack source (%s)", jack_get_client_name(u->client));
     pa_proplist_sets(data.proplist, "jack.client_name", jack_get_client_name(u->client));
 
+    if (pa_modargs_get_proplist(ma, "source_properties", data.proplist, PA_UPDATE_REPLACE) < 0) {
+        pa_log("Invalid properties");
+        pa_source_new_data_done(&data);
+        goto fail;
+    }
+
     u->source = pa_source_new(m->core, &data, PA_SOURCE_LATENCY);
     pa_source_new_data_done(&data);
 
index a1ef8da4f6ccfeb501f28bd6bf0e45ed7449a276..02a7e1ff27be63b84376f82dc7a63d3fb01e8b97 100644 (file)
@@ -55,12 +55,13 @@ PA_MODULE_VERSION(PACKAGE_VERSION);
 PA_MODULE_LOAD_ONCE(FALSE);
 PA_MODULE_USAGE(
         "sink_name=<name for the sink> "
+        "sink_properties=<properties for the sink> "
         "slaves=<slave sinks> "
         "adjust_time=<seconds> "
         "resample_method=<method> "
         "format=<sample format> "
-        "channels=<number of channels> "
         "rate=<sample rate> "
+        "channels=<number of channels> "
         "channel_map=<channel map>");
 
 #define DEFAULT_SINK_NAME "combined"
@@ -73,12 +74,13 @@ PA_MODULE_USAGE(
 
 static const char* const valid_modargs[] = {
     "sink_name",
+    "sink_properties",
     "slaves",
     "adjust_time",
     "resample_method",
     "format",
-    "channels",
     "rate",
+    "channels",
     "channel_map",
     NULL
 };
@@ -1080,6 +1082,12 @@ int pa__init(pa_module*m) {
     if (slaves)
         pa_proplist_sets(data.proplist, "combine.slaves", slaves);
 
+    if (pa_modargs_get_proplist(ma, "sink_properties", data.proplist, PA_UPDATE_REPLACE) < 0) {
+        pa_log("Invalid properties");
+        pa_sink_new_data_done(&data);
+        goto fail;
+    }
+
     u->sink = pa_sink_new(m->core, &data, PA_SINK_LATENCY);
     pa_sink_new_data_done(&data);
 
index a1a783aae5243eb1ea98d928ce680b3537027dd9..8cb25c51d7f50cba26a4a20c16eedb90e2c6844d 100644 (file)
@@ -68,10 +68,11 @@ PA_MODULE_VERSION(PACKAGE_VERSION);
 PA_MODULE_LOAD_ONCE(FALSE);
 PA_MODULE_USAGE(
         "sink_name=<name for the sink> "
+        "sink_properties=<properties for the sink> "
         "server=<address> cookie=<filename>  "
         "format=<sample format> "
-        "channels=<number of channels> "
-        "rate=<sample rate>");
+        "rate=<sample rate> "
+        "channels=<number of channels>");
 
 #define DEFAULT_SINK_NAME "esound_out"
 
@@ -118,12 +119,13 @@ struct userdata {
 };
 
 static const char* const valid_modargs[] = {
+    "sink_name",
+    "sink_properties",
     "server",
     "cookie",
-    "rate",
     "format",
+    "rate",
     "channels",
-    "sink_name",
     NULL
 };
 
@@ -586,6 +588,12 @@ int pa__init(pa_module*m) {
     pa_proplist_sets(data.proplist, PA_PROP_DEVICE_API, "esd");
     pa_proplist_setf(data.proplist, PA_PROP_DEVICE_DESCRIPTION, "EsounD Output on %s", espeaker);
 
+    if (pa_modargs_get_proplist(ma, "sink_properties", data.proplist, PA_UPDATE_REPLACE) < 0) {
+        pa_log("Invalid properties");
+        pa_sink_new_data_done(&data);
+        goto fail;
+    }
+
     u->sink = pa_sink_new(m->core, &data, PA_SINK_LATENCY|PA_SINK_NETWORK);
     pa_sink_new_data_done(&data);
 
index 44052c9c47f9f89c193beb5f9439c643477fb57a..15af74a6b9d71affa9cfe069a97de0963352621e 100644 (file)
@@ -50,10 +50,11 @@ PA_MODULE_VERSION(PACKAGE_VERSION);
 PA_MODULE_LOAD_ONCE(FALSE);
 PA_MODULE_USAGE(
         "sink_name=<name for the sink> "
+        "sink_properties=<properties for the sink> "
         "master=<name of sink to remap> "
         "format=<sample format> "
-        "channels=<number of channels> "
         "rate=<sample rate> "
+        "channels=<number of channels> "
         "channel_map=<channel map> "
         "plugin=<ladspa plugin name> "
         "label=<ladspa plugin label> "
@@ -85,10 +86,11 @@ struct userdata {
 
 static const char* const valid_modargs[] = {
     "sink_name",
+    "sink_properties",
     "master",
     "format",
-    "channels",
     "rate",
+    "channels",
     "channel_map",
     "plugin",
     "label",
@@ -705,6 +707,12 @@ int pa__init(pa_module*m) {
     pa_proplist_sets(sink_data.proplist, "device.ladspa.copyright", d->Copyright);
     pa_proplist_setf(sink_data.proplist, "device.ladspa.unique_id", "%lu", (unsigned long) d->UniqueID);
 
+    if (pa_modargs_get_proplist(ma, "sink_properties", sink_data.proplist, PA_UPDATE_REPLACE) < 0) {
+        pa_log("Invalid properties");
+        pa_sink_new_data_done(&sink_data);
+        goto fail;
+    }
+
     u->sink = pa_sink_new(m->core, &sink_data, PA_SINK_LATENCY|PA_SINK_DYNAMIC_LATENCY);
     pa_sink_new_data_done(&sink_data);
 
index c0c2facfa59a3fbe26766b1a46bb898cb9601c27..30a99ca7fbbca12cac87ae7ca63f6276785f4ce4 100644 (file)
@@ -291,7 +291,7 @@ int pa__init(pa_module*m) {
     pa_proplist_sets(data.proplist, PA_PROP_DEVICE_CLASS, "abstract");
 
     if (pa_modargs_get_proplist(ma, "sink_properties", data.proplist, PA_UPDATE_REPLACE) < 0) {
-        pa_log("Invalid properties.");
+        pa_log("Invalid properties");
         pa_sink_new_data_done(&data);
         goto fail;
     }
index 304d01c7518b9686226eceb893842eb36791511c..5b0f64142ca2699118a490cdf4e1022e02e2283b 100644 (file)
@@ -54,10 +54,11 @@ PA_MODULE_VERSION(PACKAGE_VERSION);
 PA_MODULE_LOAD_ONCE(FALSE);
 PA_MODULE_USAGE(
         "sink_name=<name for the sink> "
+        "sink_properties=<properties for the sink> "
         "file=<path of the FIFO> "
         "format=<sample format> "
-        "channels=<number of channels> "
         "rate=<sample rate>"
+        "channels=<number of channels> "
         "channel_map=<channel map>");
 
 #define DEFAULT_FILE_NAME "fifo_output"
@@ -83,11 +84,12 @@ struct userdata {
 };
 
 static const char* const valid_modargs[] = {
+    "sink_name",
+    "sink_properties",
     "file",
-    "rate",
     "format",
+    "rate",
     "channels",
-    "sink_name",
     "channel_map",
     NULL
 };
@@ -279,6 +281,12 @@ int pa__init(pa_module*m) {
     pa_sink_new_data_set_sample_spec(&data, &ss);
     pa_sink_new_data_set_channel_map(&data, &map);
 
+    if (pa_modargs_get_proplist(ma, "sink_properties", data.proplist, PA_UPDATE_REPLACE) < 0) {
+        pa_log("Invalid properties");
+        pa_sink_new_data_done(&data);
+        goto fail;
+    }
+
     u->sink = pa_sink_new(m->core, &data, PA_SINK_LATENCY);
     pa_sink_new_data_done(&data);
 
index 6ed4fbfe281c7a35ec62187731c6f1fb324c43e5..61c9fc0eb61e5b8f5d1162d858ae57397518879e 100644 (file)
@@ -54,10 +54,11 @@ PA_MODULE_VERSION(PACKAGE_VERSION);
 PA_MODULE_LOAD_ONCE(FALSE);
 PA_MODULE_USAGE(
         "source_name=<name for the source> "
+        "source_properties=<properties for the source> "
         "file=<path of the FIFO> "
         "format=<sample format> "
-        "channels=<number of channels> "
         "rate=<sample rate> "
+        "channels=<number of channels> "
         "channel_map=<channel map>");
 
 #define DEFAULT_FILE_NAME "/tmp/music.input"
@@ -81,11 +82,12 @@ struct userdata {
 };
 
 static const char* const valid_modargs[] = {
+    "source_name",
+    "source_properties",
     "file",
+    "format",
     "rate",
     "channels",
-    "format",
-    "source_name",
     "channel_map",
     NULL
 };
@@ -264,6 +266,12 @@ int pa__init(pa_module*m) {
     pa_source_new_data_set_sample_spec(&data, &ss);
     pa_source_new_data_set_channel_map(&data, &map);
 
+    if (pa_modargs_get_proplist(ma, "source_properties", data.proplist, PA_UPDATE_REPLACE) < 0) {
+        pa_log("Invalid properties");
+        pa_source_new_data_done(&data);
+        goto fail;
+    }
+
     u->source = pa_source_new(m->core, &data, PA_SOURCE_LATENCY);
     pa_source_new_data_done(&data);
 
index 4d68b1b07248f715793ac78649b0b35f1847b08a..052a3a5ec03555748c1249419a3755469e80cf4b 100644 (file)
@@ -72,11 +72,11 @@ PA_MODULE_VERSION(PACKAGE_VERSION);
 PA_MODULE_LOAD_ONCE(FALSE);
 PA_MODULE_USAGE(
         "sink_name=<name for the sink> "
-        "description=<description for the sink> "
+        "sink_properties=<properties for the sink> "
         "server=<address>  "
         "format=<sample format> "
-        "channels=<number of channels> "
-        "rate=<sample rate>");
+        "rate=<sample rate> "
+        "channels=<number of channels>");
 
 #define DEFAULT_SINK_NAME "raop"
 
@@ -118,12 +118,13 @@ struct userdata {
 };
 
 static const char* const valid_modargs[] = {
+    "sink_name",
+    "sink_properties",
     "server",
-    "rate",
     "format",
+    "rate",
     "channels",
-    "sink_name",
-    "description",
+    "description", /* supported for compatibility reasons, made redundant by sink_properties= */
     NULL
 };
 
@@ -587,6 +588,12 @@ int pa__init(pa_module*m) {
     else
         pa_proplist_setf(data.proplist, PA_PROP_DEVICE_DESCRIPTION, "RAOP sink '%s'", server);
 
+    if (pa_modargs_get_proplist(ma, "sink_properties", data.proplist, PA_UPDATE_REPLACE) < 0) {
+        pa_log("Invalid properties");
+        pa_sink_new_data_done(&data);
+        goto fail;
+    }
+
     u->sink = pa_sink_new(m->core, &data, PA_SINK_LATENCY|PA_SINK_NETWORK);
     pa_sink_new_data_done(&data);
 
index f9777bef3113d660b503031004fad3b573cb57df..119f5b9f5bbcc3ef216f0a8256ec2c27aa0264b6 100644 (file)
@@ -44,6 +44,7 @@ PA_MODULE_VERSION(PACKAGE_VERSION);
 PA_MODULE_LOAD_ONCE(FALSE);
 PA_MODULE_USAGE(
         "sink_name=<name for the sink> "
+        "sink_properties=<properties for the sink> "
         "master=<name of sink to remap> "
         "master_channel_map=<channel map> "
         "format=<sample format> "
@@ -62,10 +63,11 @@ struct userdata {
 
 static const char* const valid_modargs[] = {
     "sink_name",
+    "sink_properties",
     "master",
     "master_channel_map",
-    "rate",
     "format",
+    "rate",
     "channels",
     "channel_map",
     "remix",
@@ -354,6 +356,12 @@ int pa__init(pa_module*m) {
     pa_proplist_sets(sink_data.proplist, PA_PROP_DEVICE_MASTER_DEVICE, master->name);
     pa_proplist_sets(sink_data.proplist, PA_PROP_DEVICE_CLASS, "filter");
 
+    if (pa_modargs_get_proplist(ma, "sink_properties", sink_data.proplist, PA_UPDATE_REPLACE) < 0) {
+        pa_log("Invalid properties");
+        pa_sink_new_data_done(&sink_data);
+        goto fail;
+    }
+
     u->sink = pa_sink_new(m->core, &sink_data, PA_SINK_LATENCY|PA_SINK_DYNAMIC_LATENCY);
     pa_sink_new_data_done(&sink_data);
 
index a6e15d8107cad5cb8618b576eca1aa795e72db50..14a04e47c9193cb7364b7a2190f4df4525058e32 100644 (file)
@@ -55,8 +55,9 @@ PA_MODULE_DESCRIPTION("Sine wave generator source");
 PA_MODULE_VERSION(PACKAGE_VERSION);
 PA_MODULE_LOAD_ONCE(FALSE);
 PA_MODULE_USAGE(
-        "rate=<sample rate> "
         "source_name=<name for the source> "
+        "source_properties=<properties for the source> "
+        "rate=<sample rate> "
         "frequency=<frequency in Hz>");
 
 #define DEFAULT_SOURCE_NAME "sine_input"
@@ -79,8 +80,9 @@ struct userdata {
 };
 
 static const char* const valid_modargs[] = {
-    "rate",
     "source_name",
+    "source_properties",
+    "rate",
     "frequency",
     NULL
 };
@@ -248,6 +250,12 @@ int pa__init(pa_module*m) {
     pa_proplist_setf(data.proplist, "sine.hz", "%u", frequency);
     pa_source_new_data_set_sample_spec(&data, &ss);
 
+    if (pa_modargs_get_proplist(ma, "source_properties", data.proplist, PA_UPDATE_REPLACE) < 0) {
+        pa_log("Invalid properties");
+        pa_source_new_data_done(&data);
+        goto fail;
+    }
+
     u->source = pa_source_new(m->core, &data, PA_SOURCE_LATENCY);
     pa_source_new_data_done(&data);
 
index 3f46406a5d5f13f235be5679b525f0fadf50661e..5cfa97a76908c02d8ef47b24ba58d894576a4fbb 100644 (file)
@@ -68,7 +68,9 @@ PA_MODULE_DESCRIPTION("Solaris Sink/Source");
 PA_MODULE_VERSION(PACKAGE_VERSION);
 PA_MODULE_USAGE(
     "sink_name=<name for the sink> "
+    "sink_properties=<properties for the sink> "
     "source_name=<name for the source> "
+    "source_properties=<properties for the source> "
     "device=<audio device file name> "
     "record=<enable source?> "
     "playback=<enable sink?> "
@@ -112,7 +114,9 @@ struct userdata {
 
 static const char* const valid_modargs[] = {
     "sink_name",
+    "sink_properties",
     "source_name",
+    "source_properties",
     "device",
     "record",
     "playback",
@@ -897,10 +901,16 @@ int pa__init(pa_module *m) {
         pa_source_new_data_set_channel_map(&source_new_data, &map);
         pa_proplist_sets(source_new_data.proplist, PA_PROP_DEVICE_STRING, u->device_name);
         pa_proplist_sets(source_new_data.proplist, PA_PROP_DEVICE_API, "solaris");
-        pa_proplist_setf(source_new_data.proplist, PA_PROP_DEVICE_DESCRIPTION, "Solaris PCM source");
+        pa_proplist_sets(source_new_data.proplist, PA_PROP_DEVICE_DESCRIPTION, "Solaris PCM source");
         pa_proplist_sets(source_new_data.proplist, PA_PROP_DEVICE_ACCESS_MODE, "serial");
         pa_proplist_setf(source_new_data.proplist, PA_PROP_DEVICE_BUFFERING_BUFFER_SIZE, "%lu", (unsigned long) u->buffer_size);
 
+        if (pa_modargs_get_proplist(ma, "source_properties", source_new_data.proplist, PA_UPDATE_REPLACE) < 0) {
+            pa_log("Invalid properties");
+            pa_source_new_data_done(&source_new_data);
+            goto fail;
+        }
+
         u->source = pa_source_new(m->core, &source_new_data, PA_SOURCE_HARDWARE|PA_SOURCE_LATENCY|PA_SOURCE_HW_VOLUME_CTRL);
         pa_source_new_data_done(&source_new_data);
         pa_xfree(name_buf);
@@ -939,9 +949,15 @@ int pa__init(pa_module *m) {
         pa_sink_new_data_set_channel_map(&sink_new_data, &map);
         pa_proplist_sets(sink_new_data.proplist, PA_PROP_DEVICE_STRING, u->device_name);
         pa_proplist_sets(sink_new_data.proplist, PA_PROP_DEVICE_API, "solaris");
-        pa_proplist_setf(sink_new_data.proplist, PA_PROP_DEVICE_DESCRIPTION, "Solaris PCM sink");
+        pa_proplist_sets(sink_new_data.proplist, PA_PROP_DEVICE_DESCRIPTION, "Solaris PCM sink");
         pa_proplist_sets(sink_new_data.proplist, PA_PROP_DEVICE_ACCESS_MODE, "serial");
 
+        if (pa_modargs_get_proplist(ma, "sink_properties", sink_new_data.proplist, PA_UPDATE_REPLACE) < 0) {
+            pa_log("Invalid properties");
+            pa_sink_new_data_done(&sink_new_data);
+            goto fail;
+        }
+
         u->sink = pa_sink_new(m->core, &sink_new_data, PA_SINK_HARDWARE|PA_SINK_LATENCY|PA_SINK_HW_VOLUME_CTRL|PA_SINK_HW_MUTE_CTRL);
         pa_sink_new_data_done(&sink_new_data);
 
index 5ea58aa004e8a5e88beca2e80e50807e9c6e379a..6f525da3c8bf8566d518607d6319c7fc41aab496 100644 (file)
 #ifdef TUNNEL_SINK
 PA_MODULE_DESCRIPTION("Tunnel module for sinks");
 PA_MODULE_USAGE(
+        "sink_name=<name for the local sink> "
+        "sink_properties=<properties for the local sink> "
         "server=<address> "
         "sink=<remote sink name> "
         "cookie=<filename> "
         "format=<sample format> "
         "channels=<number of channels> "
         "rate=<sample rate> "
-        "sink_name=<name for the local sink> "
         "channel_map=<channel map>");
 #else
 PA_MODULE_DESCRIPTION("Tunnel module for sources");
 PA_MODULE_USAGE(
+        "source_name=<name for the local source> "
+        "source_properties=<properties for the local source> "
         "server=<address> "
         "source=<remote source name> "
         "cookie=<filename> "
         "format=<sample format> "
         "channels=<number of channels> "
         "rate=<sample rate> "
-        "source_name=<name for the local source> "
         "channel_map=<channel map>");
 #endif
 
@@ -97,9 +99,11 @@ static const char* const valid_modargs[] = {
     "rate",
 #ifdef TUNNEL_SINK
     "sink_name",
+    "sink_properties",
     "sink",
 #else
     "source_name",
+    "source_properties",
     "source",
 #endif
     "channel_map",
@@ -1873,6 +1877,12 @@ int pa__init(pa_module*m) {
     if (u->sink_name)
         pa_proplist_sets(data.proplist, "tunnel.remote.sink", u->sink_name);
 
+    if (pa_modargs_get_proplist(ma, "sink_properties", data.proplist, PA_UPDATE_REPLACE) < 0) {
+        pa_log("Invalid properties");
+        pa_sink_new_data_done(&data);
+        goto fail;
+    }
+
     u->sink = pa_sink_new(m->core, &data, PA_SINK_NETWORK|PA_SINK_LATENCY|PA_SINK_HW_VOLUME_CTRL|PA_SINK_HW_MUTE_CTRL);
     pa_sink_new_data_done(&data);
 
@@ -1911,6 +1921,12 @@ int pa__init(pa_module*m) {
     if (u->source_name)
         pa_proplist_sets(data.proplist, "tunnel.remote.source", u->source_name);
 
+    if (pa_modargs_get_proplist(ma, "source_properties", data.proplist, PA_UPDATE_REPLACE) < 0) {
+        pa_log("Invalid properties");
+        pa_source_new_data_done(&data);
+        goto fail;
+    }
+
     u->source = pa_source_new(m->core, &data, PA_SOURCE_NETWORK|PA_SOURCE_LATENCY);
     pa_source_new_data_done(&data);
 
index d6f549cd3b58d368d54c426e254d00cf4e839dbf..7d8d25e49bdac24b9dd2bd1ee457842744c72023 100644 (file)
@@ -85,16 +85,18 @@ PA_MODULE_VERSION(PACKAGE_VERSION);
 PA_MODULE_LOAD_ONCE(FALSE);
 PA_MODULE_USAGE(
         "sink_name=<name for the sink> "
+        "sink_properties=<properties for the sink> "
         "source_name=<name for the source> "
+        "source_properties=<properties for the source> "
         "device=<OSS device> "
         "record=<enable source?> "
         "playback=<enable sink?> "
         "format=<sample format> "
-        "channels=<number of channels> "
         "rate=<sample rate> "
+        "channels=<number of channels> "
+        "channel_map=<channel map> "
         "fragments=<number of fragments> "
         "fragment_size=<fragment size> "
-        "channel_map=<channel map> "
         "mmap=<enable memory mapping?>");
 
 #define DEFAULT_DEVICE "/dev/dsp"
@@ -140,7 +142,9 @@ struct userdata {
 
 static const char* const valid_modargs[] = {
     "sink_name",
+    "sink_properties",
     "source_name",
+    "source_properties",
     "device",
     "record",
     "playback",
@@ -1314,6 +1318,12 @@ int pa__init(pa_module*m) {
         pa_proplist_setf(source_new_data.proplist, PA_PROP_DEVICE_BUFFERING_BUFFER_SIZE, "%lu", (unsigned long) (u->in_hwbuf_size));
         pa_proplist_setf(source_new_data.proplist, PA_PROP_DEVICE_BUFFERING_FRAGMENT_SIZE, "%lu", (unsigned long) (u->in_fragment_size));
 
+        if (pa_modargs_get_proplist(ma, "source_properties", source_new_data.proplist, PA_UPDATE_REPLACE) < 0) {
+            pa_log("Invalid properties");
+            pa_source_new_data_done(&source_new_data);
+            goto fail;
+        }
+
         u->source = pa_source_new(m->core, &source_new_data, PA_SOURCE_HARDWARE|PA_SOURCE_LATENCY);
         pa_source_new_data_done(&source_new_data);
         pa_xfree(name_buf);
@@ -1376,6 +1386,12 @@ int pa__init(pa_module*m) {
         pa_proplist_setf(sink_new_data.proplist, PA_PROP_DEVICE_BUFFERING_BUFFER_SIZE, "%lu", (unsigned long) (u->out_hwbuf_size));
         pa_proplist_setf(sink_new_data.proplist, PA_PROP_DEVICE_BUFFERING_FRAGMENT_SIZE, "%lu", (unsigned long) (u->out_fragment_size));
 
+        if (pa_modargs_get_proplist(ma, "sink_properties", sink_new_data.proplist, PA_UPDATE_REPLACE) < 0) {
+            pa_log("Invalid properties");
+            pa_sink_new_data_done(&sink_new_data);
+            goto fail;
+        }
+
         u->sink = pa_sink_new(m->core, &sink_new_data, PA_SINK_HARDWARE|PA_SINK_LATENCY);
         pa_sink_new_data_done(&sink_new_data);
         pa_xfree(name_buf);