Show a patch.

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

{
    "id": 4113,
    "url": "https://patchwork.libcamera.org/api/patches/4113/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/4113/",
    "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": "<20200622144257.GA27697@kaaira-HP-Pavilion-Notebook>",
    "date": "2020-06-22T14:42:57",
    "name": "[libcamera-devel,v2] libcamera: stream_option: use format name to set cam/qcam format",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "3adea52e9bb3cf824c3c5908cd30d93a4de26d0d",
    "submitter": {
        "id": 39,
        "url": "https://patchwork.libcamera.org/api/people/39/?format=api",
        "name": "Kaaira Gupta",
        "email": "kgupta@es.iitr.ac.in"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/4113/mbox/",
    "series": [
        {
            "id": 1025,
            "url": "https://patchwork.libcamera.org/api/series/1025/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1025",
            "date": "2020-06-22T14:42:57",
            "name": "[libcamera-devel,v2] libcamera: stream_option: use format name to set cam/qcam format",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/1025/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/4113/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/4113/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<kgupta@es.iitr.ac.in>",
        "Received": [
            "from mail-pl1-x633.google.com (mail-pl1-x633.google.com\n\t[IPv6:2607:f8b0:4864:20::633])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D8688603BD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 22 Jun 2020 16:43:05 +0200 (CEST)",
            "by mail-pl1-x633.google.com with SMTP id y18so7673622plr.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 22 Jun 2020 07:43:05 -0700 (PDT)",
            "from kaaira-HP-Pavilion-Notebook ([103.113.213.178])\n\tby smtp.gmail.com with ESMTPSA id\n\ts98sm14281431pjb.33.2020.06.22.07.43.01\n\t(version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256);\n\tMon, 22 Jun 2020 07:43:03 -0700 (PDT)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=es-iitr-ac-in.20150623.gappssmtp.com\n\theader.i=@es-iitr-ac-in.20150623.gappssmtp.com header.b=\"uJPsoaBj\"; \n\tdkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=es-iitr-ac-in.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:subject:message-id:mime-version:content-disposition\n\t:user-agent; bh=e7bAIgwEZ6H2ceQIzrYCe5roF2dUQtcnWoZUniepiuc=;\n\tb=uJPsoaBj6/ZbQdpO2vdN7CQRilIFyXuZHA9tDyu/vpP3N3LiPf9fznyooKddtjjHhw\n\te4zeQ7ojVCVp/zyxvcEWWhRF7oWcehwWF2efSITORrMW2dYz02JcQl8GO5NaJIomkCQw\n\trF/i99pam5eVjuEXVa1fjmpS0OFoe1APy/zrKT8GJG6+OFHJOCYobqBnHz2zAnLK3dc6\n\tKENCumqqgT2acpvufZ4Q+W0/teoLmHBCYkxCFDciIuADfP54u5rkvyCM4u37uCgU57Wj\n\tWeVjZqphJCE0Czv4V4V3zdYvH+9jNnaWtVfeLbdRLEh3hVXlsweGCmMqEhwjfJoHdGAF\n\tJxKg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:subject:message-id:mime-version\n\t:content-disposition:user-agent;\n\tbh=e7bAIgwEZ6H2ceQIzrYCe5roF2dUQtcnWoZUniepiuc=;\n\tb=GLYews9ekOFU1Cze7iiatbKgwPL1+e5vRTYpXJUHjggPi4zOGFwupXpCCVeyovGUCL\n\tWfBxO/jp2zUhUb0X8voVT10Rq+kirDVaqJjxdLBbOvEWwrcjvNgGOWp2klSS4RgZpX30\n\th7LtFwxhSvTRt2uCnTx0YDdavcGThEJAC+KC8jXxAxh9WdbI57X4aPFwVGrpKJNSJAC0\n\tLzs7dPIlctY9ml7qVZyNiZ6O9INtyzEUISyM5mcn5n53nniKNYfTfOh91j6sIdvMNLaN\n\tEGTXP7kv25/9T6qQerjGRjbbqCiSgER8IsnA29wIpH6LkjdYOmS4EpFQnpp36tOpb0Hh\n\tZVZQ==",
        "X-Gm-Message-State": "AOAM531oKOPRir9byE/e9D+1q0dMNX014bIPdvnizYNSHhcCWt2uROIH\n\tHOnWFpLfQdjaCkB+tcs+tWei9Rad35iJ+w==",
        "X-Google-Smtp-Source": "ABdhPJxejtaTIQzINsWmj7nPR5jQTjjeYbjMUGHfPCzLNZWk0Z/nd9IHx30prS7qIBOXdwR0sDufVg==",
        "X-Received": "by 2002:a17:902:fe8b:: with SMTP id\n\tx11mr19709302plm.179.1592836983935; \n\tMon, 22 Jun 2020 07:43:03 -0700 (PDT)",
        "Date": "Mon, 22 Jun 2020 20:12:57 +0530",
        "From": "Kaaira Gupta <kgupta@es.iitr.ac.in>",
        "To": "libcamera-devel@lists.libcamera.org, Kieran Bingham\n\t<kieran.bingham@ideasonboard.com>, Niklas =?iso-8859-1?q?S=F6derlund?=\n\t<niklas.soderlund@ragnatech.se>",
        "Message-ID": "<20200622144257.GA27697@kaaira-HP-Pavilion-Notebook>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=us-ascii",
        "Content-Disposition": "inline",
        "User-Agent": "Mutt/1.9.4 (2018-02-28)",
        "Subject": "[libcamera-devel] [PATCH v2] libcamera: stream_option: use format\n\tname to set cam/qcam format",
        "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>",
        "X-List-Received-Date": "Mon, 22 Jun 2020 14:43:06 -0000"
    },
    "content": "Replace hex input for pixelformats with their format names, for input in\ncam and qcam.\n\nSigned-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>\n---\n\nChanges since v1:\n\t-use format names, according to formats namespace, instead of\n\tFourCC\n\n src/cam/stream_options.cpp | 52 +++++++++++++++++++++++++++++++++++---\n 1 file changed, 49 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/src/cam/stream_options.cpp b/src/cam/stream_options.cpp\nindex bd12c8f..9fc428a 100644\n--- a/src/cam/stream_options.cpp\n+++ b/src/cam/stream_options.cpp\n@@ -6,6 +6,8 @@\n  */\n #include \"stream_options.h\"\n \n+#include <libcamera/formats.h>\n+\n #include <iostream>\n \n using namespace libcamera;\n@@ -19,7 +21,7 @@ StreamKeyValueParser::StreamKeyValueParser()\n \t\t  ArgumentRequired);\n \taddOption(\"height\", OptionInteger, \"Height in pixels\",\n \t\t  ArgumentRequired);\n-\taddOption(\"pixelformat\", OptionInteger, \"Pixel format\",\n+\taddOption(\"pixelformat\", OptionString, \"Pixel format name\",\n \t\t  ArgumentRequired);\n }\n \n@@ -96,8 +98,52 @@ int StreamKeyValueParser::updateConfiguration(CameraConfiguration *config,\n \t\t}\n \n \t\t/* \\todo Translate 4CC string to pixelformat with modifier. */\n-\t\tif (opts.isSet(\"pixelformat\"))\n-\t\t\tcfg.pixelFormat = PixelFormat(opts[\"pixelformat\"]);\n+\t\tif (opts.isSet(\"pixelformat\")) {\n+\t\t\tstd::map<std::string, PixelFormat> pixelFormatNames{\n+\t\t\t\t{ \"BGR888\", formats::BGR888 },\n+\t\t\t\t{ \"RGB888\", formats::RGB888 },\n+\t\t\t\t{ \"ABGR8888\", formats::ABGR8888 },\n+\t\t\t\t{ \"ARGB8888\", formats::ARGB8888 },\n+\t\t\t\t{ \"BGRA8888\", formats::BGRA8888 },\n+\t\t\t\t{ \"RGBA8888\", formats::RGBA8888 },\n+\t\t\t\t{ \"YUYV\", formats::YUYV },\n+\t\t\t\t{ \"YVYU\", formats::YVYU },\n+\t\t\t\t{ \"UYVY\", formats::UYVY },\n+\t\t\t\t{ \"VYUY\", formats::VYUY },\n+\t\t\t\t{ \"NV16\", formats::NV16 },\n+\t\t\t\t{ \"NV61\", formats::NV61 },\n+\t\t\t\t{ \"NV12\", formats::NV12 },\n+\t\t\t\t{ \"NV21\", formats::NV21 },\n+\t\t\t\t{ \"YUV420\", formats::YUV420 },\n+\t\t\t\t{ \"YUV422\", formats::YUV422 },\n+\t\t\t\t{ \"R8\", formats::R8 },\n+\t\t\t\t{ \"SBGGR8\", formats::SBGGR8 },\n+\t\t\t\t{ \"SGBRG8\", formats::SGBRG8 },\n+\t\t\t\t{ \"SGRBG8\", formats::SGRBG8 },\n+\t\t\t\t{ \"SRGGB8\", formats::SRGGB8 },\n+\t\t\t\t{ \"SBGGR10\", formats::SBGGR10 },\n+\t\t\t\t{ \"SGBRG10\", formats::SGBRG10 },\n+\t\t\t\t{ \"SGRBG10\", formats::SGRBG10 },\n+\t\t\t\t{ \"SRGGB10\", formats::SRGGB10 },\n+\t\t\t\t{ \"SBGGR10_CSI2P\", formats::SBGGR10_CSI2P },\n+\t\t\t\t{ \"SGBRG10_CSI2P\", formats::SGBRG10_CSI2P },\n+\t\t\t\t{ \"SGRBG10_CSI2P\", formats::SGRBG10_CSI2P },\n+\t\t\t\t{ \"SRGGB10_CSI2P\", formats::SRGGB10_CSI2P },\n+\t\t\t\t{ \"SBGGR12\", formats::SBGGR12 },\n+\t\t\t\t{ \"SGBRG12\", formats::SGBRG12 },\n+\t\t\t\t{ \"SGRBG12\", formats::SGRBG12 },\n+\t\t\t\t{ \"SRGGB12\", formats::SRGGB12 },\n+\t\t\t\t{ \"SBGGR12_CSI2P\", formats::SBGGR12_CSI2P },\n+\t\t\t\t{ \"SGBRG12_CSI2P\", formats::SGBRG12_CSI2P },\n+\t\t\t\t{ \"SGRBG12_CSI2P\", formats::SGRBG12_CSI2P },\n+\t\t\t\t{ \"SRGGB12_CSI2P\", formats::SRGGB12_CSI2P },\n+\t\t\t\t{ \"MJPEG\", formats::MJPEG },\n+\t\t\t};\n+\n+\t\t\tstd::map<std::string, PixelFormat>::iterator it;\n+\t\t\tit = pixelFormatNames.find(opts[\"pixelformat\"]);\n+\t\t\tcfg.pixelFormat = it->second;\n+\t\t}\n \t}\n \n \treturn 0;\n",
    "prefixes": [
        "libcamera-devel",
        "v2"
    ]
}