Show a patch.

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

{
    "id": 10687,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/10687/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/10687/",
    "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": "<20201218164754.81422-7-jacopo@jmondi.org>",
    "date": "2020-12-18T16:47:51",
    "name": "[libcamera-devel,v2,6/9] libcamera: controls: List-initialize ControlList",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "f7c06bf91ffa00197d4b90b73c3bbaffb0866f4e",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/1.1/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": {
        "id": 15,
        "url": "https://patchwork.libcamera.org/api/1.1/users/15/?format=api",
        "username": "jmondi",
        "first_name": "Jacopo",
        "last_name": "Mondi",
        "email": "jacopo@jmondi.org"
    },
    "mbox": "https://patchwork.libcamera.org/patch/10687/mbox/",
    "series": [
        {
            "id": 1538,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1538/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1538",
            "date": "2020-12-18T16:47:45",
            "name": "libcamera: Introduce sensor database",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/1538/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/10687/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/10687/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 91B39C0F1A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 18 Dec 2020 16:47:57 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 40083615D2;\n\tFri, 18 Dec 2020 17:47:57 +0100 (CET)",
            "from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net\n\t[217.70.183.200])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B08E661597\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 18 Dec 2020 17:47:51 +0100 (CET)",
            "from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 7EA0720008\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 18 Dec 2020 16:47:51 +0000 (UTC)"
        ],
        "X-Originating-IP": "93.34.118.233",
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri, 18 Dec 2020 17:47:51 +0100",
        "Message-Id": "<20201218164754.81422-7-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.29.2",
        "In-Reply-To": "<20201218164754.81422-1-jacopo@jmondi.org>",
        "References": "<20201218164754.81422-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v2 6/9] libcamera: controls:\n\tList-initialize ControlList",
        "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": "Provide an additional constructor to the ControlList class to\nallow the construction of instances of the class with the usage\nof an std::intializer_list<> of ControlId and an associated\nControlValue.\n\nThe new constructor allows to intialize a ControlList instance\nat construction time, allowing the declaration of populated\nControlList instances.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n include/libcamera/controls.h |  2 ++\n src/libcamera/controls.cpp   | 11 +++++++++++\n 2 files changed, 13 insertions(+)",
    "diff": "diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h\nindex 3634dc431618..4df6615a3c7b 100644\n--- a/include/libcamera/controls.h\n+++ b/include/libcamera/controls.h\n@@ -348,9 +348,11 @@ class ControlList\n {\n private:\n \tusing ControlListMap = std::unordered_map<unsigned int, ControlValue>;\n+\tusing ControlsMap = std::unordered_map<const ControlId *, ControlValue>;\n \n public:\n \tControlList();\n+\tControlList(std::initializer_list<ControlsMap::value_type> controls);\n \tControlList(const ControlIdMap &idmap, ControlValidator *validator = nullptr);\n \tControlList(const ControlInfoMap &infoMap, ControlValidator *validator = nullptr);\n \ndiff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp\nindex c58ed3946f3b..7650057dde7d 100644\n--- a/src/libcamera/controls.cpp\n+++ b/src/libcamera/controls.cpp\n@@ -797,6 +797,17 @@ ControlList::ControlList()\n {\n }\n \n+/**\n+ * \\brief Construct a ControlList with a list of values\n+ * \\param[in] controls The controls and associated values to initialize the list with\n+ */\n+ControlList::ControlList(std::initializer_list<ControlsMap::value_type> controls)\n+\t: ControlList()\n+{\n+\tfor (const auto &ctrl : controls)\n+\t\tset(ctrl.first->id(), ctrl.second);\n+}\n+\n /**\n  * \\brief Construct a ControlList with an optional control validator\n  * \\param[in] idmap The ControlId map for the control list target object\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "6/9"
    ]
}