querycap.rst 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
  2. .. c:namespace:: V4L
  3. .. _querycap:
  4. *********************
  5. Querying Capabilities
  6. *********************
  7. Because V4L2 covers a wide variety of devices not all aspects of the API
  8. are equally applicable to all types of devices. Furthermore devices of
  9. the same type have different capabilities and this specification permits
  10. the omission of a few complicated and less important parts of the API.
  11. The :ref:`VIDIOC_QUERYCAP` ioctl is available to
  12. check if the kernel device is compatible with this specification, and to
  13. query the :ref:`functions <devices>` and :ref:`I/O methods <io>`
  14. supported by the device.
  15. Starting with kernel version 3.1, :ref:`VIDIOC_QUERYCAP`
  16. will return the V4L2 API version used by the driver, with generally
  17. matches the Kernel version. There's no need of using
  18. :ref:`VIDIOC_QUERYCAP` to check if a specific ioctl
  19. is supported, the V4L2 core now returns ``ENOTTY`` if a driver doesn't
  20. provide support for an ioctl.
  21. Other features can be queried by calling the respective ioctl, for
  22. example :ref:`VIDIOC_ENUMINPUT` to learn about the
  23. number, types and names of video connectors on the device. Although
  24. abstraction is a major objective of this API, the
  25. :ref:`VIDIOC_QUERYCAP` ioctl also allows driver
  26. specific applications to reliably identify the driver.
  27. All V4L2 drivers must support :ref:`VIDIOC_QUERYCAP`.
  28. Applications should always call this ioctl after opening the device.