Show a patch.

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

{
    "id": 11364,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/11364/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/11364/",
    "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": "<20210222132121.6728-1-laurent.pinchart@ideasonboard.com>",
    "date": "2021-02-22T13:21:21",
    "name": "[libcamera-devel,PATCH/WIP] libcamera: controls: Add a function to merge two control lists",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "3b3f7e1c950a7a8dbf7c66cd1aa9448d135faacf",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": {
        "id": 14,
        "url": "https://patchwork.libcamera.org/api/1.1/users/14/?format=api",
        "username": "pinchartl",
        "first_name": "Laurent",
        "last_name": "Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "mbox": "https://patchwork.libcamera.org/patch/11364/mbox/",
    "series": [
        {
            "id": 1720,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1720/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1720",
            "date": "2021-02-22T13:21:21",
            "name": "[libcamera-devel,PATCH/WIP] libcamera: controls: Add a function to merge two control lists",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1720/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/11364/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/11364/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 1347FBD1F6\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 22 Feb 2021 13:21:54 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 97D6F68A15;\n\tMon, 22 Feb 2021 14:21:53 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 17BBD68A07\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 22 Feb 2021 14:21:52 +0100 (CET)",
            "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7EA7E66;\n\tMon, 22 Feb 2021 14:21: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=\"XgjcMlgo\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1614000111;\n\tbh=WLY3uitlxZTUZJm9SbfUU+M646ZtUwuvzi6pM5/86AU=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=XgjcMlgoTaPzcuZhedquEtYklTECdT5BL57IqyNWrPU47p69OKPqNwnA5s1hqcdrT\n\tLmNj4YG+hWEVLoXnEqYfcCfVDympDbU8EkHOlDn1GFEwk6hOfKMw697om9td6tTtqt\n\t+ddaTFYqY/OAbwZGXx+vtKeXwOlEpNNqHZMUSIbI=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 22 Feb 2021 15:21:21 +0200",
        "Message-Id": "<20210222132121.6728-1-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.28.0",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH/WIP] libcamera: controls: Add a function\n\tto merge two control lists",
        "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>",
        "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>"
    },
    "content": "Add a new ControlList::merge() function to merge two control lists. The\nsemantics is identical to std::unordered_map::merge(). This can be used\nby pipeline handlers to merge metadata they populate with metadata\nreceived from an IPA.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/controls.h |  2 ++\n src/libcamera/controls.cpp   | 20 ++++++++++++++++++++\n 2 files changed, 22 insertions(+)\n\nHello,\n\nThis may come handy for the IPU3 IPA. The patch hasn't been tested yet,\nI'm in particular not entirely sure of the idmap_ check. I've opted for\nan ASSERT() to be restrictive and catch potential issues, we may decide\nto relax the requirement (or handle it differently) if the assertion is\ntriggered and the analysis of the problem shows that a different\napproach is required.",
    "diff": "diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h\nindex 1a5690a5ccbe..16726ce9b1ed 100644\n--- a/include/libcamera/controls.h\n+++ b/include/libcamera/controls.h\n@@ -363,7 +363,9 @@ public:\n \n \tbool empty() const { return controls_.empty(); }\n \tstd::size_t size() const { return controls_.size(); }\n+\n \tvoid clear() { controls_.clear(); }\n+\tvoid merge(ControlList &source);\n \n \tbool contains(const ControlId &id) const;\n \tbool contains(unsigned int id) const;\ndiff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp\nindex c58ed3946f3b..58555ea64c95 100644\n--- a/src/libcamera/controls.cpp\n+++ b/src/libcamera/controls.cpp\n@@ -874,6 +874,26 @@ ControlList::ControlList(const ControlInfoMap &infoMap, ControlValidator *valida\n  * \\brief Removes all controls from the list\n  */\n \n+/**\n+ * \\brief Merge the \\a source into the ControlList\n+ * \\param[in] source The ControlList to merge into this object\n+ *\n+ * Merging two control lists extracts elements from the \\a source and insert\n+ * them in *this. If the \\a source contains elements whose key is already\n+ * present in *this, then those elements are not extracted. The semantics is\n+ * identical to std::unordered_map::merge() in that only internal pointers to\n+ * nodes are updated, without copying or moving the elements.\n+ *\n+ * Only control lists created from the same ControlIdMap or ControlInfoMap may\n+ * be merged. Attempting to do otherwise results in undefined behaviour.\n+ */\n+void ControlList::merge(ControlList &source)\n+{\n+\tASSERT(idmap_ == source.idmap_);\n+\n+\tcontrols_.merge(source.controls_);\n+}\n+\n /**\n  * \\brief Check if the list contains a control with the specified \\a id\n  * \\param[in] id The control ID\n",
    "prefixes": [
        "libcamera-devel",
        "PATCH/WIP"
    ]
}