Patch Detail
Show a patch.
GET /api/1.1/patches/12923/?format=api
{ "id": 12923, "url": "https://patchwork.libcamera.org/api/1.1/patches/12923/?format=api", "web_url": "https://patchwork.libcamera.org/patch/12923/", "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": "<20210712215645.30478-11-laurent.pinchart@ideasonboard.com>", "date": "2021-07-12T21:56:25", "name": "[libcamera-devel,v2,10/30] cam: options: Drop some OptionValue cast operators", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "b1e482f1e275e2c6b867cb6e7abc22f4d7ffd162", "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/12923/mbox/", "series": [ { "id": 2229, "url": "https://patchwork.libcamera.org/api/1.1/series/2229/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2229", "date": "2021-07-12T21:56:15", "name": "Multi-camera support in the cam application", "version": 2, "mbox": "https://patchwork.libcamera.org/series/2229/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/12923/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/12923/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 AB65AC3227\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 12 Jul 2021 21:57:46 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E0F2D68535;\n\tMon, 12 Jul 2021 23:57:45 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 375C068524\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 12 Jul 2021 23:57:39 +0200 (CEST)", "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CB38ECC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 12 Jul 2021 23:57:38 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"BJa66u5B\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1626127059;\n\tbh=u/EKlYW1O9mTY+f8DbJqsRgDxxZ0Th5N2SH8PLdqrJE=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=BJa66u5B7MEZna/nJiuCObG5W3SRcWXObQjjlvmye/652a+JUBe0bk/xqogG1GVHL\n\tvDnWhBhg2KphmDZ1gxZAT7eq409zLva7KHlmwJ46s6ojIL8gckr1QqiH6Xf4KRSbAX\n\tuDWo5MQF/ViwGNaahexoJoYPVk3ljTyoaPeIdiCg=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 13 Jul 2021 00:56:25 +0300", "Message-Id": "<20210712215645.30478-11-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.31.1", "In-Reply-To": "<20210712215645.30478-1-laurent.pinchart@ideasonboard.com>", "References": "<20210712215645.30478-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v2 10/30] cam: options: Drop some\n\tOptionValue cast operators", "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": "While OptionValue cast operators to int and std::string allow useful\nshortcut syntaxes, the cast operators to KeyValueParser::Options and\nstd::vector<OptionValue> are less useful. A an explicit static_cast call\nwould be more cumbersome to write than an explicit .toKeyValues() or\ntoArray(), and implicit cast hide too much of what's going on.\n\nDrop those two cast operators, and replace the only implicit cast\noccurrence with .toKeyValues(). While at it, drop the local opts\nvariable in StreamKeyValueParser::roles() as it isn't used.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/cam/options.cpp | 20 --------------------\n src/cam/options.h | 2 --\n src/cam/stream_options.cpp | 3 +--\n 3 files changed, 1 insertion(+), 24 deletions(-)", "diff": "diff --git a/src/cam/options.cpp b/src/cam/options.cpp\nindex 59b26be4deff..fda6d9764ac5 100644\n--- a/src/cam/options.cpp\n+++ b/src/cam/options.cpp\n@@ -603,26 +603,6 @@ OptionValue::operator std::string() const\n \treturn toString();\n }\n \n-/**\n- * \\brief Cast the value to a key-value list\n- * \\return The option value as a KeyValueParser::Options, or an empty list if\n- * the value type isn't ValueType::ValueKeyValue\n- */\n-OptionValue::operator KeyValueParser::Options() const\n-{\n-\treturn toKeyValues();\n-}\n-\n-/**\n- * \\brief Cast the value to an array\n- * \\return The option value as a std::vector of OptionValue, or an empty vector\n- * if the value type isn't ValueType::ValueArray\n- */\n-OptionValue::operator std::vector<OptionValue>() const\n-{\n-\treturn toArray();\n-}\n-\n /**\n * \\brief Retrieve the value as an int\n * \\return The option value as an int, or 0 if the value type isn't\ndiff --git a/src/cam/options.h b/src/cam/options.h\nindex e894822c0061..210e502a24e1 100644\n--- a/src/cam/options.h\n+++ b/src/cam/options.h\n@@ -138,8 +138,6 @@ public:\n \n \toperator int() const;\n \toperator std::string() const;\n-\toperator KeyValueParser::Options() const;\n-\toperator std::vector<OptionValue>() const;\n \n \tint toInteger() const;\n \tstd::string toString() const;\ndiff --git a/src/cam/stream_options.cpp b/src/cam/stream_options.cpp\nindex c58272c23d25..b90dbb97f087 100644\n--- a/src/cam/stream_options.cpp\n+++ b/src/cam/stream_options.cpp\n@@ -48,11 +48,10 @@ StreamRoles StreamKeyValueParser::roles(const OptionValue &values)\n \n \tStreamRoles roles;\n \tfor (auto const &value : streamParameters) {\n-\t\tKeyValueParser::Options opts = value.toKeyValues();\n \t\tStreamRole role;\n \n \t\t/* If role is invalid or not set default to viewfinder. */\n-\t\tif (!parseRole(&role, value))\n+\t\tif (!parseRole(&role, value.toKeyValues()))\n \t\t\trole = StreamRole::Viewfinder;\n \n \t\troles.push_back(role);\n", "prefixes": [ "libcamera-devel", "v2", "10/30" ] }