summaryrefslogtreecommitdiffhomepage
path: root/video-opencv/impl-metadata.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2019-03-18 17:56:57 +0100
committerStanislaw Halik <sthalik@misaki.pl>2019-03-18 17:56:57 +0100
commitec0a37f30b5e5cb6cd4ce4abdb946945e05cd7ce (patch)
tree2676080d6da070c9d69eb2d5530a3187f45cbb3f /video-opencv/impl-metadata.cpp
parentdd23cae02106fdf0fe23ddf865767fb987cc3477 (diff)
video/opencv: split impl files
Diffstat (limited to 'video-opencv/impl-metadata.cpp')
-rw-r--r--video-opencv/impl-metadata.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/video-opencv/impl-metadata.cpp b/video-opencv/impl-metadata.cpp
new file mode 100644
index 00000000..84b11822
--- /dev/null
+++ b/video-opencv/impl-metadata.cpp
@@ -0,0 +1,42 @@
+#include "impl.hpp"
+#include "camera-names.hpp"
+#include "video-property-page.hpp"
+
+namespace opencv_camera_impl {
+
+metadata::metadata() = default;
+
+std::unique_ptr<camera> metadata::make_camera(const QString& name)
+{
+ int idx = camera_name_to_index(name);
+ if (idx != -1)
+ return std::make_unique<cam>(idx);
+ else
+ return nullptr;
+}
+
+std::vector<QString> metadata::camera_names() const
+{
+ return get_camera_names();
+}
+
+bool metadata::can_show_dialog(const QString& camera_name)
+{
+ return camera_name_to_index(camera_name) != -1;
+}
+
+bool metadata::show_dialog(const QString& camera_name)
+{
+ int idx = camera_name_to_index(camera_name);
+ if (idx != -1)
+ {
+ video_property_page::show(idx);
+ return true;
+ }
+ else
+ return false;
+}
+
+OTR_REGISTER_CAMERA(metadata)
+
+} // ns opencv_camera_impl