[libcamera-devel] [PATCH] libcamera: pipeline: simple: converter: Handle unsupported input format

Umang Jain umang.jain at ideasonboard.com
Thu Jul 21 20:04:43 CEST 2022


Hi,

Thank you for the patch,

On 7/15/22 20:46, Xavier Roumegue via libcamera-devel wrote:
> SimpleConverter::formats() should return an empty vector if the input
> format is not supported by the converter.
>
> Signed-off-by: Xavier Roumegue <xavier.roumegue at oss.nxp.com>


With Laurent's suggestion applied,

Reviewed-by: Umang Jain <umang.jain at ideasonboard.com>

> ---
>   src/libcamera/pipeline/simple/converter.cpp | 6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/src/libcamera/pipeline/simple/converter.cpp b/src/libcamera/pipeline/simple/converter.cpp
> index 77c44fc8..19134edc 100644
> --- a/src/libcamera/pipeline/simple/converter.cpp
> +++ b/src/libcamera/pipeline/simple/converter.cpp
> @@ -220,6 +220,12 @@ std::vector<PixelFormat> SimpleConverter::formats(PixelFormat input)
>   		return {};
>   	}
>   
> +	if (v4l2Format.fourcc != V4L2PixelFormat::fromPixelFormat(input)) {
> +		LOG(SimplePipeline, Debug)
> +			<< "Input format " << input.toString() << " not supported.";
> +		return {};
> +	}
> +
>   	std::vector<PixelFormat> pixelFormats;
>   
>   	for (const auto &format : m2m_->capture()->formats()) {


More information about the libcamera-devel mailing list