요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. _mem2mem:
********************************
Video Memory-To-Memory Interface
********************************
A V4L2 memory-to-memory device can compress, decompress, transform, or
otherwise convert video data from one format into another format, in memory.
Such memory-to-memory devices set the ``V4L2_CAP_VIDEO_M2M`` or
``V4L2_CAP_VIDEO_M2M_MPLANE`` capability. Examples of memory-to-memory
devices are codecs, scalers, deinterlacers or format converters (i.e.
converting from YUV to RGB).
A memory-to-memory video node acts just like a normal video node, but it
supports both output (sending frames from memory to the hardware)
and capture (receiving the processed frames from the hardware into
memory) stream I/O. An application will have to setup the stream I/O for
both sides and finally call :ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>`
for both capture and output to start the hardware.
Memory-to-memory devices function as a shared resource: you can
open the video node multiple times, each application setting up their
own properties that are local to the file handle, and each can use
it independently from the others. The driver will arbitrate access to
the hardware and reprogram it whenever another file handler gets access.
This is different from the usual video node behavior where the video
properties are global to the device (i.e. changing something through one
file handle is visible through another file handle).
One of the most common memory-to-memory device is the codec. Codecs
are more complicated than most and require additional setup for
their codec parameters. This is done through codec controls.
See :ref:`codec-controls`. More details on how to use codec memory-to-memory
devices are given in the following sections.
.. toctree::
:maxdepth: 1
dev-decoder
dev-encoder
dev-stateless-decoder
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
변환 장치와 두 streaming 방향
1-30V4L2 memory-to-memory 장치는 메모리 안의 비디오 데이터를 한 format에서 다른 format으로 압축, 압축 해제, 변형 또는 변환합니다. 이런 장치는 `V4L2_CAP_VIDEO_M2M` 또는 `V4L2_CAP_VIDEO_M2M_MPLANE` capability를 설정합니다.
대표적인 memory-to-memory 장치는 codec, scaler, deinterlacer와 YUV를 RGB로 바꾸는 format converter입니다.
memory-to-memory video node는 일반 video node처럼 동작하지만 output과 capture stream I/O를 모두 지원합니다. output은 memory의 frame을 하드웨어로 보내고 capture는 처리된 frame을 하드웨어에서 memory로 받습니다. 애플리케이션은 양쪽 stream I/O를 모두 구성하고 capture와 output 모두에 `VIDIOC_STREAMON`을 호출해야 하드웨어가 시작됩니다.
이 장치는 공유 자원으로 동작합니다. 여러 애플리케이션이 video node를 각각 열고 file handle에 국한된 속성을 따로 설정해 독립적으로 사용할 수 있습니다. driver는 하드웨어 접근을 중재하고 다른 file handler가 차례를 얻을 때마다 하드웨어를 다시 program합니다.
이는 한 file handle의 변경이 다른 handle에서도 보이는 일반 video node의 device-global 속성과 다른 동작입니다.
capability와 양쪽 queue의 데이터 방향입니다.
여러 file handle의 독립 상태를 한 하드웨어에서 실행합니다.
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. _mem2mem:
********************************
Video Memory-To-Memory Interface
********************************
A V4L2 memory-to-memory device can compress, decompress, transform, or
otherwise convert video data from one format into another format, in memory.
Such memory-to-memory devices set the ``V4L2_CAP_VIDEO_M2M`` or
``V4L2_CAP_VIDEO_M2M_MPLANE`` capability. Examples of memory-to-memory
devices are codecs, scalers, deinterlacers or format converters (i.e.
converting from YUV to RGB).
A memory-to-memory video node acts just like a normal video node, but it
supports both output (sending frames from memory to the hardware)
and capture (receiving the processed frames from the hardware into
memory) stream I/O. An application will have to setup the stream I/O for
both sides and finally call :ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>`
for both capture and output to start the hardware.
Memory-to-memory devices function as a shared resource: you can
open the video node multiple times, each application setting up their
own properties that are local to the file handle, and each can use
it independently from the others. The driver will arbitrate access to
the hardware and reprogram it whenever another file handler gets access.
This is different from the usual video node behavior where the video
properties are global to the device (i.e. changing something through one
file handle is visible through another file handle).
Codec control과 하위 인터페이스
31-43가장 흔한 memory-to-memory 장치 가운데 하나가 codec입니다. codec은 보통 다른 변환기보다 복잡하고 추가 codec parameter 설정이 필요하며, 이 작업은 codec control을 통해 수행합니다. 자세한 control은 `codec-controls` 절을 참조합니다.
이 색인은 codec memory-to-memory 장치의 구체적인 사용법으로 상태 유지형 decoder, 상태 유지형 encoder, stateless decoder 문서를 연결합니다.
각 codec 실행 모델의 세부 절차입니다.
One of the most common memory-to-memory device is the codec. Codecs
are more complicated than most and require additional setup for
their codec parameters. This is done through codec controls.
See :ref:`codec-controls`. More details on how to use codec memory-to-memory
devices are given in the following sections.
.. toctree::
:maxdepth: 1
dev-decoder
dev-encoder
dev-stateless-decoder
요약·해설
dev-mem2mem.rst:1-43Memory-to-memory 장치는 OUTPUT과 CAPTURE를 모두 streaming해야 하며, driver가 여러 file handle의 독립 상태를 하나의 변환 하드웨어에 차례로 적용합니다.