From e38cba4e13b7d404c0723a498be6fde652988711 Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Mon, 5 Mar 2018 18:18:30 +0100 Subject: [PATCH] v4l2: check device caps If V4L2_CAP_DEVICE_CAPS is set, device_caps must be checked for the V4L2_CAP_VIDEO_CAPTURE flag instead of capabilities. --- spa/plugins/v4l2/v4l2-utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spa/plugins/v4l2/v4l2-utils.c b/spa/plugins/v4l2/v4l2-utils.c index a23609db0..25df85874 100644 --- a/spa/plugins/v4l2/v4l2-utils.c +++ b/spa/plugins/v4l2/v4l2-utils.c @@ -83,7 +83,9 @@ static int spa_v4l2_open(struct impl *this) return -err; } - if ((port->cap.capabilities & V4L2_CAP_VIDEO_CAPTURE) == 0) { + if ((port->cap.capabilities & V4L2_CAP_VIDEO_CAPTURE) == 0 || + ((port->cap.capabilities & V4L2_CAP_DEVICE_CAPS) && + (port->cap.device_caps & V4L2_CAP_VIDEO_CAPTURE) == 0)) { spa_log_error(port->log, "v4l2: %s is no video capture device", props->device); return -ENODEV; }