Show a patch.

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

{
    "id": 21279,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/21279/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/21279/",
    "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": "<20240916045802.3799103-2-chenghaoyang@google.com>",
    "date": "2024-09-16T04:51:55",
    "name": "[1/1] libcamera: Add StreamRole into StreamConfiguration",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "03bbd125c6aa76e988132dbf120e8c941fcb9281",
    "submitter": {
        "id": 117,
        "url": "https://patchwork.libcamera.org/api/1.1/people/117/?format=api",
        "name": "Cheng-Hao Yang",
        "email": "chenghaoyang@chromium.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/21279/mbox/",
    "series": [
        {
            "id": 4600,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4600/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4600",
            "date": "2024-09-16T04:51:54",
            "name": "Add StreamRole into StreamConfiguration",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/4600/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/21279/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/21279/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 0D3CEC3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 16 Sep 2024 04:58:19 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A1F6B63500;\n\tMon, 16 Sep 2024 06:58:18 +0200 (CEST)",
            "from mail-pf1-x432.google.com (mail-pf1-x432.google.com\n\t[IPv6:2607:f8b0:4864:20::432])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C5260618E3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Sep 2024 06:58:14 +0200 (CEST)",
            "by mail-pf1-x432.google.com with SMTP id\n\td2e1a72fcca58-718e1ce7e84so2863280b3a.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 15 Sep 2024 21:58:14 -0700 (PDT)",
            "from chenghaoyang-low.c.googlers.com.com\n\t(208.158.221.35.bc.googleusercontent.com. [35.221.158.208])\n\tby smtp.gmail.com with ESMTPSA id\n\td2e1a72fcca58-71944ab5590sm2996267b3a.65.2024.09.15.21.58.11\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSun, 15 Sep 2024 21:58:12 -0700 (PDT)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"oH8yRcjW\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=chromium.org; s=google; t=1726462693; x=1727067493;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=eoqGVILsE6mFBQBGrz8bxAwZezeYWnk5vho4nXkdgcc=;\n\tb=oH8yRcjWaQuZzNPGs6BKY/aBHdkQ9NacR1cNOPc1b2wBaTmanYTIuLdYK3TT3xBNpF\n\tvd8gMezW4MLz3XV2MREdIadKvDHpypuk/0J9P9fkLXXpdj5neyqRtuXVBU9O5eO5WGbj\n\tzOBISFtbrhIFJV35MwaVVTagH0zUM2a7/77gc=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1726462693; x=1727067493;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=eoqGVILsE6mFBQBGrz8bxAwZezeYWnk5vho4nXkdgcc=;\n\tb=hTvdZTzYvriPkQDtjSTtMrmFQ/axI1DNvKJ7bZL2ZORC1VCy/9IXGPcMPRsUXREjdA\n\tBEQ2IHwLuuWLBxLfBwRxBAhs65S24FXfC0e8848Sq1e+3z+QQgYcwmngBQUDKcMI2krX\n\tnpnAajdaeCxGK8S9At66NIqAZ2RX26HqzYERP4TUpTIdizKNqHpmQ6WdHJvpwxbXLikL\n\tn59ezkwma+KvrC8W2rkcxTX6p3AuTK5bDVfqpR8sGN56j215UxGuZG13sTVSsqSDK6RO\n\tRFuhDmDkJ+URDobBbPV+G7N0cq0NJfc8GSUVZHz0RyhdDgpYFZQVW1IUIazceV0mTit4\n\t8J7w==",
        "X-Gm-Message-State": "AOJu0YwJ15dD2yFqELHAaGzNQCceJlYrfn+axJUCvTxSMLWoE92B8HY0\n\t5mek/4A721lzF6rFFewyIAiUiWh7mHK/YddePeQ/4KmzdWGxP9LKW1rwaYkw7sqR+Ez8hO++KqY\n\t=",
        "X-Google-Smtp-Source": "AGHT+IH+ckfWo6/XelCYbq+1hgGKMPs8/LrXCA6K0AI9n1hV6Bkm25UJo6Rbod5rLAKGyaIODVSEHw==",
        "X-Received": "by 2002:a05:6a00:10c5:b0:706:3329:5533 with SMTP id\n\td2e1a72fcca58-719261ee946mr22173193b3a.24.1726462692911; \n\tSun, 15 Sep 2024 21:58:12 -0700 (PDT)",
        "From": "Harvey Yang <chenghaoyang@chromium.org>",
        "X-Google-Original-From": "Harvey Yang <chenghaoyang@google.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Han-Lin Chen <hanlinchen@chromium.org>,\n\tHarvey Yang <chenghaoyang@chromium.org>",
        "Subject": "[PATCH 1/1] libcamera: Add StreamRole into StreamConfiguration",
        "Date": "Mon, 16 Sep 2024 04:51:55 +0000",
        "Message-ID": "<20240916045802.3799103-2-chenghaoyang@google.com>",
        "X-Mailer": "git-send-email 2.46.0.662.g92d0881bb0-goog",
        "In-Reply-To": "<20240916045802.3799103-1-chenghaoyang@google.com>",
        "References": "<20240916045802.3799103-1-chenghaoyang@google.com>",
        "MIME-Version": "1.0",
        "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": "From: Han-Lin Chen <hanlinchen@chromium.org>\n\nAdd StreamRole into StreamConfigurations, so the user can configure\na specific stream as a specific role. Some platforms will configure\ndifferently for different roles internally.\n\nSigned-off-by: Han-Lin Chen <hanlinchen@chromium.org>\nCo-developed-by: Harvey Yang <chenghaoyang@chromium.org>\n---\n include/libcamera/stream.h |  2 ++\n src/libcamera/stream.cpp   | 12 ++++++++++--\n 2 files changed, 12 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\nindex 071b7169..1dccba5e 100644\n--- a/include/libcamera/stream.h\n+++ b/include/libcamera/stream.h\n@@ -21,6 +21,7 @@ namespace libcamera {\n \n class Camera;\n class Stream;\n+enum class StreamRole;\n \n class StreamFormats\n {\n@@ -50,6 +51,7 @@ struct StreamConfiguration {\n \n \tstd::optional<ColorSpace> colorSpace;\n \n+\tStreamRole role;\n \tStream *stream() const { return stream_; }\n \tvoid setStream(Stream *stream) { stream_ = stream; }\n \tconst StreamFormats &formats() const { return formats_; }\ndiff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\nindex 1f75dbbc..3e378d0d 100644\n--- a/src/libcamera/stream.cpp\n+++ b/src/libcamera/stream.cpp\n@@ -281,7 +281,7 @@ SizeRange StreamFormats::range(const PixelFormat &pixelformat) const\n  */\n StreamConfiguration::StreamConfiguration()\n \t: pixelFormat(0), stride(0), frameSize(0), bufferCount(0),\n-\t  stream_(nullptr)\n+\t  role(StreamRole::Viewfinder), stream_(nullptr)\n {\n }\n \n@@ -290,7 +290,7 @@ StreamConfiguration::StreamConfiguration()\n  */\n StreamConfiguration::StreamConfiguration(const StreamFormats &formats)\n \t: pixelFormat(0), stride(0), frameSize(0), bufferCount(0),\n-\t  stream_(nullptr), formats_(formats)\n+\t  role(StreamRole::Viewfinder), stream_(nullptr), formats_(formats)\n {\n }\n \n@@ -350,6 +350,14 @@ StreamConfiguration::StreamConfiguration(const StreamFormats &formats)\n  * color spaces can be supported and in what combinations.\n  */\n \n+/**\n+ * \\var StreamConfiguration::role\n+ * \\brief The StreamRole that this StreamConfiguration should be set to\n+ *\n+ * Some applications may want to assign a StreamConfiguration to a certain\n+ * role of Stream.\n+ */\n+\n /**\n  * \\fn StreamConfiguration::stream()\n  * \\brief Retrieve the stream associated with the configuration\n",
    "prefixes": [
        "1/1"
    ]
}