Patch Detail
Show a patch.
GET /api/patches/23375/?format=api
{ "id": 23375, "url": "https://patchwork.libcamera.org/api/patches/23375/?format=api", "web_url": "https://patchwork.libcamera.org/patch/23375/", "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": "<20250515123039.3134682-2-barnabas.pocze@ideasonboard.com>", "date": "2025-05-15T12:30:39", "name": "[v1,2/2] Revert \"controls: Add boolean constructors for ControlInfo\"", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "b39d92619899f296356ea3b19d0b660612c41bd0", "submitter": { "id": 216, "url": "https://patchwork.libcamera.org/api/people/216/?format=api", "name": "Barnabás Pőcze", "email": "barnabas.pocze@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/23375/mbox/", "series": [ { "id": 5174, "url": "https://patchwork.libcamera.org/api/series/5174/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5174", "date": "2025-05-15T12:30:38", "name": "[v1,1/2] libcamera: converter_v4l2_m2m: Add missing `<set>` include", "version": 1, "mbox": "https://patchwork.libcamera.org/series/5174/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/23375/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/23375/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 18800C3200\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 15 May 2025 12:30:48 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D819A68D72;\n\tThu, 15 May 2025 14:30:44 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C60C068B70\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 15 May 2025 14:30:42 +0200 (CEST)", "from pb-laptop.local (185.221.142.248.nat.pool.zt.hu\n\t[185.221.142.248])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A7677886\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 15 May 2025 14:30:25 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"tOQiPlmo\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1747312225;\n\tbh=ZiIyeTavdLCKHaNTD7kyqe2i1n4mnPELISd3J4eREeg=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=tOQiPlmoTa1Btv3UehkI4+Q1o1nb9oRaiOicsez3/ZhO/e3U2DtjJM8Oa7wS+joWI\n\td4oEb3Y26Ai86cBXDXjJ9QoAZms7fM9AIkPAXTwqFsYJ2Qg2T6jXj9I0+Py0eoqTL/\n\trWZI6pYX/ZejeZ1UNO7uBX/p4QC4aje/bzGl2a9s=", "From": "=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Subject": "[PATCH v1 2/2] Revert \"controls: Add boolean constructors for\n\tControlInfo\"", "Date": "Thu, 15 May 2025 14:30:39 +0200", "Message-ID": "<20250515123039.3134682-2-barnabas.pocze@ideasonboard.com>", "X-Mailer": "git-send-email 2.49.0", "In-Reply-To": "<20250515123039.3134682-1-barnabas.pocze@ideasonboard.com>", "References": "<20250515123039.3134682-1-barnabas.pocze@ideasonboard.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "This reverts commit 10cdc914dad282b4ca0ad11067d5c6d446af1fcc.\n\nThe contstructors introduced by that commit are not used anywhere,\nand they do not match the existing practice for boolean controls.\n\nSpecifically, every single boolean control is described by calling\nthe `ControlInfo(ControlValue, ControlValue, ControlValue = {})`\nconstructor. Crucially, that constructor does not set `values_`,\nwhile the two removed contructors do. And whether or not `values_`\nhas any elements is currently used as an implicit sign to decide\nwhether or not the control is \"enum-like\", and those are assumed\nto have type `int32_t`.\n\nFor example, any boolean control described using any of the two\nremoved constructors would cause an assertion in failure in\n`CameraSession::listControls()` when calling `value.get<int32_t>()`.\n\nSigned-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n---\n include/libcamera/controls.h | 3 ---\n src/libcamera/controls.cpp | 29 -----------------------------\n test/controls/control_info.cpp | 33 ---------------------------------\n 3 files changed, 65 deletions(-)", "diff": "diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h\nindex 2ae4ec3d4..32fb31f78 100644\n--- a/include/libcamera/controls.h\n+++ b/include/libcamera/controls.h\n@@ -10,7 +10,6 @@\n #include <assert.h>\n #include <map>\n #include <optional>\n-#include <set>\n #include <stdint.h>\n #include <string>\n #include <unordered_map>\n@@ -334,8 +333,6 @@ public:\n \t\t\t const ControlValue &def = {});\n \texplicit ControlInfo(Span<const ControlValue> values,\n \t\t\t const ControlValue &def = {});\n-\texplicit ControlInfo(std::set<bool> values, bool def);\n-\texplicit ControlInfo(bool value);\n \n \tconst ControlValue &min() const { return min_; }\n \tconst ControlValue &max() const { return max_; }\ndiff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp\nindex 70f6f6092..eaa34e70b 100644\n--- a/src/libcamera/controls.cpp\n+++ b/src/libcamera/controls.cpp\n@@ -625,35 +625,6 @@ ControlInfo::ControlInfo(Span<const ControlValue> values,\n \t\tvalues_.push_back(value);\n }\n \n-/**\n- * \\brief Construct a boolean ControlInfo with both boolean values\n- * \\param[in] values The control valid boolean values (both true and false)\n- * \\param[in] def The control default boolean value\n- *\n- * Construct a ControlInfo for a boolean control, where both true and false are\n- * valid values. \\a values must be { false, true } (the order is irrelevant).\n- * The minimum value will always be false, and the maximum always true. The\n- * default value is \\a def.\n- */\n-ControlInfo::ControlInfo(std::set<bool> values, bool def)\n-\t: min_(false), max_(true), def_(def), values_({ false, true })\n-{\n-\tASSERT(values.count(def) && values.size() == 2);\n-}\n-\n-/**\n- * \\brief Construct a boolean ControlInfo with only one valid value\n- * \\param[in] value The control valid boolean value\n- *\n- * Construct a ControlInfo for a boolean control, where there is only valid\n- * value. The minimum, maximum, and default values will all be \\a value.\n- */\n-ControlInfo::ControlInfo(bool value)\n-\t: min_(value), max_(value), def_(value)\n-{\n-\tvalues_ = { value };\n-}\n-\n /**\n * \\fn ControlInfo::min()\n * \\brief Retrieve the minimum value of the control\ndiff --git a/test/controls/control_info.cpp b/test/controls/control_info.cpp\nindex e1bb43f0e..09c17ae63 100644\n--- a/test/controls/control_info.cpp\n+++ b/test/controls/control_info.cpp\n@@ -46,39 +46,6 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\t/*\n-\t\t * Test information retrieval from a control with boolean\n-\t\t * values.\n-\t\t */\n-\t\tControlInfo aeEnable({ false, true }, false);\n-\n-\t\tif (aeEnable.min().get<bool>() != false ||\n-\t\t aeEnable.def().get<bool>() != false ||\n-\t\t aeEnable.max().get<bool>() != true) {\n-\t\t\tcout << \"Invalid control range for AeEnable\" << endl;\n-\t\t\treturn TestFail;\n-\t\t}\n-\n-\t\tif (aeEnable.values()[0].get<bool>() != false ||\n-\t\t aeEnable.values()[1].get<bool>() != true) {\n-\t\t\tcout << \"Invalid control values for AeEnable\" << endl;\n-\t\t\treturn TestFail;\n-\t\t}\n-\n-\t\tControlInfo awbEnable(true);\n-\n-\t\tif (awbEnable.min().get<bool>() != true ||\n-\t\t awbEnable.def().get<bool>() != true ||\n-\t\t awbEnable.max().get<bool>() != true) {\n-\t\t\tcout << \"Invalid control range for AwbEnable\" << endl;\n-\t\t\treturn TestFail;\n-\t\t}\n-\n-\t\tif (awbEnable.values()[0].get<bool>() != true) {\n-\t\t\tcout << \"Invalid control values for AwbEnable\" << endl;\n-\t\t\treturn TestFail;\n-\t\t}\n-\n \t\treturn TestPass;\n \t}\n };\n", "prefixes": [ "v1", "2/2" ] }