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.
This commit is contained in:
Philipp Zabel 2018-03-05 18:18:30 +01:00 committed by Wim Taymans
parent 187b6d4bf9
commit e38cba4e13

View file

@ -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;
}