[libcamera-devel,v3,11/12] libcamera: rpi: Change default stream formats
diff mbox series

Message ID 20230915130650.35691-12-jacopo.mondi@ideasonboard.com
State Accepted
Headers show
Series
  • libcamera: Introduce SensorConfiguration
Related show

Commit Message

Jacopo Mondi Sept. 15, 2023, 1:06 p.m. UTC
From: Naushir Patuck <naush@raspberrypi.com>

Switch to XRGB8888 as a default Viewfinder role output format, and
YUV420 as a default output format for everything else.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
---
 src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
index d83811801460..0de91123ee50 100644
--- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
+++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
@@ -264,7 +264,7 @@  CameraConfiguration::Status RPiCameraConfiguration::validate()
 
 		if (fmts.find(out.dev->toV4L2PixelFormat(cfgPixFmt)) == fmts.end()) {
 			/* If we cannot find a native format, use a default one. */
-			cfgPixFmt = formats::NV12;
+			cfgPixFmt = formats::YUV420;
 			status = Adjusted;
 		}
 
@@ -427,7 +427,7 @@  PipelineHandlerBase::generateConfiguration(Camera *camera, Span<const StreamRole
 
 		case StreamRole::StillCapture:
 			fmts = data->ispFormats();
-			pixelFormat = formats::NV12;
+			pixelFormat = formats::YUV420;
 			/*
 			 * Still image codecs usually expect the sYCC color space.
 			 * Even RGB codecs will be fine as the RGB we get with the
@@ -461,7 +461,7 @@  PipelineHandlerBase::generateConfiguration(Camera *camera, Span<const StreamRole
 
 		case StreamRole::Viewfinder:
 			fmts = data->ispFormats();
-			pixelFormat = formats::ARGB8888;
+			pixelFormat = formats::XRGB8888;
 			colorSpace = ColorSpace::Sycc;
 			size = { 800, 600 };
 			bufferCount = 4;