From 33fd94ecb4471e35946b233dead772b1c7c92a40 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 3 Nov 2020 15:30:42 +0200 Subject: libcamera: pipeline: vivid: Print diagnostic on configuration failure In case the setFormat() call on the video device fails to match the configuration, print both the requested and actual configurations to ease debugging. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Signed-off-by: Kieran Bingham --- src/libcamera/pipeline/vivid/vivid.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/libcamera/pipeline/vivid/vivid.cpp b/src/libcamera/pipeline/vivid/vivid.cpp index f603ad8f..8943d04f 100644 --- a/src/libcamera/pipeline/vivid/vivid.cpp +++ b/src/libcamera/pipeline/vivid/vivid.cpp @@ -195,8 +195,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()); -- cgit v1.2.1