summaryrefslogtreecommitdiff
path: root/stream.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-06-09 12:11:25 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-06-09 12:20:02 +0300
commitdf651c5b397a4b6648695cdf725a8243ff512dcd (patch)
treea8f88286cedafe8c8d35cbaa38698063a2e64961 /stream.c
parent6dc91f22f9bb2aafeee2f7c5df53a02a37acc3a0 (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.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/stream.c b/stream.c
index 13b8493..e08aca7 100644
--- a/stream.c
+++ b/stream.c
@@ -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)