[pulseaudio-discuss] [PATCH 1/9] Create nodes for sink inputs

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Thu Nov 7 18:00:06 CET 2013


All user-routable sink inputs (i.e. those that don't set
PA_SINK_INPUT_DONT_MOVE) should have a node, so that those entities
stay user-routable also after sink input routing has been converted
to be node-based.
---
 src/modules/echo-cancel/module-echo-cancel.c | 3 +++
 src/modules/module-equalizer-sink.c          | 3 +++
 src/modules/module-ladspa-sink.c             | 3 +++
 src/modules/module-loopback.c                | 4 ++++
 src/modules/module-remap-sink.c              | 3 +++
 src/modules/module-sine.c                    | 3 +++
 src/modules/module-virtual-sink.c            | 3 +++
 src/modules/module-virtual-surround-sink.c   | 3 +++
 src/modules/rtp/module-rtp-recv.c            | 3 +++
 src/pulsecore/play-memblockq.c               | 5 +++++
 src/pulsecore/protocol-esound.c              | 3 +++
 src/pulsecore/protocol-simple.c              | 3 +++
 src/pulsecore/sound-file-stream.c            | 3 +++
 todo                                         | 5 +++++
 14 files changed, 47 insertions(+)

diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c
index 84116f7..7c3a039 100644
--- a/src/modules/echo-cancel/module-echo-cancel.c
+++ b/src/modules/echo-cancel/module-echo-cancel.c
@@ -1902,6 +1902,9 @@ int pa__init(pa_module*m) {
     pa_sink_input_new_data_set_channel_map(&sink_input_data, &sink_map);
     sink_input_data.flags = PA_SINK_INPUT_VARIABLE_RATE;
 
+    pa_sink_input_new_data_set_create_node(&sink_input_data, true);
+    pa_node_new_data_set_fallback_name_prefix(&sink_input_data.node_data, "echo-cancel");
+
     pa_sink_input_new(&u->sink_input, m->core, &sink_input_data);
     pa_sink_input_new_data_done(&sink_input_data);
 
diff --git a/src/modules/module-equalizer-sink.c b/src/modules/module-equalizer-sink.c
index 61f14be..d274980 100644
--- a/src/modules/module-equalizer-sink.c
+++ b/src/modules/module-equalizer-sink.c
@@ -1232,6 +1232,9 @@ int pa__init(pa_module*m) {
     pa_sink_input_new_data_set_sample_spec(&sink_input_data, &ss);
     pa_sink_input_new_data_set_channel_map(&sink_input_data, &map);
 
+    pa_sink_input_new_data_set_create_node(&sink_input_data, true);
+    pa_node_new_data_set_fallback_name_prefix(&sink_input_data.node_data, "equalizer");
+
     pa_sink_input_new(&u->sink_input, m->core, &sink_input_data);
     pa_sink_input_new_data_done(&sink_input_data);
 
diff --git a/src/modules/module-ladspa-sink.c b/src/modules/module-ladspa-sink.c
index 320b106..c4717c4 100644
--- a/src/modules/module-ladspa-sink.c
+++ b/src/modules/module-ladspa-sink.c
@@ -1259,6 +1259,9 @@ int pa__init(pa_module*m) {
     pa_sink_input_new_data_set_sample_spec(&sink_input_data, &ss);
     pa_sink_input_new_data_set_channel_map(&sink_input_data, &map);
 
+    pa_sink_input_new_data_set_create_node(&sink_input_data, true);
+    pa_node_new_data_set_fallback_name_prefix(&sink_input_data.node_data, "ladspa");
+
     pa_sink_input_new(&u->sink_input, m->core, &sink_input_data);
     pa_sink_input_new_data_done(&sink_input_data);
 
diff --git a/src/modules/module-loopback.c b/src/modules/module-loopback.c
index 4353061..4361fc7 100644
--- a/src/modules/module-loopback.c
+++ b/src/modules/module-loopback.c
@@ -872,6 +872,10 @@ int pa__init(pa_module *m) {
 
     if (sink_dont_move)
         sink_input_data.flags |= PA_SINK_INPUT_DONT_MOVE;
+    else {
+        pa_sink_input_new_data_set_create_node(&sink_input_data, true);
+        pa_node_new_data_set_fallback_name_prefix(&sink_input_data.node_data, "loopback");
+    }
 
     pa_sink_input_new(&u->sink_input, m->core, &sink_input_data);
     pa_sink_input_new_data_done(&sink_input_data);
diff --git a/src/modules/module-remap-sink.c b/src/modules/module-remap-sink.c
index 0c08822..2946cff 100644
--- a/src/modules/module-remap-sink.c
+++ b/src/modules/module-remap-sink.c
@@ -413,6 +413,9 @@ int pa__init(pa_module*m) {
     pa_sink_input_new_data_set_channel_map(&sink_input_data, &stream_map);
     sink_input_data.flags = (remix ? 0 : PA_SINK_INPUT_NO_REMIX);
 
+    pa_sink_input_new_data_set_create_node(&sink_input_data, true);
+    pa_node_new_data_set_fallback_name_prefix(&sink_input_data.node_data, "remap");
+
     pa_sink_input_new(&u->sink_input, m->core, &sink_input_data);
     pa_sink_input_new_data_done(&sink_input_data);
 
diff --git a/src/modules/module-sine.c b/src/modules/module-sine.c
index 573a7c0..013fba4 100644
--- a/src/modules/module-sine.c
+++ b/src/modules/module-sine.c
@@ -161,6 +161,9 @@ int pa__init(pa_module*m) {
     pa_proplist_setf(data.proplist, "sine.hz", "%u", frequency);
     pa_sink_input_new_data_set_sample_spec(&data, &ss);
 
+    pa_sink_input_new_data_set_create_node(&data, true);
+    pa_node_new_data_set_fallback_name_prefix(&data.node_data, "sine");
+
     pa_sink_input_new(&u->sink_input, m->core, &data);
     pa_sink_input_new_data_done(&data);
 
diff --git a/src/modules/module-virtual-sink.c b/src/modules/module-virtual-sink.c
index 165cc7f..710d914 100644
--- a/src/modules/module-virtual-sink.c
+++ b/src/modules/module-virtual-sink.c
@@ -575,6 +575,9 @@ int pa__init(pa_module*m) {
     pa_sink_input_new_data_set_sample_spec(&sink_input_data, &ss);
     pa_sink_input_new_data_set_channel_map(&sink_input_data, &map);
 
+    pa_sink_input_new_data_set_create_node(&sink_input_data, true);
+    pa_node_new_data_set_fallback_name_prefix(&sink_input_data.node_data, "virtual");
+
     pa_sink_input_new(&u->sink_input, m->core, &sink_input_data);
     pa_sink_input_new_data_done(&sink_input_data);
 
diff --git a/src/modules/module-virtual-surround-sink.c b/src/modules/module-virtual-surround-sink.c
index ed9dbaa..a289b4a 100644
--- a/src/modules/module-virtual-surround-sink.c
+++ b/src/modules/module-virtual-surround-sink.c
@@ -677,6 +677,9 @@ int pa__init(pa_module*m) {
     pa_sink_input_new_data_set_sample_spec(&sink_input_data, &sink_input_ss);
     pa_sink_input_new_data_set_channel_map(&sink_input_data, &sink_input_map);
 
+    pa_sink_input_new_data_set_create_node(&sink_input_data, true);
+    pa_node_new_data_set_fallback_name_prefix(&sink_input_data.node_data, "virtual-surround");
+
     pa_sink_input_new(&u->sink_input, m->core, &sink_input_data);
     pa_sink_input_new_data_done(&sink_input_data);
 
diff --git a/src/modules/rtp/module-rtp-recv.c b/src/modules/rtp/module-rtp-recv.c
index a4f7733..9952a25 100644
--- a/src/modules/rtp/module-rtp-recv.c
+++ b/src/modules/rtp/module-rtp-recv.c
@@ -536,6 +536,9 @@ static struct session *session_new(struct userdata *u, const pa_sdp_info *sdp_in
     pa_sink_input_new_data_set_sample_spec(&data, &sdp_info->sample_spec);
     data.flags = PA_SINK_INPUT_VARIABLE_RATE;
 
+    pa_sink_input_new_data_set_create_node(&data, true);
+    pa_node_new_data_set_fallback_name_prefix(&data.node_data, "rtp-recv");
+
     pa_sink_input_new(&s->sink_input, u->module->core, &data);
     pa_sink_input_new_data_done(&data);
 
diff --git a/src/pulsecore/play-memblockq.c b/src/pulsecore/play-memblockq.c
index ff0c52b..c0ed921 100644
--- a/src/pulsecore/play-memblockq.c
+++ b/src/pulsecore/play-memblockq.c
@@ -207,6 +207,11 @@ pa_sink_input* pa_memblockq_sink_input_new(
     pa_proplist_update(data.proplist, PA_UPDATE_REPLACE, p);
     data.flags |= flags;
 
+    if (!(data.flags & PA_SINK_INPUT_DONT_MOVE)) {
+        pa_sink_input_new_data_set_create_node(&data, true);
+        pa_node_new_data_set_fallback_name_prefix(&data.node_data, "play-memblockq");
+    }
+
     pa_sink_input_new(&u->sink_input, sink->core, &data);
     pa_sink_input_new_data_done(&data);
 
diff --git a/src/pulsecore/protocol-esound.c b/src/pulsecore/protocol-esound.c
index 7c1b7a2..d69b554 100644
--- a/src/pulsecore/protocol-esound.c
+++ b/src/pulsecore/protocol-esound.c
@@ -428,6 +428,9 @@ static int esd_proto_stream_play(connection *c, esd_proto_t request, const void
         pa_sink_input_new_data_set_sink(&sdata, sink, false);
     pa_sink_input_new_data_set_sample_spec(&sdata, &ss);
 
+    pa_sink_input_new_data_set_create_node(&sdata, true);
+    pa_node_new_data_set_fallback_name_prefix(&sdata.node_data, "esound");
+
     pa_sink_input_new(&c->sink_input, c->protocol->core, &sdata);
     pa_sink_input_new_data_done(&sdata);
 
diff --git a/src/pulsecore/protocol-simple.c b/src/pulsecore/protocol-simple.c
index fc36880..f155809 100644
--- a/src/pulsecore/protocol-simple.c
+++ b/src/pulsecore/protocol-simple.c
@@ -540,6 +540,9 @@ void pa_simple_protocol_connect(pa_simple_protocol *p, pa_iochannel *io, pa_simp
         pa_proplist_update(data.proplist, PA_UPDATE_MERGE, c->client->proplist);
         pa_sink_input_new_data_set_sample_spec(&data, &o->sample_spec);
 
+        pa_sink_input_new_data_set_create_node(&data, true);
+        pa_node_new_data_set_fallback_name_prefix(&data.node_data, "simple");
+
         pa_sink_input_new(&c->sink_input, p->core, &data);
         pa_sink_input_new_data_done(&data);
 
diff --git a/src/pulsecore/sound-file-stream.c b/src/pulsecore/sound-file-stream.c
index 33f7337..1269a47 100644
--- a/src/pulsecore/sound-file-stream.c
+++ b/src/pulsecore/sound-file-stream.c
@@ -307,6 +307,9 @@ int pa_play_file(
     pa_proplist_sets(data.proplist, PA_PROP_MEDIA_FILENAME, fname);
     pa_sndfile_init_proplist(u->sndfile, data.proplist);
 
+    pa_sink_input_new_data_set_create_node(&data, true);
+    pa_node_new_data_set_fallback_name_prefix(&data.node_data, "sound-file");
+
     pa_sink_input_new(&u->sink_input, sink->core, &data);
     pa_sink_input_new_data_done(&data);
 
diff --git a/todo b/todo
index 653bedc..a28a79e 100644
--- a/todo
+++ b/todo
@@ -45,3 +45,8 @@ Long term:
 
 Backends for:
 - portaudio  (semi-done)
+
+Routing:
+- Create nodes for source outputs.
+- Create nodes for sinks.
+- Create nodes for sources.
-- 
1.8.3.1



More information about the pulseaudio-discuss mailing list