diff options
author | mrsanchos <orokhovatskiy@gmail.com> | 2018-02-16 21:05:36 +0300 |
---|---|---|
committer | mrsanchos <orokhovatskiy@gmail.com> | 2018-02-16 21:05:36 +0300 |
commit | b52fd95f1cc86e86ecb696eab07c8d6b6a2e9f5d (patch) | |
tree | a8d5a8c98d8ca3b60b0805504049275a3311f59b /tracker-pt/ftnoir_tracker_pt.cpp | |
parent | 82c43da829fdac974b3d6adb8742715382ddd051 (diff) | |
parent | 7a973ae2ad396c8413405e40bcb2eaab67c95d15 (diff) |
Merge branch 'unstable' of https://github.com/opentrack/opentrack into unstable
Diffstat (limited to 'tracker-pt/ftnoir_tracker_pt.cpp')
-rw-r--r-- | tracker-pt/ftnoir_tracker_pt.cpp | 21 |
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) |