summaryrefslogtreecommitdiff
path: root/lib/v4l2.c
AgeCommit message (Collapse)Author
2022-11-22v4l2: write size value when dequeueing bufferPaul Elder
When we dequeue a buffer from a V4L2 device, it would be good to know the size of the buffer. Save it to our struct video_buffer when dequeueing. Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-11-22v4l2: populate video_buffer mem field at dequeuePaul Elder
Our v4l2_queue_buffer and v4l2_dequeue_buffer functions give us a wrapper around the raw V4L2 ioctls with a wrapper struct video_buffer around the raw struct v4l2_buffer. The problem is that the video_buffer's mem field is never populated, so there's no way to access the mem that the buffer refers to given only the buffer. Populate the video_buffer's mem field at v4l2_dequeue_buffer based on the dequeued v4l2 buf's index. Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-11-17lib: v4l2: Set sizeimage during v4l2_set_format()Daniel Scally
videobuf2 relies on the sizeimage field to calculate buffer size when the format is MJPEG, because the bytes-per-line calculation is missing. Fill in that field as part of v4l2_set_format() so the API works correctly. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
2019-02-06v4l2: add v4l2_set_frame_ratePaul Elder
We would like to be able to set the frame rate of video sources. This patch adds such a function for v4l2-based video sources to use. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2018-06-12Split UVC gadget into a library and test applicationLaurent Pinchart
Split the project into a UVC gadget library and a test application. To avoid rolling out a custom build system, switch to CMake. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>