filter-graph: pass context to plugins

Make it possible to pass context to plugins and nodes in the
filter-chain.

We can use this to make filters aware of the graph clock or
latency, for example.
This commit is contained in:
Wim Taymans 2026-06-04 16:53:03 +02:00
parent aa075c2a12
commit 5e521d3532
10 changed files with 48 additions and 17 deletions

View file

@ -1269,6 +1269,8 @@ struct impl {
struct spa_handle *handle;
struct spa_filter_graph *graph;
struct spa_filter_graph_ctx ctx[3];
uint32_t n_ctx;
struct spa_hook graph_listener;
uint32_t n_inputs;
uint32_t n_outputs;
@ -1402,7 +1404,8 @@ static int activate_graph(struct impl *impl)
snprintf(rate, sizeof(rate), "%lu", impl->rate);
res = spa_filter_graph_activate(impl->graph, &SPA_DICT_ITEMS(
SPA_DICT_ITEM(SPA_KEY_AUDIO_RATE, rate)));
SPA_DICT_ITEM(SPA_KEY_AUDIO_RATE, rate)),
impl->n_ctx, impl->ctx);
if (res >= 0) {
struct pw_loop *data_loop = pw_stream_get_data_loop(impl->playback);