summaryrefslogtreecommitdiff
path: root/isp
diff options
context:
space:
mode:
Diffstat (limited to 'isp')
-rw-r--r--isp/v4l2.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/isp/v4l2.c b/isp/v4l2.c
index be5c604..6f3ffbe 100644
--- a/isp/v4l2.c
+++ b/isp/v4l2.c
@@ -258,6 +258,7 @@ struct v4l2_device *v4l2_open(const char *devname)
{
struct v4l2_device *dev;
struct v4l2_capability cap;
+ __u32 capabilities;
int ret;
dev = malloc(sizeof *dev);
@@ -285,9 +286,17 @@ struct v4l2_device *v4l2_open(const char *devname)
return NULL;
}
- if (cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)
+ /* If the device_caps field is set use it, otherwise use the older
+ * capabilities field. We can't rely on the capabilities field
+ * unconditionally as kernels that support device_caps for the omap3isp
+ * driver (>= v3.19) will set both CAPTURE and OUTPUT in the
+ * capabilities field.
+ */
+ capabilities = cap.device_caps ? : cap.capabilities;
+
+ if (capabilities & V4L2_CAP_VIDEO_CAPTURE)
dev->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- else if (cap.capabilities & V4L2_CAP_VIDEO_OUTPUT)
+ else if (capabilities & V4L2_CAP_VIDEO_OUTPUT)
dev->type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
else {
printf("Error opening device %s: neither video capture "