aboutsummaryrefslogtreecommitdiffstats
path: root/meta-pipewire/recipes-multimedia/pipewire/pipewire/0008-audio-dsp-allow-mode-to-be-set-with-a-property.patch
blob: 681bae697d451dd8cf3200ec7db308c889751dff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From 0c85e1110e32720785f861c7a85cf0636394eee4 Mon Sep 17 00:00:00 2001
From: Julian Bouzas <julian.bouzas@collabora.com>
Date: Thu, 27 Jun 2019 12:44:39 -0400
Subject: [PATCH] audio-dsp: allow mode to be set with a property

Upstream-Status: Submitted [https://github.com/PipeWire/pipewire/pull/167]
---
 src/modules/module-audio-dsp/audio-dsp.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/modules/module-audio-dsp/audio-dsp.c b/src/modules/module-audio-dsp/audio-dsp.c
index be8a7592..68249307 100644
--- a/src/modules/module-audio-dsp/audio-dsp.c
+++ b/src/modules/module-audio-dsp/audio-dsp.c
@@ -264,7 +264,7 @@ struct pw_node *pw_audio_dsp_new(struct pw_core *core,
 {
 	struct pw_node *node;
 	struct node *n;
-	const char *api, *alias, *str, *factory;
+	const char *api, *alias, *str, *factory, *mode;
 	char node_name[128];
 	struct pw_properties *pr;
 	int i;
@@ -279,6 +279,7 @@ struct pw_node *pw_audio_dsp_new(struct pw_core *core,
 		pw_log_error("missing audio-dsp.name property");
 		goto error;
 	}
+	mode = pw_properties_get(pr, "audio-dsp.mode");
 
 	snprintf(node_name, sizeof(node_name), "system_%s", alias);
 	for (i = 0; node_name[i]; i++) {
@@ -296,7 +297,9 @@ struct pw_node *pw_audio_dsp_new(struct pw_core *core,
 	if ((str = pw_properties_get(pr, "node.id")) != NULL)
 		pw_properties_set(pr, "node.session", str);
 
-	if (direction == PW_DIRECTION_OUTPUT) {
+	if (mode) {
+		factory = mode;
+	} else if (direction == PW_DIRECTION_OUTPUT) {
 		pw_properties_set(pr, "merger.monitor", "1");
 		factory = "merge";
 	} else {
-- 
2.20.1