summaryrefslogtreecommitdiff
path: root/lib/v4l2.c
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2022-11-22 10:54:53 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2022-11-22 16:02:25 +0000
commit6a466b3e46b843385cea82dd6cc042aefdb986ed (patch)
treea8c02a14c8d8485225ee5d76ff99bc3b84616f7c /lib/v4l2.c
parentd11fa45c11dfce99a737f46d7d6e41f280e01ae0 (diff)
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 <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>
Diffstat (limited to 'lib/v4l2.c')
-rw-r--r--lib/v4l2.c1
1 files changed, 1 insertions, 0 deletions
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);