From patchwork Wed Oct 7 18:57:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 10019 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 30F2BBEEDF for ; Wed, 7 Oct 2020 18:57:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id F00B3605AF; Wed, 7 Oct 2020 20:57:28 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="XskCyXrR"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 40E9A605A8 for ; Wed, 7 Oct 2020 20:57:26 +0200 (CEST) Received: from Q.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C506FA08; Wed, 7 Oct 2020 20:57:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1602097046; bh=uaMmk/7AafdplmO8uRLp0DAPjFzTNL2BkU25iHwc/hA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XskCyXrR18pMGzRXOhniOa2ycE9i4grluNumQEIlyIN8KVx2L+hoEnwfKr2cUfdZI NRPginqtICWORBafZNNZ5STef9jR3tWyvgs2+6ZHiD8UGbFlsuDFYqlBDGMRDPevcw oxVbo2drEaqYDswd7fG5f7eI0Do6Yz8HfZFZt/lY= From: Kieran Bingham To: libcamera devel Date: Wed, 7 Oct 2020 19:57:19 +0100 Message-Id: <20201007185719.3208272-3-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201007185719.3208272-1-kieran.bingham@ideasonboard.com> References: <20200911162039.61933-1-jacopo@jmondi.org> <20201007185719.3208272-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/2] DNI: How to use a draft control X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This just shows how the draft state can be used on a control or property. Expressing a draft key on the property_ids or control_ids yaml descriptions will automatically move the entrys to the draft namespace. --- src/libcamera/camera_sensor.cpp | 2 +- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 2 +- src/libcamera/property_ids.yaml | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp index 78c7ceec7c44..4e899d180d95 100644 --- a/src/libcamera/camera_sensor.cpp +++ b/src/libcamera/camera_sensor.cpp @@ -249,7 +249,7 @@ int CameraSensor::init() propertyValue = rotationControl->second.def().get(); else propertyValue = 0; - properties_.set(properties::Rotation, propertyValue); + properties_.set(properties::draft::Rotation, propertyValue); /* Enumerate, sort and cache media bus codes and sizes. */ formats_ = subdev_->formats(pad_); diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 26dbd2573e04..c1468178f163 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -270,7 +270,7 @@ CameraConfiguration::Status RPiCameraConfiguration::validate() * error means the platform can never run. Let's just print a warning * and continue regardless; the rotation is effectively set to zero. */ - int32_t rotation = data_->sensor_->properties().get(properties::Rotation); + int32_t rotation = data_->sensor_->properties().get(properties::draft::Rotation); bool success; Transform rotationTransform = transformFromRotation(rotation, &success); if (!success) diff --git a/src/libcamera/property_ids.yaml b/src/libcamera/property_ids.yaml index 7261263a9ba3..e3400cc9d469 100644 --- a/src/libcamera/property_ids.yaml +++ b/src/libcamera/property_ids.yaml @@ -28,6 +28,7 @@ controls: - Rotation: type: int32_t + draft: true description: | The camera rotation is expressed as the angular difference in degrees between two reference systems, one relative to the camera module, and