mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix(video): only list video devices with video capture capability
This change adds a check for the V4L2_CAP_VIDEO_CAPTURE capability of the video device found on devfs. This will filter out 'metadata' device nodes that may be present on devfs at some /dev/videoN path. Fixes #6276
This commit is contained in:
parent
cfe6250d9d
commit
98a818cbea
|
@ -206,7 +206,8 @@ QVector<QPair<QString, QString>> v4l2::getDeviceList()
|
|||
ioctl(fd, VIDIOC_QUERYCAP, &caps);
|
||||
close(fd);
|
||||
|
||||
devices += {file, reinterpret_cast<const char*>(caps.card)};
|
||||
if (caps.device_caps & V4L2_CAP_VIDEO_CAPTURE)
|
||||
devices += {file, reinterpret_cast<const char*>(caps.card)};
|
||||
}
|
||||
return devices;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user