[libcamera-devel] [PATCH 4/9] libcamera: controls: Make ControlList::find() protected

Jacopo Mondi jacopo at jmondi.org
Wed Oct 9 10:21:27 CEST 2019


Hi Laurent,

On Tue, Oct 08, 2019 at 01:46:37AM +0300, Laurent Pinchart wrote:
> To prepare for
>
prepare for what ? :)

With this fixed
Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>

Thanks
  j

> 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
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20191009/9ebebf68/attachment.sig>


More information about the libcamera-devel mailing list