mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -05:00
support new channel_map argument in sink/source modules
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@803 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
fbb0d1436c
commit
185a57cadd
11 changed files with 158 additions and 49 deletions
|
|
@ -50,7 +50,15 @@
|
|||
PA_MODULE_AUTHOR("Lennart Poettering")
|
||||
PA_MODULE_DESCRIPTION("ALSA Source")
|
||||
PA_MODULE_VERSION(PACKAGE_VERSION)
|
||||
PA_MODULE_USAGE("source_name=<name for the source> device=<ALSA device> format=<sample format> channels=<number of channels> rate=<sample rate> fragments=<number of fragments> fragment_size=<fragment size>")
|
||||
PA_MODULE_USAGE(
|
||||
"source_name=<name for the source> "
|
||||
"device=<ALSA device> "
|
||||
"format=<sample format> "
|
||||
"channels=<number of channels> "
|
||||
"rate=<sample rate> "
|
||||
"fragments=<number of fragments> "
|
||||
"fragment_size=<fragment size> "
|
||||
"channel_map=<channel map>")
|
||||
|
||||
struct userdata {
|
||||
snd_pcm_t *pcm_handle;
|
||||
|
|
@ -74,6 +82,7 @@ static const char* const valid_modargs[] = {
|
|||
"format",
|
||||
"fragments",
|
||||
"fragment_size",
|
||||
"channel_map",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
|
@ -287,6 +296,7 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
struct userdata *u = NULL;
|
||||
const char *dev;
|
||||
pa_sample_spec ss;
|
||||
pa_channel_map map;
|
||||
unsigned periods, fragsize;
|
||||
snd_pcm_uframes_t period_size;
|
||||
size_t frame_size;
|
||||
|
|
@ -299,7 +309,7 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
}
|
||||
|
||||
ss = c->default_sample_spec;
|
||||
if (pa_modargs_get_sample_spec(ma, &ss) < 0) {
|
||||
if (pa_modargs_get_sample_spec_and_channel_map(ma, &ss, &map) < 0) {
|
||||
pa_log(__FILE__": failed to parse sample specification");
|
||||
goto fail;
|
||||
}
|
||||
|
|
@ -345,7 +355,7 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
u->mixer_handle = NULL;
|
||||
}
|
||||
|
||||
u->source = pa_source_new(c, __FILE__, pa_modargs_get_value(ma, "source_name", DEFAULT_SOURCE_NAME), 0, &ss, NULL);
|
||||
u->source = pa_source_new(c, __FILE__, pa_modargs_get_value(ma, "source_name", DEFAULT_SOURCE_NAME), 0, &ss, &map);
|
||||
assert(u->source);
|
||||
|
||||
u->source->userdata = u;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue