diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-07-06 10:20:51 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-07-06 10:47:47 +0200 |
commit | faab09446c5c26b96e59218abc34b1dc24727418 (patch) | |
tree | 9fc386f72ed736b3994ac1809f6a993d1a91ea2c /ftnoir_tracker_pt/ftnoir_tracker_pt.cpp | |
parent | 2e7407a094c74b629cbe8348e9007c6373e476fe (diff) |
pt: initial camera dialog
Diffstat (limited to 'ftnoir_tracker_pt/ftnoir_tracker_pt.cpp')
-rw-r--r-- | ftnoir_tracker_pt/ftnoir_tracker_pt.cpp | 8 |
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 4d55a422..dc0659e5 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp @@ -74,7 +74,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()) { @@ -133,6 +138,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(s.camera_name)); camera.set_res(s.cam_res_x, s.cam_res_y); |