Show a patch.

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

{
    "id": 14798,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/14798/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/14798/",
    "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": "<20211126104045.4756-3-david.plowman@raspberrypi.com>",
    "date": "2021-11-26T10:40:40",
    "name": "[libcamera-devel,v7,2/7] libcamera: Add ColorSpace fields to StreamConfiguration",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "f28e1e57463ccbb3842b873ce273663a7c832cc9",
    "submitter": {
        "id": 42,
        "url": "https://patchwork.libcamera.org/api/1.1/people/42/?format=api",
        "name": "David Plowman",
        "email": "david.plowman@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/14798/mbox/",
    "series": [
        {
            "id": 2761,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2761/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2761",
            "date": "2021-11-26T10:40:38",
            "name": "Colour spaces",
            "version": 7,
            "mbox": "https://patchwork.libcamera.org/series/2761/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/14798/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/14798/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 3A4D4BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 26 Nov 2021 10:41:06 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1CCF460569;\n\tFri, 26 Nov 2021 11:41:05 +0100 (CET)",
            "from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com\n\t[IPv6:2a00:1450:4864:20::42d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AB3CC604FB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 Nov 2021 11:41:00 +0100 (CET)",
            "by mail-wr1-x42d.google.com with SMTP id d24so17747400wra.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 Nov 2021 02:41:00 -0800 (PST)",
            "from pi4-davidp.pitowers.org\n\t([2a00:1098:3142:14:e4a2:3070:eea4:e434])\n\tby smtp.gmail.com with ESMTPSA id\n\ty7sm5106795wrw.55.2021.11.26.02.40.59\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 26 Nov 2021 02:41:00 -0800 (PST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"SIx+3CBN\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=shW5Lu1A+Lc6XtBauNJCn5DQ5L+QxnNGx+78Zmg+UGQ=;\n\tb=SIx+3CBN1jUyaMs1J3d70jdQDaSXSlkgQMf97/itJp0xXZNGUqiJSe8IfMjb6ka1U0\n\twFDknXrC2poh8heRJJ9wKpQ34iS3ALImrgsNQOsXZNPL1Ln10whd2mKFKuPWkUzZ+AHc\n\tUgKrU4rKpzTwOvc6nvfuJhxNKOk4In0OVWriqpuMdejjiAZR+URscbonoFMzIivYCwjl\n\t982kihDLNU0en7EhABdYFnNV8uLXbidV9eIpDL93/ITQGdz3XhxsFSftq5KevSmzaUZ9\n\tB7XUWlPIk7hwtkCalWLcyLrAqvqGPZmAxlKEeaX8o4cKFIoCjlNxwf4U8hBFtLLGlsc9\n\t9cyA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=shW5Lu1A+Lc6XtBauNJCn5DQ5L+QxnNGx+78Zmg+UGQ=;\n\tb=oGFkpDV2N4mICqg7P9a1ir+W4nhJqsgqqz1XeAnq2OkvawzeWcRJBfX7MvFZcb1Ev2\n\tyk3AqP2m7xzJmmwyZ6cggnrfSNyFs4qucnahu2M8g7NMe3qtVYQGzxZ4D26KtwOu1jzy\n\tULybAc/8l3YKUMMoSr7KO9euwFge/tdkNkhiYDGugi/xVJkGoVPXRMHoW9t4Y7ESE5S5\n\t9/SzQerUaSm4t7BSclxKjcDi3/waJgMb0TuJuFNFX0M0ap4vO2kRo0ZxvCU5Gh6reDIv\n\ti/6OysnC7N5UH40+xGpB9y1ofY03lGIIXGVAgAynm40VeHrNspcIO4DIoOFIdAI9jRWd\n\ta6rQ==",
        "X-Gm-Message-State": "AOAM532O3DoxburM7NzOwROwtOcaxuKR2R7QyFyCo4/7eV1VVo5Ysb4u\n\tmLaJKy5fs+LunP79UpjP9ADPQg==",
        "X-Google-Smtp-Source": "ABdhPJxtVsEtgrZ3r1oO/tSinSZ2lT0KtyWkRTNNYmzdqcYCaA66TPT5371Ygm706LEEzqUjmPLGAw==",
        "X-Received": "by 2002:a05:6000:118a:: with SMTP id\n\tg10mr13414724wrx.533.1637923260472; \n\tFri, 26 Nov 2021 02:41:00 -0800 (PST)",
        "From": "David Plowman <david.plowman@raspberrypi.com>",
        "To": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tHans Verkuil <hverkuil-cisco@xs4all.nl>, Tomasz Figa <tfiga@google.com>, \n\tJacopo Mondi <jacopo@jmondi.org>,\n\tNaushir Patuck <naush@raspberrypi.com>, \n\tlibcamera-devel@lists.libcamera.org",
        "Date": "Fri, 26 Nov 2021 10:40:40 +0000",
        "Message-Id": "<20211126104045.4756-3-david.plowman@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.30.2",
        "In-Reply-To": "<20211126104045.4756-1-david.plowman@raspberrypi.com>",
        "References": "<20211126104045.4756-1-david.plowman@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v7 2/7] libcamera: Add ColorSpace fields\n\tto StreamConfiguration",
        "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": "This is so that applications can choose appropriate color spaces which\nwill then be passed down to the V4L2 devices.\n\nThe ColorSpace field is actually optional. If it is not set you will\nget the driver's default color space.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Umang Jain <umang.jain@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 41ec02b1..f0ae7e62 100644\n--- a/include/libcamera/stream.h\n+++ b/include/libcamera/stream.h\n@@ -12,6 +12,7 @@\n #include <string>\n #include <vector>\n \n+#include <libcamera/color_space.h>\n #include <libcamera/framebuffer.h>\n #include <libcamera/geometry.h>\n #include <libcamera/pixel_format.h>\n@@ -47,6 +48,8 @@ struct StreamConfiguration {\n \n \tunsigned int bufferCount;\n \n+\tstd::optional<ColorSpace> colorSpace;\n+\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 b421e17e..b281c309 100644\n--- a/src/libcamera/stream.cpp\n+++ b/src/libcamera/stream.cpp\n@@ -329,6 +329,25 @@ StreamConfiguration::StreamConfiguration(const StreamFormats &formats)\n  * \\brief Requested number of buffers to allocate for the stream\n  */\n \n+/**\n+ * \\var StreamConfiguration::colorSpace\n+ * \\brief The ColorSpace for this stream\n+ *\n+ * This field allows a ColorSpace to be selected for this Stream.\n+ *\n+ * The field is optional and an application can choose to leave it unset.\n+ * On some platforms, generateConfiguration() may provide default values\n+ * here which the application can of course override.\n+ *\n+ * If a specific ColorSpace is requested but the Camera cannot deliver it,\n+ * then the StreamConfiguration will be adjusted to a value that can be\n+ * delivered. In this case the validate() method will indicate via its\n+ * return value that the CameraConfiguration has been adjusted.\n+ *\n+ * Note that platforms will typically have different constraints on what\n+ * color spaces can be supported and in what combinations.\n+ */\n+\n /**\n  * \\fn StreamConfiguration::stream()\n  * \\brief Retrieve the stream associated with the configuration\n",
    "prefixes": [
        "libcamera-devel",
        "v7",
        "2/7"
    ]
}