162306a36Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later 262306a36Sopenharmony_ci 362306a36Sopenharmony_ci.. _querycap: 462306a36Sopenharmony_ci 562306a36Sopenharmony_ci********************* 662306a36Sopenharmony_ciQuerying Capabilities 762306a36Sopenharmony_ci********************* 862306a36Sopenharmony_ci 962306a36Sopenharmony_ciBecause V4L2 covers a wide variety of devices not all aspects of the API 1062306a36Sopenharmony_ciare equally applicable to all types of devices. Furthermore devices of 1162306a36Sopenharmony_cithe same type have different capabilities and this specification permits 1262306a36Sopenharmony_cithe omission of a few complicated and less important parts of the API. 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_ciThe :ref:`VIDIOC_QUERYCAP` ioctl is available to 1562306a36Sopenharmony_cicheck if the kernel device is compatible with this specification, and to 1662306a36Sopenharmony_ciquery the :ref:`functions <devices>` and :ref:`I/O methods <io>` 1762306a36Sopenharmony_cisupported by the device. 1862306a36Sopenharmony_ci 1962306a36Sopenharmony_ciStarting with kernel version 3.1, :ref:`VIDIOC_QUERYCAP` 2062306a36Sopenharmony_ciwill return the V4L2 API version used by the driver, with generally 2162306a36Sopenharmony_cimatches the Kernel version. There's no need of using 2262306a36Sopenharmony_ci:ref:`VIDIOC_QUERYCAP` to check if a specific ioctl 2362306a36Sopenharmony_ciis supported, the V4L2 core now returns ``ENOTTY`` if a driver doesn't 2462306a36Sopenharmony_ciprovide support for an ioctl. 2562306a36Sopenharmony_ci 2662306a36Sopenharmony_ciOther features can be queried by calling the respective ioctl, for 2762306a36Sopenharmony_ciexample :ref:`VIDIOC_ENUMINPUT` to learn about the 2862306a36Sopenharmony_cinumber, types and names of video connectors on the device. Although 2962306a36Sopenharmony_ciabstraction is a major objective of this API, the 3062306a36Sopenharmony_ci:ref:`VIDIOC_QUERYCAP` ioctl also allows driver 3162306a36Sopenharmony_cispecific applications to reliably identify the driver. 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ciAll V4L2 drivers must support :ref:`VIDIOC_QUERYCAP`. 3462306a36Sopenharmony_ciApplications should always call this ioctl after opening the device. 35