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

Andrey Konovalov andrey.konovalov at linaro.org
Tue Apr 21 22:39:54 CEST 2020


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);
-			return ret;
+			/* Try next mbus_code supported by the sensor */
+			continue;
 		}
 
 		std::map<V4L2PixelFormat, std::vector<SizeRange>> videoFormats =
-- 
2.17.1



More information about the libcamera-devel mailing list