← Documents Documentation/userspace-api/media/v4l/vidioc-subdev-enum-frame-interval.rst GitHub 원문 ↗

Linux 6.18.37 · 사용자 공간 API

VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL ioctl

서브디바이스 pad의 프레임 간격을 형식과 크기별로 열거하는 절차와 구조체 필드를 설명합니다.

Source pathDocumentation/userspace-api/media/v4l/vidioc-subdev-enum-frame-interval.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

vidioc-subdev-enum-frame-interval.rst:1-113

열거 결과는 pad 하나만의 고정 목록이 아니라 형식, 크기, 다른 pad의 try format과 활성 링크에 의존하는 현재 파이프라인 조건의 결과입니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2 .. c:namespace:: V4L
3
4 .. _VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL:
5
6 ***************************************
7 ioctl VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL
8 ***************************************
9
10 Name
11 ====
12
13 VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL - Enumerate frame intervals
14
15 Synopsis
16 ========
17
18 .. c:macro:: VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL
19
20 ``int ioctl(int fd, VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL, struct v4l2_subdev_frame_interval_enum * argp)``
21
22 Arguments
23 =========
24
25 ``fd``
26 File descriptor returned by :c:func:`open()`.
27
28 ``argp``
29 Pointer to struct :c:type:`v4l2_subdev_frame_interval_enum`.
30
31 Description
32 ===========
33
34 This ioctl lets applications enumerate available frame intervals on a
35 given sub-device pad. Frame intervals only makes sense for sub-devices
36 that can control the frame period on their own. This includes, for
37 instance, image sensors and TV tuners.
38
39 For the common use case of image sensors, the frame intervals available
40 on the sub-device output pad depend on the frame format and size on the
41 same pad. Applications must thus specify the desired format and size
42 when enumerating frame intervals.
43
44 To enumerate frame intervals applications initialize the ``index``,
45 ``pad``, ``which``, ``code``, ``width`` and ``height`` fields of struct
46 :c:type:`v4l2_subdev_frame_interval_enum`
47 and call the :ref:`VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL` ioctl with a pointer
48 to this structure. Drivers fill the rest of the structure or return an
49 EINVAL error code if one of the input fields is invalid. All frame
50 intervals are enumerable by beginning at index zero and incrementing by
51 one until ``EINVAL`` is returned.
52
53 Available frame intervals may depend on the current 'try' formats at
54 other pads of the sub-device, as well as on the current active links.
55 See :ref:`VIDIOC_SUBDEV_G_FMT` for more
56 information about the try formats.
57
58 Sub-devices that support the frame interval enumeration ioctl should
59 implemented it on a single pad only. Its behaviour when supported on
60 multiple pads of the same sub-device is not defined.
61
62 .. c:type:: v4l2_subdev_frame_interval_enum
63
64 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|
65
66 .. flat-table:: struct v4l2_subdev_frame_interval_enum
67 :header-rows: 0
68 :stub-columns: 0
69 :widths: 1 1 2
70
71 * - __u32
72 - ``index``
73 - Number of the format in the enumeration, set by the application.
74 * - __u32
75 - ``pad``
76 - Pad number as reported by the media controller API.
77 * - __u32
78 - ``code``
79 - The media bus format code, as defined in
80 :ref:`v4l2-mbus-format`.
81 * - __u32
82 - ``width``
83 - Frame width, in pixels.
84 * - __u32
85 - ``height``
86 - Frame height, in pixels.
87 * - struct :c:type:`v4l2_fract`
88 - ``interval``
89 - Period, in seconds, between consecutive video frames.
90 * - __u32
91 - ``which``
92 - Frame intervals to be enumerated, from enum
93 :ref:`v4l2_subdev_format_whence <v4l2-subdev-format-whence>`.
94 * - __u32
95 - ``stream``
96 - Stream identifier.
97 * - __u32
98 - ``reserved``\ [7]
99 - Reserved for future extensions. Applications and drivers must set
100 the array to zero.
101
102 Return Value
103 ============
104
105 On success 0 is returned, on error -1 and the ``errno`` variable is set
106 appropriately. The generic error codes are described at the
107 :ref:`Generic Error Codes <gen-errors>` chapter.
108
109 EINVAL
110 The struct :c:type:`v4l2_subdev_frame_interval_enum` ``pad`` references a
111 non-existing pad, the ``which`` field has an unsupported value, one of the
112 ``code``, ``width`` or ``height`` fields are invalid for the given pad, or
113 the ``index`` field is out of bounds.
114

3. 한국어 전문 번역

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

목적, 호출 형식과 인자

1-30

`VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL`은 지정한 서브디바이스 pad에서 사용할 수 있는 프레임 간격을 열거합니다. `argp`는 조건과 결과를 담는 `struct v4l2_subdev_frame_interval_enum`을 가리킵니다.

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

.. _VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL:

***************************************
ioctl VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL
***************************************

Name
====

VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL - Enumerate frame intervals

Synopsis
========

.. c:macro:: VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL

``int ioctl(int fd, VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL, struct v4l2_subdev_frame_interval_enum * argp)``

Arguments
=========

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

``argp``
    Pointer to struct :c:type:`v4l2_subdev_frame_interval_enum`.

열거 조건과 의존성

31-60

프레임 간격은 이미지 센서나 TV 튜너처럼 자체적으로 프레임 주기를 제어할 수 있는 서브디바이스에만 의미가 있습니다.

이미지 센서의 출력 pad에서 가능한 간격은 같은 pad의 프레임 형식과 크기에 의존합니다. 따라서 응용 프로그램은 `index`, `pad`, `which`, `code`, `width`, `height`를 설정해 원하는 형식과 크기를 함께 지정해야 합니다.

열거는 `index = 0`에서 시작해 한 번에 1씩 증가시키며 호출합니다. 드라이버는 나머지 필드를 채우고, 입력 필드가 잘못되었거나 더 이상 항목이 없으면 `EINVAL`을 반환합니다.

가능한 간격은 다른 pad의 현재 try format과 활성 링크에도 달라질 수 있습니다. try format의 의미와 구성은 `VIDIOC_SUBDEV_G_FMT` 설명을 함께 확인해야 합니다.

이 ioctl을 지원하는 서브디바이스는 한 pad에서만 구현해야 합니다. 같은 서브디바이스의 여러 pad에서 지원할 때의 동작은 정의되어 있지 않습니다.

프레임 간격 열거
pad, which, media-bus code, width, height 설정index를 0으로 설정ioctl 성공 시 interval과 stream 확인index를 1 증가시켜 반복EINVAL이면 열거 종료 또는 입력 조건 재검토

고정된 형식과 크기에 대해 인덱스를 순서대로 조회합니다.

Description
===========

This ioctl lets applications enumerate available frame intervals on a
given sub-device pad. Frame intervals only makes sense for sub-devices
that can control the frame period on their own. This includes, for
instance, image sensors and TV tuners.

For the common use case of image sensors, the frame intervals available
on the sub-device output pad depend on the frame format and size on the
same pad. Applications must thus specify the desired format and size
when enumerating frame intervals.

To enumerate frame intervals applications initialize the ``index``,
``pad``, ``which``, ``code``, ``width`` and ``height`` fields of struct
:c:type:`v4l2_subdev_frame_interval_enum`
and call the :ref:`VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL` ioctl with a pointer
to this structure. Drivers fill the rest of the structure or return an
EINVAL error code if one of the input fields is invalid. All frame
intervals are enumerable by beginning at index zero and incrementing by
one until ``EINVAL`` is returned.

Available frame intervals may depend on the current 'try' formats at
other pads of the sub-device, as well as on the current active links.
See :ref:`VIDIOC_SUBDEV_G_FMT` for more
information about the try formats.

Sub-devices that support the frame interval enumeration ioctl should
implemented it on a single pad only. Its behaviour when supported on
multiple pads of the same sub-device is not defined.

struct v4l2_subdev_frame_interval_enum

61-100
프레임 간격 열거 구조체
형식필드의미
`__u32``index`응용 프로그램이 설정하는 열거 인덱스
`__u32``pad`Media Controller API가 보고한 pad 번호
`__u32``code`media-bus 프레임 형식 코드
`__u32``width`픽셀 단위 프레임 너비
`__u32``height`픽셀 단위 프레임 높이
`struct v4l2_fract``interval`연속 비디오 프레임 사이의 초 단위 주기
`__u32``which`열거할 프레임 간격의 상태로 `v4l2_subdev_format_whence` 값 사용
`__u32``stream`스트림 식별자
`__u32[7]``reserved[7]`향후 확장용이며 응용 프로그램과 드라이버가 모두 0으로 설정

응용 프로그램이 설정할 선택 조건과 드라이버가 반환할 간격을 함께 담습니다.

`interval`은 `v4l2_fract`이므로 분자와 분모로 프레임 사이의 시간을 표현합니다. 프레임률을 비교할 때는 간격의 역수라는 점을 고려해야 합니다.


.. c:type:: v4l2_subdev_frame_interval_enum

.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|

.. flat-table:: struct v4l2_subdev_frame_interval_enum
    :header-rows:  0
    :stub-columns: 0
    :widths:       1 1 2

    * - __u32
      - ``index``
      - Number of the format in the enumeration, set by the application.
    * - __u32
      - ``pad``
      - Pad number as reported by the media controller API.
    * - __u32
      - ``code``
      - The media bus format code, as defined in
	:ref:`v4l2-mbus-format`.
    * - __u32
      - ``width``
      - Frame width, in pixels.
    * - __u32
      - ``height``
      - Frame height, in pixels.
    * - struct :c:type:`v4l2_fract`
      - ``interval``
      - Period, in seconds, between consecutive video frames.
    * - __u32
      - ``which``
      - Frame intervals to be enumerated, from enum
	:ref:`v4l2_subdev_format_whence <v4l2-subdev-format-whence>`.
    * - __u32
      - ``stream``
      - Stream identifier.
    * - __u32
      - ``reserved``\ [7]
      - Reserved for future extensions. Applications and drivers must set
	the array to zero.

반환값과 EINVAL

101-113

성공하면 0, 오류이면 -1을 반환하고 `errno`를 설정합니다. `EINVAL`은 열거 종료 신호일 수도 있고 입력 조합 오류일 수도 있으므로 현재 인덱스와 필드를 함께 검사해야 합니다.

프레임 간격 열거의 EINVAL 조건
검사 대상오류 조건
`pad`존재하지 않는 pad를 참조함
`which`지원되지 않는 값을 사용함
`code`, `width`, `height`지정한 pad에서 유효하지 않은 형식 또는 크기 조합임
`index`열거 범위를 벗어남

pad와 형식 조건 또는 인덱스가 유효하지 않을 때 반환됩니다.


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 struct :c:type:`v4l2_subdev_frame_interval_enum` ``pad`` references a
    non-existing pad, the ``which`` field has an unsupported value, one of the
    ``code``, ``width`` or ``height`` fields are invalid for the given pad, or
    the ``index`` field is out of bounds.