[libcamera-devel] [PATCH v3 17/22] libcamera: raspberrypi: Fill stride and frameSize at config validation
Paul Elder
paul.elder at ideasonboard.com
Sat Jul 4 15:31:35 CEST 2020
Fill the stride and frameSize fields of the StreamConfiguration at
configuration validation time instead of at camera configuration time.
Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
---
New in v3
---
src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index 18d068a..fc696ff 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -447,6 +447,10 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()
count++;
+ const PixelFormatInfo &info = PixelFormatInfo::info(cfg.pixelFormat);
+ cfg.stride = info.stride(cfg.size.width, 0);
+ cfg.frameSize = info.frameSize(cfg.size);
+
/* Can only output 1 RAW stream, or 2 YUV/RGB streams. */
if (rawCount > 1 || outCount > 2) {
LOG(RPI, Error) << "Invalid number of streams requested";
@@ -655,7 +659,6 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)
if (isRaw(cfg.pixelFormat)) {
cfg.setStream(&data->isp_[Isp::Input]);
- cfg.stride = sensorFormat.planes[0].bpl;
data->isp_[Isp::Input].setExternal(true);
continue;
}
@@ -679,7 +682,6 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)
}
cfg.setStream(&data->isp_[Isp::Output0]);
- cfg.stride = format.planes[0].bpl;
data->isp_[Isp::Output0].setExternal(true);
}
@@ -705,7 +707,6 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)
*/
if (!cfg.stream()) {
cfg.setStream(&data->isp_[Isp::Output1]);
- cfg.stride = format.planes[0].bpl;
data->isp_[Isp::Output1].setExternal(true);
}
}
--
2.27.0
More information about the libcamera-devel
mailing list