summaryrefslogtreecommitdiffhomepage
path: root/video-ps3eye/module.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2019-09-22 16:51:23 +0200
committerStanislaw Halik <sthalik@misaki.pl>2019-09-22 16:51:51 +0200
commit4cb73ce5853d924c17381f3183226b8835172da7 (patch)
tree8670106bf6b216d7397bff0b104c7d1a4563f244 /video-ps3eye/module.hpp
parentc8fb7bfa37555e5cbe68f368ebb98b161fb2771a (diff)
video/ps3eye: buffer flush
Diffstat (limited to 'video-ps3eye/module.hpp')
-rw-r--r--video-ps3eye/module.hpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/video-ps3eye/module.hpp b/video-ps3eye/module.hpp
index a9283d14..357af14c 100644
--- a/video-ps3eye/module.hpp
+++ b/video-ps3eye/module.hpp
@@ -1,3 +1,54 @@
#pragma once
#include "video/camera.hpp"
+
+#if 0
+
+namespace video {
+
+struct OTR_VIDEO_EXPORT camera_
+{
+ camera_();
+ virtual ~camera_();
+
+ virtual std::vector<QString> camera_names() const = 0;
+ virtual std::unique_ptr<camera> make_camera(const QString& name) = 0;
+ virtual bool show_dialog(const QString& camera_name) = 0;
+ virtual bool can_show_dialog(const QString& camera_name) = 0;
+};
+
+struct OTR_VIDEO_EXPORT camera
+{
+ struct info final
+ {
+ // TODO: expose FOV-based focal length for regular webcams
+ int width = 0, height = 0, fps = 0;
+ double fx = 0, fy = 0; // focal length
+ double P_x = 0, P_y = 0; // principal point
+ double dist_c[8] {}; // distortion coefficients
+ };
+
+ camera();
+ virtual ~camera();
+
+ [[nodiscard]] virtual bool start(info& args) = 0;
+ virtual void stop() = 0;
+ virtual bool is_open() = 0;
+
+ virtual std::tuple<const frame&, bool> get_frame() = 0;
+ [[nodiscard]] virtual bool show_dialog() = 0;
+};
+
+} // ns video
+
+#endif
+
+namespace video::impl {
+struct ps3eye_camera_ : camera_
+{
+ std::vector<QString> camera_names() const override;
+ std::unique_ptr<camera> make_camera(const QString& name) override;
+ bool show_dialog(const QString& camera_name) override;
+ bool can_show_dialog(const QString& camera_name) override;
+};
+} // ns video::impl