summaryrefslogtreecommitdiff
path: root/src/libcamera/camera_sensor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcamera/camera_sensor.cpp')
-rw-r--r--src/libcamera/camera_sensor.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp
index 274ed419..e442b89d 100644
--- a/src/libcamera/camera_sensor.cpp
+++ b/src/libcamera/camera_sensor.cpp
@@ -16,7 +16,6 @@
#include <string.h>
#include <libcamera/property_ids.h>
-#include <libcamera/transform.h>
#include <libcamera/base/utils.h>
@@ -751,7 +750,6 @@ V4L2SubdeviceFormat CameraSensor::getFormat(const std::vector<unsigned int> &mbu
.mbus_code = bestCode,
.size = *bestSize,
.colorSpace = ColorSpace::Raw,
- .transform = Transform::Identity,
};
return format;
@@ -760,6 +758,8 @@ V4L2SubdeviceFormat CameraSensor::getFormat(const std::vector<unsigned int> &mbu
/**
* \brief Set the sensor output format
* \param[in] format The desired sensor output format
+ * \param[in] transform The transform to be applied on the sensor.
+ * Defaults to Identity.
*
* If flips are writable they are configured according to the desired Transform.
* Transform::Identity always corresponds to H/V flip being disabled if the
@@ -770,18 +770,16 @@ V4L2SubdeviceFormat CameraSensor::getFormat(const std::vector<unsigned int> &mbu
*
* \return 0 on success or a negative error code otherwise
*/
-int CameraSensor::setFormat(V4L2SubdeviceFormat *format)
+int CameraSensor::setFormat(V4L2SubdeviceFormat *format, Transform transform)
{
/* Configure flips if the sensor supports that. */
if (supportFlips_) {
ControlList flipCtrls(subdev_->controls());
flipCtrls.set(V4L2_CID_HFLIP,
- static_cast<int32_t>(!!(format->transform &
- Transform::HFlip)));
+ static_cast<int32_t>(!!(transform & Transform::HFlip)));
flipCtrls.set(V4L2_CID_VFLIP,
- static_cast<int32_t>(!!(format->transform &
- Transform::VFlip)));
+ static_cast<int32_t>(!!(transform & Transform::VFlip)));
int ret = subdev_->setControls(&flipCtrls);
if (ret)