{"id":12418,"url":"https://patchwork.libcamera.org/api/patches/12418/?format=json","web_url":"https://patchwork.libcamera.org/patch/12418/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210526034720.1253094-1-paul.elder@ideasonboard.com>","date":"2021-05-26T03:47:18","name":"[libcamera-devel,v4,1/3] controls: Split FrameDurations into FrameDuration and FrameDurationLimits","commit_ref":"19772ffe102ab2e72d0f9f1403e0c02fcca4424d","pull_url":null,"state":"accepted","archived":false,"hash":"2e2263776ea4a2ca75981a6a7fe3dbb33def7762","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/?format=json","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/12418/mbox/","series":[{"id":2069,"url":"https://patchwork.libcamera.org/api/series/2069/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2069","date":"2021-05-26T03:47:18","name":"[libcamera-devel,v4,1/3] controls: Split FrameDurations into FrameDuration and FrameDurationLimits","version":4,"mbox":"https://patchwork.libcamera.org/series/2069/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12418/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12418/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 499F0C3203\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 26 May 2021 03:47:40 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9DB6568921;\n\tWed, 26 May 2021 05:47:39 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 67834602AB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 26 May 2021 05:47:37 +0200 (CEST)","from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6AF6F332;\n\tWed, 26 May 2021 05:47:35 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"LeuvGw0+\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1622000856;\n\tbh=Gv8ny0/BZG6QU6EuEdfTMM/QbW7QQ+UN4cfmNPnFwzM=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=LeuvGw0+IwSLY4ic3Oi1jk2jvc+qcKmNzdMyLuIKPIy+TcddfjtCdeOpBxJFYzT9o\n\teHXjqE4cDFeXi6X3RzNHtm7mt2yuvyWQSCyfplCJWykHVJ4rj1ybkJEOAZpfYhEuiD\n\tx4NhO1qF+ZMBVQnfx9lruIiuDef4jqXkP1UjMkT4=","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 26 May 2021 12:47:18 +0900","Message-Id":"<20210526034720.1253094-1-paul.elder@ideasonboard.com>","X-Mailer":"git-send-email 2.27.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v4 1/3] controls: Split FrameDurations\n\tinto FrameDuration and FrameDurationLimits","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"We need a separate control to report the nominal frame duration, but\nit's also useful to report the min/max frame duration values that will\nbe used. Split the FrameDurations control into FrameDuration and\nFrameDurationLimits respectively to support both of these.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n---\nChanges in v4:\n- set FrameDurationLimits (instead of FrameDuration) in the ipu3\n  pipeline handler\n\nChanges in v3:\n- mention that the control is meant to be returned in metadata\n- s/nominal/instantaneous\n---\n include/libcamera/ipa/raspberrypi.h  | 2 +-\n src/android/camera_device.cpp        | 2 +-\n src/ipa/raspberrypi/raspberrypi.cpp  | 4 ++--\n src/libcamera/control_ids.yaml       | 9 ++++++++-\n src/libcamera/pipeline/ipu3/ipu3.cpp | 7 ++++---\n 5 files changed, 16 insertions(+), 8 deletions(-)","diff":"diff --git a/include/libcamera/ipa/raspberrypi.h b/include/libcamera/ipa/raspberrypi.h\nindex d10c1733..a8790000 100644\n--- a/include/libcamera/ipa/raspberrypi.h\n+++ b/include/libcamera/ipa/raspberrypi.h\n@@ -44,7 +44,7 @@ static const ControlInfoMap Controls = {\n \t{ &controls::Sharpness, ControlInfo(0.0f, 16.0f, 1.0f) },\n \t{ &controls::ColourCorrectionMatrix, ControlInfo(-16.0f, 16.0f) },\n \t{ &controls::ScalerCrop, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) },\n-\t{ &controls::FrameDurations, ControlInfo(INT64_C(1000), INT64_C(1000000000)) },\n+\t{ &controls::FrameDurationLimits, ControlInfo(INT64_C(1000), INT64_C(1000000000)) },\n \t{ &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) },\n };\n \ndiff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex dc0c8f5f..9e267b5f 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -864,7 +864,7 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n \n \tint64_t minFrameDurationNsec = -1;\n \tint64_t maxFrameDurationNsec = -1;\n-\tconst auto frameDurationsInfo = controlsInfo.find(&controls::FrameDurations);\n+\tconst auto frameDurationsInfo = controlsInfo.find(&controls::FrameDurationLimits);\n \tif (frameDurationsInfo != controlsInfo.end()) {\n \t\tminFrameDurationNsec = frameDurationsInfo->second.min().get<int64_t>() * 1000;\n \t\tmaxFrameDurationNsec = frameDurationsInfo->second.max().get<int64_t>() * 1000;\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex e5bb8159..0c4752ec 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -859,7 +859,7 @@ void IPARPi::queueRequest(const ControlList &controls)\n \t\t\tbreak;\n \t\t}\n \n-\t\tcase controls::FRAME_DURATIONS: {\n+\t\tcase controls::FRAME_DURATION_LIMITS: {\n \t\t\tauto frameDurations = ctrl.second.get<Span<const int64_t>>();\n \t\t\tapplyFrameDurations(frameDurations[0], frameDurations[1]);\n \t\t\tbreak;\n@@ -1074,7 +1074,7 @@ void IPARPi::applyFrameDurations(double minFrameDuration, double maxFrameDuratio\n \tmaxFrameDuration_ = std::max(maxFrameDuration_, minFrameDuration_);\n \n \t/* Return the validated limits via metadata. */\n-\tlibcameraMetadata_.set(controls::FrameDurations,\n+\tlibcameraMetadata_.set(controls::FrameDurationLimits,\n \t\t\t       { static_cast<int64_t>(minFrameDuration_),\n \t\t\t\t static_cast<int64_t>(maxFrameDuration_) });\n \ndiff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml\nindex 88d81ac4..f62ade48 100644\n--- a/src/libcamera/control_ids.yaml\n+++ b/src/libcamera/control_ids.yaml\n@@ -323,7 +323,14 @@ controls:\n         step to respect the received gain factor and shall report\n         their total value in the request metadata.\n \n-  - FrameDurations:\n+  - FrameDuration:\n+      type: int64_t\n+      description: |\n+        The instantaneous frame duration from start of frame exposure to start\n+        of next exposure, expressed in microseconds. This control is meant to\n+        be returned in metadata.\n+\n+  - FrameDurationLimits:\n       type: int64_t\n       description: |\n         The minimum and maximum (in that order) frame duration,\ndiff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 25203256..2d15d488 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -983,9 +983,10 @@ int PipelineHandlerIPU3::initControls(IPU3CameraData *data)\n \t\tframeDurations[i] = frameSize / (sensorInfo.pixelRate / 1000000U);\n \t}\n \n-\tcontrols[&controls::FrameDurations] = ControlInfo(frameDurations[0],\n-\t\t\t\t\t\t\t  frameDurations[1],\n-\t\t\t\t\t\t\t  frameDurations[2]);\n+\tcontrols[&controls::FrameDurationLimits] =\n+\t\tControlInfo(frameDurations[0],\n+\t\t\t    frameDurations[1],\n+\t\t\t    frameDurations[2]);\n \n \t/*\n \t * Compute the scaler crop limits.\n","prefixes":["libcamera-devel","v4","1/3"]}