From 565f95d64ff92e8712e8090988180c343dd3bcb5 Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Tue, 21 Apr 2020 23:39:54 +0300 Subject: libcamera: pipeline: simple: Try next mbus code if setupFormats() fails 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 Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- src/libcamera/pipeline/simple/simple.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/libcamera/pipeline/simple/simple.cpp') diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index c2498d4e..0bab5af8 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -269,10 +269,11 @@ int SimpleCameraData::init() ret = setupFormats(&format, V4L2Subdevice::TryFormat); if (ret < 0) { - LOG(SimplePipeline, Error) - << "Failed to setup pipeline for media bus code " - << utils::hex(code, 4); - return ret; + LOG(SimplePipeline, Debug) + << "Media bus code " << utils::hex(code, 4) + << " not supported for this pipeline"; + /* Try next mbus_code supported by the sensor */ + continue; } V4L2VideoDevice::Formats videoFormats = -- cgit v1.2.1