From 9e625441ad66f38361c5e4f6aa0e9d0a7d9043db Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 21 Feb 2020 16:25:55 +0100 Subject: [PATCH] videotestsrc: implement enum port-io --- spa/plugins/videotestsrc/videotestsrc.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/spa/plugins/videotestsrc/videotestsrc.c b/spa/plugins/videotestsrc/videotestsrc.c index 4fae4ecb7..fb89ffa5e 100644 --- a/spa/plugins/videotestsrc/videotestsrc.c +++ b/spa/plugins/videotestsrc/videotestsrc.c @@ -576,6 +576,18 @@ impl_node_port_enum_params(void *object, int seq, return 0; } break; + case SPA_PARAM_IO: + switch (result.index) { + case 0: + param = spa_pod_builder_add_object(&b, + SPA_TYPE_OBJECT_ParamIO, id, + SPA_PARAM_IO_id, SPA_POD_Id(SPA_IO_Buffers), + SPA_PARAM_IO_size, SPA_POD_Int(sizeof(struct spa_io_buffers))); + break; + default: + return 0; + } + break; default: return -ENOENT; } @@ -728,11 +740,13 @@ impl_node_port_set_io(void *object, spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL); port = &this->port; - if (id == SPA_IO_Buffers) + switch (id) { + case SPA_IO_Buffers: port->io = data; - else + break; + default: return -ENOENT; - + } return 0; }