Show a patch.

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

{
    "id": 14608,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/14608/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/14608/",
    "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": "<20211115161205.24335-3-david.plowman@raspberrypi.com>",
    "date": "2021-11-15T16:12:00",
    "name": "[libcamera-devel,v5,2/7] libcamera: Add ColorSpace fields to StreamConfiguration",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "721865036c40d698c5350fead92bdfdb95e63940",
    "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/14608/mbox/",
    "series": [
        {
            "id": 2719,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2719/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2719",
            "date": "2021-11-15T16:11:58",
            "name": "Colour spaces",
            "version": 5,
            "mbox": "https://patchwork.libcamera.org/series/2719/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/14608/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/14608/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 5B642BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 15 Nov 2021 16:13:05 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 037276036C;\n\tMon, 15 Nov 2021 17:13:05 +0100 (CET)",
            "from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com\n\t[IPv6:2a00:1450:4864:20::42e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6B5526038A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Nov 2021 17:12:59 +0100 (CET)",
            "by mail-wr1-x42e.google.com with SMTP id a9so5564227wrr.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Nov 2021 08:12:59 -0800 (PST)",
            "from pi4-davidp.pitowers.org\n\t([2a00:1098:3142:14:1ce1:9965:4328:89c4])\n\tby smtp.gmail.com with ESMTPSA id\n\tj40sm16315615wms.16.2021.11.15.08.12.57\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 15 Nov 2021 08:12:57 -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=\"XVMawex1\"; 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=nUVlWu72PlyE29kbK+yxhDq/7AfELhGkPOIcJt8NS14=;\n\tb=XVMawex1WpM22FegeF6CknBX6PO3gxVlU5o/PF1oQtiDQucLhRtkcoOGOfMRHqUSPC\n\tWHR0/wg4xKHmcvVxU3/fctvePWjm+XjBtgTyuOMol1VD70073WRiYbJL8ojlZAzibn8N\n\tkFp98sg4g5AyX0HbUAUIPktYluKKd8zeKivSGwGGXqeIbqjkiAszjZPzjiZdHHC7YdRa\n\tRPnDbgtAPsfP+VqzgtJ22cs0Cy1ZqvzFWr96L9fDOYawU13+NaP6RyjtKaLrCMKPGUJB\n\tPL8k4OuLIYJh2rD5KctEIFOdyWF4L6SAlulOKOw8Wdw2Ny3DMCvYqBBXbGJVVMGyphyX\n\tF7cg==",
        "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=nUVlWu72PlyE29kbK+yxhDq/7AfELhGkPOIcJt8NS14=;\n\tb=EdAiHo0IATwrecs2df8+0h9Km/nAz83Dq8UlX59vatiCbJefICe/24kTIREarbUn+3\n\t7/ETZUzLm69uENGVRAtXVumUIEOw7yKDxSWJ/FNikDK07yN/OY5WOFqlXnS1Zr2cwc1s\n\tLpVDYu023NttZl4REygzFSUlN3EVTFzlmpOXEDGOR4PLALpmPdMi6nvPz0GEkY5sCdJw\n\telbN2iyIsMNDDc74gC1nNSV67i3i94msOAh8u3HLPEkzFCEO7joERLFZWnkpuCYRiuxz\n\tipYI9MQHgdPRUUCyaFk0qY/RdHYEqIRuN1+JNWzsZaBQtuTATm7UGGeCqHkzta+oYlf3\n\tHg0g==",
        "X-Gm-Message-State": "AOAM531GuDfpPnrHPvd6P097xl+eQ12CcVWl1UpZmm9B1g8yPH0Q6USi\n\tJDMrH3INzpgRNlGAOhQYDJHJdA==",
        "X-Google-Smtp-Source": "ABdhPJzFb0ubWNGB/FhLothieQB55Oanm48khGe1NurwGjcCN4DLho+q9T1NK1PIvLD3L8gp0cwoKg==",
        "X-Received": "by 2002:a5d:68cb:: with SMTP id p11mr186357wrw.262.1636992779201;\n\tMon, 15 Nov 2021 08:12:59 -0800 (PST)",
        "From": "David Plowman <david.plowman@raspberrypi.com>",
        "To": "hverkuil-cisco@xs4all.nl, laurent.pinchart@ideasonboard.com,\n\tkieran.bingham@ideasonboard.com, jacopo@jmondi.org, tfiga@google.com, \n\tnaush@raspberrypi.com, libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 15 Nov 2021 16:12:00 +0000",
        "Message-Id": "<20211115161205.24335-3-david.plowman@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20211115161205.24335-1-david.plowman@raspberrypi.com>",
        "References": "<20211115161205.24335-1-david.plowman@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v5 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\nThere are two fields: the \"requestedColorSpace\" which is the one an\napplication wants, and the \"actualColorSpace\" which is what the\nunderlying hardware can deliver, and which is filled in by the\nvalidate() method.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\n---\n include/libcamera/stream.h |  4 ++++\n src/libcamera/stream.cpp   | 25 +++++++++++++++++++++++++\n 2 files changed, 29 insertions(+)",
    "diff": "diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\nindex 0c55e716..fe491ff5 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,9 @@ struct StreamConfiguration {\n \n \tunsigned int bufferCount;\n \n+\tColorSpace requestedColorSpace;\n+\tColorSpace actualColorSpace;\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..1ddbbb8c 100644\n--- a/src/libcamera/stream.cpp\n+++ b/src/libcamera/stream.cpp\n@@ -329,6 +329,31 @@ StreamConfiguration::StreamConfiguration(const StreamFormats &formats)\n  * \\brief Requested number of buffers to allocate for the stream\n  */\n \n+/**\n+ * \\var StreamConfiguration::requestedColorSpace\n+ * \\brief The ColorSpace this stream should have\n+ *\n+ * The generateConfiguration method will generate reasonable default\n+ * values (ColorSpace::Jpeg for stills, ColorSpace::Rec709 for video and\n+ * ColorSpace::Raw for raw streams) but applications are free to overwrite\n+ * this value.\n+ */\n+\n+/**\n+ * \\var StreamConfiguration::actualColorSpace\n+ * \\brief The ColorSpace the will be used for this stream\n+ *\n+ * This field is filled in by CameraConfiguration::validate().\n+ * Normally this should match the requestedColorSpace, but it may differ\n+ * if the hardware does not support it.\n+ *\n+ * In general cameras may have different constraints here, for example,\n+ * they may require all output streams to share the same color space.\n+ * Sometimes the fields within this color space may report \"Undefined\"\n+ * values if the hardware drivers are going to use a color space that\n+ * is not recognised by the ColorSpace class.\n+ */\n+\n /**\n  * \\fn StreamConfiguration::stream()\n  * \\brief Retrieve the stream associated with the configuration\n",
    "prefixes": [
        "libcamera-devel",
        "v5",
        "2/7"
    ]
}