[pulseaudio-discuss] [PATCH 18/21] jack: Add node supprt
Tanu Kaskinen
tanu.kaskinen at linux.intel.com
Wed Jun 19 08:40:15 PDT 2013
---
src/modules/jack/module-jack-sink.c | 7 +++++++
src/modules/jack/module-jack-source.c | 7 +++++++
2 files changed, 14 insertions(+)
diff --git a/src/modules/jack/module-jack-sink.c b/src/modules/jack/module-jack-sink.c
index 1e34abd..a270e1a 100644
--- a/src/modules/jack/module-jack-sink.c
+++ b/src/modules/jack/module-jack-sink.c
@@ -34,6 +34,7 @@
#include <pulse/xmalloc.h>
#include <pulsecore/sink.h>
+#include <pulsecore/sink-node.h>
#include <pulsecore/module.h>
#include <pulsecore/core-util.h>
#include <pulsecore/modargs.h>
@@ -77,6 +78,7 @@ struct userdata {
pa_core *core;
pa_module *module;
pa_sink *sink;
+ pa_sink_node *sink_node;
unsigned channels;
@@ -451,6 +453,8 @@ int pa__init(pa_module*m) {
pa_sink_set_fixed_latency(u->sink, pa_bytes_to_usec(n, &u->sink->sample_spec));
pa_sink_put(u->sink);
+ u->sink_node = pa_sink_node_new(u->sink, "jack-output");
+
if (ports)
jack_free(ports);
pa_modargs_free(ma);
@@ -486,6 +490,9 @@ void pa__done(pa_module*m) {
if (!(u = m->userdata))
return;
+ if (u->sink_node)
+ pa_sink_node_free(u->sink_node);
+
if (u->sink)
pa_sink_unlink(u->sink);
diff --git a/src/modules/jack/module-jack-source.c b/src/modules/jack/module-jack-source.c
index cf62882..7159005 100644
--- a/src/modules/jack/module-jack-source.c
+++ b/src/modules/jack/module-jack-source.c
@@ -34,6 +34,7 @@
#include <pulse/xmalloc.h>
#include <pulsecore/source.h>
+#include <pulsecore/source-node.h>
#include <pulsecore/module.h>
#include <pulsecore/core-util.h>
#include <pulsecore/modargs.h>
@@ -67,6 +68,7 @@ struct userdata {
pa_core *core;
pa_module *module;
pa_source *source;
+ pa_source_node *source_node;
unsigned channels;
@@ -397,6 +399,8 @@ int pa__init(pa_module*m) {
pa_source_set_fixed_latency(u->source, pa_bytes_to_usec(n, &u->source->sample_spec));
pa_source_put(u->source);
+ u->source_node = pa_source_node_new(u->source, "jack-input");
+
if (ports)
jack_free(ports);
pa_modargs_free(ma);
@@ -431,6 +435,9 @@ void pa__done(pa_module*m) {
if (!(u = m->userdata))
return;
+ if (u->source_node)
+ pa_source_node_free(u->source_node);
+
if (u->source)
pa_source_unlink(u->source);
--
1.8.1.2
More information about the pulseaudio-discuss
mailing list