| Message ID | 20210319130120.141563-3-jacopo@jmondi.org |
|---|---|
| State | Accepted |
| Headers | show |
| Series |
|
| Related | show |
Hi Jacopo, On Fri, Mar 19, 2021 at 02:01:19PM +0100, Jacopo Mondi wrote: > Do not register the Location property if not available from the firmware > interface instead of defaulting it to External. > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> > --- > src/libcamera/camera_sensor.cpp | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp > index 27f82071151e..f7ed91d990f7 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()) { > -- > 2.30.0 > > _______________________________________________ > libcamera-devel mailing list > libcamera-devel@lists.libcamera.org > https://lists.libcamera.org/listinfo/libcamera-devel
diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp index 27f82071151e..f7ed91d990f7 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()) {