[libcamera-devel] [PATCH v3 4/6] libcamera: camera_sensor: Default 'location' to External
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Wed Dec 30 21:14:42 CET 2020
Hi Jacopo,
Thank you for the patch.
On Wed, Dec 30, 2020 at 07:01:18PM +0100, Jacopo Mondi wrote:
> If the sensor driver does not report the camera location default it
> to 'External' instead of 'Front'.
>
> As the camera location is used to construct the camera unique name
> presented to the user, it makes more sense to report multiple 'External'
> cameras instead of multiple 'Front' ones.
>
> Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
> src/libcamera/camera_sensor.cpp | 13 ++++++-------
> 1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp
> index 2ce19a40b448..1a316da45511 100644
> --- a/src/libcamera/camera_sensor.cpp
> +++ b/src/libcamera/camera_sensor.cpp
> @@ -352,7 +352,6 @@ int CameraSensor::initProperties()
> const ControlInfoMap &controls = subdev_->controls();
> int32_t propertyValue;
>
> - /* Camera Location: default is front location. */
> const auto &orientation = controls.find(V4L2_CID_CAMERA_ORIENTATION);
> if (orientation != controls.end()) {
> int32_t v4l2Orientation = orientation->second.def().get<int32_t>();
> @@ -361,22 +360,22 @@ int CameraSensor::initProperties()
> default:
> LOG(CameraSensor, Warning)
> << "Unsupported camera location "
> - << v4l2Orientation << ", setting to Front";
> + << v4l2Orientation << ", setting to External";
> /* Fall-through */
> + case V4L2_CAMERA_ORIENTATION_EXTERNAL:
> + propertyValue = properties::CameraLocationExternal;
> + break;
> case V4L2_CAMERA_ORIENTATION_FRONT:
> propertyValue = properties::CameraLocationFront;
> break;
> case V4L2_CAMERA_ORIENTATION_BACK:
> propertyValue = properties::CameraLocationBack;
> break;
> - case V4L2_CAMERA_ORIENTATION_EXTERNAL:
> - propertyValue = properties::CameraLocationExternal;
> - break;
> }
> } else {
> - propertyValue = properties::CameraLocationFront;
> + propertyValue = properties::CameraLocationExternal;
> LOG(CameraSensor, Debug)
> - << "Location property defaulted to 'Front Camera'";
> + << "Location property defaulted to 'External Camera'";
> }
> properties_.set(properties::Location, propertyValue);
>
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list