brintos

brintos / linux-shallow public Read only

0
0
Text · 1.7 KiB · 4b1964d Raw
50 lines · plain
1.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later2.. c:namespace:: V4L3 4.. _io:5 6############7Input/Output8############9The V4L2 API defines several different methods to read from or write to10a device. All drivers exchanging data with applications must support at11least one of them.12 13The classic I/O method using the :c:func:`read()` and14:c:func:`write()` function is automatically selected after opening a15V4L2 device. When the driver does not support this method attempts to16read or write will fail at any time.17 18Other methods must be negotiated. To select the streaming I/O method19with memory mapped or user buffers applications call the20:ref:`VIDIOC_REQBUFS` ioctl.21 22Video overlay can be considered another I/O method, although the23application does not directly receive the image data. It is selected by24initiating video overlay with the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`25ioctl. For more information see :ref:`overlay`.26 27Generally exactly one I/O method, including overlay, is associated with28each file descriptor. The only exceptions are applications not29exchanging data with a driver ("panel applications", see :ref:`open`)30and drivers permitting simultaneous video capturing and overlay using31the same file descriptor, for compatibility with V4L and earlier32versions of V4L2.33 34:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` and :ref:`VIDIOC_REQBUFS` would permit this to some35degree, but for simplicity drivers need not support switching the I/O36method (after first switching away from read/write) other than by37closing and reopening the device.38 39The following sections describe the various I/O methods in more detail.40 41.. toctree::42    :maxdepth: 143 44    rw45    mmap46    userp47    dmabuf48    buffer49    field-order50