Show a patch.

GET /api/1.1/patches/17641/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 17641,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/17641/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/17641/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20221019205614.25751-2-laurent.pinchart@ideasonboard.com>",
    "date": "2022-10-19T20:56:12",
    "name": "[libcamera-devel,v2,1/3] ipa: Pass metadata to Algorithm::process() function",
    "commit_ref": "c20ca6587dcba983e192c65124accacb3a0d21ac",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "e8d69e84dc7f2e10c6ffe8ac4ce0c91c516ceb51",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/17641/mbox/",
    "series": [
        {
            "id": 3570,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3570/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3570",
            "date": "2022-10-19T20:56:11",
            "name": "ipa: Fill metadata in individual algorithms",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/3570/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/17641/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/17641/checks/",
    "tags": {},
    "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 68414C327C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 19 Oct 2022 20:56:43 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8A21A62E65;\n\tWed, 19 Oct 2022 22:56:41 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3E3D362DFA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 19 Oct 2022 22:56:40 +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 C366D570\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 19 Oct 2022 22:56:39 +0200 (CEST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1666213001;\n\tbh=prmlCGxeEhrPEMzwd6NcmlMsXzpOxQ5G6eErNmWO2S8=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=dQvtQK/M45GPOOgvTJkl1k1YljBjmgK+cXjKhrFitr6ysU3NIoD7qkjxMc73jrgxK\n\tVa0iB3cMR/b84p5iOCs0BivGBBxYxCLqIFpc0ik9i5VbmNg2BC2dKqv6TiYj3KPycu\n\t0zAeWT8Dhcc47V0aF8sNJ4CrxhCQLlysaYQI223G5UEMf/yg+oXk692Bmm9Inc05Np\n\t2bis3WKBhv4M35Wiw5EP9d4gcl31dlIc0IC+g3d3FYujZjw19HTJPBttYQxY4luA97\n\tOkqWygeorbqDhBU7Xk27Ztp388JftmxLYWtfV3VJmFg/1jJhqt1fPOGDbJgtMVVO5b\n\tY+p6gg7bWM2/g==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1666213000;\n\tbh=prmlCGxeEhrPEMzwd6NcmlMsXzpOxQ5G6eErNmWO2S8=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=Hm3jMd1fjICspX96Ul0KhfVvE19k+MiSPX1x5QD8z2T8tubCPfsMmm64MukyRFSAK\n\t6qn5mFAa+doldXf4MX9zp6GYKW0jomcDrhfRoI+RRdIGaBCWfYdXUenozoBU30DLuH\n\tDu265fVeIX5fLzBm5ANiqIAgUUj10IuGM7Yo5/kg="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"Hm3jMd1f\"; dkim-atps=neutral",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 19 Oct 2022 23:56:12 +0300",
        "Message-Id": "<20221019205614.25751-2-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.37.3",
        "In-Reply-To": "<20221019205614.25751-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20221019205614.25751-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 1/3] ipa: Pass metadata to\n\tAlgorithm::process() function",
        "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": "Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Extend the Algorithm::process() function with a metadata control list,\nto be filled by individual algorithms with frame metadata. Update the\nrkisp1 and ipu3 IPA modules accordingly, and drop the dead code in the\nIPARkISP1::prepareMetadata() function while at it.\n\nThis only creates the infrastructure, filling metadata in individual\nalgorithms will be handled separately.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\nChanges since v1:\n\n- Pass metadata as last argument to process()\n- Add missing documentation update in src/ipa/rkisp1/algorithms/agc.cpp\n- Correctly send metadata to pipeline handler in IPU3 IPA module\n---\n src/ipa/ipu3/algorithms/af.cpp           |  4 +++-\n src/ipa/ipu3/algorithms/af.h             |  3 ++-\n src/ipa/ipu3/algorithms/agc.cpp          |  4 +++-\n src/ipa/ipu3/algorithms/agc.h            |  3 ++-\n src/ipa/ipu3/algorithms/awb.cpp          |  3 ++-\n src/ipa/ipu3/algorithms/awb.h            |  3 ++-\n src/ipa/ipu3/algorithms/tone_mapping.cpp |  4 +++-\n src/ipa/ipu3/algorithms/tone_mapping.h   |  3 ++-\n src/ipa/ipu3/ipu3.cpp                    | 14 +++++++-------\n src/ipa/libipa/algorithm.cpp             |  5 +++--\n src/ipa/libipa/algorithm.h               |  3 ++-\n src/ipa/rkisp1/algorithms/agc.cpp        |  4 +++-\n src/ipa/rkisp1/algorithms/agc.h          |  3 ++-\n src/ipa/rkisp1/algorithms/awb.cpp        |  3 ++-\n src/ipa/rkisp1/algorithms/awb.h          |  5 +++--\n src/ipa/rkisp1/rkisp1.cpp                | 17 +++--------------\n 16 files changed, 44 insertions(+), 37 deletions(-)",
    "diff": "diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp\nindex 75632aa39d21..5a0452a5719b 100644\n--- a/src/ipa/ipu3/algorithms/af.cpp\n+++ b/src/ipa/ipu3/algorithms/af.cpp\n@@ -409,6 +409,7 @@ bool Af::afIsOutOfFocus(IPAContext &context)\n  * \\param[in] frame The frame context sequence number\n  * \\param[in] frameContext The current frame context\n  * \\param[in] stats The statistics buffer of IPU3\n+ * \\param[out] metadata Metadata for the frame, to be filled by the algorithm\n  *\n  * Ideally, a clear image also has a relatively higher contrast. So, every\n  * image for each focus step should be tested to find an optimal focus step.\n@@ -423,7 +424,8 @@ bool Af::afIsOutOfFocus(IPAContext &context)\n  */\n void Af::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n \t\t [[maybe_unused]] IPAFrameContext &frameContext,\n-\t\t const ipu3_uapi_stats_3a *stats)\n+\t\t const ipu3_uapi_stats_3a *stats,\n+\t\t [[maybe_unused]] ControlList &metadata)\n {\n \t/* Evaluate the AF buffer length */\n \tuint32_t afRawBufferLen = context.configuration.af.afGrid.width *\ndiff --git a/src/ipa/ipu3/algorithms/af.h b/src/ipa/ipu3/algorithms/af.h\nindex 89d37ac18615..c6168e30fb2e 100644\n--- a/src/ipa/ipu3/algorithms/af.h\n+++ b/src/ipa/ipu3/algorithms/af.h\n@@ -36,7 +36,8 @@ public:\n \t\t     ipu3_uapi_params *params) override;\n \tvoid process(IPAContext &context, const uint32_t frame,\n \t\t     IPAFrameContext &frameContext,\n-\t\t     const ipu3_uapi_stats_3a *stats) override;\n+\t\t     const ipu3_uapi_stats_3a *stats,\n+\t\t     ControlList &metadata) override;\n \n private:\n \tvoid afCoarseScan(IPAContext &context);\ndiff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp\nindex a1a3c38ffe84..f4e559bf8b84 100644\n--- a/src/ipa/ipu3/algorithms/agc.cpp\n+++ b/src/ipa/ipu3/algorithms/agc.cpp\n@@ -320,13 +320,15 @@ double Agc::estimateLuminance(IPAActiveState &activeState,\n  * \\param[in] frame The current frame sequence number\n  * \\param[in] frameContext The current frame context\n  * \\param[in] stats The IPU3 statistics and ISP results\n+ * \\param[out] metadata Metadata for the frame, to be filled by the algorithm\n  *\n  * Identify the current image brightness, and use that to estimate the optimal\n  * new exposure and gain for the scene.\n  */\n void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n \t\t  IPAFrameContext &frameContext,\n-\t\t  const ipu3_uapi_stats_3a *stats)\n+\t\t  const ipu3_uapi_stats_3a *stats,\n+\t\t  [[maybe_unused]] ControlList &metadata)\n {\n \t/*\n \t * Estimate the gain needed to have the proportion of pixels in a given\ndiff --git a/src/ipa/ipu3/algorithms/agc.h b/src/ipa/ipu3/algorithms/agc.h\nindex 59b4b9843c2f..9d6e3ff1a687 100644\n--- a/src/ipa/ipu3/algorithms/agc.h\n+++ b/src/ipa/ipu3/algorithms/agc.h\n@@ -30,7 +30,8 @@ public:\n \tint configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n \tvoid process(IPAContext &context, const uint32_t frame,\n \t\t     IPAFrameContext &frameContext,\n-\t\t     const ipu3_uapi_stats_3a *stats) override;\n+\t\t     const ipu3_uapi_stats_3a *stats,\n+\t\t     ControlList &metadata) override;\n \n private:\n \tdouble measureBrightness(const ipu3_uapi_stats_3a *stats,\ndiff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp\nindex 0dbd7d4c374f..6452b6a1acd2 100644\n--- a/src/ipa/ipu3/algorithms/awb.cpp\n+++ b/src/ipa/ipu3/algorithms/awb.cpp\n@@ -389,7 +389,8 @@ void Awb::calculateWBGains(const ipu3_uapi_stats_3a *stats)\n  */\n void Awb::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n \t\t  [[maybe_unused]] IPAFrameContext &frameContext,\n-\t\t  const ipu3_uapi_stats_3a *stats)\n+\t\t  const ipu3_uapi_stats_3a *stats,\n+\t\t  [[maybe_unused]] ControlList &metadata)\n {\n \tcalculateWBGains(stats);\n \ndiff --git a/src/ipa/ipu3/algorithms/awb.h b/src/ipa/ipu3/algorithms/awb.h\nindex 28e2d38a711c..7a70854e8999 100644\n--- a/src/ipa/ipu3/algorithms/awb.h\n+++ b/src/ipa/ipu3/algorithms/awb.h\n@@ -44,7 +44,8 @@ public:\n \t\t     ipu3_uapi_params *params) override;\n \tvoid process(IPAContext &context, const uint32_t frame,\n \t\t     IPAFrameContext &frameContext,\n-\t\t     const ipu3_uapi_stats_3a *stats) override;\n+\t\t     const ipu3_uapi_stats_3a *stats,\n+\t\t     ControlList &metadata) override;\n \n private:\n \t/* \\todo Make these structs available to all the ISPs ? */\ndiff --git a/src/ipa/ipu3/algorithms/tone_mapping.cpp b/src/ipa/ipu3/algorithms/tone_mapping.cpp\nindex eac3d4064443..a169894cb628 100644\n--- a/src/ipa/ipu3/algorithms/tone_mapping.cpp\n+++ b/src/ipa/ipu3/algorithms/tone_mapping.cpp\n@@ -79,13 +79,15 @@ void ToneMapping::prepare([[maybe_unused]] IPAContext &context,\n  * \\param[in] frame The current frame sequence number\n  * \\param[in] frameContext The current frame context\n  * \\param[in] stats The IPU3 statistics and ISP results\n+ * \\param[out] metadata Metadata for the frame, to be filled by the algorithm\n  *\n  * The tone mapping look up table is generated as an inverse power curve from\n  * our gamma setting.\n  */\n void ToneMapping::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n \t\t\t  [[maybe_unused]] IPAFrameContext &frameContext,\n-\t\t\t  [[maybe_unused]] const ipu3_uapi_stats_3a *stats)\n+\t\t\t  [[maybe_unused]] const ipu3_uapi_stats_3a *stats,\n+\t\t\t  [[maybe_unused]] ControlList &metadata)\n {\n \t/*\n \t * Hardcode gamma to 1.1 as a default for now.\ndiff --git a/src/ipa/ipu3/algorithms/tone_mapping.h b/src/ipa/ipu3/algorithms/tone_mapping.h\nindex 822e5168df82..5ae35da55e87 100644\n--- a/src/ipa/ipu3/algorithms/tone_mapping.h\n+++ b/src/ipa/ipu3/algorithms/tone_mapping.h\n@@ -23,7 +23,8 @@ public:\n \t\t     IPAFrameContext &frameContext, ipu3_uapi_params *params) override;\n \tvoid process(IPAContext &context, const uint32_t frame,\n \t\t     IPAFrameContext &frameContext,\n-\t\t     const ipu3_uapi_stats_3a *stats) override;\n+\t\t     const ipu3_uapi_stats_3a *stats,\n+\t\t     ControlList &metadata) override;\n \n private:\n \tdouble gamma_;\ndiff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\nindex 891643e057b8..bc0f6007baca 100644\n--- a/src/ipa/ipu3/ipu3.cpp\n+++ b/src/ipa/ipu3/ipu3.cpp\n@@ -630,22 +630,22 @@ void IPAIPU3::processStatsBuffer(const uint32_t frame,\n \n \tdouble lineDuration = context_.configuration.sensor.lineDuration.get<std::micro>();\n \tint32_t vBlank = context_.configuration.sensor.defVBlank;\n-\tControlList ctrls(controls::controls);\n+\tControlList metadata(controls::controls);\n \n \tfor (auto const &algo : algorithms())\n-\t\talgo->process(context_, frame, frameContext, stats);\n+\t\talgo->process(context_, frame, frameContext, stats, metadata);\n \n \tsetControls(frame);\n \n \t/* \\todo Use VBlank value calculated from each frame exposure. */\n \tint64_t frameDuration = (vBlank + sensorInfo_.outputSize.height) * lineDuration;\n-\tctrls.set(controls::FrameDuration, frameDuration);\n+\tmetadata.set(controls::FrameDuration, frameDuration);\n \n-\tctrls.set(controls::AnalogueGain, frameContext.sensor.gain);\n+\tmetadata.set(controls::AnalogueGain, frameContext.sensor.gain);\n \n-\tctrls.set(controls::ColourTemperature, context_.activeState.awb.temperatureK);\n+\tmetadata.set(controls::ColourTemperature, context_.activeState.awb.temperatureK);\n \n-\tctrls.set(controls::ExposureTime, frameContext.sensor.exposure * lineDuration);\n+\tmetadata.set(controls::ExposureTime, frameContext.sensor.exposure * lineDuration);\n \n \t/*\n \t * \\todo The Metadata provides a path to getting extended data\n@@ -655,7 +655,7 @@ void IPAIPU3::processStatsBuffer(const uint32_t frame,\n \t * likely want to avoid putting platform specific metadata in.\n \t */\n \n-\tmetadataReady.emit(frame, ctrls);\n+\tmetadataReady.emit(frame, metadata);\n }\n \n /**\ndiff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/libipa/algorithm.cpp\nindex 55abddab2b0a..71f583840a5a 100644\n--- a/src/ipa/libipa/algorithm.cpp\n+++ b/src/ipa/libipa/algorithm.cpp\n@@ -107,11 +107,12 @@ namespace ipa {\n  * \\param[in] frame The frame context sequence number\n  * \\param[in] frameContext The current frame's context\n  * \\param[in] stats The IPA statistics and ISP results\n+ * \\param[out] metadata Metadata for the frame, to be filled by the algorithm\n  *\n  * This function is called while camera is running for every frame processed by\n  * the ISP, to process statistics generated from that frame by the ISP.\n- * Algorithms shall use this data to run calculations and update their state\n- * accordingly.\n+ * Algorithms shall use this data to run calculations, update their state\n+ * accordingly, and fill the frame metadata.\n  *\n  * Processing shall not take an undue amount of time, and any extended or\n  * computationally expensive calculations or operations must be handled\ndiff --git a/src/ipa/libipa/algorithm.h b/src/ipa/libipa/algorithm.h\nindex d8601f9ccaff..38b3231c5d0e 100644\n--- a/src/ipa/libipa/algorithm.h\n+++ b/src/ipa/libipa/algorithm.h\n@@ -55,7 +55,8 @@ public:\n \tvirtual void process([[maybe_unused]] typename Module::Context &context,\n \t\t\t     [[maybe_unused]] const uint32_t frame,\n \t\t\t     [[maybe_unused]] typename Module::FrameContext &frameContext,\n-\t\t\t     [[maybe_unused]] const typename Module::Stats *stats)\n+\t\t\t     [[maybe_unused]] const typename Module::Stats *stats,\n+\t\t\t     [[maybe_unused]] ControlList &metadata)\n \t{\n \t}\n };\ndiff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\nindex 04062a364e7f..37cd10f9b302 100644\n--- a/src/ipa/rkisp1/algorithms/agc.cpp\n+++ b/src/ipa/rkisp1/algorithms/agc.cpp\n@@ -283,12 +283,14 @@ double Agc::measureBrightness(const rkisp1_cif_isp_hist_stat *hist) const\n  * \\param[in] frame The frame context sequence number\n  * \\param[in] frameContext The current frame context\n  * \\param[in] stats The RKISP1 statistics and ISP results\n+ * \\param[out] metadata Metadata for the frame, to be filled by the algorithm\n  *\n  * Identify the current image brightness, and use that to estimate the optimal\n  * new exposure and gain for the scene.\n  */\n void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n-\t\t  IPAFrameContext &frameContext, const rkisp1_stat_buffer *stats)\n+\t\t  IPAFrameContext &frameContext, const rkisp1_stat_buffer *stats,\n+\t\t  [[maybe_unused]] ControlList &metadata)\n {\n \t/*\n \t * \\todo Verify that the exposure and gain applied by the sensor for\ndiff --git a/src/ipa/rkisp1/algorithms/agc.h b/src/ipa/rkisp1/algorithms/agc.h\nindex 9ad5c32fd6f6..da4d2d4e8359 100644\n--- a/src/ipa/rkisp1/algorithms/agc.h\n+++ b/src/ipa/rkisp1/algorithms/agc.h\n@@ -31,7 +31,8 @@ public:\n \t\t     rkisp1_params_cfg *params) override;\n \tvoid process(IPAContext &context, const uint32_t frame,\n \t\t     IPAFrameContext &frameContext,\n-\t\t     const rkisp1_stat_buffer *stats) override;\n+\t\t     const rkisp1_stat_buffer *stats,\n+\t\t     ControlList &metadata) override;\n \n private:\n \tvoid computeExposure(IPAContext &Context, IPAFrameContext &frameContext,\ndiff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp\nindex 3349948a3acf..f597ded800c2 100644\n--- a/src/ipa/rkisp1/algorithms/awb.cpp\n+++ b/src/ipa/rkisp1/algorithms/awb.cpp\n@@ -208,7 +208,8 @@ void Awb::queueRequest(IPAContext &context,\n void Awb::process(IPAContext &context,\n \t\t  [[maybe_unused]] const uint32_t frame,\n \t\t  IPAFrameContext &frameContext,\n-\t\t  const rkisp1_stat_buffer *stats)\n+\t\t  const rkisp1_stat_buffer *stats,\n+\t\t  [[maybe_unused]] ControlList &metadata)\n {\n \tconst rkisp1_cif_isp_stat *params = &stats->params;\n \tconst rkisp1_cif_isp_awb_stat *awb = &params->awb;\ndiff --git a/src/ipa/rkisp1/algorithms/awb.h b/src/ipa/rkisp1/algorithms/awb.h\nindex d76b538288ec..f5633b1171a0 100644\n--- a/src/ipa/rkisp1/algorithms/awb.h\n+++ b/src/ipa/rkisp1/algorithms/awb.h\n@@ -27,8 +27,9 @@ public:\n \t\t\t  IPAFrameContext &frameContext,\n \t\t\t  const ControlList &controls) override;\n \tvoid process(IPAContext &context, const uint32_t frame,\n-\t\t     IPAFrameContext &frameCtx,\n-\t\t     const rkisp1_stat_buffer *stats) override;\n+\t\t     IPAFrameContext &frameContext,\n+\t\t     const rkisp1_stat_buffer *stats,\n+\t\t     ControlList &metadata) override;\n \n private:\n \tuint32_t estimateCCT(double red, double green, double blue);\ndiff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\nindex ba3c547e02f6..494d8c891509 100644\n--- a/src/ipa/rkisp1/rkisp1.cpp\n+++ b/src/ipa/rkisp1/rkisp1.cpp\n@@ -69,7 +69,6 @@ protected:\n \n private:\n \tvoid setControls(unsigned int frame);\n-\tvoid prepareMetadata(unsigned int frame, unsigned int aeState);\n \n \tstd::map<unsigned int, FrameBuffer> buffers_;\n \tstd::map<unsigned int, MappedFrameBuffer> mappedBuffers_;\n@@ -338,14 +337,14 @@ void IPARkISP1::processStatsBuffer(const uint32_t frame, const uint32_t bufferId\n \tframeContext.sensor.gain =\n \t\tcamHelper_->gain(sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get<int32_t>());\n \n-\tunsigned int aeState = 0;\n+\tControlList metadata(controls::controls);\n \n \tfor (auto const &algo : algorithms())\n-\t\talgo->process(context_, frame, frameContext, stats);\n+\t\talgo->process(context_, frame, frameContext, stats, metadata);\n \n \tsetControls(frame);\n \n-\tprepareMetadata(frame, aeState);\n+\tmetadataReady.emit(frame, metadata);\n }\n \n void IPARkISP1::setControls(unsigned int frame)\n@@ -366,16 +365,6 @@ void IPARkISP1::setControls(unsigned int frame)\n \tsetSensorControls.emit(frame, ctrls);\n }\n \n-void IPARkISP1::prepareMetadata(unsigned int frame, unsigned int aeState)\n-{\n-\tControlList ctrls(controls::controls);\n-\n-\tif (aeState)\n-\t\tctrls.set(controls::AeLocked, aeState == 2);\n-\n-\tmetadataReady.emit(frame, ctrls);\n-}\n-\n } /* namespace ipa::rkisp1 */\n \n /*\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "1/3"
    ]
}