Show a patch.

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

{
    "id": 16589,
    "url": "https://patchwork.libcamera.org/api/patches/16589/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16589/",
    "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": "<20220711153711.36679-3-rishikeshdonadkar@gmail.com>",
    "date": "2022-07-11T15:37:08",
    "name": "[libcamera-devel,v3,2/5] gstreamer: Update the obtained colorimetry in caps.",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "1c68df540861bd5d7611ef92b4b233d5627a7a1f",
    "submitter": {
        "id": 118,
        "url": "https://patchwork.libcamera.org/api/people/118/?format=api",
        "name": "Rishikesh Donadkar",
        "email": "rishikeshdonadkar@gmail.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/16589/mbox/",
    "series": [
        {
            "id": 3270,
            "url": "https://patchwork.libcamera.org/api/series/3270/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3270",
            "date": "2022-07-11T15:37:06",
            "name": "Add colorimetry support to libcamera gstreamer element.",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/3270/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16589/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16589/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 292E3BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 11 Jul 2022 15:38:19 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E1CC963317;\n\tMon, 11 Jul 2022 17:38:18 +0200 (CEST)",
            "from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com\n\t[IPv6:2607:f8b0:4864:20::42d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DDACE62752\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 11 Jul 2022 17:38:17 +0200 (CEST)",
            "by mail-pf1-x42d.google.com with SMTP id l124so5078270pfl.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 11 Jul 2022 08:38:17 -0700 (PDT)",
            "from localhost.localdomain ([103.124.170.70])\n\tby smtp.googlemail.com with ESMTPSA id\n\tu18-20020a17090a891200b001ef87123615sm4891268pjn.37.2022.07.11.08.38.14\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 11 Jul 2022 08:38:16 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1657553898;\n\tbh=S+pMnG9qArCipiVzmsCS00FAuvLtVCHo8cfZuFnUdyM=;\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:Cc:\n\tFrom;\n\tb=brGjidRmZB0qpZWaflSPrK9opGYaRe3vJ93dtxDQUsnzb+xQD0700gfh8n8BgnhVj\n\t7Up9T9cWSYmJEm3NA+QLQpHnzVaYnBwxf6wCHRbiFOnAVMFj7S0R/YTZgFEACov7Qc\n\tD4YefBkBMaljYQ5QCdV29/fq/WsA+fgRXOWcgMw3RWG54oIxthFGEJPJ9M2uNWOp1t\n\tUK0bi3PiGvJI9GI48u7J41QgZbhjony8JT/OVBkrV3axZ7qDXGVOwpqbTQHkFIMQ6w\n\tPHP6/vZS/ukjwfVgh0GaFv90WTjkQNHLZWDGPZ8/9MIz9YFQzRYTrxGKHZPGkMK/5p\n\t2sHujNZu/LnHw==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=T7FcClSDovKV4o5TX4pXqGgDSXUR6G3jMCCkLVzbUmA=;\n\tb=L1hxUZhfPy+xVk3duC1bwnV/8nCYaf4b5clx/0LQiYi2aJwkCRYFb7LySsVOJcmfIX\n\t64kCMfECmNvk/uB6L+n/TSHOZYdfuwFd2Vl05r8QQRD1HvXdCOGAeklKsz2LWvNs0Otk\n\tGxp8/OyUHDJUGSc12nlo6PFerdZOBNNyusZ5pM1yqDGna8fpsMXxdtMU3UsrR3OZCKKW\n\tNyO69loBFkMoLXNGs2B78fZXWBVWT77+gCcQ1lfr9VZFpX0AtngzU1MMkryCmsGj1UdC\n\tLX5+A4xWnCeFHE3szA5qLgPj/JpGx4gL685248MagijeN6iXi2aXjimpExLuEuTK98Ga\n\tbKlA=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"L1hxUZhf\"; dkim-atps=neutral",
        "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=T7FcClSDovKV4o5TX4pXqGgDSXUR6G3jMCCkLVzbUmA=;\n\tb=xVSVJ3tGn8YIajvyTcr3uU/NA2JB4lomy68PMup4Y6ihrRquTRnQhu1+IixRVbfcg5\n\tMA8lV9L7k2G9VtDT/rfS3RwWxqP+Mhd68pErEcBTPUsBRr/bk5WrPGFr3pB2BnVyUZP9\n\taixCp/54sAlZ1Hzf5z5Q3ZT9nDGB/Hk1X/VSbj4nBhbPgPE7PAS7HSewqfr8e7ghD6Pl\n\tvasXqBH4ZEEPLlBnIESlJGQtfZI7ehXf2aBX+l8pdDDgfdi5QgdSvlGNpnFYAz54Sb7h\n\tb4QPeCbV2fn61ITdhCbUX3OZRE9IVu0mREGQPFfwGFS1PRoN1rGdumeZCUiyDk+v4a42\n\t+p+Q==",
        "X-Gm-Message-State": "AJIora+sInSpC8MSHzUCSMu7U1MXy/qDEqwwPYcIAcjcaeMJxw9qV0Yk\n\t6TwI6YztQw7CL+XKmRHdE2QgalgYL6Q=",
        "X-Google-Smtp-Source": "AGRyM1uAJq2JW8o5SFvVhNFjj0Fl3viJchCyhsLuGjZOpq5y8whYXZb4vaSC9kHrYp2Qd5lvvD3oWA==",
        "X-Received": "by 2002:a63:385d:0:b0:415:df85:4b73 with SMTP id\n\th29-20020a63385d000000b00415df854b73mr10049165pgn.179.1657553896258; \n\tMon, 11 Jul 2022 08:38:16 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 11 Jul 2022 21:07:08 +0530",
        "Message-Id": "<20220711153711.36679-3-rishikeshdonadkar@gmail.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220711153711.36679-1-rishikeshdonadkar@gmail.com>",
        "References": "<20220711153711.36679-1-rishikeshdonadkar@gmail.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v3 2/5] gstreamer: Update the obtained\n\tcolorimetry in caps.",
        "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": "Rishikesh Donadkar via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Rishikesh Donadkar <rishikeshdonadkar@gmail.com>",
        "Cc": "Rishikesh Donadkar <rishikeshdonadkar@gmail.com>,\n\tnicolas.dufresne@collabora.com, vedantparanjape160201@gmail.com",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "If the colorspace is set in the StreamConfiguration, convert the\nlibcamera colorspace to GStreamer colorimetry using the function\ncolorimetry_from_colorspace() which will take in the ColorSpace value\nand return the gst string representation of the colorimetry.\n\nIf the colorimetry corresponding to the colorspace set in the\nStreamConfiguration is not available in GStreamer remove the\nfield colorimetry from the caps structure if present.\n\nSigned-off-by: Rishikesh Donadkar <rishikeshdonadkar@gmail.com>\n---\n src/gstreamer/gstlibcamera-utils.cpp | 13 +++++++++++++\n 1 file changed, 13 insertions(+)",
    "diff": "diff --git a/src/gstreamer/gstlibcamera-utils.cpp b/src/gstreamer/gstlibcamera-utils.cpp\nindex 43837602..a2d9b64d 100644\n--- a/src/gstreamer/gstlibcamera-utils.cpp\n+++ b/src/gstreamer/gstlibcamera-utils.cpp\n@@ -164,11 +164,24 @@ gst_libcamera_stream_configuration_to_caps(const StreamConfiguration &stream_cfg\n {\n \tGstCaps *caps = gst_caps_new_empty();\n \tGstStructure *s = bare_structure_from_format(stream_cfg.pixelFormat);\n+\tgchar *colorimetry = nullptr;\n+\tstd::optional<ColorSpace> colorspace = stream_cfg.colorSpace;\n \n \tgst_structure_set(s,\n \t\t\t  \"width\", G_TYPE_INT, stream_cfg.size.width,\n \t\t\t  \"height\", G_TYPE_INT, stream_cfg.size.height,\n \t\t\t  nullptr);\n+\n+\tif (colorspace) {\n+\t\tColorSpace colorspaceValue = colorspace.value();\n+\t\tcolorimetry = colorimetry_from_colorspace(colorspaceValue);\n+\t\tif (colorimetry)\n+\t\t\tgst_structure_set(s, \"colorimetry\", G_TYPE_STRING, colorimetry, nullptr);\n+\t\telse\n+\t\t\tgst_structure_remove_fields(s, \"colorimetry\", nullptr);\n+\t\t\n+\t}\n+\n \tgst_caps_append_structure(caps, s);\n \n \treturn caps;\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "2/5"
    ]
}