[libcamera-devel] [PATCH v2 3/8] libcamera: pipeline: vimc: Remove internal usage of ImageFormats

Kieran Bingham kieran.bingham at ideasonboard.com
Tue Mar 17 14:54:40 CET 2020


Hi Niklas,

Out of interest, wouldn't this squash into
  [5/8] "Remove usage of ImageFormats"?

--
Kieran


On 17/03/2020 03:52, Niklas Söderlund wrote:
> There is no need to use the ImageFormats helper to generate a map of
> PixelFormat to sizes, use std::map directly.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
> Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
>  src/libcamera/pipeline/vimc.cpp | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp
> index 8792dfe48ed8db31..72924bf2f55d0021 100644
> --- a/src/libcamera/pipeline/vimc.cpp
> +++ b/src/libcamera/pipeline/vimc.cpp
> @@ -173,17 +173,17 @@ CameraConfiguration *PipelineHandlerVimc::generateConfiguration(Camera *camera,
>  	if (roles.empty())
>  		return config;
>  
> -	ImageFormats formats;
> +	std::map<PixelFormat, std::vector<SizeRange>> formats;
>  
>  	for (PixelFormat pixelformat : pixelformats) {
>  		/* The scaler hardcodes a x3 scale-up ratio. */
>  		std::vector<SizeRange> sizes{
>  			SizeRange{ 48, 48, 4096, 2160 }
>  		};
> -		formats.addFormat(pixelformat, sizes);
> +		formats[pixelformat] = sizes;
>  	}
>  
> -	StreamConfiguration cfg(formats.data());
> +	StreamConfiguration cfg(formats);
>  
>  	cfg.pixelFormat = DRM_FORMAT_BGR888;
>  	cfg.size = { 1920, 1080 };
> 

-- 
Regards
--
Kieran


More information about the libcamera-devel mailing list