From patchwork Tue Aug 27 09:50:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 1859 X-Patchwork-Delegate: jacopo@jmondi.org Return-Path: Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8256C60E38 for ; Tue, 27 Aug 2019 11:48:46 +0200 (CEST) Received: from uno.homenet.telecomitalia.it (unknown [87.18.63.98]) (Authenticated sender: jacopo@jmondi.org) by relay11.mail.gandi.net (Postfix) with ESMTPSA id C8C3C100003; Tue, 27 Aug 2019 09:48:45 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Tue, 27 Aug 2019 11:50:03 +0200 Message-Id: <20190827095008.11405-4-jacopo@jmondi.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190827095008.11405-1-jacopo@jmondi.org> References: <20190827095008.11405-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 3/7] libcamera: controls: Add camera properties IDs X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 09:48:46 -0000 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 --- 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 */