diff options
author | Paul Elder <paul.elder@ideasonboard.com> | 2024-10-16 20:19:41 +0900 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2024-10-21 00:22:56 +0300 |
commit | aafa406edd39d04689bfcd4ff5239f918a0885ce (patch) | |
tree | 22324b4308540d7be9f2bc4ea89f23b0eef5049e /include | |
parent | f0325383cdbd321d7632b54fc41fc8165bcf406b (diff) |
libcamera: controls: Add vendor information to ControlId
Add vendor/namespace information to ControlId, so that the vendor can be
queried from it. This is expected to be used by applications either
simply to display the vendor or for it to be used for grouping in a
UI.
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/controls.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index 28fec767..3cfe2de5 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -235,12 +235,13 @@ private: class ControlId { public: - ControlId(unsigned int id, const std::string &name, ControlType type, - std::size_t size = 0, + ControlId(unsigned int id, const std::string &name, const std::string &vendor, + ControlType type, std::size_t size = 0, const std::map<std::string, int32_t> &enumStrMap = {}); unsigned int id() const { return id_; } const std::string &name() const { return name_; } + const std::string &vendor() const { return vendor_; } ControlType type() const { return type_; } bool isArray() const { return size_ > 0; } std::size_t size() const { return size_; } @@ -251,6 +252,7 @@ private: unsigned int id_; std::string name_; + std::string vendor_; ControlType type_; std::size_t size_; std::map<std::string, int32_t> enumStrMap_; @@ -283,8 +285,9 @@ class Control : public ControlId public: using type = T; - Control(unsigned int id, const char *name, const std::map<std::string, int32_t> &enumStrMap = {}) - : ControlId(id, name, details::control_type<std::remove_cv_t<T>>::value, + Control(unsigned int id, const char *name, const char *vendor, + const std::map<std::string, int32_t> &enumStrMap = {}) + : ControlId(id, name, vendor, details::control_type<std::remove_cv_t<T>>::value, details::control_type<std::remove_cv_t<T>>::size, enumStrMap) { } |