{"id":431,"url":"https://patchwork.libcamera.org/api/patches/431/?format=json","web_url":"https://patchwork.libcamera.org/patch/431/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20190128151137.31075-2-jacopo@jmondi.org>","date":"2019-01-28T15:11:36","name":"[libcamera-devel,1/2] libcamera: v4l2-format: Add V4L2DeviceFormat","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"6fe22dc3da7eebfe0dac8ce16ced974f3c43a037","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/431/mbox/","series":[{"id":152,"url":"https://patchwork.libcamera.org/api/series/152/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=152","date":"2019-01-28T15:11:35","name":"V4L2Device: Add get/set format support","version":1,"mbox":"https://patchwork.libcamera.org/series/152/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/431/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/431/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 AA43460DB7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Jan 2019 16:11:30 +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 3F2C8240013;\n\tMon, 28 Jan 2019 15:11:30 +0000 (UTC)"],"From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 28 Jan 2019 16:11:36 +0100","Message-Id":"<20190128151137.31075-2-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.20.1","In-Reply-To":"<20190128151137.31075-1-jacopo@jmondi.org>","References":"<20190128151137.31075-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 1/2] libcamera: v4l2-format: Add\n\tV4L2DeviceFormat","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":"Mon, 28 Jan 2019 15:11:30 -0000"},"content":"Add a V4L2DeviceFormat class aimed to be used to provide format configuration\nrequests to a V4L2Device.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/include/v4l2_device.h | 14 ++++++++\n src/libcamera/v4l2_device.cpp       | 56 +++++++++++++++++++++++++++++\n 2 files changed, 70 insertions(+)","diff":"diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h\nindex c67ebbf..c70959e 100644\n--- a/src/libcamera/include/v4l2_device.h\n+++ b/src/libcamera/include/v4l2_device.h\n@@ -53,6 +53,20 @@ struct V4L2Capability final : v4l2_capability {\n \t}\n };\n \n+class V4L2DeviceFormat\n+{\n+public:\n+\tuint32_t width;\n+\tuint32_t height;\n+\tuint32_t fourcc;\n+\n+\tstruct {\n+\t\tuint32_t size;\n+\t\tuint32_t bpl;\n+\t} planesFmt[3];\n+\tunsigned int planes;\n+};\n+\n class MediaEntity;\n class V4L2Device\n {\ndiff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\nindex 408f9b9..d6143f2 100644\n--- a/src/libcamera/v4l2_device.cpp\n+++ b/src/libcamera/v4l2_device.cpp\n@@ -80,6 +80,62 @@ LOG_DEFINE_CATEGORY(V4L2)\n  * \\return True if the device provides Streaming I/O IOCTLs\n  */\n \n+/**\n+ * \\class V4L2DeviceFormat\n+ * \\brief The V4L2 device image format and sizes\n+ *\n+ * Describes the image format and image sizes to be programmed on a V4L2\n+ * video device. The image format is defined by fourcc code as defined by\n+ * the V4L2 APIs with the V4L2_PIX_FMT_ macros, a visible width and height\n+ * and a variable number of planes (1 to 3) with variable sizes and line\n+ * strides.\n+ *\n+ * Formats defined as 'single planar' by the V4L2 APIs are represented with\n+ * V4L2DeviceFormat instances with a single plane\n+ * (V4L2DeviceFormat::planes = 1). Semi-planar and multiplanar formats use\n+ * 2 and 3 planes respectively.\n+ *\n+ * V4L2DeviceFormat defines the exchange format between components that\n+ * receive image configuration requests from applications and a V4L2Device.\n+ * The V4L2Device validates and applies the requested size and format to\n+ * the device driver.\n+ */\n+\n+/**\n+ * \\var V4L2DeviceFormat::width\n+ * \\brief The image width\n+ */\n+\n+/**\n+ * \\var V4L2DeviceFormat::height\n+ * \\brief The image height\n+ */\n+\n+/**\n+ * \\var V4L2DeviceFormat::fourcc\n+ * \\brief The pixel encoding scheme\n+ *\n+ * The fourcc code, as defined by the V4L2 APIs with the V4L2_PIX_FMT_ macros,\n+ * that identifies the image format pixel encoding scheme.\n+ */\n+\n+/**\n+ * \\var V4L2DeviceFormat::planesFmt\n+ * \\brief The per-plane size information\n+ *\n+ * Images are stored in memory in one or more data planes. Each data plane\n+ * has a specific size and line length, which could differ from the image\n+ * visible sizes to accommodate line or plane padding data.\n+ *\n+ * Only the first V4L2DeviceFormat::planes entries are considered valid.\n+ *\n+ */\n+\n+/**\n+ * \\var V4L2DeviceFormat::planes\n+ * \\brief The number of valid data planes\n+ */\n+\n /**\n  * \\class V4L2Device\n  * \\brief V4L2Device object and API\n","prefixes":["libcamera-devel","1/2"]}