[libcamera-devel] [PATCH v3 4/4] pipeline: raspberrypi: Avoid invalid PixelFormat warning message

Naushir Patuck naush at raspberrypi.com
Thu Nov 18 17:42:16 CET 2021


PixelFormatInfo::info() would log a warning message if the PixelFormat was
invalid when called from the isRaw() function. Add a validity test in isRaw()
to avoid this warning message.

Signed-off-by: Naushir Patuck <naush at raspberrypi.com>
---
 src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index 4f6c699a4379..ad526a8be6a2 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -102,6 +102,9 @@ bool isRaw(const PixelFormat &pixFmt)
 	 * The isRaw test might be redundant right now the pipeline handler only
 	 * supports RAW sensors. Leave it in for now, just as a sanity check.
 	 */
+	if (!pixFmt.isValid())
+		return false;
+
 	const PixelFormatInfo &info = PixelFormatInfo::info(pixFmt);
 	if (!info.isValid())
 		return false;
-- 
2.25.1



More information about the libcamera-devel mailing list