From 85befa816e5a01372b52ecbd345f34815d1b9bc6 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Mon, 6 Feb 2023 19:21:32 +0100 Subject: libcamera: Remove transform from V4L2SubdeviceFormat Commit 6f6e1bf704fe ("libcamera: camera_sensor: Apply flips at setFormat()") extended the CameraSensor::setFormat() function to apply vertical/horizontal flips on the sensor based on the supplied Transform. To pass the Transform to the function the V4L2SubdeviceFormat structure has been augmented with a Transform member. However as the newly added Transform is not used at all in the V4L2Subdevice class, it should not be part of V4L2SubdeviceFormat. Fix that by removing the transform field from V4L2SubdeviceFormat and pass it as an explicit parameter to CameraSensor::setFormat(). Fixes: 6f6e1bf704fe ("libcamera: camera_sensor: Apply flips at setFormat()) Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/libcamera/pipeline/raspberrypi/raspberrypi.cpp') 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(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; -- cgit v1.2.1