From dfdca3ce29fa8ad13ee6abd40a22662193a30442 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 2 Mar 2022 10:02:55 +0100 Subject: [PATCH] stream: add support for PropsInfo So that streams and filter can describe custom properties. --- src/pipewire/filter.c | 10 +++++++--- src/pipewire/stream.c | 8 ++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/pipewire/filter.c b/src/pipewire/filter.c index 3fa460bf3..4a317be58 100644 --- a/src/pipewire/filter.c +++ b/src/pipewire/filter.c @@ -147,9 +147,10 @@ struct filter { uint32_t change_mask_all; struct spa_node_info info; struct spa_list param_list; -#define IDX_Props 0 -#define IDX_ProcessLatency 1 -#define N_NODE_PARAMS 2 +#define IDX_PropInfo 0 +#define IDX_Props 1 +#define IDX_ProcessLatency 2 +#define N_NODE_PARAMS 3 struct spa_param_info params[N_NODE_PARAMS]; struct spa_process_latency_info process_latency; @@ -174,6 +175,8 @@ struct filter { static int get_param_index(uint32_t id) { switch (id) { + case SPA_PARAM_PropInfo: + return IDX_PropInfo; case SPA_PARAM_Props: return IDX_Props; case SPA_PARAM_ProcessLatency: @@ -1495,6 +1498,7 @@ pw_filter_connect(struct pw_filter *filter, impl->info.max_output_ports = UINT32_MAX; impl->info.flags = impl->process_rt ? SPA_NODE_FLAG_RT : 0; impl->info.props = &filter->properties->dict; + impl->params[IDX_PropInfo] = SPA_PARAM_INFO(SPA_PARAM_PropInfo, 0); impl->params[IDX_Props] = SPA_PARAM_INFO(SPA_PARAM_Props, SPA_PARAM_INFO_WRITE); impl->params[IDX_ProcessLatency] = SPA_PARAM_INFO(SPA_PARAM_ProcessLatency, 0); impl->info.params = impl->params; diff --git a/src/pipewire/stream.c b/src/pipewire/stream.c index aabc70e1c..6344103f6 100644 --- a/src/pipewire/stream.c +++ b/src/pipewire/stream.c @@ -136,8 +136,9 @@ struct stream { uint32_t change_mask_all; struct spa_node_info info; -#define IDX_Props 0 -#define N_NODE_PARAMS 1 +#define IDX_PropInfo 0 +#define IDX_Props 1 +#define N_NODE_PARAMS 2 struct spa_param_info params[N_NODE_PARAMS]; uint32_t media_type; @@ -174,6 +175,8 @@ struct stream { static int get_param_index(uint32_t id) { switch (id) { + case SPA_PARAM_PropInfo: + return IDX_PropInfo; case SPA_PARAM_Props: return IDX_Props; default: @@ -1726,6 +1729,7 @@ pw_stream_connect(struct pw_stream *stream, if (!impl->process_rt) impl->info.flags |= SPA_NODE_FLAG_ASYNC; impl->info.props = &stream->properties->dict; + impl->params[IDX_PropInfo] = SPA_PARAM_INFO(SPA_PARAM_PropInfo, 0); impl->params[IDX_Props] = SPA_PARAM_INFO(SPA_PARAM_Props, SPA_PARAM_INFO_WRITE); impl->info.params = impl->params; impl->info.n_params = N_NODE_PARAMS;