Patch Detail
Show a patch.
GET /api/patches/2388/?format=api
{ "id": 2388, "url": "https://patchwork.libcamera.org/api/patches/2388/?format=api", "web_url": "https://patchwork.libcamera.org/patch/2388/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/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": "<20191204132106.21582-5-jacopo@jmondi.org>", "date": "2019-12-04T13:21:00", "name": "[libcamera-devel,04/10] libcamera: controls: Add default to ControlRange", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "4d97760a2c2191d37414738394b94fe4f06ec2e9", "submitter": { "id": 3, "url": "https://patchwork.libcamera.org/api/people/3/?format=api", "name": "Jacopo Mondi", "email": "jacopo@jmondi.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/2388/mbox/", "series": [ { "id": 581, "url": "https://patchwork.libcamera.org/api/series/581/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=581", "date": "2019-12-04T13:20:56", "name": "Introduce camera properties", "version": 1, "mbox": "https://patchwork.libcamera.org/series/581/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/2388/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/2388/checks/", "tags": {}, "headers": { "Return-Path": "<jacopo@jmondi.org>", "Received": [ "from relay10.mail.gandi.net (relay10.mail.gandi.net\n\t[217.70.178.230])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0AFA061CE6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 4 Dec 2019 14:21:22 +0100 (CET)", "from uno.lan (93-34-114-233.ip49.fastwebnet.it [93.34.114.233])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay10.mail.gandi.net (Postfix) with ESMTPSA id 8ADD7240008;\n\tWed, 4 Dec 2019 13:21:21 +0000 (UTC)" ], "From": "Jacopo Mondi <jacopo@jmondi.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 4 Dec 2019 14:21:00 +0100", "Message-Id": "<20191204132106.21582-5-jacopo@jmondi.org>", "X-Mailer": "git-send-email 2.23.0", "In-Reply-To": "<20191204132106.21582-1-jacopo@jmondi.org>", "References": "<20191204132106.21582-1-jacopo@jmondi.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 04/10] libcamera: controls: Add default to\n\tControlRange", "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": "Wed, 04 Dec 2019 13:21:22 -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 | 7 ++++++-\n src/libcamera/controls.cpp | 17 +++++++++++++++--\n 2 files changed, 21 insertions(+), 3 deletions(-)", "diff": "diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h\nindex b1b73367e874..1e2f284eafeb 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 &defaultValue = 0);\n \n \tconst ControlValue &min() const { return min_; }\n \tconst ControlValue &max() const { return max_; }\n+\tconst ControlValue &defaultValue() const { return defaultValue_; }\n \n \tstd::string toString() const;\n \n@@ -131,6 +133,9 @@ public:\n \t\treturn !(*this == other);\n \t}\n \n+protected:\n+\tControlValue defaultValue_;\n+\n private:\n \tControlValue min_;\n \tControlValue max_;\ndiff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp\nindex 7d8a0e97ee3a..bacba0fbf68a 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::defaultValue_\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] defaultValue 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 &defaultValue)\n+\t: defaultValue_(defaultValue), min_(min), max_(max)\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::defaultValue()\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", "04/10" ] }