@@ -248,11 +248,10 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()
* to the user request.
*/
- BayerFormat cfgBayer = BayerFormat::fromPixelFormat(rawStream->pixelFormat);
- cfgBayer.cfa = data_->sensor_->bayerOrder(combinedTransform_);
+ ColorFilterArray cfa = data_->sensor_->bayerOrder(combinedTransform_);
- if (rawStream->pixelFormat != cfgBayer.toPixelFormat()) {
- rawStream->pixelFormat = cfgBayer.toPixelFormat();
+ if (!rawStream->bayerOrder || rawStream->bayerOrder.value() != cfa) {
+ rawStream->bayerOrder = cfa;
status = Adjusted;
}
}
@@ -500,6 +499,16 @@ PipelineHandlerBase::generateConfiguration(Camera *camera, std::span<const Strea
cfg.pixelFormat = *pixelFormat;
cfg.colorSpace = colorSpace;
cfg.bufferCount = bufferCount;
+
+ /*
+ * Colour order of the raw data is only relevant for raw
+ * streams. Populate the sensor's native (untransformed) color
+ * filter array order; validate() will update it with the
+ * order resulting from the transform applied to the sensor.
+ */
+ if (role == StreamRole::Raw)
+ cfg.bayerOrder = data->sensor_->bayerOrder(Transform::Identity);
+
config->addConfiguration(cfg);
}
With only generic (bayer-order independent) formats supported throughout libcamera now, ensure that we populate StreamConfiguration::bayerOrder when generating new configurations, and update them during validate() depending upon the combined flips and transforms. Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com> --- src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)