[{"id":13391,"web_url":"https://patchwork.libcamera.org/comment/13391/","msgid":"<20201022025943.GC3942@pendragon.ideasonboard.com>","date":"2020-10-22T02:59:43","subject":"Re: [libcamera-devel] [PATCH v3 11/14] android: camera_device:\n\tReport PIPELINE_MAX_DEPTH","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 Wed, Oct 21, 2020 at 04:36:32PM +0200, Jacopo Mondi wrote:\n> Register the ANDROID_REQUEST_PIPELINE_MAX_DEPTH static property\n> inspecting the value reported by the pipeline handler.\n> \n> If the Camera does not report any suitable value, default the\n> static property to 2.\n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\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 | 15 ++++++++++++---\n>  1 file changed, 12 insertions(+), 3 deletions(-)\n> \n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index e9404c2f3004..8166b09bb69a 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -13,6 +13,7 @@\n>  #include <tuple>\n>  #include <vector>\n>  \n> +#include <libcamera/control_ids.h>\n>  #include <libcamera/controls.h>\n>  #include <libcamera/formats.h>\n>  #include <libcamera/property_ids.h>\n> @@ -591,6 +592,8 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n>  \t\treturn nullptr;\n>  \t}\n>  \n> +\tconst ControlInfoMap &controlsInfo = camera_->controls();\n> +\n>  \t/* Color correction static metadata. */\n>  \tstd::vector<uint8_t> aberrationModes = {\n>  \t\tANDROID_COLOR_CORRECTION_ABERRATION_MODE_OFF,\n> @@ -882,9 +885,15 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n>  \tstaticMetadata_->addEntry(ANDROID_REQUEST_PARTIAL_RESULT_COUNT,\n>  \t\t\t\t  &partialResultCount, 1);\n>  \n> -\tuint8_t maxPipelineDepth = 2;\n> -\tstaticMetadata_->addEntry(ANDROID_REQUEST_PIPELINE_MAX_DEPTH,\n> -\t\t\t\t  &maxPipelineDepth, 1);\n> +\t{\n> +\t\t/* Default the value to 2 if not reported by the camera. */\n> +\t\tuint8_t maxPipelineDepth = 2;\n> +\t\tconst auto &infoMap = controlsInfo.find(&controls::draft::PipelineDepth);\n> +\t\tif (infoMap != controlsInfo.end())\n> +\t\t\tmaxPipelineDepth = infoMap->second.max().get<int32_t>();\n> +\t\tstaticMetadata_->addEntry(ANDROID_REQUEST_PIPELINE_MAX_DEPTH,\n> +\t\t\t\t\t  &maxPipelineDepth, 1);\n> +\t}\n>  \n>  \t/* LIMITED does not support reprocessing. */\n>  \tuint32_t maxNumInputStreams = 0;","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 16532C3D3C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 22 Oct 2020 03:00:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 85FDF61059;\n\tThu, 22 Oct 2020 05:00:31 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A1D576034F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 22 Oct 2020 05:00:29 +0200 (CEST)","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 2158053;\n\tThu, 22 Oct 2020 05:00:29 +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=\"cpOLXfYu\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1603335629;\n\tbh=u5GldJEljdWCeChua9KerCVBkwIbGTTZ4MarZdc0f1M=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=cpOLXfYuqaN83D71nXkGMhVJxoVjyZhYREnUi2SpZ7JV7zEHiwgQ68ErDvof7VXZA\n\tsk/uirdCysFxLhNXTMu4+xKBV2xccVAG8+RnyBw3HBDE+u4XgCeZ5kys8/U07bUt9B\n\tf5E0pDySooNhXbXoV1yjXwvfPMM0Emw43/WTyezc=","Date":"Thu, 22 Oct 2020 05:59:43 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<20201022025943.GC3942@pendragon.ideasonboard.com>","References":"<20201021143635.22846-1-jacopo@jmondi.org>\n\t<20201021143635.22846-12-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20201021143635.22846-12-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v3 11/14] android: camera_device:\n\tReport PIPELINE_MAX_DEPTH","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>"}}]