Show a patch.

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

{
    "id": 2288,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/2288/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/2288/",
    "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": "<20191028110208.15751-6-laurent.pinchart@ideasonboard.com>",
    "date": "2019-10-28T11:02:06",
    "name": "[libcamera-devel,v2,5/7] libcamera: stream: Use the newly defined PixelFormat",
    "commit_ref": "c53f8fbbab29385c584f9229c9ee57107b954225",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "d6d3e84dbd60957c039a2b03d7f7575769f4ba58",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/2288/mbox/",
    "series": [
        {
            "id": 564,
            "url": "https://patchwork.libcamera.org/api/1.1/series/564/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=564",
            "date": "2019-10-28T11:02:01",
            "name": "libcamera: Introduce a PixelFormat type",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/564/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/2288/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/2288/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<laurent.pinchart@ideasonboard.com>",
        "Received": [
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C0C4B6017F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Oct 2019 12:02:20 +0100 (CET)",
            "from pendragon.ideasonboard.com (unknown [91.217.168.176])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5CDFDB7D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Oct 2019 12:02:20 +0100 (CET)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1572260540;\n\tbh=kJj3ADYx+OdeCoe8CtEz+7JuirOoi2z97a+J1IWotxo=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=qt8o5nv2jhm+T8qPh5SVQULKyyU6t1ucWFSFuApeVcFFiUeWGb80IT/7rM4Tvpy+Z\n\tPO73oGzQZ0RGkF0XwTSElGFbUrjngSXfW8H/iRjwBZOe62H7z4d9aVH9IclNpzVB19\n\tfKJYnNirc8j9i9dKB6EN/T2dbyr8oz7iW3aY5lLo=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 28 Oct 2019 13:02:06 +0200",
        "Message-Id": "<20191028110208.15751-6-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.23.0",
        "In-Reply-To": "<20191028110208.15751-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20191028110208.15751-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 5/7] libcamera: stream: Use the newly\n\tdefined PixelFormat",
        "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, 28 Oct 2019 11:02:22 -0000"
    },
    "content": "From: Jacopo Mondi <jacopo@jmondi.org>\n\nUse the newly defined PixelFormat type to define the image format\ncontained in the StreamFormats and StreamConfiguration classes.\n\nUpdate the classes documentation accordingly.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/stream.h | 13 +++++++------\n src/libcamera/stream.cpp   | 17 +++++++----------\n 2 files changed, 14 insertions(+), 16 deletions(-)",
    "diff": "diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\nindex 2e619cdf0e89..a404eccf34d9 100644\n--- a/include/libcamera/stream.h\n+++ b/include/libcamera/stream.h\n@@ -14,6 +14,7 @@\n \n #include <libcamera/buffer.h>\n #include <libcamera/geometry.h>\n+#include <libcamera/pixelformats.h>\n \n namespace libcamera {\n \n@@ -24,15 +25,15 @@ class StreamFormats\n {\n public:\n \tStreamFormats();\n-\tStreamFormats(const std::map<unsigned int, std::vector<SizeRange>> &formats);\n+\tStreamFormats(const std::map<PixelFormat, std::vector<SizeRange>> &formats);\n \n-\tstd::vector<unsigned int> pixelformats() const;\n-\tstd::vector<Size> sizes(unsigned int pixelformat) const;\n+\tstd::vector<PixelFormat> pixelformats() const;\n+\tstd::vector<Size> sizes(PixelFormat pixelformat) const;\n \n-\tSizeRange range(unsigned int pixelformat) const;\n+\tSizeRange range(PixelFormat pixelformat) const;\n \n private:\n-\tstd::map<unsigned int, std::vector<SizeRange>> formats_;\n+\tstd::map<PixelFormat, std::vector<SizeRange>> formats_;\n };\n \n enum MemoryType {\n@@ -44,7 +45,7 @@ struct StreamConfiguration {\n \tStreamConfiguration();\n \tStreamConfiguration(const StreamFormats &formats);\n \n-\tunsigned int pixelFormat;\n+\tPixelFormat pixelFormat;\n \tSize size;\n \n \tMemoryType memoryType;\ndiff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\nindex b8e7209c1047..45f31ae1e2da 100644\n--- a/src/libcamera/stream.cpp\n+++ b/src/libcamera/stream.cpp\n@@ -94,7 +94,7 @@ StreamFormats::StreamFormats()\n  * \\brief Construct a StreamFormats object with a map of image formats\n  * \\param[in] formats A map of pixel formats to a sizes description\n  */\n-StreamFormats::StreamFormats(const std::map<unsigned int, std::vector<SizeRange>> &formats)\n+StreamFormats::StreamFormats(const std::map<PixelFormat, std::vector<SizeRange>> &formats)\n \t: formats_(formats)\n {\n }\n@@ -103,9 +103,9 @@ StreamFormats::StreamFormats(const std::map<unsigned int, std::vector<SizeRange>\n  * \\brief Retrieve the list of supported pixel formats\n  * \\return The list of supported pixel formats\n  */\n-std::vector<unsigned int> StreamFormats::pixelformats() const\n+std::vector<PixelFormat> StreamFormats::pixelformats() const\n {\n-\tstd::vector<unsigned int> formats;\n+\tstd::vector<PixelFormat> formats;\n \n \tfor (auto const &it : formats_)\n \t\tformats.push_back(it.first);\n@@ -115,7 +115,7 @@ std::vector<unsigned int> StreamFormats::pixelformats() const\n \n /**\n  * \\brief Retrieve the list of frame sizes supported for \\a pixelformat\n- * \\param[in] pixelformat Pixel format to retrieve sizes for\n+ * \\param[in] pixelformat PixelFormat to retrieve sizes for\n  *\n  * If the sizes described for \\a pixelformat are discrete they are returned\n  * directly.\n@@ -127,7 +127,7 @@ std::vector<unsigned int> StreamFormats::pixelformats() const\n  *\n  * \\return A list of frame sizes or an empty list on error\n  */\n-std::vector<Size> StreamFormats::sizes(unsigned int pixelformat) const\n+std::vector<Size> StreamFormats::sizes(PixelFormat pixelformat) const\n {\n \t/*\n \t * Sizes to try and extract from ranges.\n@@ -230,7 +230,7 @@ std::vector<Size> StreamFormats::sizes(unsigned int pixelformat) const\n \n /**\n  * \\brief Retrieve the range of minimum and maximum sizes\n- * \\param[in] pixelformat Pixel format to retrieve range for\n+ * \\param[in] pixelformat PixelFormat to retrieve range for\n  *\n  * If the size described for \\a pixelformat is a range, that range is returned\n  * directly. If the sizes described are a list of discrete sizes, a range is\n@@ -240,7 +240,7 @@ std::vector<Size> StreamFormats::sizes(unsigned int pixelformat) const\n  *\n  * \\return A range of valid image sizes or an empty range on error\n  */\n-SizeRange StreamFormats::range(unsigned int pixelformat) const\n+SizeRange StreamFormats::range(PixelFormat pixelformat) const\n {\n \tauto const it = formats_.find(pixelformat);\n \tif (it == formats_.end())\n@@ -311,9 +311,6 @@ StreamConfiguration::StreamConfiguration(const StreamFormats &formats)\n /**\n  * \\var StreamConfiguration::pixelFormat\n  * \\brief Stream pixel format\n- *\n- * This is a little endian four character code representation of the pixel\n- * format described in V4L2 using the V4L2_PIX_FMT_* definitions.\n  */\n \n /**\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "5/7"
    ]
}