[libcamera-devel] [PATCH v3 5/6] libcamera: camera_sensor: Do not default 'rotation'

Jacopo Mondi jacopo at jmondi.org
Wed Dec 30 19:01:19 CET 2020


The 'rotation' property is not critical. Only register if the
sensor driver reports it.

Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
 src/libcamera/camera_sensor.cpp | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp
index 1a316da45511..f7b20b396914 100644
--- a/src/libcamera/camera_sensor.cpp
+++ b/src/libcamera/camera_sensor.cpp
@@ -379,16 +379,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()) {
 		propertyValue = rotationControl->second.def().get<int32_t>();
-	} else {
-		propertyValue = 0;
-		LOG(CameraSensor, Debug)
-			<< "Rotation property defaulted to 0 degrees";
+		properties_.set(properties::Rotation, propertyValue);
 	}
-	properties_.set(properties::Rotation, propertyValue);
 
 	properties_.set(properties::PixelArraySize, pixelArraySize_);
 	properties_.set(properties::PixelArrayActiveAreas, { activeAreaSize_ });
-- 
2.29.2



More information about the libcamera-devel mailing list