Back to home page

OSCL-LXR

 
 

    


0001 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
0002 
0003 .. _querycap:
0004 
0005 *********************
0006 Querying Capabilities
0007 *********************
0008 
0009 Because V4L2 covers a wide variety of devices not all aspects of the API
0010 are equally applicable to all types of devices. Furthermore devices of
0011 the same type have different capabilities and this specification permits
0012 the omission of a few complicated and less important parts of the API.
0013 
0014 The :ref:`VIDIOC_QUERYCAP` ioctl is available to
0015 check if the kernel device is compatible with this specification, and to
0016 query the :ref:`functions <devices>` and :ref:`I/O methods <io>`
0017 supported by the device.
0018 
0019 Starting with kernel version 3.1, :ref:`VIDIOC_QUERYCAP`
0020 will return the V4L2 API version used by the driver, with generally
0021 matches the Kernel version. There's no need of using
0022 :ref:`VIDIOC_QUERYCAP` to check if a specific ioctl
0023 is supported, the V4L2 core now returns ``ENOTTY`` if a driver doesn't
0024 provide support for an ioctl.
0025 
0026 Other features can be queried by calling the respective ioctl, for
0027 example :ref:`VIDIOC_ENUMINPUT` to learn about the
0028 number, types and names of video connectors on the device. Although
0029 abstraction is a major objective of this API, the
0030 :ref:`VIDIOC_QUERYCAP` ioctl also allows driver
0031 specific applications to reliably identify the driver.
0032 
0033 All V4L2 drivers must support :ref:`VIDIOC_QUERYCAP`.
0034 Applications should always call this ioctl after opening the device.