From 185a57cadd7b4e8e85c7fbecc866d7c279704e12 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 26 Apr 2006 15:40:14 +0000 Subject: 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 --- src/modules/module-tunnel.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'src/modules/module-tunnel.c') diff --git a/src/modules/module-tunnel.c b/src/modules/module-tunnel.c index abfa68a4..bffcc7c0 100644 --- a/src/modules/module-tunnel.c +++ b/src/modules/module-tunnel.c @@ -51,11 +51,27 @@ #ifdef TUNNEL_SINK #include "module-tunnel-sink-symdef.h" PA_MODULE_DESCRIPTION("Tunnel module for sinks") -PA_MODULE_USAGE("server=
sink= cookie= format= channels= rate= sink_name=") +PA_MODULE_USAGE( + "server=
" + "sink= " + "cookie= " + "format= " + "channels= " + "rate= " + "sink_name= " + "channel_map=") #else #include "module-tunnel-source-symdef.h" PA_MODULE_DESCRIPTION("Tunnel module for sources") -PA_MODULE_USAGE("server=
source= cookie= format= channels= rate= source_name=") +PA_MODULE_USAGE( + "server=
" + "source= " + "cookie= " + "format= " + "channels= " + "rate= " + "source_name= " + "channel_map=") #endif PA_MODULE_AUTHOR("Lennart Poettering") @@ -87,6 +103,7 @@ static const char* const valid_modargs[] = { "source_name", "source", #endif + "channel_map", NULL, }; @@ -838,6 +855,7 @@ int pa__init(pa_core *c, pa_module*m) { pa_modargs *ma = NULL; struct userdata *u = NULL; pa_sample_spec ss; + pa_channel_map map; struct timeval ntv; assert(c && m); @@ -877,7 +895,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__": invalid sample format specification"); goto fail; } @@ -893,7 +911,7 @@ int pa__init(pa_core *c, pa_module*m) { pa_socket_client_set_callback(u->client, on_connection, u); #ifdef TUNNEL_SINK - if (!(u->sink = pa_sink_new(c, __FILE__, pa_modargs_get_value(ma, "sink_name", DEFAULT_SINK_NAME), 0, &ss, NULL))) { + if (!(u->sink = pa_sink_new(c, __FILE__, pa_modargs_get_value(ma, "sink_name", DEFAULT_SINK_NAME), 0, &ss, &map))) { pa_log(__FILE__": failed to create sink."); goto fail; } @@ -909,7 +927,7 @@ int pa__init(pa_core *c, pa_module*m) { pa_sink_set_owner(u->sink, m); #else - if (!(u->source = pa_source_new(c, __FILE__, pa_modargs_get_value(ma, "source_name", DEFAULT_SOURCE_NAME), 0, &ss, NULL))) { + if (!(u->source = pa_source_new(c, __FILE__, pa_modargs_get_value(ma, "source_name", DEFAULT_SOURCE_NAME), 0, &ss, &map))) { pa_log(__FILE__": failed to create source."); goto fail; } -- cgit