summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2020-12-30 17:15:51 +0100
committerJacopo Mondi <jacopo@jmondi.org>2021-01-18 10:39:14 +0100
commitc35123e6f91b6269cf6f5ae9216aeccebc545c75 (patch)
treeee6d5f281d06fe83e20654b19430e28c84d8d66d
parent87ceac9c8cc0afb3be0f68155cd0f906cbb98120 (diff)
libcamera: camera_sensor: Do not default 'rotation'
The 'rotation' property is not critical. Only register it if the sensor driver reports it. Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
-rw-r--r--src/libcamera/camera_sensor.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp
index 71aa268f..e9c80c30 100644
--- a/src/libcamera/camera_sensor.cpp
+++ b/src/libcamera/camera_sensor.cpp
@@ -370,13 +370,11 @@ int CameraSensor::initProperties()
}
properties_.set(properties::Location, propertyValue);
- /* Camera Rotation: default is 0 degrees. */
const auto &rotationControl = controls.find(V4L2_CID_CAMERA_SENSOR_ROTATION);
- if (rotationControl != controls.end())
+ if (rotationControl != controls.end()) {
propertyValue = rotationControl->second.def().get<int32_t>();
- else
- propertyValue = 0;
- properties_.set(properties::Rotation, propertyValue);
+ properties_.set(properties::Rotation, propertyValue);
+ }
properties_.set(properties::PixelArraySize, pixelArraySize_);
properties_.set(properties::PixelArrayActiveAreas, { activeArea_ });