diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2018-06-09 12:11:25 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2018-06-09 12:20:02 +0300 |
commit | df651c5b397a4b6648695cdf725a8243ff512dcd (patch) | |
tree | a8f88286cedafe8c8d35cbaa38698063a2e64961 /stream.c | |
parent | 6dc91f22f9bb2aafeee2f7c5df53a02a37acc3a0 (diff) |
v4l2: Extract video buffer structure to separate file
The v4l2_video_buffer structure describes a video buffer. It is used by
the v4l2_device class only, but isn't otherwise tied to V4L2. To prepare
for non-V4L2 video sources, extract it to a separate file and rename it
to video_buffer.
At the same time, add a new video_buffer_set structure to represent as
set of video buffers.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'stream.c')
-rw-r--r-- | stream.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -47,7 +47,7 @@ struct uvc_stream static void capture_video_process(void *d) { struct uvc_stream *stream = d; - struct v4l2_video_buffer buf; + struct video_buffer buf; int ret; ret = v4l2_dequeue_buffer(stream->cap, &buf); @@ -60,7 +60,7 @@ static void capture_video_process(void *d) static void uvc_video_process(void *d) { struct uvc_stream *stream = d; - struct v4l2_video_buffer buf; + struct video_buffer buf; int ret; ret = v4l2_dequeue_buffer(stream->uvc->vdev, &buf); @@ -92,7 +92,7 @@ static int uvc_video_enable(struct uvc_stream *stream, int enable) return ret; } - ret = v4l2_import_buffers(dev->vdev, dev->vdev->nbufs, cap->buffers); + ret = v4l2_import_buffers(dev->vdev, &cap->buffers); if (ret < 0) { printf("Failed to import buffers: %s (%d)\n", strerror(-ret), -ret); goto error; @@ -137,8 +137,8 @@ static int capture_video_stream(struct uvc_stream *stream, int enable) goto error; } - for (i = 0; i < cap->nbufs; ++i) { - struct v4l2_video_buffer *buf = &cap->buffers[i]; + for (i = 0; i < cap->buffers.nbufs; ++i) { + struct video_buffer *buf = &cap->buffers.buffers[i]; ret = v4l2_queue_buffer(cap, buf); if (ret < 0) |