summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/modules/alsa/alsa-sink.c6
-rw-r--r--src/modules/alsa/alsa-source.c6
-rw-r--r--src/modules/alsa/module-alsa-card.c18
-rw-r--r--src/modules/alsa/module-alsa-sink.c2
-rw-r--r--src/modules/alsa/module-alsa-source.c2
-rw-r--r--src/modules/bluetooth/module-bluetooth-device.c34
-rw-r--r--src/modules/jack/module-jack-sink.c16
-rw-r--r--src/modules/jack/module-jack-source.c16
-rw-r--r--src/modules/module-combine.c12
-rw-r--r--src/modules/module-esound-sink.c16
-rw-r--r--src/modules/module-ladspa-sink.c12
-rw-r--r--src/modules/module-null-sink.c2
-rw-r--r--src/modules/module-pipe-sink.c14
-rw-r--r--src/modules/module-pipe-source.c14
-rw-r--r--src/modules/module-raop-sink.c19
-rw-r--r--src/modules/module-remap-sink.c10
-rw-r--r--src/modules/module-sine-source.c12
-rw-r--r--src/modules/module-solaris.c20
-rw-r--r--src/modules/module-tunnel.c20
-rw-r--r--src/modules/oss/module-oss.c20
20 files changed, 227 insertions, 44 deletions
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index 784a8dd5..59f53110 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -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);
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index 780da831..f1c18196 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -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);
diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c
index d894b9ce..ad52f5e3 100644
--- a/src/modules/alsa/module-alsa-card.c
+++ b/src/modules/alsa/module-alsa-card.c
@@ -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);
diff --git a/src/modules/alsa/module-alsa-sink.c b/src/modules/alsa/module-alsa-sink.c
index 8e600ab8..058ea205 100644
--- a/src/modules/alsa/module-alsa-sink.c
+++ b/src/modules/alsa/module-alsa-sink.c
@@ -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",
diff --git a/src/modules/alsa/module-alsa-source.c b/src/modules/alsa/module-alsa-source.c
index e6b27b3d..3bd1b451 100644
--- a/src/modules/alsa/module-alsa-source.c
+++ b/src/modules/alsa/module-alsa-source.c
@@ -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",
diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 812b0bae..dbec00d4 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -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 */
diff --git a/src/modules/jack/module-jack-sink.c b/src/modules/jack/module-jack-sink.c
index 31b8a96e..290038e7 100644
--- a/src/modules/jack/module-jack-sink.c
+++ b/src/modules/jack/module-jack-sink.c
@@ -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);
diff --git a/src/modules/jack/module-jack-source.c b/src/modules/jack/module-jack-source.c
index 9a215c54..ef89a98e 100644
--- a/src/modules/jack/module-jack-source.c
+++ b/src/modules/jack/module-jack-source.c
@@ -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);
diff --git a/src/modules/module-combine.c b/src/modules/module-combine.c
index a1ef8da4..02a7e1ff 100644
--- a/src/modules/module-combine.c
+++ b/src/modules/module-combine.c
@@ -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);
diff --git a/src/modules/module-esound-sink.c b/src/modules/module-esound-sink.c
index a1a783aa..8cb25c51 100644
--- a/src/modules/module-esound-sink.c
+++ b/src/modules/module-esound-sink.c
@@ -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);
diff --git a/src/modules/module-ladspa-sink.c b/src/modules/module-ladspa-sink.c
index 44052c9c..15af74a6 100644
--- a/src/modules/module-ladspa-sink.c
+++ b/src/modules/module-ladspa-sink.c
@@ -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);
diff --git a/src/modules/module-null-sink.c b/src/modules/module-null-sink.c
index c0c2facf..30a99ca7 100644
--- a/src/modules/module-null-sink.c
+++ b/src/modules/module-null-sink.c
@@ -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;
}
diff --git a/src/modules/module-pipe-sink.c b/src/modules/module-pipe-sink.c
index 304d01c7..5b0f6414 100644
--- a/src/modules/module-pipe-sink.c
+++ b/src/modules/module-pipe-sink.c
@@ -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);
diff --git a/src/modules/module-pipe-source.c b/src/modules/module-pipe-source.c
index 6ed4fbfe..61c9fc0e 100644
--- a/src/modules/module-pipe-source.c
+++ b/src/modules/module-pipe-source.c
@@ -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);
diff --git a/src/modules/module-raop-sink.c b/src/modules/module-raop-sink.c
index 4d68b1b0..052a3a5e 100644
--- a/src/modules/module-raop-sink.c
+++ b/src/modules/module-raop-sink.c
@@ -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);
diff --git a/src/modules/module-remap-sink.c b/src/modules/module-remap-sink.c
index f9777bef..119f5b9f 100644
--- a/src/modules/module-remap-sink.c
+++ b/src/modules/module-remap-sink.c
@@ -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);
diff --git a/src/modules/module-sine-source.c b/src/modules/module-sine-source.c
index a6e15d81..14a04e47 100644
--- a/src/modules/module-sine-source.c
+++ b/src/modules/module-sine-source.c
@@ -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);
diff --git a/src/modules/module-solaris.c b/src/modules/module-solaris.c
index 3f46406a..5cfa97a7 100644
--- a/src/modules/module-solaris.c
+++ b/src/modules/module-solaris.c
@@ -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);
diff --git a/src/modules/module-tunnel.c b/src/modules/module-tunnel.c
index 5ea58aa0..6f525da3 100644
--- a/src/modules/module-tunnel.c
+++ b/src/modules/module-tunnel.c
@@ -64,24 +64,26 @@
#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);
diff --git a/src/modules/oss/module-oss.c b/src/modules/oss/module-oss.c
index d6f549cd..7d8d25e4 100644
--- a/src/modules/oss/module-oss.c
+++ b/src/modules/oss/module-oss.c
@@ -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);