[{"id":24015,"web_url":"https://patchwork.libcamera.org/comment/24015/","msgid":"<20220721074244.GG3984498@pyrite.rasen.tech>","date":"2022-07-21T07:42:44","subject":"Re: [libcamera-devel] [PATCH v2 1/4] ipa: libipa: algorithm: Add\n\tqueueRequest() to the Algorithm class","submitter":{"id":97,"url":"https://patchwork.libcamera.org/api/people/97/","name":"Nicolas Dufresne via libcamera-devel","email":"libcamera-devel@lists.libcamera.org"},"content":"Hi Florian,\n\nOn Wed, Jul 20, 2022 at 05:42:18PM +0200, Florian Sylvestre via libcamera-devel wrote:\n> Add queueRequest() function to the Algorithm class. The queueRequest() function\n> provides controls values coming from the application to each algorithm.\n> Each algorithm is responsible for retrieving the controls associated to them.\n> \n> Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  src/ipa/libipa/algorithm.cpp | 16 ++++++++++++++++\n>  src/ipa/libipa/algorithm.h   |  8 ++++++++\n>  2 files changed, 24 insertions(+)\n> \n> diff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/libipa/algorithm.cpp\n> index 8549fe3f..38200e57 100644\n> --- a/src/ipa/libipa/algorithm.cpp\n> +++ b/src/ipa/libipa/algorithm.cpp\n> @@ -81,6 +81,22 @@ namespace ipa {\n>   * includes setting fields and flags that enable those processing blocks.\n>   */\n>  \n> +/**\n> + * \\fn Algorithm::queueRequest()\n> + * \\brief Provide control values to the algorithm\n> + * \\param[in] context The shared IPA context\n> + * \\param[in] frame The frame number to apply the control values\n> + * \\param[in] controls The list of user controls\n> + *\n> + * This function is called for each request queued to the camera. It provides\n> + * the controls stored in the request to the algorithm. The \\a frame number\n> + * is the Request sequence number and identifies the desired corresponding\n> + * frame to target for the controls to take effect.\n> + *\n> + * Algorithms shall read the applicable controls and store their value for later\n> + * use during frame processing.\n> + */\n> +\n>  /**\n>   * \\fn Algorithm::process()\n>   * \\brief Process ISP statistics, and run algorithm operations\n> diff --git a/src/ipa/libipa/algorithm.h b/src/ipa/libipa/algorithm.h\n> index 2a8871d8..ccc659a6 100644\n> --- a/src/ipa/libipa/algorithm.h\n> +++ b/src/ipa/libipa/algorithm.h\n> @@ -9,6 +9,8 @@\n>  #include <memory>\n>  #include <string>\n>  \n> +#include <libcamera/controls.h>\n> +\n>  namespace libcamera {\n>  \n>  class YamlObject;\n> @@ -40,6 +42,12 @@ public:\n>  \t{\n>  \t}\n>  \n> +\tvirtual void queueRequest([[maybe_unused]] typename Module::Context &context,\n> +\t\t\t\t  [[maybe_unused]] const uint32_t frame,\n> +\t\t\t\t  [[maybe_unused]] const ControlList &controls)\n> +\t{\n> +\t}\n> +\n>  \tvirtual void process([[maybe_unused]] typename Module::Context &context,\n>  \t\t\t     [[maybe_unused]] typename Module::FrameContext *frameContext,\n>  \t\t\t     [[maybe_unused]] const typename Module::Stats *stats)\n> -- \n> 2.34.1\n>","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 61638BD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 21 Jul 2022 07:42:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8B44B63312;\n\tThu, 21 Jul 2022 09:42:53 +0200 (CEST)","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 B248B603F5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 21 Jul 2022 09:42:52 +0200 (CEST)","from pyrite.rasen.tech (softbank036240121080.bbtec.net\n\t[36.240.121.80])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 28EFF496;\n\tThu, 21 Jul 2022 09:42:50 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1658389373;\n\tbh=dxEbc4fKoYP01XdbCmi8CJcXvR1QGIXneJ18q5ZT7+w=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=umd4nf7yPeOKKf/cKT4cG3UwJ3JOkJX4KwekC/Jw/0iKoHL7hT0d8uwWL0/urrNox\n\tQfaU4w96mwOJlzQjHht0Zb06UvpTV7cE5zc66IvRIAJGsFSM82y32D0Whqr+NtTOg3\n\t5PSMxEZHfNsm6X4+OrpWpnmLMdxwSGhs/0aCl6Uj+JCeLYsNTPH5IslzrIH3ptwPEr\n\tGBje461uiZRo32QlGTng4Sx3m4baP9m1y5xbU3INKiqr1UzQR06frexF9pRlQUe2xP\n\tNF0vKfZZJMhXAmXfnoM+O13cmfKNxc9BAQJdiFXKvoCYYokppEmIp1CqokBaMRL8W3\n\twcuRg0g1Qqgxg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1658389372;\n\tbh=dxEbc4fKoYP01XdbCmi8CJcXvR1QGIXneJ18q5ZT7+w=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Db0+EECWvtZHOL6YClKoZ+Tqd6gTbWCg8bWyyiLc71P6gHPDxUhXwcx+VW8Yl1tgY\n\tenkqwSXJ2vCjwZiI+04H4aSls6dGYQTJ4G7d6L0is8POAgTvyce+L2g49V9+9yWqqc\n\tRSKv86txDdjTg2PGe7N6r6o+tP8psFpu7ZxKNhfA="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"Db0+EECW\"; dkim-atps=neutral","Date":"Thu, 21 Jul 2022 16:42:44 +0900","To":"Florian Sylvestre <fsylvestre@baylibre.com>","Message-ID":"<20220721074244.GG3984498@pyrite.rasen.tech>","References":"<20220720154221.50937-1-fsylvestre@baylibre.com>\n\t<20220720154221.50937-2-fsylvestre@baylibre.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20220720154221.50937-2-fsylvestre@baylibre.com>","Subject":"Re: [libcamera-devel] [PATCH v2 1/4] ipa: libipa: algorithm: Add\n\tqueueRequest() to the Algorithm class","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>","From":"Paul Elder via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"paul.elder@ideasonboard.com","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":24025,"web_url":"https://patchwork.libcamera.org/comment/24025/","msgid":"<165840797074.2228597.3582341881085829337@Monstersaurus>","date":"2022-07-21T12:52:50","subject":"Re: [libcamera-devel] [PATCH v2 1/4] ipa: libipa: algorithm: Add\n\tqueueRequest() to the Algorithm class","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Florian,\n\nQuoting Florian Sylvestre via libcamera-devel (2022-07-20 16:42:18)\n> Add queueRequest() function to the Algorithm class. The queueRequest() function\n> provides controls values coming from the application to each algorithm.\n> Each algorithm is responsible for retrieving the controls associated to them.\n> \n> Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nI think this is going the right direction for what I had in mind too,\nand you may have seen I've picked this into my development branch [0]\n\nhttps://lists.libcamera.org/pipermail/libcamera-devel/2022-July/032471.html\n\nI've tried to get the changes from v1 to v2 in that branch as well, but\nI originally picked from v1, so I might have to take a closer look\nlater.\n\nI don't really mind which series goes in first, I can rebase my work\naccordingly.\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n>  src/ipa/libipa/algorithm.cpp | 16 ++++++++++++++++\n>  src/ipa/libipa/algorithm.h   |  8 ++++++++\n>  2 files changed, 24 insertions(+)\n> \n> diff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/libipa/algorithm.cpp\n> index 8549fe3f..38200e57 100644\n> --- a/src/ipa/libipa/algorithm.cpp\n> +++ b/src/ipa/libipa/algorithm.cpp\n> @@ -81,6 +81,22 @@ namespace ipa {\n>   * includes setting fields and flags that enable those processing blocks.\n>   */\n>  \n> +/**\n> + * \\fn Algorithm::queueRequest()\n> + * \\brief Provide control values to the algorithm\n> + * \\param[in] context The shared IPA context\n> + * \\param[in] frame The frame number to apply the control values\n> + * \\param[in] controls The list of user controls\n> + *\n> + * This function is called for each request queued to the camera. It provides\n> + * the controls stored in the request to the algorithm. The \\a frame number\n> + * is the Request sequence number and identifies the desired corresponding\n> + * frame to target for the controls to take effect.\n> + *\n> + * Algorithms shall read the applicable controls and store their value for later\n> + * use during frame processing.\n> + */\n> +\n>  /**\n>   * \\fn Algorithm::process()\n>   * \\brief Process ISP statistics, and run algorithm operations\n> diff --git a/src/ipa/libipa/algorithm.h b/src/ipa/libipa/algorithm.h\n> index 2a8871d8..ccc659a6 100644\n> --- a/src/ipa/libipa/algorithm.h\n> +++ b/src/ipa/libipa/algorithm.h\n> @@ -9,6 +9,8 @@\n>  #include <memory>\n>  #include <string>\n>  \n> +#include <libcamera/controls.h>\n> +\n>  namespace libcamera {\n>  \n>  class YamlObject;\n> @@ -40,6 +42,12 @@ public:\n>         {\n>         }\n>  \n> +       virtual void queueRequest([[maybe_unused]] typename Module::Context &context,\n> +                                 [[maybe_unused]] const uint32_t frame,\n> +                                 [[maybe_unused]] const ControlList &controls)\n> +       {\n> +       }\n> +\n>         virtual void process([[maybe_unused]] typename Module::Context &context,\n>                              [[maybe_unused]] typename Module::FrameContext *frameContext,\n>                              [[maybe_unused]] const typename Module::Stats *stats)\n> -- \n> 2.34.1\n>","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 AC3C8BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 21 Jul 2022 12:52:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 620D46330F;\n\tThu, 21 Jul 2022 14:52:54 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0308D601B8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 21 Jul 2022 14:52:53 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9993A496;\n\tThu, 21 Jul 2022 14:52:52 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1658407974;\n\tbh=NquL7C0s9ZBmk5+eZ1KtDlQB1DfMH8D0uSnJijr9eGo=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=L37jBOfv8RC0ovsjr9D0G/I0cLjAiMnQueDeeT5fw6dmCtjaJwc/GwohKk9cMnJ5i\n\tOZncwhnmg4Im6C/C8vUV1SPPq0YEPY1UZ20yHZHKCCE/w+gjcsKuBkvn6wwayxPyJ1\n\tyaTv4tIxI0frIwMEqPUEc5Ac7cqGf/+fmzeuyM6BJ8jzf4Hax5k4qJcxHZ/dLsuEuG\n\ti15wEDyBbAOpNGtxuZIx2P/+NNa5zvjZhN7kJSHf91T7bRHqqv1ti3KTJN3MyfB+Fr\n\tP4Z6+dN7ddIgt9I7Cs2CpHBGxWDc7uopeHSifVMIXXPXohO5C/wlZAMVb4mUtUJblN\n\t15FHUg+34zb1w==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1658407972;\n\tbh=NquL7C0s9ZBmk5+eZ1KtDlQB1DfMH8D0uSnJijr9eGo=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=D8PHcL9xIk+mHicZZ8q7D2MGJ88yJs2YfwbDVF/CpD00J7bLNQw4fFtWHFi4xXpMZ\n\tbXrdSSBRu0SYMvVvyt+6QzsBjO71U+6nrreFw3nBYqRJWqEXp3cUjo4GzD4exe/p0Q\n\t2VDNrW3aL/lhmcxL1cn91siuxfcCtBqL3qnRBM5s="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"D8PHcL9x\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220720154221.50937-2-fsylvestre@baylibre.com>","References":"<20220720154221.50937-1-fsylvestre@baylibre.com>\n\t<20220720154221.50937-2-fsylvestre@baylibre.com>","To":"Florian Sylvestre <fsylvestre@baylibre.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 21 Jul 2022 13:52:50 +0100","Message-ID":"<165840797074.2228597.3582341881085829337@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v2 1/4] ipa: libipa: algorithm: Add\n\tqueueRequest() to the Algorithm class","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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]