modules: add {sink|source|card}_properties argument to all modules

This commit is contained in:
Lennart Poettering 2009-05-28 02:39:22 +02:00
parent 208862698e
commit 1c4393acf0
20 changed files with 231 additions and 48 deletions

View 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);