[libcamera-devel] [PATCH v2 08/24] libcamera: controls: Make ControList constructor public

Niklas Söderlund niklas.soderlund at ragnatech.se
Mon Nov 18 18:12:55 CET 2019


Hi Laurent,

Thanks for your work.

On 2019-11-08 22:53:53 +0200, Laurent Pinchart wrote:
> We need to construct empty ControlList objects to serialization. Make
> the constructor public.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>

> ---
>  include/libcamera/controls.h |  1 +
>  src/libcamera/controls.cpp   | 11 +++++++++++
>  2 files changed, 12 insertions(+)
> 
> diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h
> index 6bad36cbc369..b35e006bc046 100644
> --- a/include/libcamera/controls.h
> +++ b/include/libcamera/controls.h
> @@ -188,6 +188,7 @@ private:
>  	using ControlListMap = std::unordered_map<unsigned int, ControlValue>;
>  
>  public:
> +	ControlList();
>  	ControlList(const ControlIdMap &idmap, ControlValidator *validator = nullptr);
>  	ControlList(const ControlInfoMap &info, ControlValidator *validator = nullptr);
>  
> diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp
> index ae6ca2a7cf7e..178ce3d99bce 100644
> --- a/src/libcamera/controls.cpp
> +++ b/src/libcamera/controls.cpp
> @@ -588,6 +588,17 @@ void ControlInfoMap::generateIdmap()
>   * controls.
>   */
>  
> +/**
> + * \brief Construct a ControlList not associated with any object
> + *
> + * This constructor is meant to support ControlList serialization and shall not
> + * be used directly by application.
> + */
> +ControlList::ControlList()
> +	: validator_(nullptr), idmap_(nullptr)
> +{
> +}
> +
>  /**
>   * \brief Construct a ControlList with an optional control validator
>   * \param[in] idmap The ControlId map for the control list target object
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

-- 
Regards,
Niklas Söderlund


More information about the libcamera-devel mailing list