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

Jacopo Mondi jacopo at jmondi.org
Tue Aug 27 11:50:03 CEST 2019


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.
+ */
+
+/**
+ * \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.
+ */
+
 } /* namespace libcamera */
-- 
2.23.0



More information about the libcamera-devel mailing list