요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: V4L
.. _io:
############
Input/Output
############
The V4L2 API defines several different methods to read from or write to
a device. All drivers exchanging data with applications must support at
least one of them.
The classic I/O method using the :c:func:`read()` and
:c:func:`write()` function is automatically selected after opening a
V4L2 device. When the driver does not support this method attempts to
read or write will fail at any time.
Other methods must be negotiated. To select the streaming I/O method
with memory mapped or user buffers applications call the
:ref:`VIDIOC_REQBUFS` ioctl.
Video overlay can be considered another I/O method, although the
application does not directly receive the image data. It is selected by
initiating video overlay with the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`
ioctl. For more information see :ref:`overlay`.
Generally exactly one I/O method, including overlay, is associated with
each file descriptor. The only exceptions are applications not
exchanging data with a driver ("panel applications", see :ref:`open`)
and drivers permitting simultaneous video capturing and overlay using
the same file descriptor, for compatibility with V4L and earlier
versions of V4L2.
:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` and :ref:`VIDIOC_REQBUFS` would permit this to some
degree, but for simplicity drivers need not support switching the I/O
method (after first switching away from read/write) other than by
closing and reopening the device.
The following sections describe the various I/O methods in more detail.
.. toctree::
:maxdepth: 1
rw
mmap
userp
dmabuf
buffer
field-order
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
V4L2 I/O 방식과 선택
1-31V4L2는 장치에서 읽거나 장치로 쓰는 여러 I/O 방식을 정의하며, 응용 프로그램과 데이터를 교환하는 모든 드라이버는 그중 적어도 하나를 지원해야 합니다.
선택 시점과 데이터 소유 방식을 비교합니다.
일반적으로 파일 디스크립터 하나에는 overlay를 포함해 정확히 한 I/O 방식만 연결됩니다. 예외는 드라이버와 데이터를 교환하지 않는 panel application, 그리고 V4L 및 초기 V4L2 호환을 위해 같은 디스크립터에서 캡처와 오버레이를 동시에 허용하는 드라이버입니다.
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: V4L
.. _io:
############
Input/Output
############
The V4L2 API defines several different methods to read from or write to
a device. All drivers exchanging data with applications must support at
least one of them.
The classic I/O method using the :c:func:`read()` and
:c:func:`write()` function is automatically selected after opening a
V4L2 device. When the driver does not support this method attempts to
read or write will fail at any time.
Other methods must be negotiated. To select the streaming I/O method
with memory mapped or user buffers applications call the
:ref:`VIDIOC_REQBUFS` ioctl.
Video overlay can be considered another I/O method, although the
application does not directly receive the image data. It is selected by
initiating video overlay with the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`
ioctl. For more information see :ref:`overlay`.
Generally exactly one I/O method, including overlay, is associated with
each file descriptor. The only exceptions are applications not
exchanging data with a driver ("panel applications", see :ref:`open`)
and drivers permitting simultaneous video capturing and overlay using
the same file descriptor, for compatibility with V4L and earlier
I/O 방식 전환 제약과 하위 문서
32-49`VIDIOC_S_FMT`와 `VIDIOC_REQBUFS`를 이용하면 어느 정도 I/O 방식을 바꿀 수 있지만, 단순성을 위해 드라이버는 read/write에서 처음 다른 방식으로 전환한 뒤에는 추가 전환을 지원할 의무가 없습니다. 확실한 전환 방법은 장치를 닫고 다시 여는 것입니다.
파일 디스크립터별로 방식을 확정하는 흐름입니다.
이어지는 하위 문서는 read/write, mmap, user pointer, DMABUF, 공통 buffer 구조와 field order를 각각 자세히 설명합니다.
versions of V4L2.
:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` and :ref:`VIDIOC_REQBUFS` would permit this to some
degree, but for simplicity drivers need not support switching the I/O
method (after first switching away from read/write) other than by
closing and reopening the device.
The following sections describe the various I/O methods in more detail.
.. toctree::
:maxdepth: 1
rw
mmap
userp
dmabuf
buffer
field-order
요약·해설
io.rst:1-49파일 디스크립터마다 보통 하나의 I/O 방식만 사용하며, streaming은 VIDIOC_REQBUFS로 협상하고 overlay는 VIDIOC_S_FMT로 시작합니다.