summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/ftnoir_tracker_pt.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-02-16 11:07:57 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-02-16 12:55:48 +0100
commite42a0361c986c39a9456226f1465a7fb721fe111 (patch)
tree67120790e85b977be6c5a5578293a6b3c31888af /tracker-pt/ftnoir_tracker_pt.cpp
parent5a8c8f1d45997165396502e9404ed371e5ae59fe (diff)
tracker/{pt,wii}: simplify api
Remove useless abstract member functions, simplify some. Issue: #718
Diffstat (limited to 'tracker-pt/ftnoir_tracker_pt.cpp')
-rw-r--r--tracker-pt/ftnoir_tracker_pt.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp
index af086e5c..243fbd60 100644
--- a/tracker-pt/ftnoir_tracker_pt.cpp
+++ b/tracker-pt/ftnoir_tracker_pt.cpp
@@ -120,22 +120,12 @@ void Tracker_PT::run()
qDebug() << "pt: thread stopped";
}
-void Tracker_PT::maybe_reopen_camera()
+bool Tracker_PT::maybe_reopen_camera()
{
QMutexLocker l(&camera_mtx);
- pt_camera_open_status status = camera->start(camera_name_to_index(s.camera_name),
- s.cam_fps, s.cam_res_x, s.cam_res_y);
-
- switch (status)
- {
- case cam_open_error:
- break;
- case cam_open_ok_change:
- break;
- case cam_open_ok_no_change:
- break;
- }
+ return camera->start(camera_name_to_index(s.camera_name),
+ s.cam_fps, s.cam_res_x, s.cam_res_y);
}
void Tracker_PT::set_fov(int value)
@@ -156,11 +146,12 @@ module_status Tracker_PT::start_tracker(QFrame* video_frame)
//video_widget->resize(video_frame->width(), video_frame->height());
video_frame->show();
- maybe_reopen_camera();
+ if (!maybe_reopen_camera())
+ return { tr("Can't open camera") };
start(QThread::HighPriority);
- return status_ok();
+ return {};
}
void Tracker_PT::data(double *data)