Patch Detail
Show a patch.
GET /api/1.1/patches/1264/?format=api
{ "id": 1264, "url": "https://patchwork.libcamera.org/api/1.1/patches/1264/?format=api", "web_url": "https://patchwork.libcamera.org/patch/1264/", "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": "<20190522221210.19257-1-laurent.pinchart@ideasonboard.com>", "date": "2019-05-22T22:12:10", "name": "[libcamera-devel] cam: Rename conf variable referring to command line option to opt", "commit_ref": "8d846ed8a7d9d7c9783472a618a7f369f0843e67", "pull_url": null, "state": "accepted", "archived": false, "hash": "894d81678d80ea361eea09e34a5e3e599584a97d", "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/1264/mbox/", "series": [ { "id": 319, "url": "https://patchwork.libcamera.org/api/1.1/series/319/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=319", "date": "2019-05-22T22:12:10", "name": "[libcamera-devel] cam: Rename conf variable referring to command line option to opt", "version": 1, "mbox": "https://patchwork.libcamera.org/series/319/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/1264/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/1264/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 6637560103\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 23 May 2019 00:12:32 +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 E76CD443\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 23 May 2019 00:12:30 +0200 (CEST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1558563151;\n\tbh=JfbuY1cQ7hAVZsVREBLpkFblFJC4uznc4+BdJxKaraQ=;\n\th=From:To:Subject:Date:From;\n\tb=vSdQ3HttJsDwu823TjpV3zRAcHdFnC7IHihcPSXq1y9VeM8svcsyXltgh/NOZAo7s\n\tWu4o8Zm4NXOIaKDJjGjleXNudHqCstSTUCnPiq80M7s+kucOjN9UR34K8UC6FVYeTW\n\t3/UxMUJSTMFO1ErKZuUgUvqO8UvNO+kHLKLKF3GY=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 23 May 2019 01:12:10 +0300", "Message-Id": "<20190522221210.19257-1-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.21.0", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH] cam: Rename conf variable referring to\n\tcommand line option to opt", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.23", "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, 22 May 2019 22:12:32 -0000" }, "content": "Naming a variable that refers to command line options 'conf' is\nconfusing as we using 'config' and 'cfg' to refer to camera and stream\nconfigurations. Rename it to 'opt'.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/cam/main.cpp | 26 +++++++++++++-------------\n 1 file changed, 13 insertions(+), 13 deletions(-)", "diff": "diff --git a/src/cam/main.cpp b/src/cam/main.cpp\nindex 5ecd7e0e38d7..4155889678ce 100644\n--- a/src/cam/main.cpp\n+++ b/src/cam/main.cpp\n@@ -98,19 +98,19 @@ static std::unique_ptr<CameraConfiguration> prepareCameraConfig()\n \n \t/* Use roles and get a default configuration. */\n \tfor (auto const &value : streamOptions) {\n-\t\tKeyValueParser::Options conf = value.toKeyValues();\n+\t\tKeyValueParser::Options opt = value.toKeyValues();\n \n-\t\tif (!conf.isSet(\"role\")) {\n+\t\tif (!opt.isSet(\"role\")) {\n \t\t\troles.push_back(StreamRole::VideoRecording);\n-\t\t} else if (conf[\"role\"].toString() == \"viewfinder\") {\n+\t\t} else if (opt[\"role\"].toString() == \"viewfinder\") {\n \t\t\troles.push_back(StreamRole::Viewfinder);\n-\t\t} else if (conf[\"role\"].toString() == \"video\") {\n+\t\t} else if (opt[\"role\"].toString() == \"video\") {\n \t\t\troles.push_back(StreamRole::VideoRecording);\n-\t\t} else if (conf[\"role\"].toString() == \"still\") {\n+\t\t} else if (opt[\"role\"].toString() == \"still\") {\n \t\t\troles.push_back(StreamRole::StillCapture);\n \t\t} else {\n \t\t\tstd::cerr << \"Unknown stream role \"\n-\t\t\t\t << conf[\"role\"].toString() << std::endl;\n+\t\t\t\t << opt[\"role\"].toString() << std::endl;\n \t\t\treturn nullptr;\n \t\t}\n \t}\n@@ -125,18 +125,18 @@ static std::unique_ptr<CameraConfiguration> prepareCameraConfig()\n \t/* Apply configuration explicitly requested. */\n \tunsigned int i = 0;\n \tfor (auto const &value : streamOptions) {\n-\t\tKeyValueParser::Options conf = value.toKeyValues();\n+\t\tKeyValueParser::Options opt = value.toKeyValues();\n \t\tStreamConfiguration &cfg = config->at(i++);\n \n-\t\tif (conf.isSet(\"width\"))\n-\t\t\tcfg.size.width = conf[\"width\"];\n+\t\tif (opt.isSet(\"width\"))\n+\t\t\tcfg.size.width = opt[\"width\"];\n \n-\t\tif (conf.isSet(\"height\"))\n-\t\t\tcfg.size.height = conf[\"height\"];\n+\t\tif (opt.isSet(\"height\"))\n+\t\t\tcfg.size.height = opt[\"height\"];\n \n \t\t/* TODO: Translate 4CC string to ID. */\n-\t\tif (conf.isSet(\"pixelformat\"))\n-\t\t\tcfg.pixelFormat = conf[\"pixelformat\"];\n+\t\tif (opt.isSet(\"pixelformat\"))\n+\t\t\tcfg.pixelFormat = opt[\"pixelformat\"];\n \t}\n \n \treturn config;\n", "prefixes": [ "libcamera-devel" ] }