[libcamera-devel] [PATCH 4/9] libcamera: controls: Make ControlList::find() protected
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Tue Oct 8 00:46:37 CEST 2019
To prepare for
Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
include/libcamera/controls.h | 3 ++-
src/libcamera/controls.cpp | 14 ++++++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h
index a5a6a135ec16..fc33f0762138 100644
--- a/include/libcamera/controls.h
+++ b/include/libcamera/controls.h
@@ -159,10 +159,11 @@ public:
const ControlValue &get(const ControlId &id) const;
void set(const ControlId &id, const ControlValue &value);
-private:
+protected:
const ControlValue *find(const ControlId &id) const;
ControlValue *find(const ControlId &id);
+private:
ControlValidator *validator_;
ControlListMap controls_;
};
diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp
index e528dd80a2a7..afea09d6d7d7 100644
--- a/src/libcamera/controls.cpp
+++ b/src/libcamera/controls.cpp
@@ -515,6 +515,13 @@ void ControlList::set(const ControlId &id, const ControlValue &value)
*val = value;
}
+/**
+ * \brief Find a control in the list
+ * \param[in] id The control ID
+ *
+ * \return The control value for the control \a id, or nullptr if no such
+ * control exists in the list
+ */
const ControlValue *ControlList::find(const ControlId &id) const
{
const auto iter = controls_.find(&id);
@@ -528,6 +535,13 @@ const ControlValue *ControlList::find(const ControlId &id) const
return &iter->second;
}
+/**
+ * \brief Find a control in the list
+ * \param[in] id The control ID
+ *
+ * \return The control value for the control \a id, or nullptr if no such
+ * control exists in the list
+ */
ControlValue *ControlList::find(const ControlId &id)
{
if (validator_ && !validator_->validate(id)) {
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list