요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. _planar-apis:
*****************************
Single- and multi-planar APIs
*****************************
Some devices require data for each input or output video frame to be
placed in discontiguous memory buffers. In such cases, one video frame
has to be addressed using more than one memory address, i.e. one pointer
per "plane". A plane is a sub-buffer of the current frame. For examples
of such formats see :ref:`pixfmt`.
Initially, V4L2 API did not support multi-planar buffers and a set of
extensions has been introduced to handle them. Those extensions
constitute what is being referred to as the "multi-planar API".
Some of the V4L2 API calls and structures are interpreted differently,
depending on whether single- or multi-planar API is being used. An
application can choose whether to use one or the other by passing a
corresponding buffer type to its ioctl calls. Multi-planar versions of
buffer types are suffixed with an ``_MPLANE`` string. For a list of
available multi-planar buffer types see enum
:c:type:`v4l2_buf_type`.
Multi-planar formats
====================
Multi-planar API introduces new multi-planar formats. Those formats use
a separate set of FourCC codes. It is important to distinguish between
the multi-planar API and a multi-planar format. Multi-planar API calls
can handle all single-planar formats as well (as long as they are passed
in multi-planar API structures), while the single-planar API cannot
handle multi-planar formats.
Calls that distinguish between single and multi-planar APIs
===========================================================
:ref:`VIDIOC_QUERYCAP <VIDIOC_QUERYCAP>`
Two additional multi-planar capabilities are added. They can be set
together with non-multi-planar ones for devices that handle both
single- and multi-planar formats.
:ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>`, :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`, :ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>`
New structures for describing multi-planar formats are added: struct
:c:type:`v4l2_pix_format_mplane` and
struct :c:type:`v4l2_plane_pix_format`.
Drivers may define new multi-planar formats, which have distinct
FourCC codes from the existing single-planar ones.
:ref:`VIDIOC_QBUF <VIDIOC_QBUF>`, :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>`, :ref:`VIDIOC_QUERYBUF <VIDIOC_QUERYBUF>`
A new struct :c:type:`v4l2_plane` structure for
describing planes is added. Arrays of this structure are passed in
the new ``m.planes`` field of struct
:c:type:`v4l2_buffer`.
:ref:`VIDIOC_REQBUFS <VIDIOC_REQBUFS>`
Will allocate multi-planar buffers as requested.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
분리된 프레임 버퍼
1-27일부 장치는 입력 또는 출력 프레임의 데이터를 서로 떨어진 메모리 버퍼에 배치해야 합니다. 이때 프레임 하나를 둘 이상의 주소, 즉 평면마다 포인터 하나로 지정합니다. 평면은 현재 프레임을 이루는 하위 버퍼입니다.
초기 V4L2 API에는 다중 평면 버퍼 지원이 없었고, 이를 처리하기 위한 확장 집합이 다중 평면 API로 추가되었습니다. ioctl에 전달하는 버퍼 유형으로 단일 또는 다중 평면 API를 선택하며, 다중 평면 유형은 `_MPLANE` 접미사를 사용합니다. 사용 가능한 유형은 `v4l2_buf_type`을 참조합니다.
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. _planar-apis:
*****************************
Single- and multi-planar APIs
*****************************
Some devices require data for each input or output video frame to be
placed in discontiguous memory buffers. In such cases, one video frame
has to be addressed using more than one memory address, i.e. one pointer
per "plane". A plane is a sub-buffer of the current frame. For examples
of such formats see :ref:`pixfmt`.
Initially, V4L2 API did not support multi-planar buffers and a set of
extensions has been introduced to handle them. Those extensions
constitute what is being referred to as the "multi-planar API".
Some of the V4L2 API calls and structures are interpreted differently,
depending on whether single- or multi-planar API is being used. An
application can choose whether to use one or the other by passing a
corresponding buffer type to its ioctl calls. Multi-planar versions of
buffer types are suffixed with an ``_MPLANE`` string. For a list of
available multi-planar buffer types see enum
:c:type:`v4l2_buf_type`.
다중 평면 API와 포맷의 구분
28-38다중 평면 API는 별도의 FourCC를 사용하는 다중 평면 포맷도 도입합니다. 하지만 API와 포맷은 서로 다른 개념입니다.
다중 평면 API 호출은 단일 평면 포맷을 다중 평면 구조체에 담아 처리할 수 있습니다. 반대로 단일 평면 API는 다중 평면 포맷을 처리할 수 없습니다.
Multi-planar formats
====================
Multi-planar API introduces new multi-planar formats. Those formats use
a separate set of FourCC codes. It is important to distinguish between
the multi-planar API and a multi-planar format. Multi-planar API calls
can handle all single-planar formats as well (as long as they are passed
in multi-planar API structures), while the single-planar API cannot
handle multi-planar formats.
API에 따라 달라지는 호출
39-61같은 ioctl이라도 버퍼 유형에 따라 기능 비트와 구조체 해석이 달라집니다.
Calls that distinguish between single and multi-planar APIs
===========================================================
:ref:`VIDIOC_QUERYCAP <VIDIOC_QUERYCAP>`
Two additional multi-planar capabilities are added. They can be set
together with non-multi-planar ones for devices that handle both
single- and multi-planar formats.
:ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>`, :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`, :ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>`
New structures for describing multi-planar formats are added: struct
:c:type:`v4l2_pix_format_mplane` and
struct :c:type:`v4l2_plane_pix_format`.
Drivers may define new multi-planar formats, which have distinct
FourCC codes from the existing single-planar ones.
:ref:`VIDIOC_QBUF <VIDIOC_QBUF>`, :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>`, :ref:`VIDIOC_QUERYBUF <VIDIOC_QUERYBUF>`
A new struct :c:type:`v4l2_plane` structure for
describing planes is added. Arrays of this structure are passed in
the new ``m.planes`` field of struct
:c:type:`v4l2_buffer`.
:ref:`VIDIOC_REQBUFS <VIDIOC_REQBUFS>`
Will allocate multi-planar buffers as requested.
요약·해설
planar-apis.rst:1-61분리된 평면 버퍼와 관련 ioctl 구조체의 차이를 설명합니다.