mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-12-21 08:56:46 -05:00
modules: add {sink|source|card}_properties argument to all modules
This commit is contained in:
parent
208862698e
commit
1c4393acf0
20 changed files with 231 additions and 48 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue