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