From 28c16c6dc72f4c41307f1a317860791c595cdcd6 Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Tue, 28 Aug 2018 02:15:22 -0400 Subject: v4l2-source: implement set_frame_rate op Implement the video source op set_frame_rate for v4l2-source video source. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- lib/v4l2-source.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib') diff --git a/lib/v4l2-source.c b/lib/v4l2-source.c index 7eced6a..8cb9aef 100644 --- a/lib/v4l2-source.c +++ b/lib/v4l2-source.c @@ -54,6 +54,13 @@ static int v4l2_source_set_format(struct video_source *s, return v4l2_set_format(src->vdev, fmt); } +static int v4l2_source_set_frame_rate(struct video_source *s, unsigned int fps) +{ + struct v4l2_source *src = to_v4l2_source(s); + + return v4l2_set_frame_rate(src->vdev, fps); +} + static int v4l2_source_alloc_buffers(struct video_source *s, unsigned int nbufs) { struct v4l2_source *src = to_v4l2_source(s); @@ -144,6 +151,7 @@ static int v4l2_source_queue_buffer(struct video_source *s, static const struct video_source_ops v4l2_source_ops = { .destroy = v4l2_source_destroy, .set_format = v4l2_source_set_format, + .set_frame_rate = v4l2_source_set_frame_rate, .alloc_buffers = v4l2_source_alloc_buffers, .export_buffers = v4l2_source_export_buffers, .free_buffers = v4l2_source_free_buffers, -- cgit v1.2.3