[libcamera-devel] [PATCH 2/2] libcamera: pipeline: vivid: Print diagnostic on configuration failure

Kieran Bingham kieran.bingham at ideasonboard.com
Tue Nov 3 16:32:47 CET 2020


Hi Laurent,

On 03/11/2020 13:30, Laurent Pinchart wrote:
> In case the setFormat() call on the video device fails to match the
> configuration, print both the requested and actual configurations to
> ease debugging.

Sounds like it would be helpful. Again I'll add this to the vivid branch.

Sometime we should move that branch onto a repository at libcamera.org
rather than my personal external repository - but we can deal with that
later.

Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>

> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
>  src/libcamera/pipeline/vivid/vivid.cpp | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/pipeline/vivid/vivid.cpp b/src/libcamera/pipeline/vivid/vivid.cpp
> index bf8f82af981f..a0ccbd1e711e 100644
> --- a/src/libcamera/pipeline/vivid/vivid.cpp
> +++ b/src/libcamera/pipeline/vivid/vivid.cpp
> @@ -181,8 +181,13 @@ int PipelineHandlerVivid::configure(Camera *camera, CameraConfiguration *config)
>  		return ret;
>  
>  	if (format.size != cfg.size ||
> -	    format.fourcc != data->video_->toV4L2PixelFormat(cfg.pixelFormat))
> +	    format.fourcc != data->video_->toV4L2PixelFormat(cfg.pixelFormat)) {
> +		LOG(VIVID, Error)
> +			<< "Requested " << cfg.toString() << ", got "
> +			<< format.size.toString() << "-"
> +			<< format.fourcc.toString();
>  		return -EINVAL;
> +	}
>  
>  	/* Set initial controls specific to VIVID */
>  	ControlList controls(data->video_->controls());
> 

-- 
Regards
--
Kieran


More information about the libcamera-devel mailing list