aboutsummaryrefslogtreecommitdiffstats
path: root/src/v4l.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-20 11:58:48 (GMT)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-20 19:40:11 (GMT)
commitd5408980dc7f46cbcef5721358334ab1b7ad102b (patch)
tree7f3dd86e565a79212bbfeea1a1e22f8dd58b1960 /src/v4l.c
parent75f8cc6781e3e834b27c5999c83258654655088b (diff)
v4l: use device_caps instead of capabilities
The capabilities field stores the capabilities of the device as a hole, and not only the specific devnode that it was opened. What's desired there is to check if the specific devnode supports read(), mmap() and it is a capture device. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'src/v4l.c')
-rw-r--r--src/v4l.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/v4l.c b/src/v4l.c
index 87adb3c..7cea990 100644
--- a/src/v4l.c
+++ b/src/v4l.c
@@ -242,7 +242,7 @@ void camera_cap(cam_t *cam)
}
}
- if (!(vid_cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) {
+ if (!(vid_cap.device_caps & V4L2_CAP_VIDEO_CAPTURE)) {
msg = g_strdup_printf(_("Device %s is not a video capture device)."),
cam->video_dev);
error_dialog(msg);
@@ -250,7 +250,7 @@ void camera_cap(cam_t *cam)
exit(0);
}
- if (!(vid_cap.capabilities & V4L2_CAP_STREAMING))
+ if (!(vid_cap.device_caps & V4L2_CAP_STREAMING))
cam->read = TRUE;
strncpy(cam->name, (const char *)vid_cap.card, sizeof(cam->name));
@@ -259,7 +259,7 @@ void camera_cap(cam_t *cam)
if (cam->debug == TRUE) {
printf("\nVIDIOC_QUERYCAP\n");
printf("device name = %s\n", vid_cap.card);
- printf("device caps = 0x%08x\n", vid_cap.capabilities);
+ printf("device caps = 0x%08x\n", vid_cap.device_caps);
printf("max width = %d\n", cam->max_width);
printf("max height = %d\n", cam->max_height);
printf("min width = %d\n", cam->min_width);

Privacy Policy