From 7b29587840152328eace5a4a9f836d56e545c63e Mon Sep 17 00:00:00 2001
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Date: Thu, 24 Dec 2020 17:54:07 +0200
Subject: libcamera: pipeline: simple: Rename Configuration::pixelFormat

The Configuration::pixelFormat field stores the pixel format at the
output of the capture part of the pipeline. Rename it to captureFormat,
to match the related captureSize field.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Phi-Bang Nguyen <pnguyen@baylibre.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
---
 src/libcamera/pipeline/simple/simple.cpp | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

(limited to 'src')

diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
index a4537a2e..bce19009 100644
--- a/src/libcamera/pipeline/simple/simple.cpp
+++ b/src/libcamera/pipeline/simple/simple.cpp
@@ -157,7 +157,7 @@ public:
 
 	struct Configuration {
 		uint32_t code;
-		PixelFormat pixelFormat;
+		PixelFormat captureFormat;
 		Size captureSize;
 		SizeRange outputSizes;
 	};
@@ -379,7 +379,7 @@ int SimpleCameraData::init()
 
 			Configuration config;
 			config.code = code;
-			config.pixelFormat = pixelFormat;
+			config.captureFormat = pixelFormat;
 			config.captureSize = format.size;
 
 			if (!converter) {
@@ -551,7 +551,8 @@ CameraConfiguration::Status SimpleCameraConfiguration::validate()
 		status = Adjusted;
 	}
 
-	needConversion_ = cfg.pixelFormat != pipeConfig.pixelFormat
+	/* \todo Create a libcamera core class to group format and size */
+	needConversion_ = cfg.pixelFormat != pipeConfig.captureFormat
 			|| cfg.size != pipeConfig.captureSize;
 
 	cfg.bufferCount = 3;
@@ -656,7 +657,7 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)
 		return ret;
 
 	/* Configure the video node. */
-	V4L2PixelFormat videoFormat = video->toV4L2PixelFormat(pipeConfig.pixelFormat);
+	V4L2PixelFormat videoFormat = video->toV4L2PixelFormat(pipeConfig.captureFormat);
 
 	V4L2DeviceFormat captureFormat;
 	captureFormat.fourcc = videoFormat;
@@ -686,7 +687,7 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)
 
 	if (useConverter_) {
 		StreamConfiguration inputCfg;
-		inputCfg.pixelFormat = pipeConfig.pixelFormat;
+		inputCfg.pixelFormat = pipeConfig.captureFormat;
 		inputCfg.size = pipeConfig.captureSize;
 		inputCfg.stride = captureFormat.planes[0].bpl;
 		inputCfg.bufferCount = cfg.bufferCount;
-- 
cgit v1.2.1