Show a patch.

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

{
    "id": 2399,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/2399/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/2399/",
    "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": "<20191205204350.28196-5-jacopo@jmondi.org>",
    "date": "2019-12-05T20:43:44",
    "name": "[libcamera-devel,v2,04/10] libcamera: controls: Add default to ControlRange",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "0661188a73a36acf3328f1322f51686dacbc4381",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/1.1/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/2399/mbox/",
    "series": [
        {
            "id": 582,
            "url": "https://patchwork.libcamera.org/api/1.1/series/582/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=582",
            "date": "2019-12-05T20:43:40",
            "name": "Introduce camera properties",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/582/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/2399/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/2399/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<jacopo@jmondi.org>",
        "Received": [
            "from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net\n\t[217.70.183.201])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 19EB56136A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  5 Dec 2019 21:41:53 +0100 (CET)",
            "from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 5FFB21BF207;\n\tThu,  5 Dec 2019 20:41:52 +0000 (UTC)"
        ],
        "X-Originating-IP": "2.224.242.101",
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu,  5 Dec 2019 21:43:44 +0100",
        "Message-Id": "<20191205204350.28196-5-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.23.0",
        "In-Reply-To": "<20191205204350.28196-1-jacopo@jmondi.org>",
        "References": "<20191205204350.28196-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 04/10] libcamera: controls: Add default\n\tto ControlRange",
        "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>",
        "X-List-Received-Date": "Thu, 05 Dec 2019 20:41:53 -0000"
    },
    "content": "Augment the the ControlRange class to store the control default value.\n\nThis is particularly relevant for v4l2 controls used to create\nCamera properties, which are constructed using immutable video device\nproperties, whose value won't change at runtime.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n include/libcamera/controls.h |  5 ++++-\n src/libcamera/controls.cpp   | 17 +++++++++++++++--\n 2 files changed, 19 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h\nindex b1b73367e874..458b84e8fa8c 100644\n--- a/include/libcamera/controls.h\n+++ b/include/libcamera/controls.h\n@@ -114,10 +114,12 @@ class ControlRange\n {\n public:\n \texplicit ControlRange(const ControlValue &min = 0,\n-\t\t\t      const ControlValue &max = 0);\n+\t\t\t      const ControlValue &max = 0,\n+\t\t\t      const ControlValue &def = 0);\n \n \tconst ControlValue &min() const { return min_; }\n \tconst ControlValue &max() const { return max_; }\n+\tconst ControlValue &def() const { return def_; }\n \n \tstd::string toString() const;\n \n@@ -134,6 +136,7 @@ public:\n private:\n \tControlValue min_;\n \tControlValue max_;\n+\tControlValue def_;\n };\n \n using ControlIdMap = std::unordered_map<unsigned int, const ControlId *>;\ndiff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp\nindex 7d8a0e97ee3a..1678d3cba4f3 100644\n--- a/src/libcamera/controls.cpp\n+++ b/src/libcamera/controls.cpp\n@@ -353,14 +353,21 @@ Control<int64_t>::Control(unsigned int id, const char *name)\n  * pipeline handlers to describe the controls they support.\n  */\n \n+/**\n+ * \\var ControlRange::def_\n+ * \\brief The control default value\n+ */\n+\n /**\n  * \\brief Construct a ControlRange with minimum and maximum range parameters\n  * \\param[in] min The control minimum value\n  * \\param[in] max The control maximum value\n+ * \\param[in] def The control default value\n  */\n ControlRange::ControlRange(const ControlValue &min,\n-\t\t\t   const ControlValue &max)\n-\t: min_(min), max_(max)\n+\t\t\t   const ControlValue &max,\n+\t\t\t   const ControlValue &def)\n+\t: min_(min), max_(max), def_(def)\n {\n }\n \n@@ -376,6 +383,12 @@ ControlRange::ControlRange(const ControlValue &min,\n  * \\return A ControlValue with the maximum value for the control\n  */\n \n+/**\n+ * \\fn ControlRange::def()\n+ * \\brief Retrieve the default value of the control\n+ * \\return A ControlValue with the default value for the control\n+ */\n+\n /**\n  * \\brief Provide a string representation of the ControlRange\n  */\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "04/10"
    ]
}