summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo.mondi@ideasonboard.com>2023-10-19 16:01:31 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2023-10-23 16:06:09 +0300
commitc65e40b8480ffb5f50e01a4e6713164c7194a937 (patch)
tree670518e9c6df2bfce3986f5accae02e01974ccd9 /src/libcamera/pipeline/rpi/common/pipeline_base.cpp
parenta28f871836e1dc3fc8031589c91f814b844dbe55 (diff)
libcamera: Use CameraConfiguration::orientation
Replace the usage of CameraConfiguration::transform with the newly introduced CameraConfiguration::orientation. Rework and rename the CameraSensor::validateTransform(transform) to CameraSensor::computeTransform(orientation), that given the desired image orientation computes the Transform that pipeline handlers should apply to the sensor to obtain it. Port all pipeline handlers to use the newly introduced function. This commit breaks existing applications as it removes the public CameraConfiguration::transform in favour of CameraConfiguration::orientation. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/libcamera/pipeline/rpi/common/pipeline_base.cpp')
-rw-r--r--src/libcamera/pipeline/rpi/common/pipeline_base.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
index 7c88b87e..ee222d06 100644
--- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
+++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
@@ -174,9 +174,9 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()
* rotation and store the final combined transform that configure() will
* need to apply to the sensor to save us working it out again.
*/
- Transform requestedTransform = transform;
- combinedTransform_ = data_->sensor_->validateTransform(&transform);
- if (transform != requestedTransform)
+ Orientation requestedOrientation = orientation;
+ combinedTransform_ = data_->sensor_->computeTransform(&orientation);
+ if (orientation != requestedOrientation)
status = Adjusted;
rawStreams_.clear();
@@ -1234,7 +1234,8 @@ int CameraData::configureIPA(const CameraConfiguration *config, ipa::RPi::Config
}
/* Always send the user transform to the IPA. */
- params.transform = static_cast<unsigned int>(config->transform);
+ Transform transform = config->orientation / Orientation::Rotate0;
+ params.transform = static_cast<unsigned int>(transform);
/* Ready the IPA - it must know about the sensor resolution. */
ret = ipa_->configure(sensorInfo_, params, result);