← Documents Documentation/userspace-api/media/v4l/vidioc-g-std.rst GitHub 원문 ↗

Linux 6.18.37 · 사용자 공간 API

VIDIOC_G_STD·VIDIOC_S_STD ioctl

현재 아날로그 영상 표준을 조회·선택하는 네 ioctl과 플래그의 비모호성, 미지원 타이밍 및 읽기 전용 서브디바이스 오류를 설명합니다.

Source pathDocumentation/userspace-api/media/v4l/vidioc-g-std.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

vidioc-g-std.rst:1-82

조회 결과의 표준 플래그는 하나의 열거 항목으로 판별 가능해야 하며, 설정 결과는 별도 조회로 확인합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2 .. c:namespace:: V4L
3
4 .. _VIDIOC_G_STD:
5
6 **************************************************************************
7 ioctl VIDIOC_G_STD, VIDIOC_S_STD, VIDIOC_SUBDEV_G_STD, VIDIOC_SUBDEV_S_STD
8 **************************************************************************
9
10 Name
11 ====
12
13 VIDIOC_G_STD - VIDIOC_S_STD - VIDIOC_SUBDEV_G_STD - VIDIOC_SUBDEV_S_STD - Query or select the video standard of the current input
14
15 Synopsis
16 ========
17
18 .. c:macro:: VIDIOC_G_STD
19
20 ``int ioctl(int fd, VIDIOC_G_STD, v4l2_std_id *argp)``
21
22 .. c:macro:: VIDIOC_S_STD
23
24 ``int ioctl(int fd, VIDIOC_S_STD, const v4l2_std_id *argp)``
25
26 .. c:macro:: VIDIOC_SUBDEV_G_STD
27
28 ``int ioctl(int fd, VIDIOC_SUBDEV_G_STD, v4l2_std_id *argp)``
29
30 .. c:macro:: VIDIOC_SUBDEV_S_STD
31
32 ``int ioctl(int fd, VIDIOC_SUBDEV_S_STD, const v4l2_std_id *argp)``
33
34 Arguments
35 =========
36
37 ``fd``
38 File descriptor returned by :c:func:`open()`.
39
40 ``argp``
41 Pointer to :c:type:`v4l2_std_id`.
42
43 Description
44 ===========
45
46 To query and select the current video standard applications use the
47 :ref:`VIDIOC_G_STD <VIDIOC_G_STD>` and :ref:`VIDIOC_S_STD <VIDIOC_G_STD>` ioctls which take a pointer to a
48 :ref:`v4l2_std_id <v4l2-std-id>` type as argument. :ref:`VIDIOC_G_STD <VIDIOC_G_STD>`
49 can return a single flag or a set of flags as in struct
50 :c:type:`v4l2_standard` field ``id``. The flags must be
51 unambiguous such that they appear in only one enumerated
52 struct :c:type:`v4l2_standard` structure.
53
54 :ref:`VIDIOC_S_STD <VIDIOC_G_STD>` accepts one or more flags, being a write-only ioctl it
55 does not return the actual new standard as :ref:`VIDIOC_G_STD <VIDIOC_G_STD>` does. When
56 no flags are given or the current input does not support the requested
57 standard the driver returns an ``EINVAL`` error code. When the standard set
58 is ambiguous drivers may return ``EINVAL`` or choose any of the requested
59 standards. If the current input or output does not support standard
60 video timings (e.g. if :ref:`VIDIOC_ENUMINPUT`
61 does not set the ``V4L2_IN_CAP_STD`` flag), then ``ENODATA`` error code is
62 returned.
63
64 Calling ``VIDIOC_SUBDEV_S_STD`` on a subdev device node that has been registered
65 in read-only mode is not allowed. An error is returned and the errno variable is
66 set to ``-EPERM``.
67
68 Return Value
69 ============
70
71 On success 0 is returned, on error -1 and the ``errno`` variable is set
72 appropriately. The generic error codes are described at the
73 :ref:`Generic Error Codes <gen-errors>` chapter.
74
75 EINVAL
76 The :ref:`VIDIOC_S_STD <VIDIOC_G_STD>` parameter was unsuitable.
77
78 ENODATA
79 Standard video timings are not supported for this input or output.
80
81 EPERM
82 ``VIDIOC_SUBDEV_S_STD`` has been called on a read-only subdevice.
83

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

영상 표준 조회·선택 인터페이스

1-43

`VIDIOC_G_STD`와 `VIDIOC_S_STD`는 현재 입력의 아날로그 영상 표준을 조회하거나 선택합니다. `VIDIOC_SUBDEV_G_STD`와 `VIDIOC_SUBDEV_S_STD`는 같은 작업을 V4L2 서브디바이스 노드에 적용합니다.

ioctl 변형
명령인자역할
`VIDIOC_G_STD``v4l2_std_id *`현재 영상 표준 조회
`VIDIOC_S_STD``const v4l2_std_id *`현재 영상 표준 선택
`VIDIOC_SUBDEV_G_STD``v4l2_std_id *`서브디바이스의 현재 표준 조회
`VIDIOC_SUBDEV_S_STD``const v4l2_std_id *`서브디바이스의 현재 표준 선택

모든 명령은 `v4l2_std_id` 포인터를 사용하지만 읽기·쓰기 방향이 다릅니다.

`fd`는 `open()`이 반환한 파일 디스크립터이고, `argp`는 `v4l2_std_id`를 가리킵니다.

.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: V4L

.. _VIDIOC_G_STD:

**************************************************************************
ioctl VIDIOC_G_STD, VIDIOC_S_STD, VIDIOC_SUBDEV_G_STD, VIDIOC_SUBDEV_S_STD
**************************************************************************

Name
====

VIDIOC_G_STD - VIDIOC_S_STD - VIDIOC_SUBDEV_G_STD - VIDIOC_SUBDEV_S_STD - Query or select the video standard of the current input

Synopsis
========

.. c:macro:: VIDIOC_G_STD

``int ioctl(int fd, VIDIOC_G_STD, v4l2_std_id *argp)``

.. c:macro:: VIDIOC_S_STD

``int ioctl(int fd, VIDIOC_S_STD, const v4l2_std_id *argp)``

.. c:macro:: VIDIOC_SUBDEV_G_STD

``int ioctl(int fd, VIDIOC_SUBDEV_G_STD, v4l2_std_id *argp)``

.. c:macro:: VIDIOC_SUBDEV_S_STD

``int ioctl(int fd, VIDIOC_SUBDEV_S_STD, const v4l2_std_id *argp)``

Arguments
=========

``fd``
    File descriptor returned by :c:func:`open()`.

``argp``
    Pointer to :c:type:`v4l2_std_id`.

Description

표준 플래그와 선택 규칙

44-67

`VIDIOC_G_STD`는 `struct v4l2_standard`의 `id` 필드와 마찬가지로 플래그 하나 또는 플래그 집합을 반환할 수 있습니다. 반환된 집합은 열거된 `v4l2_standard` 구조체 하나에만 나타나도록 모호하지 않아야 합니다.

쓰기 전용인 `VIDIOC_S_STD`는 하나 이상의 표준 플래그를 받지만, 실제로 선택된 새 표준을 인자에 되돌려 주지 않습니다. 적용 결과를 확인하려면 별도로 `VIDIOC_G_STD`를 호출해야 합니다.

플래그가 비어 있거나 현재 입력이 요청 표준을 지원하지 않으면 `EINVAL`입니다. 표준 집합이 모호하면 드라이버는 `EINVAL`을 반환하거나 요청된 표준 가운데 하나를 선택할 수 있습니다.

현재 입력 또는 출력이 표준 영상 타이밍을 지원하지 않으면 `ENODATA`입니다. 예를 들어 `VIDIOC_ENUMINPUT` 결과에 `V4L2_IN_CAP_STD`가 설정되지 않은 경우가 이에 해당합니다.

읽기 전용으로 등록된 서브디바이스 노드에서 `VIDIOC_SUBDEV_S_STD`를 호출하는 것은 허용되지 않으며 `EPERM` 오류가 발생합니다.

===========

To query and select the current video standard applications use the
:ref:`VIDIOC_G_STD <VIDIOC_G_STD>` and :ref:`VIDIOC_S_STD <VIDIOC_G_STD>` ioctls which take a pointer to a
:ref:`v4l2_std_id <v4l2-std-id>` type as argument. :ref:`VIDIOC_G_STD <VIDIOC_G_STD>`
can return a single flag or a set of flags as in struct
:c:type:`v4l2_standard` field ``id``. The flags must be
unambiguous such that they appear in only one enumerated
struct :c:type:`v4l2_standard` structure.

:ref:`VIDIOC_S_STD <VIDIOC_G_STD>` accepts one or more flags, being a write-only ioctl it
does not return the actual new standard as :ref:`VIDIOC_G_STD <VIDIOC_G_STD>` does. When
no flags are given or the current input does not support the requested
standard the driver returns an ``EINVAL`` error code. When the standard set
is ambiguous drivers may return ``EINVAL`` or choose any of the requested
standards. If the current input or output does not support standard
video timings (e.g. if :ref:`VIDIOC_ENUMINPUT`
does not set the ``V4L2_IN_CAP_STD`` flag), then ``ENODATA`` error code is
returned.

Calling ``VIDIOC_SUBDEV_S_STD`` on a subdev device node that has been registered
in read-only mode is not allowed. An error is returned and the errno variable is
set to ``-EPERM``.

반환값과 오류

68-82

성공하면 0을 반환하고, 오류가 발생하면 -1을 반환한 뒤 `errno`를 설정합니다. 공통 오류는 Generic Error Codes 절을 따릅니다.

영상 표준 ioctl 오류
errno조건
`EINVAL``VIDIOC_S_STD` 인자가 부적합함
`ENODATA`현재 입력 또는 출력이 표준 영상 타이밍을 지원하지 않음
`EPERM`읽기 전용 서브디바이스에서 `VIDIOC_SUBDEV_S_STD`를 호출함

요청 내용, 장치 기능, 노드 권한에 따라 구분됩니다.

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 :ref:`VIDIOC_S_STD <VIDIOC_G_STD>` parameter was unsuitable.

ENODATA
    Standard video timings are not supported for this input or output.

EPERM
    ``VIDIOC_SUBDEV_S_STD`` has been called on a read-only subdevice.