Patch Detail
Show a patch.
GET /api/1.1/patches/17852/?format=api
{ "id": 17852, "url": "https://patchwork.libcamera.org/api/1.1/patches/17852/?format=api", "web_url": "https://patchwork.libcamera.org/patch/17852/", "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": "<20221124025133.17875-2-laurent.pinchart@ideasonboard.com>", "date": "2022-11-24T02:51:25", "name": "[libcamera-devel,v4,1/9] libcamera: stream: Add operator<<() to print StreamRole as a string", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "caa5ec1e584fab9289aa77834210b93d1b81b62d", "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/17852/mbox/", "series": [ { "id": 3634, "url": "https://patchwork.libcamera.org/api/1.1/series/3634/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3634", "date": "2022-11-24T02:51:24", "name": "Add Bayer format support for RkISP1", "version": 4, "mbox": "https://patchwork.libcamera.org/series/3634/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/17852/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/17852/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 4A63DBDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 24 Nov 2022 02:51:54 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E80B96331E;\n\tThu, 24 Nov 2022 03:51:53 +0100 (CET)", "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 B95FE63313\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Nov 2022 03:51:51 +0100 (CET)", "from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 48647496\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Nov 2022 03:51:51 +0100 (CET)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1669258313;\n\tbh=40cx5Kok1BbswVCPQnu1hRgCA5VMy9jgv48Cub9+y5M=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=Zx7cOUTBdqgHFpMU2hRK07AeLEPjssaRtpZlKu0sncH3L4fcLW1qXoZPIU94S2K5D\n\tEDAd0BdIdHzNpqJ0mWMRqGmEYTMMUC22eSGde5eqEJm/z0cjizRhAdYCNfB8XpRRf+\n\tmBGynAQkeEu3QzPEphQje6AKiFsb17a/YKpRf5F1sQF5+IVapnRiWLg/Zu7sAzUrbT\n\tMvgRrkV3vwoDID8M25SgEh6dqw2Qxu88nd4t4zx2iQKLKI/SjPlB6CyuIaOj3JWpAi\n\tK645iMBcPW7OxnYX2kkQ9BP0cbsIkG76/7bbhox7el93N5+McJXCKVtz8F/9dxBg6f\n\tdFWBHvWoLcNzA==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1669258311;\n\tbh=40cx5Kok1BbswVCPQnu1hRgCA5VMy9jgv48Cub9+y5M=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=O2uDbMt4ydJ+YIYqMA0aRl8Z4FAZK9i2+oWgT1x+wUnwrqounlQPdHUmK4+ZA/6EN\n\tEcASrU2r46KWzqC+JT8N/FNDO6EJMR1u/G70CEy0tKUpiWMKP99/1BsP4ZHvE0jjuo\n\twMjk9cP20ACf9WezOvzxcRgiYEj9lAvBSHBXhc5E=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"O2uDbMt4\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 24 Nov 2022 04:51:25 +0200", "Message-Id": "<20221124025133.17875-2-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.37.4", "In-Reply-To": "<20221124025133.17875-1-laurent.pinchart@ideasonboard.com>", "References": "<20221124025133.17875-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v4 1/9] libcamera: stream: Add\n\toperator<<() to print StreamRole as a string", "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>", "From": "Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>", "Reply-To": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "libcamera prints stream role values in log messages. To be more\nuser-friendly, add a specialization of operator<<() to print the role\nname as a string instead of a numerical value.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n include/libcamera/stream.h | 3 +++\n src/libcamera/stream.cpp | 19 +++++++++++++++++++\n 2 files changed, 22 insertions(+)", "diff": "diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\nindex f0ae7e62e0a3..efec695ad317 100644\n--- a/include/libcamera/stream.h\n+++ b/include/libcamera/stream.h\n@@ -9,6 +9,7 @@\n \n #include <map>\n #include <memory>\n+#include <ostream>\n #include <string>\n #include <vector>\n \n@@ -70,6 +71,8 @@ enum StreamRole {\n \n using StreamRoles = std::vector<StreamRole>;\n \n+std::ostream &operator<<(std::ostream &out, StreamRole role);\n+\n class Stream\n {\n public:\ndiff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\nindex 686e693bccba..67f308157fbf 100644\n--- a/src/libcamera/stream.cpp\n+++ b/src/libcamera/stream.cpp\n@@ -417,6 +417,25 @@ std::string StreamConfiguration::toString() const\n * acceptable.\n */\n \n+/**\n+ * \\brief Insert a text representation of a StreamRole into an output stream\n+ * \\param[in] out The output stream\n+ * \\param[in] role The StreamRole\n+ * \\return The output stream \\a out\n+ */\n+std::ostream &operator<<(std::ostream &out, StreamRole role)\n+{\n+\tstatic constexpr std::array<const char *, 4> names{\n+\t\t\"Raw\",\n+\t\t\"StillCapture\",\n+\t\t\"VideoRecording\",\n+\t\t\"Viewfinder\",\n+\t};\n+\n+\tout << names[static_cast<std::underlying_type_t<StreamRole>>(role)];\n+\treturn out;\n+}\n+\n /**\n * \\typedef StreamRoles\n * \\brief A vector of StreamRole\n", "prefixes": [ "libcamera-devel", "v4", "1/9" ] }