summaryrefslogtreecommitdiff
path: root/src/libcamera/camera_sensor.cpp
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2021-03-10 10:42:57 +0100
committerJacopo Mondi <jacopo@jmondi.org>2021-03-22 08:59:07 +0100
commit285d36518682b2c7cf8b932af4e8be23cbc7f6fa (patch)
tree4173e14d73b07ecd7633ff957e09fe75c7ba6b03 /src/libcamera/camera_sensor.cpp
parentaab49f903e858a2ea9765514bcc26bbd18edd13c (diff)
libcamera: camera_sensor: Do not register Location if not available
Do not register the Location property if not available from the firmware interface instead of defaulting it to External. Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/libcamera/camera_sensor.cpp')
-rw-r--r--src/libcamera/camera_sensor.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp
index 27f82071..f7ed91d9 100644
--- a/src/libcamera/camera_sensor.cpp
+++ b/src/libcamera/camera_sensor.cpp
@@ -468,12 +468,10 @@ int CameraSensor::initProperties()
propertyValue = properties::CameraLocationBack;
break;
}
+ properties_.set(properties::Location, propertyValue);
} else {
- LOG(CameraSensor, Warning)
- << "Failed to retrieve the camera location, setting to External";
- propertyValue = properties::CameraLocationExternal;
+ LOG(CameraSensor, Warning) << "Failed to retrieve the camera location";
}
- properties_.set(properties::Location, propertyValue);
const auto &rotationControl = controls.find(V4L2_CID_CAMERA_SENSOR_ROTATION);
if (rotationControl != controls.end()) {