[libcamera-devel] [SimpleCam PATCH] simple-cam: Use new metadata API

Jean-Michel Hautbois jeanmichel.hautbois at ideasonboard.com
Thu Sep 9 15:22:44 CEST 2021


Hi Kieran,

On 09/09/2021 14:14, Kieran Bingham wrote:
> In libcamera commit 32635054bc76 ("libcamera: framebuffer: Prevent
> modifying the number of metadata planes"), the planes are returned as a
> const span rather than a vector from the metadata.
> 
> This provides better protection on the underlying structures, but was a
> break in the API.
> 
> Update simple-cam to use the new API.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois at ideasonboard.com>
> ---
>  simple-cam.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/simple-cam.cpp b/simple-cam.cpp
> index a8ac3c83ccb5..95e472b4377a 100644
> --- a/simple-cam.cpp
> +++ b/simple-cam.cpp
> @@ -58,10 +58,10 @@ static void processRequest(Request *request)
>  			  << " bytesused: ";
>  
>  		unsigned int nplane = 0;
> -		for (const FrameMetadata::Plane &plane : metadata.planes)
> +		for (const FrameMetadata::Plane &plane : metadata.planes())
>  		{
>  			std::cout << plane.bytesused;
> -			if (++nplane < metadata.planes.size())
> +			if (++nplane < metadata.planes().size())
>  				std::cout << "/";
>  		}
>  
> 


More information about the libcamera-devel mailing list