1*059b1c5bSMauro Carvalho Chehab.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later 254f38fcaSMauro Carvalho Chehab 354f38fcaSMauro Carvalho Chehab.. _querycap: 454f38fcaSMauro Carvalho Chehab 554f38fcaSMauro Carvalho Chehab********************* 654f38fcaSMauro Carvalho ChehabQuerying Capabilities 754f38fcaSMauro Carvalho Chehab********************* 854f38fcaSMauro Carvalho Chehab 954f38fcaSMauro Carvalho ChehabBecause V4L2 covers a wide variety of devices not all aspects of the API 1054f38fcaSMauro Carvalho Chehabare equally applicable to all types of devices. Furthermore devices of 1154f38fcaSMauro Carvalho Chehabthe same type have different capabilities and this specification permits 1254f38fcaSMauro Carvalho Chehabthe omission of a few complicated and less important parts of the API. 1354f38fcaSMauro Carvalho Chehab 1454f38fcaSMauro Carvalho ChehabThe :ref:`VIDIOC_QUERYCAP` ioctl is available to 1554f38fcaSMauro Carvalho Chehabcheck if the kernel device is compatible with this specification, and to 1654f38fcaSMauro Carvalho Chehabquery the :ref:`functions <devices>` and :ref:`I/O methods <io>` 1754f38fcaSMauro Carvalho Chehabsupported by the device. 1854f38fcaSMauro Carvalho Chehab 1954f38fcaSMauro Carvalho ChehabStarting with kernel version 3.1, :ref:`VIDIOC_QUERYCAP` 2054f38fcaSMauro Carvalho Chehabwill return the V4L2 API version used by the driver, with generally 2154f38fcaSMauro Carvalho Chehabmatches the Kernel version. There's no need of using 2254f38fcaSMauro Carvalho Chehab:ref:`VIDIOC_QUERYCAP` to check if a specific ioctl 2354f38fcaSMauro Carvalho Chehabis supported, the V4L2 core now returns ``ENOTTY`` if a driver doesn't 2454f38fcaSMauro Carvalho Chehabprovide support for an ioctl. 2554f38fcaSMauro Carvalho Chehab 2654f38fcaSMauro Carvalho ChehabOther features can be queried by calling the respective ioctl, for 2754f38fcaSMauro Carvalho Chehabexample :ref:`VIDIOC_ENUMINPUT` to learn about the 2854f38fcaSMauro Carvalho Chehabnumber, types and names of video connectors on the device. Although 2954f38fcaSMauro Carvalho Chehababstraction is a major objective of this API, the 3054f38fcaSMauro Carvalho Chehab:ref:`VIDIOC_QUERYCAP` ioctl also allows driver 3154f38fcaSMauro Carvalho Chehabspecific applications to reliably identify the driver. 3254f38fcaSMauro Carvalho Chehab 3354f38fcaSMauro Carvalho ChehabAll V4L2 drivers must support :ref:`VIDIOC_QUERYCAP`. 3454f38fcaSMauro Carvalho ChehabApplications should always call this ioctl after opening the device. 35