summaryrefslogtreecommitdiffhomepage
path: root/video-opencv/video-property-page.cpp
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/video-property-page.cpp
parent9da1695192518c8f2ca7692fa45e4acbdf4dc2b7 (diff)
video/opencv: fix crash with obscure backends
Issue: #726
Diffstat (limited to 'video-opencv/video-property-page.cpp')
-rw-r--r--video-opencv/video-property-page.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/video-opencv/video-property-page.cpp b/video-opencv/video-property-page.cpp
index a43a5ba0..078898a5 100644
--- a/video-opencv/video-property-page.cpp
+++ b/video-opencv/video-property-page.cpp
@@ -14,6 +14,7 @@
#include "compat/run-in-thread.hpp"
#include "compat/library-path.hpp"
#include "compat/thread-name.hpp"
+#include "impl.hpp"
#include <cstring>
@@ -49,6 +50,7 @@ prop_settings_worker::prop_settings_worker(int idx_)
int ret = (int)cap.get(cv::CAP_PROP_SETTINGS);
if (ret != 0)
+ {
run_in_thread_async(qApp, [] {
QMessageBox::warning(nullptr,
"Camera properties",
@@ -56,6 +58,7 @@ prop_settings_worker::prop_settings_worker(int idx_)
QMessageBox::Cancel,
QMessageBox::NoButton);
});
+ }
else
{
idx = idx_;
@@ -67,7 +70,7 @@ prop_settings_worker::prop_settings_worker(int idx_)
void prop_settings_worker::open_prop_page()
{
- cap.open(idx);
+ cap.open(idx + opencv_camera_impl::cam::video_capture_backend);
if (cap.isOpened())
{