[{"id":15546,"web_url":"https://patchwork.libcamera.org/comment/15546/","msgid":"<YEa6k88PoWE8TaDZ@pendragon.ideasonboard.com>","date":"2021-03-09T00:00:19","subject":"Re: [libcamera-devel] [PATCH 2/3] android: camera_device: Fail\n\ttemplate on no 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 Mon, Mar 08, 2021 at 06:07:27PM +0100, Jacopo Mondi wrote:\n> The camera supported FPS range is crucial to distinguish between\n> capture templates for preview and video recording. If the pipeline\n> handler did not specify an available FPS range by registering the\n> controls::FrameDurations property so far the control was simply not\n> added to the generated capture template.\n> \n> In order to prepare to generate templates for video recording which\n> require a fixed FPS range, fail earlier in generating any template at\n> all if the available FPS range is not provided by the Camera.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/android/camera_device.cpp | 36 +++++++++++++++++++----------------\n>  1 file changed, 20 insertions(+), 16 deletions(-)\n> \n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index c72e0c73eb5e..0621ec26feb8 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -1386,6 +1386,26 @@ CameraMetadata *CameraDevice::requestTemplatePreview()\n>  \t\treturn nullptr;\n>  \t}\n>  \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\tLOG(HAL, Error) << \"Cannot create capture template without FPS range\";\n> +\t\treturn nullptr;\n> +\t}\n> +\n> +\t/*\n> +\t * \\todo Depending on the requested CaptureIntent, the FPS range\n> +\t * needs to be adjusted. For example, the capture template for\n> +\t * video capture intent shall report a fixed value.\n> +\t *\n> +\t * Also assume the AE_AVAILABLE_TARGET_FPS_RANGE static metadata\n> +\t * has been assembled as {{min, max} {max, max}}.\n> +\t */\n> +\trequestTemplate->addEntry(ANDROID_CONTROL_AE_TARGET_FPS_RANGE,\n> +\t\t\t\t  entry.data.i32, 2);\n> +\n>  \tuint8_t aeMode = ANDROID_CONTROL_AE_MODE_ON;\n>  \trequestTemplate->addEntry(ANDROID_CONTROL_AE_MODE,\n>  \t\t\t\t  &aeMode, 1);\n> @@ -1402,22 +1422,6 @@ CameraMetadata *CameraDevice::requestTemplatePreview()\n>  \trequestTemplate->addEntry(ANDROID_CONTROL_AE_LOCK,\n>  \t\t\t\t  &aeLock, 1);\n>  \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>  \t\t\t\t  &aeAntibandingMode, 1);","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 6483DBD80C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  9 Mar 2021 00:00:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 24DDB6051F;\n\tTue,  9 Mar 2021 01:00:53 +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 0AD73602E4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  9 Mar 2021 01:00:52 +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 8C09399;\n\tTue,  9 Mar 2021 01:00:51 +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=\"OFRxgW1A\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1615248051;\n\tbh=9rJBvSUgi1iwmXYMwcw2QCeHnSJ85sj0csbzjwF4VqQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=OFRxgW1AiYhxTNEAf5CE6gDAl4w6d3k+FcNcDlLX1y7KWAofjB/56hsw1p0pPECxn\n\t/taRyXsH2P8JSWPTy12Bau5JCSk7ukWikCPkZt6t/HH/4X7DHMylPE2ZlHb5J4t1GS\n\tjCSx2i5KG55hoCnLf3TDyJID0N2R2ywvWsnbk8Pk=","Date":"Tue, 9 Mar 2021 02:00:19 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<YEa6k88PoWE8TaDZ@pendragon.ideasonboard.com>","References":"<20210308170728.2212649-1-jacopo@jmondi.org>\n\t<20210308170728.2212649-3-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210308170728.2212649-3-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH 2/3] android: camera_device: Fail\n\ttemplate on no 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>"}}]