[{"id":15075,"web_url":"https://patchwork.libcamera.org/comment/15075/","msgid":"<YCHoGHdInZHFf/z9@pendragon.ideasonboard.com>","date":"2021-02-09T01:40:40","subject":"Re: [libcamera-devel] [PATCH v2 6/6] android: camera_device: Return\n\tAE FPS range","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:08PM +0100, Jacopo Mondi wrote:\n> The result metadata reported an arbitrary {30, 30} FPS range for the\n\ns/reported/reports/\n\n> AE algorithm.\n> \n> The actual FPS range should be returned in the Request::metadata, but\n> as libcamera currently does not support that feature temporary work\n\ns/temporary/temporarily/\n\n> around the issue and return the FPS range requested by the camera\n> framework.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/android/camera_device.cpp | 19 ++++++++++++++++---\n>  1 file changed, 16 insertions(+), 3 deletions(-)\n> \n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index f3f59f7dcb77..6339ef257906 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -1951,6 +1951,7 @@ std::unique_ptr<CameraMetadata>\n>  CameraDevice::getResultMetadata(Camera3RequestDescriptor *descriptor,\n>  \t\t\t\tint64_t timestamp)\n>  {\n> +\tconst CameraMetadata &settings = descriptor->settings_;\n>  \tconst ControlList &metadata = descriptor->request_->metadata();\n>  \n>  \t/*\n> @@ -1977,9 +1978,21 @@ CameraDevice::getResultMetadata(Camera3RequestDescriptor *descriptor,\n>  \tvalue = ANDROID_CONTROL_AE_MODE_ON;\n>  \tresultMetadata->addEntry(ANDROID_CONTROL_AE_MODE, &value, 1);\n>  \n> -\tstd::vector<int32_t> aeFpsTarget = { 30, 30 };\n> -\tresultMetadata->addEntry(ANDROID_CONTROL_AE_TARGET_FPS_RANGE,\n> -\t\t\t\t aeFpsTarget.data(), aeFpsTarget.size());\n> +\tcamera_metadata_ro_entry_t entry;\n> +\tbool found = settings.getEntry(ANDROID_CONTROL_AE_TARGET_FPS_RANGE, &entry);\n> +\tif (found) {\n> +\t\t/*\n> +\t\t * \\todo Retrieve the AE FPS range from the libcamera metadata.\n> +\t\t * As libcamera does not support that control, as a temporary\n> +\t\t * workaround return what the framework asked.\n> +\t\t */\n> +\t\tconst int32_t *data = entry.data.i32;\n> +\t\tstd::vector<int32_t> aeFpsTarget = {\n> +\t\t\tdata[0], data[1],\n> +\t\t};\n> +\t\tresultMetadata->addEntry(ANDROID_CONTROL_AE_TARGET_FPS_RANGE,\n> +\t\t\t\t\t aeFpsTarget.data(), aeFpsTarget.size());\n\n\t\tresultMetadata->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>  \tvalue = ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER_IDLE;\n>  \tresultMetadata->addEntry(ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER,","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 83777BD162\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  9 Feb 2021 01:41:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E588D61613;\n\tTue,  9 Feb 2021 02:41:05 +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 F04D0613F3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  9 Feb 2021 02:41:04 +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 67CCA583;\n\tTue,  9 Feb 2021 02:41:04 +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=\"e456NQWe\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1612834864;\n\tbh=XxK4hbPoEff52NEgCOMQmR4mtWWpAL12Ea8xDAAikbw=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=e456NQWeUOH63sdpX9hkP4jPVRgM/7dnlSS0iVV5g7V1n14owrNtkHWoD1MIGS3LW\n\thbMDr7pF+AlVFkc6Jc8ZfaTVSVSM4n8E/fpou6gsHek6OFRBSqvBp6YLpK9nN9wpAc\n\tt4zV7TCTWv0j5yP3iTdZwydtKuIgJO+0DS1/jxBQ=","Date":"Tue, 9 Feb 2021 03:40:40 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<YCHoGHdInZHFf/z9@pendragon.ideasonboard.com>","References":"<20210126173008.446321-1-jacopo@jmondi.org>\n\t<20210126173008.446321-7-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210126173008.446321-7-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v2 6/6] android: camera_device: Return\n\tAE FPS range","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>"}}]