[libcamera-devel] [PATCH/RFC v2 1/4] libcamera: buffer: Add const accessor to Buffer planes

Niklas Söderlund niklas.soderlund at ragnatech.se
Sun Oct 13 21:32:06 CEST 2019


Hi Laurent,

Thanks for your work.

On 2019-10-13 03:13:37 +0300, Laurent Pinchart wrote:
> In order to inspect planes of a const Buffer, add a const accessor.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

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

> ---
>  include/libcamera/buffer.h | 1 +
>  src/libcamera/buffer.cpp   | 6 ++++++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/include/libcamera/buffer.h b/include/libcamera/buffer.h
> index 7b657509ab5f..7a070205f0b5 100644
> --- a/include/libcamera/buffer.h
> +++ b/include/libcamera/buffer.h
> @@ -43,6 +43,7 @@ private:
>  class BufferMemory final
>  {
>  public:
> +	const std::vector<Plane> &planes() const { return planes_; }
>  	std::vector<Plane> &planes() { return planes_; }
>  
>  private:
> diff --git a/src/libcamera/buffer.cpp b/src/libcamera/buffer.cpp
> index 4407201bd81c..960eeb8f7d19 100644
> --- a/src/libcamera/buffer.cpp
> +++ b/src/libcamera/buffer.cpp
> @@ -181,6 +181,12 @@ void *Plane::mem()
>   * image format is multi-planar.
>   */
>  
> +/**
> + * \fn BufferMemory::planes() const
> + * \brief Retrieve the planes within the buffer
> + * \return A const reference to a vector holding all Planes within the buffer
> + */
> +
>  /**
>   * \fn BufferMemory::planes()
>   * \brief Retrieve the planes within the buffer
> -- 
> 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