요약·해설과 원문, 전문 번역을 서로 분리했습니다. 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
.. _VIDIOC_G_OUTPUT:
**************************************
ioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT
**************************************
Name
====
VIDIOC_G_OUTPUT - VIDIOC_S_OUTPUT - Query or select the current video output
Synopsis
========
.. c:macro:: VIDIOC_G_OUTPUT
``int ioctl(int fd, VIDIOC_G_OUTPUT, int *argp)``
.. c:macro:: VIDIOC_S_OUTPUT
``int ioctl(int fd, VIDIOC_S_OUTPUT, int *argp)``
Arguments
=========
``fd``
File descriptor returned by :c:func:`open()`.
``argp``
Pointer to an integer with output index.
Description
===========
To query the current video output applications call the
:ref:`VIDIOC_G_OUTPUT <VIDIOC_G_OUTPUT>` ioctl with a pointer to an integer where the driver
stores the number of the output, as in the struct
:c:type:`v4l2_output` ``index`` field. This ioctl will
fail only when there are no video outputs, returning the ``EINVAL`` error
code.
To select a video output applications store the number of the desired
output in an integer and call the :ref:`VIDIOC_S_OUTPUT <VIDIOC_G_OUTPUT>` ioctl with a
pointer to this integer. Side effects are possible. For example outputs
may support different video standards, so the driver may implicitly
switch the current standard. Because of these possible side
effects applications must select an output before querying or
negotiating any other parameters.
Information about video outputs is available using the
:ref:`VIDIOC_ENUMOUTPUT` ioctl.
Return Value
============
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
EINVAL
The number of the video output is out of bounds, or there are no
video outputs at all.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
목적, 호출 형식과 인자
1-34`VIDIOC_G_OUTPUT`과 `VIDIOC_S_OUTPUT`은 현재 video output을 조회하거나 선택합니다. 두 명령은 output index를 담는 `int *argp`를 받고, `fd`는 `open()`이 반환한 파일 디스크립터입니다.
output index는 `struct v4l2_output.index`와 같은 번호 체계를 사용합니다. 사용 가능한 output 정보는 `VIDIOC_ENUMOUTPUT`으로 열거합니다.
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: V4L
.. _VIDIOC_G_OUTPUT:
**************************************
ioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT
**************************************
Name
====
VIDIOC_G_OUTPUT - VIDIOC_S_OUTPUT - Query or select the current video output
Synopsis
========
.. c:macro:: VIDIOC_G_OUTPUT
``int ioctl(int fd, VIDIOC_G_OUTPUT, int *argp)``
.. c:macro:: VIDIOC_S_OUTPUT
``int ioctl(int fd, VIDIOC_S_OUTPUT, int *argp)``
Arguments
=========
``fd``
File descriptor returned by :c:func:`open()`.
``argp``
Pointer to an integer with output index.
현재 출력 조회와 선택 순서
35-55현재 video output을 조회하려면 정수 포인터로 G_OUTPUT을 호출합니다. 드라이버가 현재 output 번호를 저장하며 video output이 하나도 없으면 `EINVAL`입니다.
출력을 선택하려면 원하는 번호를 정수에 저장해 S_OUTPUT을 호출합니다. output마다 지원하는 video standard가 다를 수 있어 드라이버가 현재 standard를 암묵적으로 전환하는 등 부작용이 생길 수 있습니다.
따라서 애플리케이션은 다른 매개변수를 조회하거나 협상하기 전에 output을 먼저 선택하고, 이후 format·standard·streaming parameter를 다시 확인해야 합니다.
출력 변경으로 기존 협상 값이 무효화되는 일을 피합니다.
Description
===========
To query the current video output applications call the
:ref:`VIDIOC_G_OUTPUT <VIDIOC_G_OUTPUT>` ioctl with a pointer to an integer where the driver
stores the number of the output, as in the struct
:c:type:`v4l2_output` ``index`` field. This ioctl will
fail only when there are no video outputs, returning the ``EINVAL`` error
code.
To select a video output applications store the number of the desired
output in an integer and call the :ref:`VIDIOC_S_OUTPUT <VIDIOC_G_OUTPUT>` ioctl with a
pointer to this integer. Side effects are possible. For example outputs
may support different video standards, so the driver may implicitly
switch the current standard. Because of these possible side
effects applications must select an output before querying or
negotiating any other parameters.
Information about video outputs is available using the
:ref:`VIDIOC_ENUMOUTPUT` ioctl.
반환값과 오류
56-65성공하면 0을 반환합니다. 오류가 발생하면 -1을 반환하고 `errno`를 설정하며 Generic Error Codes 장의 공통 오류도 적용됩니다.
유일한 전용 오류 조건입니다.
Return Value
============
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
EINVAL
The number of the video output is out of bounds, or there are no
video outputs at all.
요약·해설
vidioc-g-output.rst:1-65video output index를 조회·선택하고 출력 변경에 따른 다른 매개변수의 재협상 순서를 다룹니다.