From 576b8aa079388d2151f396bb947cf0a8e5ba255e Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 7 Oct 2019 21:08:19 +0300 Subject: libcamera: controls: Store control name in ControlId MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ControlId class stores a pointer to the control name. This works fine for statically-defined controls, but requires code that allocates controls dynamically (for instance based on control discovery on a V4L2 device) to keep a list of control names in separate storage. To ease usage of dynamically allocated controls, store a copy of the control name string in the ControlId class. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Tested-by: Niklas Söderlund Reviewed-by: Niklas Söderlund --- src/libcamera/controls.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libcamera/controls.cpp') diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp index bfab177f..292e48cd 100644 --- a/src/libcamera/controls.cpp +++ b/src/libcamera/controls.cpp @@ -232,7 +232,7 @@ bool ControlValue::operator==(const ControlValue &other) const */ /** - * \fn ControlId::ControlId(unsigned int id, const char *name, ControlType type) + * \fn ControlId::ControlId(unsigned int id, const std::string &name, ControlType type) * \brief Construct a ControlId instance * \param[in] id The control numerical ID * \param[in] name The control name -- cgit v1.2.1