diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-06-09 11:43:04 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-06-09 11:43:04 +0200 |
commit | 7b07d63e8129b620d275845c5d79573aac72a800 (patch) | |
tree | 40677974ca967af42ccd30cd9b8c53c279d35bb5 /tracker-pt/camera.h | |
parent | 1b9dcf43be582c2719b9d5bf10b15acd59eac944 (diff) |
tracker/pt: only reset camera input when needed
Diffstat (limited to 'tracker-pt/camera.h')
-rw-r--r-- | tracker-pt/camera.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tracker-pt/camera.h b/tracker-pt/camera.h index e73d9dff..615f7142 100644 --- a/tracker-pt/camera.h +++ b/tracker-pt/camera.h @@ -11,6 +11,7 @@ #include <memory> #include <opencv2/highgui.hpp> #include <string> +#include <QString> struct CamInfo { @@ -35,7 +36,7 @@ public: void restart() { stop(); start(); } // calls corresponding template methods and reinitializes frame rate calculation - void set_device_index(int index); + void set_device(const QString& name); void set_fps(int fps); void set_res(int x_res, int y_res); @@ -46,6 +47,7 @@ public: bool get_info(CamInfo &ret); CamInfo get_desired() const { return cam_desired; } + QString get_desired_name() const; protected: // get a frame from the camera virtual bool _get_frame(cv::Mat* frame) = 0; @@ -58,10 +60,11 @@ private: float dt_valid; float dt_mean; protected: - int desired_index; - int active_index; CamInfo cam_info; CamInfo cam_desired; + QString desired_name; + int desired_index; + int active_index; }; inline Camera::~Camera() {} |