18c2ecf20Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ci.. _querycap:
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci*********************
68c2ecf20Sopenharmony_ciQuerying Capabilities
78c2ecf20Sopenharmony_ci*********************
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ciBecause V4L2 covers a wide variety of devices not all aspects of the API
108c2ecf20Sopenharmony_ciare equally applicable to all types of devices. Furthermore devices of
118c2ecf20Sopenharmony_cithe same type have different capabilities and this specification permits
128c2ecf20Sopenharmony_cithe omission of a few complicated and less important parts of the API.
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ciThe :ref:`VIDIOC_QUERYCAP` ioctl is available to
158c2ecf20Sopenharmony_cicheck if the kernel device is compatible with this specification, and to
168c2ecf20Sopenharmony_ciquery the :ref:`functions <devices>` and :ref:`I/O methods <io>`
178c2ecf20Sopenharmony_cisupported by the device.
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ciStarting with kernel version 3.1, :ref:`VIDIOC_QUERYCAP`
208c2ecf20Sopenharmony_ciwill return the V4L2 API version used by the driver, with generally
218c2ecf20Sopenharmony_cimatches the Kernel version. There's no need of using
228c2ecf20Sopenharmony_ci:ref:`VIDIOC_QUERYCAP` to check if a specific ioctl
238c2ecf20Sopenharmony_ciis supported, the V4L2 core now returns ``ENOTTY`` if a driver doesn't
248c2ecf20Sopenharmony_ciprovide support for an ioctl.
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ciOther features can be queried by calling the respective ioctl, for
278c2ecf20Sopenharmony_ciexample :ref:`VIDIOC_ENUMINPUT` to learn about the
288c2ecf20Sopenharmony_cinumber, types and names of video connectors on the device. Although
298c2ecf20Sopenharmony_ciabstraction is a major objective of this API, the
308c2ecf20Sopenharmony_ci:ref:`VIDIOC_QUERYCAP` ioctl also allows driver
318c2ecf20Sopenharmony_cispecific applications to reliably identify the driver.
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ciAll V4L2 drivers must support :ref:`VIDIOC_QUERYCAP`.
348c2ecf20Sopenharmony_ciApplications should always call this ioctl after opening the device.
35