From aafa406edd39d04689bfcd4ff5239f918a0885ce Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Wed, 16 Oct 2024 20:19:41 +0900 Subject: 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 Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham Signed-off-by: Laurent Pinchart --- include/libcamera/controls.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'include') 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 &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 enumStrMap_; @@ -283,8 +285,9 @@ class Control : public ControlId public: using type = T; - Control(unsigned int id, const char *name, const std::map &enumStrMap = {}) - : ControlId(id, name, details::control_type>::value, + Control(unsigned int id, const char *name, const char *vendor, + const std::map &enumStrMap = {}) + : ControlId(id, name, vendor, details::control_type>::value, details::control_type>::size, enumStrMap) { } -- cgit v1.2.1