summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcamera/pipeline')
-rw-r--r--src/libcamera/pipeline/ipu3/cio2.cpp3
-rw-r--r--src/libcamera/pipeline/raspberrypi/raspberrypi.cpp11
-rw-r--r--src/libcamera/pipeline/rkisp1/rkisp1.cpp6
3 files changed, 11 insertions, 9 deletions
diff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp
index a819884f..7400cb0b 100644
--- a/src/libcamera/pipeline/ipu3/cio2.cpp
+++ b/src/libcamera/pipeline/ipu3/cio2.cpp
@@ -194,8 +194,7 @@ int CIO2Device::configure(const Size &size, const Transform &transform,
*/
std::vector<unsigned int> mbusCodes = utils::map_keys(mbusCodesToPixelFormat);
sensorFormat = getSensorFormat(mbusCodes, size);
- sensorFormat.transform = transform;
- ret = sensor_->setFormat(&sensorFormat);
+ ret = sensor_->setFormat(&sensorFormat, transform);
if (ret)
return ret;
diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index 77e860ab..c0dd9551 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -832,13 +832,14 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)
}
}
- /* First calculate the best sensor mode we can use based on the user request. */
+ /*
+ * Calculate the best sensor mode we can use based on the user's
+ * request, and apply it to the sensor with the cached transform, if
+ * any.
+ */
V4L2SubdeviceFormat sensorFormat = findBestFormat(data->sensorFormats_, rawStream ? sensorSize : maxSize, bitDepth);
- /* Apply any cached transform. */
const RPiCameraConfiguration *rpiConfig = static_cast<const RPiCameraConfiguration *>(config);
- sensorFormat.transform = rpiConfig->combinedTransform_;
- /* Finally apply the format on the sensor. */
- ret = data->sensor_->setFormat(&sensorFormat);
+ ret = data->sensor_->setFormat(&sensorFormat, rpiConfig->combinedTransform_);
if (ret)
return ret;
diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index 5f22a29d..8a30fe06 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -125,6 +125,7 @@ public:
Status validate() override;
const V4L2SubdeviceFormat &sensorFormat() { return sensorFormat_; }
+ const Transform &combinedTransform() { return combinedTransform_; }
private:
bool fitsAllPaths(const StreamConfiguration &cfg);
@@ -138,6 +139,7 @@ private:
const RkISP1CameraData *data_;
V4L2SubdeviceFormat sensorFormat_;
+ Transform combinedTransform_;
};
class PipelineHandlerRkISP1 : public PipelineHandler
@@ -591,7 +593,7 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate()
if (sensorFormat_.size.isNull())
sensorFormat_.size = sensor->resolution();
- sensorFormat_.transform = combined;
+ combinedTransform_ = combined;
return status;
}
@@ -720,7 +722,7 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)
V4L2SubdeviceFormat format = config->sensorFormat();
LOG(RkISP1, Debug) << "Configuring sensor with " << format;
- ret = sensor->setFormat(&format);
+ ret = sensor->setFormat(&format, config->combinedTransform());
if (ret < 0)
return ret;