diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-20 08:58:48 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-20 16:40:11 -0300 |
commit | d5408980dc7f46cbcef5721358334ab1b7ad102b (patch) | |
tree | 7f3dd86e565a79212bbfeea1a1e22f8dd58b1960 | |
parent | 75f8cc6781e3e834b27c5999c83258654655088b (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>
-rw-r--r-- | src/v4l.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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); |