[libcamera-devel] [PATCH 4/9] libcamera: controls: Make ControlList::find() protected
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Wed Oct 9 11:10:20 CEST 2019
Hi Jacopo,
On Wed, Oct 09, 2019 at 10:21:27AM +0200, Jacopo Mondi wrote:
> On Tue, Oct 08, 2019 at 01:46:37AM +0300, Laurent Pinchart wrote:
> > To prepare for
>
> prepare for what ? :)
We should be prepared for everything ;-)
Actually this patch isn't needed, I'll drop it.
> With this fixed
> Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>
>
> > 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