diff --git a/src/modules/module-filter-chain.c b/src/modules/module-filter-chain.c index 7a2d0fb6a..6c5ccc4f0 100644 --- a/src/modules/module-filter-chain.c +++ b/src/modules/module-filter-chain.c @@ -1012,6 +1012,35 @@ extern struct spa_handle_factory spa_filter_graph_factory; * prefixed with 'input.' and 'output.' to generate a capture and playback * stream node.name respectively. * + * ## Control Stream + * + * The module can provide an input stream for control data. It can only be + * configured with the property `control.props`, properties on the filter + * definition will not be taken into account. + * + * The control stream has to be enabled by setting the attribute `enabled` of + * the `control.props` to true. + * + *\code{.unparsed} + * # ~/.config/pipewire/filter-chain.conf.d/my-filter-chain-1.conf + * + * context.modules = [ + * { name = libpipewire-module-filter-chain + * args = { + * ... + * filter.graph = {...} + * capture.props = {...} + * control.props = { + * node.name = "control_in", + * node.autoconnect = true, + * enabled = true, + * media.class = "Stream/Input/Control" + * } + * } + * } + * ] + *\endcode + * * ## Example configuration of a virtual source * * This example uses the rnnoise LADSPA plugin to create a new @@ -2133,14 +2162,10 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args) &impl->core_listener, &core_events, impl); - if (pw_properties_get(impl->control_props, "enabled") == NULL) { - impl->control_stream_active = false; - } else if (strcmp(pw_properties_get( - impl->control_props, "enabled"), "true") == 0) { - impl->control_stream_active = true; - } else if (strcmp(pw_properties_get( - impl->control_props, "enabled"), "false") == 0) { + if ((str = pw_properties_get(impl->control_props, "enabled")) == NULL) { impl->control_stream_active = false; + } else { + impl->control_stream_active = spa_atob(str); } setup_streams(impl);