Documentation/userspace-api/media/v4l/diff-v4l.rst

Source file repositories/reference/linux-study-clean/Documentation/userspace-api/media/v4l/diff-v4l.rst

File Facts

System
Linux kernel
Corpus path
Documentation/userspace-api/media/v4l/diff-v4l.rst
Extension
.rst
Size
25885 bytes
Lines
668
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: documentation
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: V4L

.. _diff-v4l:

********************************
Differences between V4L and V4L2
********************************

The Video For Linux API was first introduced in Linux 2.1 to unify and
replace various TV and radio device related interfaces, developed
independently by driver writers in prior years. Starting with Linux 2.5
the much improved V4L2 API replaces the V4L API. The support for the old
V4L calls were removed from Kernel, but the library :ref:`libv4l`
supports the conversion of a V4L API system call into a V4L2 one.

Opening and Closing Devices
===========================

For compatibility reasons the character device file names recommended
for V4L2 video capture, overlay, radio and raw vbi capture devices did
not change from those used by V4L. They are listed in :ref:`devices`
and below in :ref:`v4l-dev`.

The teletext devices (minor range 192-223) have been removed in V4L2 and
no longer exist. There is no hardware available anymore for handling
pure teletext. Instead raw or sliced VBI is used.

The V4L ``videodev`` module automatically assigns minor numbers to
drivers in load order, depending on the registered device type. We
recommend that V4L2 drivers by default register devices with the same
numbers, but the system administrator can assign arbitrary minor numbers
using driver module options. The major device number remains 81.

.. _v4l-dev:

.. flat-table:: V4L Device Types, Names and Numbers
    :header-rows:  1
    :stub-columns: 0

    * - Device Type
      - File Name
      - Minor Numbers
    * - Video capture and overlay
      - ``/dev/video`` and ``/dev/bttv0``\  [#f1]_, ``/dev/video0`` to
	``/dev/video63``
      - 0-63
    * - Radio receiver
      - ``/dev/radio``\  [#f2]_, ``/dev/radio0`` to ``/dev/radio63``
      - 64-127
    * - Raw VBI capture
      - ``/dev/vbi``, ``/dev/vbi0`` to ``/dev/vbi31``
      - 224-255

V4L prohibits (or used to prohibit) multiple opens of a device file.
V4L2 drivers *may* support multiple opens, see :ref:`open` for details
and consequences.

V4L drivers respond to V4L2 ioctls with an ``EINVAL`` error code.

Querying Capabilities
=====================

The V4L ``VIDIOCGCAP`` ioctl is equivalent to V4L2's
:ref:`VIDIOC_QUERYCAP`.

The ``name`` field in struct ``video_capability`` became
``card`` in struct :c:type:`v4l2_capability`, ``type``
was replaced by ``capabilities``. Note V4L2 does not distinguish between
device types like this, better think of basic video input, video output

Annotation

Implementation Notes