Show a patch.

GET /api/patches/17669/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 17669,
    "url": "https://patchwork.libcamera.org/api/patches/17669/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/17669/",
    "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": "<20221024000356.29521-7-laurent.pinchart@ideasonboard.com>",
    "date": "2022-10-24T00:03:49",
    "name": "[libcamera-devel,v3,06/13] 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/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/17669/mbox/",
    "series": [
        {
            "id": 3574,
            "url": "https://patchwork.libcamera.org/api/series/3574/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3574",
            "date": "2022-10-24T00:03:43",
            "name": "Add Bayer format support for RkISP1",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/3574/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/17669/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/17669/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 792B2C3285\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 24 Oct 2022 00:04:35 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 01A7E62EF8;\n\tMon, 24 Oct 2022 02:04:34 +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 D598562ED2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 24 Oct 2022 02:04:29 +0200 (CEST)",
            "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 68F01471;\n\tMon, 24 Oct 2022 02:04:29 +0200 (CEST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1666569875;\n\tbh=Yx96IqpktzpDHkyrxV43ILhbw+e0xY/upy+FAi8vPPA=;\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=aLTsEmw9PQnJQLOy+q2UYTVjPNJgR23a8g3rcmIiUYtwQtsfHBrRqG4AsxQ+0TPIg\n\tNVoKFv70WFY/q4TDDZqs7AoC4zv17JOD0HXM6bHMxQYF56ex6Eg/CRwmv6OT8tiLpI\n\tSS2cacFwEnPdSwDQ3vDSgZDo51ChuCXsaqxHQuBD0nkgYrBeNkZ5vIHn3tcRdt+9yG\n\tcREtQ2PMxDCKF+gSpYpNx6qRxYaD0LrXshW7rPEfKZftjfsByda9qllM1xVx6EQ0x+\n\tpSEGRv2jAX5e7vQXhmcCQODMaAbWdtSwDpxp4hnsQH10u/sx0R1emhx0HwQDNKgVBe\n\tkDsemM+jGE4mA==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1666569869;\n\tbh=Yx96IqpktzpDHkyrxV43ILhbw+e0xY/upy+FAi8vPPA=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=v4Gu6NdnK58FB38utRDV0jYZXMXUnWwzuC6ktjDm+CB7DXzQnyRyKlVP4pJwVkAPo\n\ts1AMI8PSAwQOvWo8TreqCUMeXyApAlqFbYMy7BtYocmq+gRiK/Z2ak0hxEvRDKIKYP\n\t96aWEA92UhlR6wAHYb9Iqq9Zu2cSSOXEAE/u02Qo="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"v4Gu6Ndn\"; dkim-atps=neutral",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 24 Oct 2022 03:03:49 +0300",
        "Message-Id": "<20221024000356.29521-7-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.37.4",
        "In-Reply-To": "<20221024000356.29521-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20221024000356.29521-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v3 06/13] 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>\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",
        "v3",
        "06/13"
    ]
}