summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-07-19 13:57:17 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-07-19 13:57:36 +0200
commitf9e80bddaf66de5abf56a2e29c5ef4c6c5004c4c (patch)
tree07f1998e431a22e85cc6cd667ea566bcc13ad21b
parent04a72110203d70338849e47a24b12d6b13fdfed6 (diff)
try to launch qv4l2 on Linux
-rw-r--r--opentrack/opencv-camera-dialog.hpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/opentrack/opencv-camera-dialog.hpp b/opentrack/opencv-camera-dialog.hpp
index 6218f125..6cfab0ab 100644
--- a/opentrack/opencv-camera-dialog.hpp
+++ b/opentrack/opencv-camera-dialog.hpp
@@ -6,9 +6,20 @@
#include <opencv2/videoio.hpp>
#include "opentrack/camera-names.hpp"
+#ifdef __linux
+#include <QProcess>
+#endif
+
template<typename tracker>
class camera_dialog
{
+#ifdef __linux
+ void open_camera_settings(cv::VideoCapture *, const QString &camera_name, QMutex *)
+ {
+ int idx = camera_name_to_index(camera_name);
+ QProcess::startDetached("qv4l2", QStringList() << "-d" << ("/dev/video" + QString::number(idx)));
+ }
+#else
cv::VideoCapture fake_capture;
QTimer t;
@@ -47,5 +58,6 @@ public:
// HACK: we're not notified when it's safe to close the capture
t.start();
}
+#endif
};