[libcamera-devel,v2,12/14] libcamera: ipu3: Use NV12 as default image format

Message ID 20190312121242.2253-13-jacopo@jmondi.org
State Superseded
Headers show
Series
  • libcamera: ipu3: ImgU support
Related show

Commit Message

Jacopo Mondi March 12, 2019, 12:12 p.m. UTC
Now that images come from the ImgU output, hardcode NV12 as default
output format.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 src/libcamera/pipeline/ipu3/ipu3.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch

diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index 4d08383291ea..f998f900b219 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -190,6 +190,7 @@  PipelineHandlerIPU3::streamConfiguration(Camera *camera,
 	IPU3CameraData *data = cameraData(camera);
 	V4L2Subdevice *sensor = data->cio2.sensor;
 	StreamConfiguration *config = &configs[&data->stream_];
+	bool found = false;
 
 	/*
 	 * Make sure the sensor produces a raw format compatible with the
@@ -208,17 +209,18 @@  PipelineHandlerIPU3::streamConfiguration(Camera *camera,
 
 			config->width = range.maxWidth;
 			config->height = range.maxHeight;
-			config->pixelFormat = cio2Code;
+			found = true;
 		}
 	}
 
 	/* If not suitable format has been found, return an empty config. */
-	if (!config->pixelFormat) {
+	if (!found) {
 		LOG(IPU3, Error) << "Sensor image format not supported";
 
 		return configs;
 	}
 
+	config->pixelFormat = V4L2_PIX_FMT_NV12;
 	config->bufferCount = IPU3_BUFFER_COUNT;
 
 	LOG(IPU3, Debug)