Commit 934a040b authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab

media: docs-rst: v4l: Document V4L2_BUF_TYPE_META_OUTPUT interface

Document the interface for metadata output, including
V4L2_BUF_TYPE_META_OUTPUT buffer type and V4L2_CAP_META_OUTPUT capability
bits.
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: default avatarTomasz Figa <tfiga@chromium.org>
Tested-by: default avatarTian Shu Qiu <tian.shu.qiu@intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 72148d1a
...@@ -472,6 +472,9 @@ enum v4l2_buf_type ...@@ -472,6 +472,9 @@ enum v4l2_buf_type
* - ``V4L2_BUF_TYPE_META_CAPTURE`` * - ``V4L2_BUF_TYPE_META_CAPTURE``
- 13 - 13
- Buffer for metadata capture, see :ref:`metadata`. - Buffer for metadata capture, see :ref:`metadata`.
* - ``V4L2_BUF_TYPE_META_OUTPUT``
- 14
- Buffer for metadata output, see :ref:`metadata`.
......
...@@ -14,21 +14,27 @@ Metadata Interface ...@@ -14,21 +14,27 @@ Metadata Interface
****************** ******************
Metadata refers to any non-image data that supplements video frames with Metadata refers to any non-image data that supplements video frames with
additional information. This may include statistics computed over the image additional information. This may include statistics computed over the image,
or frame capture parameters supplied by the image source. This interface is frame capture parameters supplied by the image source or device specific
intended for transfer of metadata to userspace and control of that operation. parameters for specifying how the device processes images. This interface is
intended for transfer of metadata between the userspace and the hardware and
control of that operation.
The metadata interface is implemented on video capture device nodes. The device The metadata interface is implemented on video device nodes. The device can be
can be dedicated to metadata or can implement both video and metadata capture dedicated to metadata or can support both video and metadata as specified in its
as specified in its reported capabilities. reported capabilities.
Querying Capabilities Querying Capabilities
===================== =====================
Device nodes supporting the metadata interface set the ``V4L2_CAP_META_CAPTURE`` Device nodes supporting the metadata capture interface set the
flag in the ``device_caps`` field of the ``V4L2_CAP_META_CAPTURE`` flag in the ``device_caps`` field of the
:c:type:`v4l2_capability` structure returned by the :c:func:`VIDIOC_QUERYCAP` :c:type:`v4l2_capability` structure returned by the :c:func:`VIDIOC_QUERYCAP`
ioctl. That flag means the device can capture metadata to memory. ioctl. That flag means the device can capture metadata to memory. Similarly,
device nodes supporting metadata output interface set the
``V4L2_CAP_META_OUTPUT`` flag in the ``device_caps`` field of
:c:type:`v4l2_capability` structure. That flag means the device can read
metadata from memory.
At least one of the read/write or streaming I/O methods must be supported. At least one of the read/write or streaming I/O methods must be supported.
...@@ -42,10 +48,11 @@ to the basic :ref:`format` ioctls, the :c:func:`VIDIOC_ENUM_FMT` ioctl must be ...@@ -42,10 +48,11 @@ to the basic :ref:`format` ioctls, the :c:func:`VIDIOC_ENUM_FMT` ioctl must be
supported as well. supported as well.
To use the :ref:`format` ioctls applications set the ``type`` field of the To use the :ref:`format` ioctls applications set the ``type`` field of the
:c:type:`v4l2_format` structure to ``V4L2_BUF_TYPE_META_CAPTURE`` and use the :c:type:`v4l2_format` structure to ``V4L2_BUF_TYPE_META_CAPTURE`` or to
:c:type:`v4l2_meta_format` ``meta`` member of the ``fmt`` union as needed per ``V4L2_BUF_TYPE_META_OUTPUT`` and use the :c:type:`v4l2_meta_format` ``meta``
the desired operation. Both drivers and applications must set the remainder of member of the ``fmt`` union as needed per the desired operation. Both drivers
the :c:type:`v4l2_format` structure to 0. and applications must set the remainder of the :c:type:`v4l2_format` structure
to 0.
.. c:type:: v4l2_meta_format .. c:type:: v4l2_meta_format
......
...@@ -258,6 +258,9 @@ specification the ioctl returns an ``EINVAL`` error code. ...@@ -258,6 +258,9 @@ specification the ioctl returns an ``EINVAL`` error code.
* - ``V4L2_CAP_STREAMING`` * - ``V4L2_CAP_STREAMING``
- 0x04000000 - 0x04000000
- The device supports the :ref:`streaming <mmap>` I/O method. - The device supports the :ref:`streaming <mmap>` I/O method.
* - ``V4L2_CAP_META_OUTPUT``
- 0x08000000
- The device supports the :ref:`metadata` output interface.
* - ``V4L2_CAP_TOUCH`` * - ``V4L2_CAP_TOUCH``
- 0x10000000 - 0x10000000
- This is a touch device. - This is a touch device.
......
...@@ -30,6 +30,7 @@ replace symbol V4L2_FIELD_TOP :c:type:`v4l2_field` ...@@ -30,6 +30,7 @@ replace symbol V4L2_FIELD_TOP :c:type:`v4l2_field`
# Documented enum v4l2_buf_type # Documented enum v4l2_buf_type
replace symbol V4L2_BUF_TYPE_META_CAPTURE :c:type:`v4l2_buf_type` replace symbol V4L2_BUF_TYPE_META_CAPTURE :c:type:`v4l2_buf_type`
replace symbol V4L2_BUF_TYPE_META_OUTPUT :c:type:`v4l2_buf_type`
replace symbol V4L2_BUF_TYPE_SDR_CAPTURE :c:type:`v4l2_buf_type` replace symbol V4L2_BUF_TYPE_SDR_CAPTURE :c:type:`v4l2_buf_type`
replace symbol V4L2_BUF_TYPE_SDR_OUTPUT :c:type:`v4l2_buf_type` replace symbol V4L2_BUF_TYPE_SDR_OUTPUT :c:type:`v4l2_buf_type`
replace symbol V4L2_BUF_TYPE_SLICED_VBI_CAPTURE :c:type:`v4l2_buf_type` replace symbol V4L2_BUF_TYPE_SLICED_VBI_CAPTURE :c:type:`v4l2_buf_type`
...@@ -163,6 +164,7 @@ replace define V4L2_CAP_META_CAPTURE device-capabilities ...@@ -163,6 +164,7 @@ replace define V4L2_CAP_META_CAPTURE device-capabilities
replace define V4L2_CAP_READWRITE device-capabilities replace define V4L2_CAP_READWRITE device-capabilities
replace define V4L2_CAP_ASYNCIO device-capabilities replace define V4L2_CAP_ASYNCIO device-capabilities
replace define V4L2_CAP_STREAMING device-capabilities replace define V4L2_CAP_STREAMING device-capabilities
replace define V4L2_CAP_META_OUTPUT device-capabilities
replace define V4L2_CAP_DEVICE_CAPS device-capabilities replace define V4L2_CAP_DEVICE_CAPS device-capabilities
replace define V4L2_CAP_TOUCH device-capabilities replace define V4L2_CAP_TOUCH device-capabilities
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment