Patch Detail
Show a patch.
GET /api/1.1/patches/2049/?format=api
{ "id": 2049, "url": "https://patchwork.libcamera.org/api/1.1/patches/2049/?format=api", "web_url": "https://patchwork.libcamera.org/patch/2049/", "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": "<20190928152238.23752-8-laurent.pinchart@ideasonboard.com>", "date": "2019-09-28T15:22:33", "name": "[libcamera-devel,07/12] libcamera: controls: Rename ControlInfo to ControlRange", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "72b9196c8880757403fac370b36d27340af3787c", "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/2049/mbox/", "series": [ { "id": 511, "url": "https://patchwork.libcamera.org/api/1.1/series/511/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=511", "date": "2019-09-28T15:22:26", "name": "Improve the application-facing controls API", "version": 1, "mbox": "https://patchwork.libcamera.org/series/511/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/2049/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/2049/checks/", "tags": {}, "headers": { "Return-Path": "<laurent.pinchart@ideasonboard.com>", "Received": [ "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A0DD661922\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 28 Sep 2019 17:22:58 +0200 (CEST)", "from pendragon.bb.dnainternet.fi\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0EDD0593\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 28 Sep 2019 17:22:58 +0200 (CEST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1569684178;\n\tbh=w1HYYrMv2/Y7NiDNksCrSYGbKaMwSvl8dho8PDQBM1Y=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=aRb2tnPCUOLUZD++xbQsUs5oW+EkjJ5YmOdvXPrfsvH//B76R4D4ar/mzWgGvss8P\n\t3Ppb2gVxte6vKfV0u+lDxKV1gPKNbWs6Ww7kr3vu00CvbP2tbbzit9ZpPXCOOWPRXo\n\tNmdPrvoCwc8eeAHlueHGK3e58JCEgwDe5q5lxdoI=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Sat, 28 Sep 2019 18:22:33 +0300", "Message-Id": "<20190928152238.23752-8-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.21.0", "In-Reply-To": "<20190928152238.23752-1-laurent.pinchart@ideasonboard.com>", "References": "<20190928152238.23752-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 07/12] libcamera: controls: Rename\n\tControlInfo to 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": "Sat, 28 Sep 2019 15:22:59 -0000" }, "content": "The ControlInfo class stores a range of valid values for a control. Its\nname is vague, as \"info\" has multiple meanings. Rename it to\nControlRange.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/controls.h | 8 +++---\n src/libcamera/controls.cpp | 28 +++++++++----------\n .../{control_info.cpp => control_range.cpp} | 14 +++++-----\n test/controls/meson.build | 2 +-\n 4 files changed, 26 insertions(+), 26 deletions(-)\n rename test/controls/{control_info.cpp => control_range.cpp} (75%)", "diff": "diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h\nindex 854ea3b84267..d3eea643c0ec 100644\n--- a/include/libcamera/controls.h\n+++ b/include/libcamera/controls.h\n@@ -95,11 +95,11 @@ private:\n \tControl &operator=(const Control &) = delete;\n };\n \n-class ControlInfo\n+class ControlRange\n {\n public:\n-\texplicit ControlInfo(const ControlValue &min = 0,\n-\t\t\t const ControlValue &max = 0);\n+\texplicit ControlRange(const ControlValue &min = 0,\n+\t\t\t const ControlValue &max = 0);\n \n \tconst ControlValue &min() const { return min_; }\n \tconst ControlValue &max() const { return max_; }\n@@ -111,7 +111,7 @@ private:\n \tControlValue max_;\n };\n \n-using ControlInfoMap = std::unordered_map<const ControlId *, ControlInfo>;\n+using ControlInfoMap = std::unordered_map<const ControlId *, ControlRange>;\n \n class ControlList\n {\ndiff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp\nindex 6a3bb353792d..51abb4ea7f6f 100644\n--- a/src/libcamera/controls.cpp\n+++ b/src/libcamera/controls.cpp\n@@ -312,42 +312,42 @@ Control<int64_t>::Control(unsigned int id, const char *name)\n #endif /* __DOXYGEN__ */\n \n /**\n- * \\class ControlInfo\n- * \\brief Describe the information and capabilities of a Control\n+ * \\class ControlRange\n+ * \\brief Describe the limits of valid values for a Control\n *\n- * The ControlInfo represents control specific meta-data which is constant on a\n- * per camera basis. ControlInfo classes are constructed by pipeline handlers\n- * to expose the controls they support and the metadata needed to utilise those\n- * controls.\n+ * The ControlRange expresses the constraints on valid values for a control.\n+ * The constraints depend on the object the control applies to, and are\n+ * constant for the lifetime of that object. They are typically constructed by\n+ * pipeline handlers to describe the controls they support.\n */\n \n /**\n- * \\brief Construct a ControlInfo with minimum and maximum range parameters\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 */\n-ControlInfo::ControlInfo(const ControlValue &min,\n-\t\t\t const ControlValue &max)\n+ControlRange::ControlRange(const ControlValue &min,\n+\t\t\t const ControlValue &max)\n \t: min_(min), max_(max)\n {\n }\n \n /**\n- * \\fn ControlInfo::min()\n+ * \\fn ControlRange::min()\n * \\brief Retrieve the minimum value of the control\n * \\return A ControlValue with the minimum value for the control\n */\n \n /**\n- * \\fn ControlInfo::max()\n+ * \\fn ControlRange::max()\n * \\brief Retrieve the maximum value of the control\n * \\return A ControlValue with the maximum value for the control\n */\n \n /**\n- * \\brief Provide a string representation of the ControlInfo\n+ * \\brief Provide a string representation of the ControlRange\n */\n-std::string ControlInfo::toString() const\n+std::string ControlRange::toString() const\n {\n \tstd::stringstream ss;\n \n@@ -358,7 +358,7 @@ std::string ControlInfo::toString() const\n \n /**\n * \\typedef ControlInfoMap\n- * \\brief A map of ControlId to ControlInfo\n+ * \\brief A map of ControlId to ControlRange\n */\n \n /**\ndiff --git a/test/controls/control_info.cpp b/test/controls/control_range.cpp\nsimilarity index 75%\nrename from test/controls/control_info.cpp\nrename to test/controls/control_range.cpp\nindex 9cf59185e459..06ec3506ee62 100644\n--- a/test/controls/control_info.cpp\n+++ b/test/controls/control_range.cpp\n@@ -2,7 +2,7 @@\n /*\n * Copyright (C) 2019, Google Inc.\n *\n- * control_info.cpp - ControlInfo tests\n+ * control_range.cpp - ControlRange tests\n */\n \n #include <iostream>\n@@ -15,16 +15,16 @@\n using namespace std;\n using namespace libcamera;\n \n-class ControlInfoTest : public Test\n+class ControlRangeTest : public Test\n {\n protected:\n \tint run()\n \t{\n \t\t/*\n-\t\t * Test information retrieval from a control with no minimum\n-\t\t * and maximum.\n+\t\t * Test information retrieval from a range with no minimum and\n+\t\t * maximum.\n \t\t */\n-\t\tControlInfo brightness;\n+\t\tControlRange brightness;\n \n \t\tif (brightness.min().get<int32_t>() != 0 ||\n \t\t brightness.max().get<int32_t>() != 0) {\n@@ -36,7 +36,7 @@ protected:\n \t\t * Test information retrieval from a control with a minimum and\n \t\t * a maximum value.\n \t\t */\n-\t\tControlInfo contrast(10, 200);\n+\t\tControlRange contrast(10, 200);\n \n \t\tif (contrast.min().get<int32_t>() != 10 ||\n \t\t contrast.max().get<int32_t>() != 200) {\n@@ -48,4 +48,4 @@ protected:\n \t}\n };\n \n-TEST_REGISTER(ControlInfoTest)\n+TEST_REGISTER(ControlRangeTest)\ndiff --git a/test/controls/meson.build b/test/controls/meson.build\nindex f4fc7b947dd9..9f0f005a2759 100644\n--- a/test/controls/meson.build\n+++ b/test/controls/meson.build\n@@ -1,6 +1,6 @@\n control_tests = [\n- [ 'control_info', 'control_info.cpp' ],\n [ 'control_list', 'control_list.cpp' ],\n+ [ 'control_range', 'control_range.cpp' ],\n [ 'control_value', 'control_value.cpp' ],\n ]\n \n", "prefixes": [ "libcamera-devel", "07/12" ] }