summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2023-07-27 14:01:07 +0100
committerJacopo Mondi <jacopo.mondi@ideasonboard.com>2023-07-31 12:09:41 +0200
commitfe73f05475ddd71a28005b3da13e05bae201098a (patch)
tree3f5277dae44b1e324d9558f6a1b0e5fe9bbb47a3
parenteed6a079d2f989bdbc24ff1d3f8fc4360fc577b0 (diff)
pipeline: rpi: Don't call toV4L2DeviceFormat() from validate()
Don't make an unnecessary call to toV4L2DeviceFormat() from validate() to get a V4L2DeviceFormat. Instead, the conversion can happen directly from the RAW stream PixelFormat. 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>
-rw-r--r--src/libcamera/pipeline/rpi/common/pipeline_base.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
index e0fbeec3..97acafbb 100644
--- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
+++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
@@ -226,10 +226,11 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()
/* Further fixups on the RAW streams. */
for (auto &raw : rawStreams) {
StreamConfiguration &cfg = config_.at(raw.index);
- V4L2DeviceFormat rawFormat;
- BayerFormat::Packing packing = BayerFormat::fromPixelFormat(cfg.pixelFormat).packing;
- rawFormat = PipelineHandlerBase::toV4L2DeviceFormat(raw.dev, sensorFormat_, packing);
+ V4L2DeviceFormat rawFormat;
+ rawFormat.fourcc = raw.dev->toV4L2PixelFormat(cfg.pixelFormat);
+ rawFormat.size = cfg.size;
+ rawFormat.colorSpace = cfg.colorSpace;
int ret = raw.dev->tryFormat(&rawFormat);
if (ret)