summaryrefslogtreecommitdiffhomepage
path: root/video-opencv/impl.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2019-04-29 16:02:13 +0200
committerStanislaw Halik <sthalik@misaki.pl>2019-04-29 16:02:13 +0200
commitf8e54403c3c30bf87491d310afd827a2d7cb7f16 (patch)
treeb5bf10614b2e4a4539ac0e33e54e6a9525806623 /video-opencv/impl.hpp
parent9da1695192518c8f2ca7692fa45e4acbdf4dc2b7 (diff)
video/opencv: fix crash with obscure backends
Issue: #726
Diffstat (limited to 'video-opencv/impl.hpp')
-rw-r--r--video-opencv/impl.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/video-opencv/impl.hpp b/video-opencv/impl.hpp
index 3d793490..db569823 100644
--- a/video-opencv/impl.hpp
+++ b/video-opencv/impl.hpp
@@ -31,6 +31,15 @@ struct metadata : camera_
struct cam final : camera
{
+static constexpr int video_capture_backend =
+#ifdef _WIN32
+ cv::CAP_DSHOW;
+#elif !defined __APPLE__
+ cv::CAP_V4L2;
+#else
+ cv::CAP_ANY;
+#endif
+
cam(int idx);
~cam() override;