diff --git a/spa/plugins/filter-graph/plugin_builtin.c b/spa/plugins/filter-graph/plugin_builtin.c index 69ed34fc2..3bcde30c9 100644 --- a/spa/plugins/filter-graph/plugin_builtin.c +++ b/spa/plugins/filter-graph/plugin_builtin.c @@ -3217,6 +3217,35 @@ static const struct spa_fga_descriptor busy_desc = { .cleanup = builtin_cleanup, }; +/* null */ +static void null_run(void * Instance, unsigned long SampleCount) +{ +} + +static struct spa_fga_port null_ports[] = { + { .index = 0, + .name = "In", + .flags = SPA_FGA_PORT_INPUT | SPA_FGA_PORT_AUDIO, + }, + { .index = 1, + .name = "Control", + .flags = SPA_FGA_PORT_INPUT | SPA_FGA_PORT_CONTROL, + }, +}; + +static const struct spa_fga_descriptor null_desc = { + .name = "null", + .flags = SPA_FGA_DESCRIPTOR_SUPPORTS_NULL_DATA, + + .n_ports = SPA_N_ELEMENTS(null_ports), + .ports = null_ports, + + .instantiate = builtin_instantiate, + .connect_port = builtin_connect_port, + .run = null_run, + .cleanup = builtin_cleanup, +}; + static const struct spa_fga_descriptor * builtin_descriptor(unsigned long Index) { switch(Index) { @@ -3284,6 +3313,8 @@ static const struct spa_fga_descriptor * builtin_descriptor(unsigned long Index) return &noisegate_desc; case 31: return &busy_desc; + case 32: + return &null_desc; } return NULL; } diff --git a/src/modules/module-filter-chain.c b/src/modules/module-filter-chain.c index 9ab3639bd..ddb014315 100644 --- a/src/modules/module-filter-chain.c +++ b/src/modules/module-filter-chain.c @@ -682,6 +682,10 @@ extern struct spa_handle_factory spa_filter_graph_factory; * - `cpu-percent` the percentage of time to keep the CPU busy. This keeps both the * graph and CPU busy. Default 0.0 * + * ### Null + * + * The `null` plugin has one data input "In" and one control input "Control" that + * simply discards the data. * * ## SOFA filters *