We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d7b241 commit 89e0edeCopy full SHA for 89e0ede
src/detection/camera/camera_linux.c
@@ -7,6 +7,9 @@
7
8
#if FF_HAVE_LINUX_VIDEODEV2
9
#include <linux/videodev2.h>
10
+#elif __has_include(<sys/videoio.h>) // OpenBSD
11
+ #include <sys/videoio.h>
12
+ #define FF_HAVE_LINUX_VIDEODEV2 1
13
#endif
14
15
const char* ffDetectCamera(FFlist* result)
@@ -19,7 +22,13 @@ const char* ffDetectCamera(FFlist* result)
19
22
path[ARRAY_SIZE(path) - 2] = (char) (i + '0');
20
23
FF_AUTO_CLOSE_FD int fd = open(path, O_RDONLY);
21
24
if (fd < 0)
- break;
25
+ {
26
+ if (errno == ENOENT)
27
+ break;
28
+ if (errno == ENXIO)
29
+ continue;
30
+ return "Failed to open /dev/videoN";
31
+ }
32
33
struct v4l2_capability cap = {};
34
if (ioctl(fd, VIDIOC_QUERYCAP, &cap) < 0 || !(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE))
0 commit comments