diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2021-10-17 16:16:59 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2021-10-17 19:23:13 +0200 |
commit | 54430acd4fb00b55b618110f60a0803448b09b13 (patch) | |
tree | aafc024d4dba783e6540bfbfb9dc430fa7da67a3 /tracker-pt | |
parent | 8e4be3612d15be86ede413ddcbf040f5ac065c95 (diff) |
tracker/pt: fix the deadlock for good this time
Diffstat (limited to 'tracker-pt')
-rw-r--r-- | tracker-pt/ftnoir_tracker_pt.cpp | 12 | ||||
-rw-r--r-- | tracker-pt/ftnoir_tracker_pt.h | 1 |
2 files changed, 2 insertions, 11 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp index db2ace64..84e66221 100644 --- a/tracker-pt/ftnoir_tracker_pt.cpp +++ b/tracker-pt/ftnoir_tracker_pt.cpp @@ -33,7 +33,6 @@ Tracker_PT::Tracker_PT(pointer<pt_runtime_traits> const& traits) : opencv_init(); connect(s.b.get(), &bundle_::saving, this, [this]{ reopen_camera_flag = true; }, Qt::DirectConnection); - connect(&s.fov, value_::value_changed<int>(), this, &Tracker_PT::set_fov, Qt::DirectConnection); } Tracker_PT::~Tracker_PT() @@ -60,9 +59,8 @@ void Tracker_PT::run() camera = nullptr; } auto camera_ = traits->make_camera(); - if (!camera_->start(s)) + if (!camera_ || !camera_->start(s)) break; - camera_->set_fov(s.fov); camera = std::move(camera_); } @@ -71,6 +69,7 @@ void Tracker_PT::run() { QMutexLocker l(&camera_mtx); + camera->set_fov(s.fov); std::tie(new_frame, info) = camera->get_frame(*frame); } @@ -119,13 +118,6 @@ void Tracker_PT::run() } } -void Tracker_PT::set_fov(int value) -{ - QMutexLocker l(&camera_mtx); - if (camera) - camera->set_fov(value); -} - module_status Tracker_PT::start_tracker(QFrame* video_frame) { { diff --git a/tracker-pt/ftnoir_tracker_pt.h b/tracker-pt/ftnoir_tracker_pt.h index dd46f098..c9b87102 100644 --- a/tracker-pt/ftnoir_tracker_pt.h +++ b/tracker-pt/ftnoir_tracker_pt.h @@ -49,7 +49,6 @@ struct Tracker_PT : QThread, ITracker private: void run() override; - void set_fov(int value); pointer<pt_runtime_traits> traits; |