Patch Detail
Show a patch.
GET /api/patches/797/?format=api
{ "id": 797, "url": "https://patchwork.libcamera.org/api/patches/797/?format=api", "web_url": "https://patchwork.libcamera.org/patch/797/", "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": "<20190326083902.26121-3-jacopo@jmondi.org>", "date": "2019-03-26T08:38:45", "name": "[libcamera-devel,v5,02/19] libcamera: formats: Define FormatEnum type", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "40748a614a52d3dffcb73313c173b74c6321f3ff", "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/797/mbox/", "series": [ { "id": 219, "url": "https://patchwork.libcamera.org/api/series/219/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=219", "date": "2019-03-26T08:38:43", "name": "libcamera: ipu3: Add ImgU support", "version": 5, "mbox": "https://patchwork.libcamera.org/series/219/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/797/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/797/checks/", "tags": {}, "headers": { "Return-Path": "<jacopo@jmondi.org>", "Received": [ "from relay10.mail.gandi.net (relay10.mail.gandi.net\n\t[217.70.178.230])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3D79461113\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Mar 2019 09:38:31 +0100 (CET)", "from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay10.mail.gandi.net (Postfix) with ESMTPSA id 5065C240016;\n\tTue, 26 Mar 2019 08:38:30 +0000 (UTC)" ], "From": "Jacopo Mondi <jacopo@jmondi.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 26 Mar 2019 09:38:45 +0100", "Message-Id": "<20190326083902.26121-3-jacopo@jmondi.org>", "X-Mailer": "git-send-email 2.21.0", "In-Reply-To": "<20190326083902.26121-1-jacopo@jmondi.org>", "References": "<20190326083902.26121-1-jacopo@jmondi.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v5 02/19] libcamera: formats: Define\n\tFormatEnum type", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.23", "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": "Tue, 26 Mar 2019 08:38:31 -0000" }, "content": "Add an internal format.h and format.cpp files to collect libcamera image\nformat related types, helpers and structures. Define and document the\nFormatEnum type, used to enumerate pixel image formats and associated\nimage resolutions.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/formats.cpp | 27 ++++++++++++++++++++++++++\n src/libcamera/include/formats.h | 22 +++++++++++++++++++++\n src/libcamera/include/v4l2_subdevice.h | 4 ++--\n src/libcamera/meson.build | 1 +\n src/libcamera/v4l2_subdevice.cpp | 5 ++---\n 5 files changed, 54 insertions(+), 5 deletions(-)\n create mode 100644 src/libcamera/formats.cpp\n create mode 100644 src/libcamera/include/formats.h", "diff": "diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\nnew file mode 100644\nindex 000000000000..56f4ddb51ffa\n--- /dev/null\n+++ b/src/libcamera/formats.cpp\n@@ -0,0 +1,27 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2019, Google Inc.\n+ *\n+ * formats.cpp - Libcamera image formats\n+ */\n+\n+#include \"formats.h\"\n+\n+/**\n+ * \\file formats.h\n+ * \\brief Types and helper methods to handle libcamera image formats\n+ */\n+\n+namespace libcamera {\n+\n+/**\n+ * \\typedef FormatEnum\n+ * \\brief Type definition for the map of image formats and sizes\n+ *\n+ * Type definition used to enumerate the supported pixel formats and image\n+ * frame sizes. The type associates in a map a pixel format (for memory\n+ * formats) or a media bus code (for bus formats), to a vector of image\n+ * resolutions represented by SizeRange items.\n+ */\n+\n+} /* namespace libcamera */\ndiff --git a/src/libcamera/include/formats.h b/src/libcamera/include/formats.h\nnew file mode 100644\nindex 000000000000..5fcfb11318e7\n--- /dev/null\n+++ b/src/libcamera/include/formats.h\n@@ -0,0 +1,22 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2019, Google Inc.\n+ *\n+ * formats.h - Libcamera image formats\n+ */\n+\n+#ifndef __LIBCAMERA_FORMATS_H__\n+#define __LIBCAMERA_FORMATS_H__\n+\n+#include <map>\n+#include <vector>\n+\n+#include \"geometry.h\"\n+\n+namespace libcamera {\n+\n+typedef std::map<unsigned int, std::vector<SizeRange>> FormatEnum;\n+\n+} /* namespace libcamera */\n+\n+#endif /* __LIBCAMERA_FORMATS_H__ */\ndiff --git a/src/libcamera/include/v4l2_subdevice.h b/src/libcamera/include/v4l2_subdevice.h\nindex 700e66bcddac..3ecf08514898 100644\n--- a/src/libcamera/include/v4l2_subdevice.h\n+++ b/src/libcamera/include/v4l2_subdevice.h\n@@ -11,6 +11,7 @@\n #include <string>\n #include <vector>\n \n+#include \"formats.h\"\n #include \"geometry.h\"\n #include \"log.h\"\n #include \"media_object.h\"\n@@ -42,8 +43,7 @@ public:\n \tint setCrop(unsigned int pad, Rectangle *rect);\n \tint setCompose(unsigned int pad, Rectangle *rect);\n \n-\tconst std::map<unsigned int, std::vector<SizeRange>>\n-\t\t\t\t\t\tformats(unsigned int pad);\n+\tFormatEnum formats(unsigned int pad);\n \n \tint getFormat(unsigned int pad, V4L2SubdeviceFormat *format);\n \tint setFormat(unsigned int pad, V4L2SubdeviceFormat *format);\ndiff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\nindex 8384cd0af451..4433abfceca3 100644\n--- a/src/libcamera/meson.build\n+++ b/src/libcamera/meson.build\n@@ -6,6 +6,7 @@ libcamera_sources = files([\n 'event_dispatcher.cpp',\n 'event_dispatcher_poll.cpp',\n 'event_notifier.cpp',\n+ 'formats.cpp',\n 'geometry.cpp',\n 'log.cpp',\n 'media_device.cpp',\ndiff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\nindex cf873487b22c..8260e6ebce0e 100644\n--- a/src/libcamera/v4l2_subdevice.cpp\n+++ b/src/libcamera/v4l2_subdevice.cpp\n@@ -210,10 +210,9 @@ int V4L2Subdevice::setCompose(unsigned int pad, Rectangle *rect)\n * \\return A map of image formats associated with a list of image sizes, or\n * an empty map on error or if the pad does not exist\n */\n-const std::map<unsigned int, std::vector<SizeRange>>\n-V4L2Subdevice::formats(unsigned int pad)\n+FormatEnum V4L2Subdevice::formats(unsigned int pad)\n {\n-\tstd::map<unsigned int, std::vector<SizeRange>> formatMap = {};\n+\tFormatEnum formatMap = {};\n \tstruct v4l2_subdev_mbus_code_enum mbusEnum = {};\n \tint ret;\n \n", "prefixes": [ "libcamera-devel", "v5", "02/19" ] }