{"id":11360,"url":"https://patchwork.libcamera.org/api/patches/11360/?format=json","web_url":"https://patchwork.libcamera.org/patch/11360/","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":"<20210222105222.393677-5-jacopo@jmondi.org>","date":"2021-02-22T10:52:21","name":"[libcamera-devel,v3,4/5] android: camera_device: Use AE FPS range in template","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"6ecf21b53374483cfc5092b57053a20bd7c8cfbd","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/11360/mbox/","series":[{"id":1717,"url":"https://patchwork.libcamera.org/api/series/1717/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1717","date":"2021-02-22T10:52:17","name":"android: Report frame durations","version":3,"mbox":"https://patchwork.libcamera.org/series/1717/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/11360/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/11360/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 0792CBD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 22 Feb 2021 10:52:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DA0A168A19;\n\tMon, 22 Feb 2021 11:52:03 +0100 (CET)","from relay11.mail.gandi.net (relay11.mail.gandi.net\n\t[217.70.178.231])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9C50C68A0E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 22 Feb 2021 11:51:59 +0100 (CET)","from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay11.mail.gandi.net (Postfix) with ESMTPSA id 3AF8D100008\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 22 Feb 2021 10:51:59 +0000 (UTC)"],"From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 22 Feb 2021 11:52:21 +0100","Message-Id":"<20210222105222.393677-5-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.30.0","In-Reply-To":"<20210222105222.393677-1-jacopo@jmondi.org>","References":"<20210222105222.393677-1-jacopo@jmondi.org>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v3 4/5] android: camera_device: Use AE FPS\n\trange in template","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>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The request template returned by requestTemplatePreview() uses an\narbitrary {15, 30} Auto-Exposure algorithm FPS range. Use the one\ncalculated at static metadata creation time, which is consistent with\nthe camera limits.\n\nOnce template generation will be performed inspecting the requested\ncapture intent, the FPS range over which the AE algorithm can range\nshall be tuned accordingly.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/android/camera_device.cpp | 21 +++++++++++++++------\n 1 file changed, 15 insertions(+), 6 deletions(-)","diff":"diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 1658e4a4dd9f..c0939eaf27ac 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -1418,12 +1418,21 @@ CameraMetadata *CameraDevice::requestTemplatePreview()\n \trequestTemplate->addEntry(ANDROID_CONTROL_AE_LOCK,\n \t\t\t\t  &aeLock, 1);\n \n-\tstd::vector<int32_t> aeFpsTarget = {\n-\t\t15, 30,\n-\t};\n-\trequestTemplate->addEntry(ANDROID_CONTROL_AE_TARGET_FPS_RANGE,\n-\t\t\t\t  aeFpsTarget.data(),\n-\t\t\t\t  aeFpsTarget.size());\n+\t/* Get the FPS range registered in the static metadata. */\n+\tcamera_metadata_ro_entry_t entry;\n+\tbool found = staticMetadata_->getEntry(ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,\n+\t\t\t\t\t       &entry);\n+\tif (found)\n+\t\t/*\n+\t\t * \\todo Depending on the requested CaptureIntent, the FPS range\n+\t\t * needs to be adjusted. For example, the capture template for\n+\t\t * video capture intent shall report a fixed value.\n+\t\t *\n+\t\t * Also assume the AE_AVAILABLE_TARGET_FPS_RANGE static metadata\n+\t\t * has been assembled as {{min, max} {max, max}}.\n+\t\t */\n+\t\trequestTemplate->addEntry(ANDROID_CONTROL_AE_TARGET_FPS_RANGE,\n+\t\t\t\t\t  entry.data.i32, 2);\n \n \tuint8_t aeAntibandingMode = ANDROID_CONTROL_AE_ANTIBANDING_MODE_AUTO;\n \trequestTemplate->addEntry(ANDROID_CONTROL_AE_ANTIBANDING_MODE,\n","prefixes":["libcamera-devel","v3","4/5"]}