From e1fee1814846927716a0ac6ce8011eb975afec7a Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 30 Apr 2021 17:43:08 +0200 Subject: [PATCH] stream: support setting properties Setting Props param will then be forwarded to the stream param_changed signal and the stream can implement custom properties. --- src/pipewire/stream.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/pipewire/stream.c b/src/pipewire/stream.c index 08e60621d..9ad0ab0c7 100644 --- a/src/pipewire/stream.c +++ b/src/pipewire/stream.c @@ -407,6 +407,18 @@ static int impl_set_io(void *object, uint32_t id, void *data, size_t size) return 0; } +static int impl_set_param(void *object, uint32_t id, uint32_t flags, const struct spa_pod *param) +{ + struct stream *impl = object; + struct pw_stream *stream = &impl->this; + + if (id != SPA_PARAM_Props) + return -ENOTSUP; + + pw_stream_emit_param_changed(stream, id, param); + return 0; +} + static int impl_send_command(void *object, const struct spa_command *command) { struct stream *impl = object; @@ -880,6 +892,7 @@ static const struct spa_node_methods impl_node = { SPA_VERSION_NODE_METHODS, .add_listener = impl_add_listener, .set_callbacks = impl_set_callbacks, + .set_param = impl_set_param, .set_io = impl_set_io, .send_command = impl_send_command, .port_set_io = impl_port_set_io,