dev-meta.rst 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. .. -*- coding: utf-8; mode: rst -*-
  2. .. _metadata:
  3. ******************
  4. Metadata Interface
  5. ******************
  6. Metadata refers to any non-image data that supplements video frames with
  7. additional information. This may include statistics computed over the image
  8. or frame capture parameters supplied by the image source. This interface is
  9. intended for transfer of metadata to userspace and control of that operation.
  10. The metadata interface is implemented on video capture device nodes. The device
  11. can be dedicated to metadata or can implement both video and metadata capture
  12. as specified in its reported capabilities.
  13. Querying Capabilities
  14. =====================
  15. Device nodes supporting the metadata interface set the ``V4L2_CAP_META_CAPTURE``
  16. flag in the ``device_caps`` field of the
  17. :c:type:`v4l2_capability` structure returned by the :c:func:`VIDIOC_QUERYCAP`
  18. ioctl. That flag means the device can capture metadata to memory.
  19. At least one of the read/write or streaming I/O methods must be supported.
  20. Data Format Negotiation
  21. =======================
  22. The metadata device uses the :ref:`format` ioctls to select the capture format.
  23. The metadata buffer content format is bound to that selected format. In addition
  24. to the basic :ref:`format` ioctls, the :c:func:`VIDIOC_ENUM_FMT` ioctl must be
  25. supported as well.
  26. To use the :ref:`format` ioctls applications set the ``type`` field of the
  27. :c:type:`v4l2_format` structure to ``V4L2_BUF_TYPE_META_CAPTURE`` and use the
  28. :c:type:`v4l2_meta_format` ``meta`` member of the ``fmt`` union as needed per
  29. the desired operation. Both drivers and applications must set the remainder of
  30. the :c:type:`v4l2_format` structure to 0.
  31. .. _v4l2-meta-format:
  32. .. flat-table:: struct v4l2_meta_format
  33. :header-rows: 0
  34. :stub-columns: 0
  35. :widths: 1 1 2
  36. * - __u32
  37. - ``dataformat``
  38. - The data format, set by the application. This is a little endian
  39. :ref:`four character code <v4l2-fourcc>`. V4L2 defines metadata formats
  40. in :ref:`meta-formats`.
  41. * - __u32
  42. - ``buffersize``
  43. - Maximum buffer size in bytes required for data. The value is set by the
  44. driver.