xref: /OK3568_Linux_fs/kernel/Documentation/userspace-api/media/v4l/querycap.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2*4882a593Smuzhiyun
3*4882a593Smuzhiyun.. _querycap:
4*4882a593Smuzhiyun
5*4882a593Smuzhiyun*********************
6*4882a593SmuzhiyunQuerying Capabilities
7*4882a593Smuzhiyun*********************
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunBecause V4L2 covers a wide variety of devices not all aspects of the API
10*4882a593Smuzhiyunare equally applicable to all types of devices. Furthermore devices of
11*4882a593Smuzhiyunthe same type have different capabilities and this specification permits
12*4882a593Smuzhiyunthe omission of a few complicated and less important parts of the API.
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunThe :ref:`VIDIOC_QUERYCAP` ioctl is available to
15*4882a593Smuzhiyuncheck if the kernel device is compatible with this specification, and to
16*4882a593Smuzhiyunquery the :ref:`functions <devices>` and :ref:`I/O methods <io>`
17*4882a593Smuzhiyunsupported by the device.
18*4882a593Smuzhiyun
19*4882a593SmuzhiyunStarting with kernel version 3.1, :ref:`VIDIOC_QUERYCAP`
20*4882a593Smuzhiyunwill return the V4L2 API version used by the driver, with generally
21*4882a593Smuzhiyunmatches the Kernel version. There's no need of using
22*4882a593Smuzhiyun:ref:`VIDIOC_QUERYCAP` to check if a specific ioctl
23*4882a593Smuzhiyunis supported, the V4L2 core now returns ``ENOTTY`` if a driver doesn't
24*4882a593Smuzhiyunprovide support for an ioctl.
25*4882a593Smuzhiyun
26*4882a593SmuzhiyunOther features can be queried by calling the respective ioctl, for
27*4882a593Smuzhiyunexample :ref:`VIDIOC_ENUMINPUT` to learn about the
28*4882a593Smuzhiyunnumber, types and names of video connectors on the device. Although
29*4882a593Smuzhiyunabstraction is a major objective of this API, the
30*4882a593Smuzhiyun:ref:`VIDIOC_QUERYCAP` ioctl also allows driver
31*4882a593Smuzhiyunspecific applications to reliably identify the driver.
32*4882a593Smuzhiyun
33*4882a593SmuzhiyunAll V4L2 drivers must support :ref:`VIDIOC_QUERYCAP`.
34*4882a593SmuzhiyunApplications should always call this ioctl after opening the device.
35