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>
This commit is contained in:
Jacopo Mondi 2021-03-10 10:42:57 +01:00
parent aab49f903e
commit 285d365186

View file

@ -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()) {