summaryrefslogtreecommitdiffhomepage
path: root/opentrack
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-06-18 11:01:44 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-06-18 11:08:33 +0200
commit278a517a6724a541374f076974f1c7ae06880abb (patch)
tree5076fda7a15c6b1f1e90871e1eac0650ad969324 /opentrack
parentb8f77c9200695dfa593cf2c86aa26a6714495d84 (diff)
api/camera-dialog: fix non non-win32 non-linux
Diffstat (limited to 'opentrack')
-rw-r--r--opentrack/opencv-camera-dialog.hpp9
1 files 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 <windows.h>
#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
-