filter-graph: make the filter-graph ports dynamic

When parsing the graph, parse the input and output port names into
a separate string array. This was we can keep them around when
setting up the graph.

Instead of setting up the graph right after loading it, do the graph
setup when we activate the graph. This makes it possible to pass the
input channels to the filter-graph and let it create the right amount of
plugins and ouput channels.

When setting up the graphs in the audioconverter, pass the current
number of channels as the input to the graph and keep track of the
channels that each filter produces.

This way we can also load a custom upmix or downmix graph, for example.
This commit is contained in:
Wim Taymans 2025-03-14 10:10:18 +01:00
parent 76619eaa1d
commit f0e09ae363
3 changed files with 122 additions and 39 deletions

View file

@ -46,6 +46,7 @@ struct spa_filter_graph_info {
#define SPA_FILTER_GRAPH_CHANGE_MASK_FLAGS (1u<<0)
#define SPA_FILTER_GRAPH_CHANGE_MASK_PROPS (1u<<1)
#define SPA_FILTER_GRAPH_CHANGE_MASK_PORTS (1u<<2)
uint64_t change_mask;
uint64_t flags;