diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-05-02 18:50:05 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-05-02 18:55:46 +0200 |
commit | 4793e57051bf17620e93f62e2651fc5df1708935 (patch) | |
tree | 806da084534c822d4107e614f46db32c1aef9a96 /tracker-easy/tracker-easy.cpp | |
parent | bac58c2d5e45d838e32bc1d5cc0b12a19365c569 (diff) |
tracker/{aruco,easy,pt}: bail out when camera missing
Diffstat (limited to 'tracker-easy/tracker-easy.cpp')
-rw-r--r-- | tracker-easy/tracker-easy.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tracker-easy/tracker-easy.cpp b/tracker-easy/tracker-easy.cpp index 0217b07f..dd96e782 100644 --- a/tracker-easy/tracker-easy.cpp +++ b/tracker-easy/tracker-easy.cpp @@ -729,6 +729,12 @@ namespace EasyTracker return module_status("Error: Solver not supported use either P3P or AP3P."); } + // Create our camera + camera = video::make_camera(iSettings.camera_name); + + if (!camera) + return error(QStringLiteral("Can't open camera %1").arg(iSettings.camera_name)); + //video_frame->setAttribute(Qt::WA_NativeWindow); widget = std::make_unique<video_widget>(video_frame); layout = std::make_unique<QHBoxLayout>(video_frame); @@ -738,8 +744,6 @@ namespace EasyTracker //video_widget->resize(video_frame->width(), video_frame->height()); video_frame->show(); - // Create our camera - camera = video::make_camera(iSettings.camera_name); // Precise timer is needed otherwise the interval is not really respected iTicker.setTimerType(Qt::PreciseTimer); SetFps(iSettings.cam_fps); |