doc-rst: customize RTD theme, captions & inline literal
[deliverable/linux.git] / Documentation / linux_tv / media / v4l / io.rst
CommitLineData
5377d91f
MH
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _io:
4
5############
6Input/Output
7############
8The V4L2 API defines several different methods to read from or write to
9a device. All drivers exchanging data with applications must support at
10least one of them.
11
760c7010
MCC
12The classic I/O method using the :ref:`read() <func-read>` and
13:ref:`write() <func-write>` function is automatically selected after opening a
5377d91f
MH
14V4L2 device. When the driver does not support this method attempts to
15read or write will fail at any time.
16
17Other methods must be negotiated. To select the streaming I/O method
18with memory mapped or user buffers applications call the
7347081e 19:ref:`VIDIOC_REQBUFS` ioctl. The asynchronous I/O
5377d91f
MH
20method is not defined yet.
21
22Video overlay can be considered another I/O method, although the
23application does not directly receive the image data. It is selected by
af4a4d0d 24initiating video overlay with the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`
5377d91f
MH
25ioctl. For more information see :ref:`overlay`.
26
27Generally exactly one I/O method, including overlay, is associated with
28each file descriptor. The only exceptions are applications not
29exchanging data with a driver ("panel applications", see :ref:`open`)
30and drivers permitting simultaneous video capturing and overlay using
31the same file descriptor, for compatibility with V4L and earlier
32versions of V4L2.
33
2212ff25 34:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` and :ref:`VIDIOC_REQBUFS` would permit this to some
5377d91f
MH
35degree, but for simplicity drivers need not support switching the I/O
36method (after first switching away from read/write) other than by
37closing and reopening the device.
38
39The following sections describe the various I/O methods in more detail.
40
41
42.. toctree::
43 :maxdepth: 1
44
45 rw
46 mmap
47 userp
48 dmabuf
49 async
50 buffer
51 field-order
This page took 0.03123 seconds and 5 git commands to generate.