From 278a517a6724a541374f076974f1c7ae06880abb Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 18 Jun 2016 11:01:44 +0200 Subject: api/camera-dialog: fix non non-win32 non-linux --- opentrack/opencv-camera-dialog.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/opentrack/opencv-camera-dialog.hpp b/opentrack/opencv-camera-dialog.hpp index eac26bde..8fa71505 100644 --- a/opentrack/opencv-camera-dialog.hpp +++ b/opentrack/opencv-camera-dialog.hpp @@ -28,12 +28,14 @@ # include #endif +#ifdef _WIN32 static void init_com_threading(void) { HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); if (FAILED(hr)) qDebug() << "failed CoInitializeEx" << hr << "code" << GetLastError(); } +#endif static void maybe_grab_frame(cv::VideoCapture& cap) { @@ -55,9 +57,9 @@ public: int idx = camera_name_to_index(camera_name); QProcess::startDetached("qv4l2", QStringList() << "-d" << ("/dev/video" + QString::number(idx))); } -#else void open_camera_settings(cv::VideoCapture* cap, const QString& camera_name, QMutex* camera_mtx) { +#elif defined(_WIN32) if (cap) { QMutexLocker l(camera_mtx); @@ -89,7 +91,11 @@ public: // HACK: we're not notified when it's safe to close the capture t.start(); } +#else + void open_camera_settings(cv::VideoCapture*, const QString&, QMutex*) {} +#endif private: +#if defined(_WIN32) cv::VideoCapture fake_capture; QTimer t; void delete_capture() @@ -100,4 +106,3 @@ private: }; #endif - -- cgit v1.2.3