From bde4deb8803026ec69e11cd380d77bf5d33ee623 Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Tue, 28 Aug 2018 02:17:15 -0400 Subject: stream, uvc: add uvc_stream_set_frame_rate We would like to be able to set the frame rate of the video source of a stream. This patch adds such a function to set the source's frame rate from the stream. The frame rate is set right after the format is set. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- include/uvcgadget/stream.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/uvcgadget/stream.h') diff --git a/include/uvcgadget/stream.h b/include/uvcgadget/stream.h index 9ab068f..bc83cfa 100644 --- a/include/uvcgadget/stream.h +++ b/include/uvcgadget/stream.h @@ -90,6 +90,19 @@ void uvc_stream_delete(struct uvc_stream *stream); int uvc_stream_set_format(struct uvc_stream *stream, const struct v4l2_pix_format *format); +/* + * uvc_stream_set_frame_rate - Set the frame rate for the stream + * @stream: the UVC stream + * @fps: the frame rate in frames per second + * + * This function is called from the UVC protocol handler to configure the frame + * rate for the video source of the @stream. It must not be called directly by + * applications. + * + * Returns 0 on success, or a negative error code on failure. + */ +int uvc_stream_set_frame_rate(struct uvc_stream *stream, unsigned int fps); + /* * uvc_stream_enable - Turn on/off video streaming for the UVC stream * @stream: the UVC stream -- cgit v1.2.3