[{"id":1697,"web_url":"https://patchwork.libcamera.org/comment/1697/","msgid":"<20190524192909.GD1702@pendragon.ideasonboard.com>","date":"2019-05-24T19:29:09","subject":"Re: [libcamera-devel] [PATCH 2/6] libcamera: v4l2_device: Add\n\tsupport for META_OUTPUT","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Fri, May 24, 2019 at 06:21:35PM +0200, Jacopo Mondi wrote:\n> Add support for output devices that expose the META_OUTPUT capabilities.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/libcamera/include/v4l2_device.h | 10 ++++++++--\n>  src/libcamera/v4l2_device.cpp       |  9 +++++++++\n>  2 files changed, 17 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h\n> index 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;\n> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\n> index 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;","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 86A8660003\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 May 2019 21:29:27 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0EFAC510;\n\tFri, 24 May 2019 21:29:26 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1558726167;\n\tbh=ekqaX+KJ0xuMtx4ftS+1GQF0k2FlkP4WZ2ja3RkJiBM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=XfNkKs5UXA9T3GX3XhzEi4N1Bis7g3b6fJGmTKBPbOlbBYHCnxhRwbkmt9KQFRgWL\n\tgu8FXhIpXPP7IlcDnseyDaepLpprr6peKbMWMF3yTsTg//ZzcfVuiIKnO9KRbo6x1w\n\tAd1Ru7WRYvX3sg72+diJvUL0qWqMQwjgMMFiFwWU=","Date":"Fri, 24 May 2019 22:29:09 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190524192909.GD1702@pendragon.ideasonboard.com>","References":"<20190524162139.4446-1-jacopo@jmondi.org>\n\t<20190524162139.4446-3-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20190524162139.4446-3-jacopo@jmondi.org>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 2/6] libcamera: v4l2_device: Add\n\tsupport for 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 19:29:27 -0000"}}]