Patch Detail
Show a patch.
GET /api/patches/2244/?format=api
{ "id": 2244, "url": "https://patchwork.libcamera.org/api/patches/2244/?format=api", "web_url": "https://patchwork.libcamera.org/patch/2244/", "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": "<20191027234312.35284-7-jacopo@jmondi.org>", "date": "2019-10-27T23:43:08", "name": "[libcamera-devel,06/10] libcamera: stream: Use the newly defined PixelFormat", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "d6d3e84dbd60957c039a2b03d7f7575769f4ba58", "submitter": { "id": 3, "url": "https://patchwork.libcamera.org/api/people/3/?format=api", "name": "Jacopo Mondi", "email": "jacopo@jmondi.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/2244/mbox/", "series": [ { "id": 559, "url": "https://patchwork.libcamera.org/api/series/559/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=559", "date": "2019-10-27T23:43:02", "name": "libcamera: Use DRM_FORMAT_* fourcc codes", "version": 1, "mbox": "https://patchwork.libcamera.org/series/559/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/2244/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/2244/checks/", "tags": {}, "headers": { "Return-Path": "<jacopo@jmondi.org>", "Received": [ "from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net\n\t[217.70.183.200])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 511A361507\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Oct 2019 00:41:28 +0100 (CET)", "from uno.localdomain (143.121.2.93.rev.sfr.net [93.2.121.143])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay7-d.mail.gandi.net (Postfix) with ESMTPSA id E456E20002;\n\tSun, 27 Oct 2019 23:41:27 +0000 (UTC)" ], "X-Originating-IP": "93.2.121.143", "From": "Jacopo Mondi <jacopo@jmondi.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 28 Oct 2019 00:43:08 +0100", "Message-Id": "<20191027234312.35284-7-jacopo@jmondi.org>", "X-Mailer": "git-send-email 2.23.0", "In-Reply-To": "<20191027234312.35284-1-jacopo@jmondi.org>", "References": "<20191027234312.35284-1-jacopo@jmondi.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 06/10] 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": "Sun, 27 Oct 2019 23:41:29 -0000" }, "content": "Use 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>\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", "06/10" ] }