[libcamera-devel] [PATCH 2/2] libcamera: pipeline: simple: try next mbus code if setupFormats() fails

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sun Jun 28 11:55:49 CEST 2020


Hi Andrey,

Thank you for the patch.

On Tue, Apr 21, 2020 at 11:39:54PM +0300, Andrey Konovalov wrote:
> Now SimpleCameraData::setupFormats() can fail if the camera sensor
> supports media bus code which some entities down the pipeline don't.
> 
> When this happens continue with the next media bus code instead of aborting
> the enumeration of the possible pipeline configurations.
> 
> Signed-off-by: Andrey Konovalov <andrey.konovalov at linaro.org>
> ---
>  src/libcamera/pipeline/simple/simple.cpp | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
> index 8212bd9..1a31e18 100644
> --- a/src/libcamera/pipeline/simple/simple.cpp
> +++ b/src/libcamera/pipeline/simple/simple.cpp
> @@ -265,10 +265,11 @@ int SimpleCameraData::init()
>  
>  		ret = setupFormats(&format, V4L2Subdevice::TryFormat);
>  		if (ret < 0) {
> -			LOG(SimplePipeline, Error)
> +			LOG(SimplePipeline, Warning)
>  				<< "Failed to setup pipeline for media bus code "
>  				<< utils::hex(code, 4);

Should we downgrade this to a debug message to avoid worrying the user
when all goes well ? Or maybe an info message to still give a hint that
something may be wrong ? And how about also making the message less
scary ?

				<< "Media bus code " << utils::hex(code, 4)
				<< " not supported for this pipeline";

If you're fine with these changes I can fix when applying.

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

> -			return ret;
> +			/* Try next mbus_code supported by the sensor */
> +			continue;
>  		}
>  
>  		std::map<V4L2PixelFormat, std::vector<SizeRange>> videoFormats =

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list