{"id":1287,"url":"https://patchwork.libcamera.org/api/1.1/patches/1287/?format=json","web_url":"https://patchwork.libcamera.org/patch/1287/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20190524162139.4446-3-jacopo@jmondi.org>","date":"2019-05-24T16:21:35","name":"[libcamera-devel,2/6] libcamera: v4l2_device: Add support for META_OUTPUT","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"69093a49945343692f829d86e912d4e1c7e7ad97","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/1.1/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/1287/mbox/","series":[{"id":326,"url":"https://patchwork.libcamera.org/api/1.1/series/326/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=326","date":"2019-05-24T16:21:33","name":"META_OUTPUT support + IPU3 parameters tuning","version":1,"mbox":"https://patchwork.libcamera.org/series/326/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/1287/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/1287/checks/","tags":{},"headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net\n\t[217.70.183.193])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1C6EF61865\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 May 2019 18:20:40 +0200 (CEST)","from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay1-d.mail.gandi.net (Postfix) with ESMTPSA id A6FCB240009;\n\tFri, 24 May 2019 16:20:38 +0000 (UTC)"],"X-Originating-IP":"2.224.242.101","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 24 May 2019 18:21:35 +0200","Message-Id":"<20190524162139.4446-3-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.21.0","In-Reply-To":"<20190524162139.4446-1-jacopo@jmondi.org>","References":"<20190524162139.4446-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 2/6] libcamera: v4l2_device: Add support\n\tfor META_OUTPUT","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":"Fri, 24 May 2019 16:20:40 -0000"},"content":"Add support for output devices that expose the META_OUTPUT capabilities.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/include/v4l2_device.h | 10 ++++++++--\n src/libcamera/v4l2_device.cpp       |  9 +++++++++\n 2 files changed, 17 insertions(+), 2 deletions(-)","diff":"diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h\nindex 2e7bd1e7f4cc..cecafa151caa 100644\n--- a/src/libcamera/include/v4l2_device.h\n+++ b/src/libcamera/include/v4l2_device.h\n@@ -59,7 +59,8 @@ struct V4L2Capability final : v4l2_capability {\n \tbool isOutput() const\n \t{\n \t\treturn device_caps() & (V4L2_CAP_VIDEO_OUTPUT |\n-\t\t\t\t\tV4L2_CAP_VIDEO_OUTPUT_MPLANE);\n+\t\t\t\t\tV4L2_CAP_VIDEO_OUTPUT_MPLANE |\n+\t\t\t\t\tV4L2_CAP_META_OUTPUT);\n \t}\n \tbool isVideo() const\n \t{\n@@ -70,7 +71,8 @@ struct V4L2Capability final : v4l2_capability {\n \t}\n \tbool isMeta() const\n \t{\n-\t\treturn device_caps() & V4L2_CAP_META_CAPTURE;\n+\t\treturn device_caps() & (V4L2_CAP_META_CAPTURE |\n+\t\t\t\t\tV4L2_CAP_META_OUTPUT);\n \t}\n \tbool isVideoCapture() const\n \t{\n@@ -84,6 +86,10 @@ struct V4L2Capability final : v4l2_capability {\n \t{\n \t\treturn isMeta() && isCapture();\n \t}\n+\tbool isMetaOutput() const\n+\t{\n+\t\treturn isMeta() && isOutput();\n+\t}\n \tbool hasStreaming() const\n \t{\n \t\treturn device_caps() & V4L2_CAP_STREAMING;\ndiff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\nindex 8366ffc4db55..e42f6ef0c340 100644\n--- a/src/libcamera/v4l2_device.cpp\n+++ b/src/libcamera/v4l2_device.cpp\n@@ -116,6 +116,12 @@ LOG_DEFINE_CATEGORY(V4L2)\n  * \\return True if the device can capture image meta-data\n  */\n \n+/**\n+ * \\fn V4L2Capability::isMetaOutput()\n+ * \\brief Identify if the device outputs image meta-data\n+ * \\return True if the device can output image meta-data\n+ */\n+\n /**\n  * \\fn V4L2Capability::hasStreaming()\n  * \\brief Determine if the device can perform Streaming I/O\n@@ -348,6 +354,9 @@ int V4L2Device::open()\n \t} else if (caps_.isMetaCapture()) {\n \t\tfdEvent_ = new EventNotifier(fd_, EventNotifier::Read);\n \t\tbufferType_ = V4L2_BUF_TYPE_META_CAPTURE;\n+\t} else if (caps_.isMetaOutput()) {\n+\t\tfdEvent_ = new EventNotifier(fd_, EventNotifier::Write);\n+\t\tbufferType_ = V4L2_BUF_TYPE_META_OUTPUT;\n \t} else {\n \t\tLOG(V4L2, Error) << \"Device is not a supported type\";\n \t\treturn -EINVAL;\n","prefixes":["libcamera-devel","2/6"]}