summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ftnoir_tracker_pt/ftnoir_tracker_pt.cpp')
-rw-r--r--ftnoir_tracker_pt/ftnoir_tracker_pt.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
index 2f852343..d48f9252 100644
--- a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
+++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
@@ -86,7 +86,12 @@ void Tracker_PT::run()
const double dt = time.elapsed() * 1e-9;
time.start();
cv::Mat frame;
- const bool new_frame = camera.get_frame(dt, &frame);
+ bool new_frame;
+
+ {
+ QMutexLocker l(&camera_mtx);
+ new_frame = camera.get_frame(dt, &frame);
+ }
if (new_frame && !frame.empty())
{
@@ -145,6 +150,7 @@ void Tracker_PT::run()
void Tracker_PT::apply_settings()
{
qDebug()<<"Tracker:: Applying settings";
+ QMutexLocker l(&camera_mtx);
QMutexLocker lock(&mutex);
camera.set_device_index(camera_name_to_index("PS3Eye Camera"));
int res_x, res_y, cam_fps;