summaryrefslogtreecommitdiffstats
path: root/src/modules/echo-cancel
diff options
context:
space:
mode:
authorTanu Kaskinen <tanu.kaskinen@digia.com>2011-02-07 18:35:51 +0200
committerColin Guthrie <cguthrie@mandriva.org>2011-02-22 10:10:48 +0000
commit969c7c80fe380a7263472fa065f04990286ed7bb (patch)
treea763183a372f3099695cab2eb2c6c57f2ea40ea5 /src/modules/echo-cancel
parent1f848f82c4571f169f18f86b4bd2ec6f863acca0 (diff)
core: Link virtual sinks and sources to their streams.
This change doesn't add any functionality in itself, but it will be useful in the future for operating on chains of sinks or sources that are piggy-backing on each other. For example, the PA_PROP_DEVICE_MASTER_DEVICE property could be handled in the core so that each virtual device doesn't have to maintain it separately. By using the origin_sink and destination_source pointers the core is able to see at stream creation time that the stream is created by a virtual device, and then update that device's property list using the name of the master device that the stream is being connected to. The same thing can be done also when the stream is being moved from a device to another, in which case the _MASTER_DEVICE property needs updating.
Diffstat (limited to 'src/modules/echo-cancel')
-rw-r--r--src/modules/echo-cancel/module-echo-cancel.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c
index 611ebb71..0108c31b 100644
--- a/src/modules/echo-cancel/module-echo-cancel.c
+++ b/src/modules/echo-cancel/module-echo-cancel.c
@@ -1502,6 +1502,7 @@ int pa__init(pa_module*m) {
source_output_data.driver = __FILE__;
source_output_data.module = m;
source_output_data.source = source_master;
+ source_output_data.destination_source = u->source;
/* FIXME
source_output_data.flags = PA_SOURCE_OUTPUT_DONT_INHIBIT_AUTO_SUSPEND; */
@@ -1531,11 +1532,14 @@ int pa__init(pa_module*m) {
u->source_output->moving = source_output_moving_cb;
u->source_output->userdata = u;
+ u->source->output_from_master = u->source_output;
+
/* Create sink input */
pa_sink_input_new_data_init(&sink_input_data);
sink_input_data.driver = __FILE__;
sink_input_data.module = m;
sink_input_data.sink = sink_master;
+ sink_input_data.origin_sink = u->sink;
pa_proplist_sets(sink_input_data.proplist, PA_PROP_MEDIA_NAME, "Echo-Cancel Sink Stream");
pa_proplist_sets(sink_input_data.proplist, PA_PROP_MEDIA_ROLE, "filter");
pa_sink_input_new_data_set_sample_spec(&sink_input_data, &sink_ss);
@@ -1566,6 +1570,8 @@ int pa__init(pa_module*m) {
u->sink_input->mute_changed = sink_input_mute_changed_cb;
u->sink_input->userdata = u;
+ u->sink->input_to_master = u->sink_input;
+
pa_sink_input_get_silence(u->sink_input, &silence);
u->source_memblockq = pa_memblockq_new(0, MEMBLOCKQ_MAXLENGTH, 0,