[libcamera-devel] [PATCH 8/9] libcamera: rkisp1: Add support for Transform
Jacopo Mondi
jacopo at jmondi.org
Thu Nov 24 13:12:19 CET 2022
Add support for Transform to the RkISP1 pipeline handler.
The pipeline rotates using the sensor's V/H flips, hence use the
CameraSensor helpers to handle transformation requests from
applications.
Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
src/libcamera/pipeline/rkisp1/rkisp1.cpp | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index 14741e73e050..41afc98ae2b2 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -26,6 +26,7 @@
#include <libcamera/property_ids.h>
#include <libcamera/request.h>
#include <libcamera/stream.h>
+#include <libcamera/transform.h>
#include <libcamera/ipa/core_ipa_interface.h>
#include <libcamera/ipa/rkisp1_ipa_interface.h>
@@ -430,17 +431,17 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate()
status = validateColorSpaces(ColorSpaceFlag::StreamsShareColorSpace);
- if (transform != Transform::Identity) {
- transform = Transform::Identity;
- status = Adjusted;
- }
-
/* Cap the number of entries to the available streams. */
if (config_.size() > pathCount) {
config_.resize(pathCount);
status = Adjusted;
}
+ Transform requestedTransform = transform;
+ Transform combined = sensor->validateTransform(&transform);
+ if (transform != requestedTransform)
+ status = Adjusted;
+
/*
* If there are more than one stream in the configuration figure out the
* order to evaluate the streams. The first stream has the highest
@@ -529,6 +530,8 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate()
if (sensorFormat_.size.isNull())
sensorFormat_.size = sensor->resolution();
+ sensorFormat_.transform = combined;
+
return status;
}
--
2.38.1
More information about the libcamera-devel
mailing list