From 6a466b3e46b843385cea82dd6cc042aefdb986ed Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Tue, 22 Nov 2022 10:54:53 +0000 Subject: v4l2: populate video_buffer mem field at dequeue 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 Reviewed-by: Kieran Bingham Signed-off-by: Paul Elder Signed-off-by: Kieran Bingham --- lib/v4l2.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') diff --git a/lib/v4l2.c b/lib/v4l2.c index 6702ece..7bcbd73 100644 --- a/lib/v4l2.c +++ b/lib/v4l2.c @@ -789,6 +789,7 @@ int v4l2_dequeue_buffer(struct v4l2_device *dev, struct video_buffer *buffer) } buffer->index = buf.index; + buffer->mem = dev->buffers.buffers[buf.index].mem; buffer->bytesused = buf.bytesused; buffer->timestamp = buf.timestamp; buffer->error = !!(buf.flags & V4L2_BUF_FLAG_ERROR); -- cgit v1.2.3