[libcamera-devel] [PATCH v2 3/4] libcamera: pipeline: rpi: Adjust to new implementation

Sebastian Fricke sebastian.fricke.linux at gmail.com
Thu Dec 31 16:53:35 CET 2020


Remove the construction of a BayerFormat from a V4L2PixelFormat through
the old constructor. Add the new 'fromV4L2PixelFormat' static member
function.

Signed-off-by: Sebastian Fricke <sebastian.fricke.linux at gmail.com>
---
 src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index 7a5f5881..8ca9b9cf 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -358,7 +358,7 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()
 			 */
 			V4L2PixelFormat fourcc = sensorFormat.fourcc;
 			if (data_->flipsAlterBayerOrder_) {
-				BayerFormat bayer(fourcc);
+				BayerFormat bayer = BayerFormat::fromV4L2PixelFormat(fourcc);
 				bayer.order = data_->nativeBayerOrder_;
 				bayer = bayer.transform(combined);
 				fourcc = bayer.toV4L2PixelFormat();
@@ -1007,7 +1007,7 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)
 	BayerFormat bayerFormat;
 	for (const auto &iter : dev->formats()) {
 		V4L2PixelFormat v4l2Format = iter.first;
-		bayerFormat = BayerFormat(v4l2Format);
+		bayerFormat = BayerFormat::fromV4L2PixelFormat(v4l2Format);
 		if (bayerFormat.isValid())
 			break;
 	}
-- 
2.25.1



More information about the libcamera-devel mailing list