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