[libcamera-devel] [PATCH v2 06/13] libcamera: pipeline: rkisp1: Export stream formats to applications

Laurent Pinchart laurent.pinchart at ideasonboard.com
Tue Sep 15 02:43:29 CEST 2020


Hi Niklas,

Thank you for the patch.

On Mon, Sep 14, 2020 at 04:21:42PM +0200, Niklas Söderlund wrote:
> The information about stream format is available but not exported to
> applications, fix this.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
> ---
> * Changes since v1
> - Fix s/applicaitons/applications/ in subject
> - Cap the max resolution reported to the sensor resolution.

I really like how you provide per-patch changelogs, it clearly helps
during review. Thank you.

> ---
>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> index e3802c76003268f6..a6cb16c0638f8d85 100644
> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> @@ -587,7 +587,13 @@ CameraConfiguration *PipelineHandlerRkISP1::generateConfiguration(Camera *camera
>  	if (roles.empty())
>  		return config;
>  
> -	StreamConfiguration cfg{};
> +	std::map<PixelFormat, std::vector<SizeRange>> streamFormats;
> +	for (const PixelFormat &format : RKISP1_RSZ_MP_FORMATS)
> +		streamFormats[format] =
> +			{ { RKISP1_RSZ_MP_SRC_MIN, data->sensor_->resolution() } };

This assumes that the sensor resolution is larger than 32x16, but I
think that's fine :-)

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

> +
> +	StreamFormats formats(streamFormats);
> +	StreamConfiguration cfg(formats);
>  	cfg.pixelFormat = formats::NV12;
>  	cfg.size = data->sensor_->resolution();
>  

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list