[{"id":15074,"web_url":"https://patchwork.libcamera.org/comment/15074/","msgid":"<YCHnf3Zc0gFvEveZ@pendragon.ideasonboard.com>","date":"2021-02-09T01:38:07","subject":"Re: [libcamera-devel] [PATCH v2 5/6] android: camera_device: Use AE\n\tFPS range in template","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Tue, Jan 26, 2021 at 06:30:07PM +0100, Jacopo Mondi wrote:\n> The request template returned by requestTemplatePreview() uses an\n> arbitrary {15, 30} Auto-Exposure algorithm FPS range. Use the one\n> calculated at static metadata creation time, which is consistent with\n> the camera limits.\n> \n> Once template generation will be performed inspecting the requested\n> capture intent, the FPS range over which the AE algorithm can range\n> shall be tuned accordingly.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/android/camera_device.cpp | 26 ++++++++++++++++++++------\n>  1 file changed, 20 insertions(+), 6 deletions(-)\n> \n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index 5a8072a8a007..f3f59f7dcb77 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -1339,12 +1339,26 @@ 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\tconst int32_t *data = entry.data.i32;\n> +\t\tstd::vector<int32_t> aeFpsTarget = {\n\nstd::array<int32_t, 2> will be more efficient.\n\n> +\t\t\tdata[0], data[1],\n> +\t\t};\n> +\t\trequestTemplate->addEntry(ANDROID_CONTROL_AE_TARGET_FPS_RANGE,\n> +\t\t\t\t\t  aeFpsTarget.data(), aeFpsTarget.size());\n\nBut you could even write\n\n\t\trequestTemplate->addEntry(ANDROID_CONTROL_AE_TARGET_FPS_RANGE,\n\t\t\t\t\t  entry.data.i32, 2);\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> +\t}\n>  \n>  \tuint8_t aeAntibandingMode = ANDROID_CONTROL_AE_ANTIBANDING_MODE_AUTO;\n>  \trequestTemplate->addEntry(ANDROID_CONTROL_AE_ANTIBANDING_MODE,","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 CEF03BD162\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  9 Feb 2021 01:38:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6A4EE6160C;\n\tTue,  9 Feb 2021 02:38:34 +0100 (CET)","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 622B8613F3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  9 Feb 2021 02:38:32 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C90DE583;\n\tTue,  9 Feb 2021 02:38:31 +0100 (CET)"],"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=\"iGaB9CTN\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1612834712;\n\tbh=LLkQoqP+0lMzLZ6CmKgW4jH2c4u753nRGVl+Cz1GiVc=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=iGaB9CTNK0m8Llf52OmgpU3B2iguiiwEDCXdlFKiFcgxduDac3ogCQPI8KyEIuGWh\n\tLmRyoFQh7c72fOM6CkSqPrGNCISqgDcV3XodoO7iKaHiqwOSclII8S0lsRYtLnDjvb\n\teqsPBZ/3qftmo7ai706KkZUtZycLkB43jcdQranc=","Date":"Tue, 9 Feb 2021 03:38:07 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<YCHnf3Zc0gFvEveZ@pendragon.ideasonboard.com>","References":"<20210126173008.446321-1-jacopo@jmondi.org>\n\t<20210126173008.446321-6-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210126173008.446321-6-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v2 5/6] android: camera_device: Use AE\n\tFPS range 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>","Cc":"libcamera-devel@lists.libcamera.org","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>"}}]