[libcamera-devel] [PATCH v2 3/7] libcamera: controls: Add camera properties IDs

Niklas Söderlund niklas.soderlund at ragnatech.se
Wed Aug 28 13:08:20 CEST 2019


Hi Jacopo,

Thanks for your work.

On 2019-08-27 11:50:03 +0200, Jacopo Mondi wrote:
> Add the PropertyID enumeration where to list the camera static
> properties supported by libcamera. Initially add the Location and
> Rotation properties
> 
> Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
> ---
>  include/libcamera/control_ids.h | 11 +++++++
>  src/libcamera/controls.cpp      | 55 +++++++++++++++++++++++++++++++++
>  2 files changed, 66 insertions(+)
> 
> diff --git a/include/libcamera/control_ids.h b/include/libcamera/control_ids.h
> index 75b6a2d5cafe..d8c3c3265ee6 100644
> --- a/include/libcamera/control_ids.h
> +++ b/include/libcamera/control_ids.h
> @@ -21,6 +21,17 @@ enum ControlId {
>  	ManualGain,
>  };
>  
> +enum CameraLocation {
> +	CAMERA_LOCATION_EXTERNAL,
> +	CAMERA_LOCATION_FRONT,
> +	CAMERA_LOCATION_BACK,
> +};
> +
> +enum PropertyId {
> +	Location,
> +	Rotation,
> +};
> +
>  } /* namespace libcamera */
>  
>  namespace std {
> diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp
> index 9adc3badc254..9562ecc189bb 100644
> --- a/src/libcamera/controls.cpp
> +++ b/src/libcamera/controls.cpp
> @@ -555,4 +555,59 @@ void ControlList::update(const ControlList &other)
>   * Specify a fixed gain parameter
>   */
>  
> +/**
> + * \enum CameraLocation
> + * \brief List the supported mounting location of a camera
> + */
> +
> +/**
> + * \var CameraLocation::CAMERA_LOCATION_EXTERNAL
> + * \brief Identify an external camera
> + *
> + * The camera is connected to the main device through extension cables
> + * and is freely movable. Typical examples of externally mounted cameras are
> + * webcams and digital camera devices.
> + */

Maybe this can be rephrased to not mention cables, maybe one day there 
will be a Bluetooth enabled camera which would be external ;-)

> +
> +/**
> + * \var CameraLocation::CAMERA_LOCATION_FRONT
> + * \brief Identify a camera mounted in the device front location
> + *
> + * The camera is mounted on the front side of the device, which is typically
> + * the user facing side.
> + */
> +
> +/**
> + * \var CameraLocation::CAMERA_LOCATION_BACK
> + * \brief Identify a camera mounted in the device back location
> + *
> + * The camera is mounted on the back side of the device, which is typically
> + * the side opposed to the front one.
> + */
> +
> +/**
> + * \enum PropertyId
> + * \brief Numerical properties ID
> + *
> + * List the identifiers of the static properties exposed by a Camera.
> + */
> +
> +/**
> + * \var PropertyId::Location
> + * \brief The camera mounting location
> + *
> + * The Camera device location is expressed as the position relative to the
> + * device intended usage orientation. Possible values are identified by the
> + * libcamera::CameraLocation enumeration.
> + */
> +
> +/**
> + * \var PropertyId::Rotation
> + * \brief The camera sensor rotation
> + *
> + * The Camera rotation is expressed as counter-clockwise rotation in degrees
> + * in respect to the intended device orientation. Typical values are 0 for
> + * upright mounted cameras, and 180 for cameras mounted upside down.
> + */

Out of curiosity why counter-clockwise and not clockwise? ;-)

I think this could be improved by explicitly stating where the observe 
is when examining the rotation. Am I looking into the camera when I 
rotate it or am "I" the camera and rotate. Maybe this is a bit over 
zealous, bit I always find this type of information lacking when I read 
this type of information and have to find out by train and error ;-)

> +
>  } /* namespace libcamera */
> -- 
> 2.23.0
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

-- 
Regards,
Niklas Söderlund


More information about the libcamera-devel mailing list