summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2021-02-03 16:38:43 +0100
committerJacopo Mondi <jacopo@jmondi.org>2021-02-05 13:22:51 +0100
commitd77233be822b1abf6ae79e44307f08fc9d06ae41 (patch)
tree4893e4598572228639259a9d636a63ad4e1b75cc
parent9690d082ec71d3c9aee313fae7b6edfec2ffb352 (diff)
libcamera: ipu3: Always report crop region
Report the crop region for every completed request. The crop region is initialized as the sensor's analogue crop rectangle and updated when a Request with a new region completes. Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
-rw-r--r--src/libcamera/pipeline/ipu3/ipu3.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index c3763507..3a9d7a5e 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -73,6 +73,7 @@ public:
Stream rawStream_;
uint32_t exposureTime_;
+ Rectangle cropRegion_;
std::unique_ptr<DelayedControls> delayedCtrls_;
IPU3Frames frameInfos_;
@@ -487,6 +488,10 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)
if (ret)
return ret;
+ CameraSensorInfo sensorInfo;
+ cio2->sensor()->sensorInfo(&sensorInfo);
+ data->cropRegion_ = sensorInfo.analogCrop;
+
/*
* If the ImgU gets configured, its driver seems to expect that
* buffers will be queued to its outputs, as otherwise the next
@@ -1121,10 +1126,9 @@ void IPU3CameraData::imguOutputBufferReady(FrameBuffer *buffer)
/* \todo Move the ExposureTime control to the IPA. */
request->metadata().set(controls::ExposureTime, exposureTime_);
/* \todo Actually apply the scaler crop region to the ImgU. */
- if (request->controls().contains(controls::ScalerCrop)) {
- Rectangle cropRegion = request->controls().get(controls::ScalerCrop);
- request->metadata().set(controls::ScalerCrop, cropRegion);
- }
+ if (request->controls().contains(controls::ScalerCrop))
+ cropRegion_ = request->controls().get(controls::ScalerCrop);
+ request->metadata().set(controls::ScalerCrop, cropRegion_);
if (buffer->metadata().status == FrameMetadata::FrameCancelled)
info->metadataProcessed = true;