[PATCH] core: Link virtual sinks and sources to their streams.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This change doesn't add any functionality in itself, but it will be useful in
the future for handling cases where something happens in the "root device" on
which virtual devices are piggy-backing, and where the event affects also the
virtual devices. 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.
---
 src/modules/module-equalizer-sink.c |    1 +
 src/modules/module-ladspa-sink.c    |    1 +
 src/modules/module-remap-sink.c     |    1 +
 src/modules/module-virtual-sink.c   |    1 +
 src/modules/module-virtual-source.c |    1 +
 src/pulsecore/sink-input.c          |    1 +
 src/pulsecore/sink-input.h          |    2 ++
 src/pulsecore/source-output.c       |    1 +
 src/pulsecore/source-output.h       |    2 ++
 9 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/modules/module-equalizer-sink.c b/src/modules/module-equalizer-sink.c
index bc349ce..01d0a44 100644
--- a/src/modules/module-equalizer-sink.c
+++ b/src/modules/module-equalizer-sink.c
@@ -1200,6 +1200,7 @@ int pa__init(pa_module*m) {
     sink_input_data.driver = __FILE__;
     sink_input_data.module = m;
     sink_input_data.sink = master;
+    sink_input_data.origin_sink = u->sink;
     pa_proplist_sets(sink_input_data.proplist, PA_PROP_MEDIA_NAME, "Equalized Stream");
     pa_proplist_sets(sink_input_data.proplist, PA_PROP_MEDIA_ROLE, "filter");
     pa_sink_input_new_data_set_sample_spec(&sink_input_data, &ss);
diff --git a/src/modules/module-ladspa-sink.c b/src/modules/module-ladspa-sink.c
index 88df67e..b1694db 100644
--- a/src/modules/module-ladspa-sink.c
+++ b/src/modules/module-ladspa-sink.c
@@ -832,6 +832,7 @@ int pa__init(pa_module*m) {
     sink_input_data.driver = __FILE__;
     sink_input_data.module = m;
     sink_input_data.sink = master;
+    sink_input_data.origin_sink = u->sink;
     pa_proplist_sets(sink_input_data.proplist, PA_PROP_MEDIA_NAME, "LADSPA Stream");
     pa_proplist_sets(sink_input_data.proplist, PA_PROP_MEDIA_ROLE, "filter");
     pa_sink_input_new_data_set_sample_spec(&sink_input_data, &ss);
diff --git a/src/modules/module-remap-sink.c b/src/modules/module-remap-sink.c
index 43748bd..e0e0b9d 100644
--- a/src/modules/module-remap-sink.c
+++ b/src/modules/module-remap-sink.c
@@ -420,6 +420,7 @@ int pa__init(pa_module*m) {
     sink_input_data.driver = __FILE__;
     sink_input_data.module = m;
     sink_input_data.sink = master;
+    sink_input_data.origin_sink = u->sink;
     pa_proplist_sets(sink_input_data.proplist, PA_PROP_MEDIA_NAME, "Remapped Stream");
     pa_proplist_sets(sink_input_data.proplist, PA_PROP_MEDIA_ROLE, "filter");
     pa_sink_input_new_data_set_sample_spec(&sink_input_data, &ss);
diff --git a/src/modules/module-virtual-sink.c b/src/modules/module-virtual-sink.c
index fac204d..904f8e9 100644
--- a/src/modules/module-virtual-sink.c
+++ b/src/modules/module-virtual-sink.c
@@ -556,6 +556,7 @@ int pa__init(pa_module*m) {
     sink_input_data.driver = __FILE__;
     sink_input_data.module = m;
     sink_input_data.sink = master;
+    sink_input_data.origin_sink = u->sink;
     pa_proplist_sets(sink_input_data.proplist, PA_PROP_MEDIA_NAME, "Virtual 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, &ss);
diff --git a/src/modules/module-virtual-source.c b/src/modules/module-virtual-source.c
index fdf89b0..e4df444 100644
--- a/src/modules/module-virtual-source.c
+++ b/src/modules/module-virtual-source.c
@@ -629,6 +629,7 @@ int pa__init(pa_module*m) {
     source_output_data.driver = __FILE__;
     source_output_data.module = m;
     source_output_data.source = master;
+    source_output_data.destination_source = u->source;
     /* FIXME
        source_output_data.flags = PA_SOURCE_OUTPUT_DONT_INHIBIT_AUTO_SUSPEND; */
 
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 065fd2d..00adc6d 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -321,6 +321,7 @@ int pa_sink_input_new(
     i->driver = pa_xstrdup(pa_path_get_filename(data->driver));
     i->module = data->module;
     i->sink = data->sink;
+    i->origin_sink = data->origin_sink;
     i->client = data->client;
 
     i->requested_resample_method = data->resample_method;
diff --git a/src/pulsecore/sink-input.h b/src/pulsecore/sink-input.h
index f81e2d4..25b2896 100644
--- a/src/pulsecore/sink-input.h
+++ b/src/pulsecore/sink-input.h
@@ -84,6 +84,7 @@ struct pa_sink_input {
     pa_client *client;                  /* may be NULL */
 
     pa_sink *sink; /* NULL while we are being moved */
+    pa_sink *origin_sink;               /* may be NULL */
 
     /* A sink input may be connected to multiple source outputs
      * directly, so that they don't get mixed data of the entire
@@ -285,6 +286,7 @@ typedef struct pa_sink_input_new_data {
     pa_client *client;
 
     pa_sink *sink;
+    pa_sink *origin_sink;
 
     pa_resample_method_t resample_method;
 
diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
index 88731e7..0bb8899 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -208,6 +208,7 @@ int pa_source_output_new(
     o->driver = pa_xstrdup(pa_path_get_filename(data->driver));
     o->module = data->module;
     o->source = data->source;
+    o->destination_source = data->destination_source;
     o->client = data->client;
 
     o->actual_resample_method = resampler ? pa_resampler_get_method(resampler) : PA_RESAMPLER_INVALID;
diff --git a/src/pulsecore/source-output.h b/src/pulsecore/source-output.h
index 273b78f..473b138 100644
--- a/src/pulsecore/source-output.h
+++ b/src/pulsecore/source-output.h
@@ -75,6 +75,7 @@ struct pa_source_output {
     pa_client *client;                    /* may be NULL */
 
     pa_source *source; /* NULL while being moved */
+    pa_source *destination_source;        /* may be NULL */
 
     /* A source output can monitor just a single input of a sink, in which case we find it here */
     pa_sink_input *direct_on_input;       /* may be NULL */
@@ -211,6 +212,7 @@ typedef struct pa_source_output_new_data {
     pa_client *client;
 
     pa_source *source;
+    pa_source *destination_source;
 
     pa_resample_method_t resample_method;
 
-- 
1.7.3.4




[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux