querycap.rst 1.4 KB

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