[libcamera-devel] [PATCH 1/3] libcamera: request: Mark metadata() and controls() as const

Kieran Bingham kieran.bingham at ideasonboard.com
Thu Dec 10 10:35:16 CET 2020


Hi Jacopo,

On 09/12/2020 17:35, Jacopo Mondi wrote:
> Mark the metadata() and controls() operations as const function to make
> it possible to retrieve them from const Request instances.
> 

Is this accurate? How do applications set controls on the request if
it's const? (before queueing it)

Or is that done somewhere else?

Metadata certainly seems like it should be const though...

--
Kieran


> Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
> ---
>  include/libcamera/request.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/libcamera/request.h b/include/libcamera/request.h
> index 655b1324bae8..1a89622ab989 100644
> --- a/include/libcamera/request.h
> +++ b/include/libcamera/request.h
> @@ -45,8 +45,8 @@ public:
>  
>  	void reuse(ReuseFlag flags = Default);
>  
> -	ControlList &controls() { return *controls_; }
> -	ControlList &metadata() { return *metadata_; }
> +	ControlList &controls() const { return *controls_; }
> +	ControlList &metadata() const { return *metadata_; }
>  	const BufferMap &buffers() const { return bufferMap_; }
>  	int addBuffer(const Stream *stream, FrameBuffer *buffer);
>  	FrameBuffer *findBuffer(const Stream *stream) const;
> 

-- 
Regards
--
Kieran


More information about the libcamera-devel mailing list