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 --- include/libcamera/internal/camera_sensor.h | 6 +++--- include/libcamera/internal/v4l2_subdevice.h | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h index bea52bad..928c61af 100644 --- a/include/libcamera/internal/camera_sensor.h +++ b/include/libcamera/internal/camera_sensor.h @@ -17,6 +17,7 @@ #include #include #include +#include #include @@ -29,8 +30,6 @@ class BayerFormat; class CameraLens; class MediaEntity; -enum class Transform; - struct CameraSensorProperties; class CameraSensor : protected Loggable @@ -55,7 +54,8 @@ public: V4L2SubdeviceFormat getFormat(const std::vector &mbusCodes, const Size &size) const; - int setFormat(V4L2SubdeviceFormat *format); + int setFormat(V4L2SubdeviceFormat *format, + Transform transform = Transform::Identity); const ControlInfoMap &controls() const; ControlList getControls(const std::vector &ids); diff --git a/include/libcamera/internal/v4l2_subdevice.h b/include/libcamera/internal/v4l2_subdevice.h index 576faf97..69862de0 100644 --- a/include/libcamera/internal/v4l2_subdevice.h +++ b/include/libcamera/internal/v4l2_subdevice.h @@ -20,7 +20,6 @@ #include #include -#include #include "libcamera/internal/formats.h" #include "libcamera/internal/media_object.h" @@ -45,7 +44,6 @@ struct V4L2SubdeviceFormat { uint32_t mbus_code; Size size; std::optional colorSpace; - Transform transform = Transform::Identity; const std::string toString() const; uint8_t bitsPerPixel() const; -- cgit v1.2.1