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

Linux 6.18.37 · 사용자 공간 API

VIDIOC_DECODER_CMD와 VIDIOC_TRY_DECODER_CMD ioctl

VIDIOC_DECODER_CMD와 TRY 변형으로 디코더를 시작·정지·일시 정지·재개·flush하고 stateful drain 및 stateless 보류 프레임을 처리하는 규칙입니다.

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

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

1. 요약·해설

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

요약·해설

vidioc-decoder-cmd.rst:1-218

VIDIOC_DECODER_CMD와 TRY 변형으로 디코더를 시작·정지·일시 정지·재개·flush하고 stateful drain 및 stateless 보류 프레임을 처리하는 규칙입니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2 .. c:namespace:: V4L
3
4 .. _VIDIOC_DECODER_CMD:
5
6 ************************************************
7 ioctl VIDIOC_DECODER_CMD, VIDIOC_TRY_DECODER_CMD
8 ************************************************
9
10 Name
11 ====
12
13 VIDIOC_DECODER_CMD - VIDIOC_TRY_DECODER_CMD - Execute an decoder command
14
15 Synopsis
16 ========
17
18 .. c:macro:: VIDIOC_DECODER_CMD
19
20 ``int ioctl(int fd, VIDIOC_DECODER_CMD, struct v4l2_decoder_cmd *argp)``
21
22 .. c:macro:: VIDIOC_TRY_DECODER_CMD
23
24 ``int ioctl(int fd, VIDIOC_TRY_DECODER_CMD, struct v4l2_decoder_cmd *argp)``
25
26 Arguments
27 =========
28
29 ``fd``
30 File descriptor returned by :c:func:`open()`.
31
32 ``argp``
33 pointer to struct :c:type:`v4l2_decoder_cmd`.
34
35 Description
36 ===========
37
38 These ioctls control an audio/video (usually MPEG-) decoder.
39 ``VIDIOC_DECODER_CMD`` sends a command to the decoder,
40 ``VIDIOC_TRY_DECODER_CMD`` can be used to try a command without actually
41 executing it. To send a command applications must initialize all fields
42 of a struct :c:type:`v4l2_decoder_cmd` and call
43 ``VIDIOC_DECODER_CMD`` or ``VIDIOC_TRY_DECODER_CMD`` with a pointer to
44 this structure.
45
46 The ``cmd`` field must contain the command code. Some commands use the
47 ``flags`` field for additional information.
48
49 A :c:func:`write()` or :ref:`VIDIOC_STREAMON`
50 call sends an implicit START command to the decoder if it has not been
51 started yet. Applies to both queues of mem2mem decoders.
52
53 A :c:func:`close()` or :ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>`
54 call of a streaming file descriptor sends an implicit immediate STOP
55 command to the decoder, and all buffered data is discarded. Applies to both
56 queues of mem2mem decoders.
57
58 In principle, these ioctls are optional, not all drivers may support them. They were
59 introduced in Linux 3.3. They are, however, mandatory for stateful mem2mem decoders
60 (as further documented in :ref:`decoder`).
61
62 .. tabularcolumns:: |p{2.0cm}|p{1.1cm}|p{2.2cm}|p{11.8cm}|
63
64 .. c:type:: v4l2_decoder_cmd
65
66 .. cssclass:: longtable
67
68 .. flat-table:: struct v4l2_decoder_cmd
69 :header-rows: 0
70 :stub-columns: 0
71 :widths: 1 1 1 3
72
73 * - __u32
74 - ``cmd``
75 -
76 - The decoder command, see :ref:`decoder-cmds`.
77 * - __u32
78 - ``flags``
79 -
80 - Flags to go with the command. If no flags are defined for this
81 command, drivers and applications must set this field to zero.
82 * - union {
83 - (anonymous)
84 * - struct
85 - ``start``
86 -
87 - Structure containing additional data for the
88 ``V4L2_DEC_CMD_START`` command.
89 * -
90 - __s32
91 - ``speed``
92 - Playback speed and direction. The playback speed is defined as
93 ``speed``/1000 of the normal speed. So 1000 is normal playback.
94 Negative numbers denote reverse playback, so -1000 does reverse
95 playback at normal speed. Speeds -1, 0 and 1 have special
96 meanings: speed 0 is shorthand for 1000 (normal playback). A speed
97 of 1 steps just one frame forward, a speed of -1 steps just one
98 frame back.
99 * -
100 - __u32
101 - ``format``
102 - Format restrictions. This field is set by the driver, not the
103 application. Possible values are ``V4L2_DEC_START_FMT_NONE`` if
104 there are no format restrictions or ``V4L2_DEC_START_FMT_GOP`` if
105 the decoder operates on full GOPs (*Group Of Pictures*). This is
106 usually the case for reverse playback: the decoder needs full
107 GOPs, which it can then play in reverse order. So to implement
108 reverse playback the application must feed the decoder the last
109 GOP in the video file, then the GOP before that, etc. etc.
110 * - struct
111 - ``stop``
112 -
113 - Structure containing additional data for the ``V4L2_DEC_CMD_STOP``
114 command.
115 * -
116 - __u64
117 - ``pts``
118 - Stop playback at this ``pts`` or immediately if the playback is
119 already past that timestamp. Leave to 0 if you want to stop after
120 the last frame was decoded.
121 * - struct
122 - ``raw``
123 * -
124 - __u32
125 - ``data``\ [16]
126 - Reserved for future extensions. Drivers and applications must set
127 the array to zero.
128 * - }
129 -
130
131
132 .. tabularcolumns:: |p{5.6cm}|p{0.6cm}|p{11.1cm}|
133
134 .. cssclass:: longtable
135
136 .. _decoder-cmds:
137
138 .. flat-table:: Decoder Commands
139 :header-rows: 0
140 :stub-columns: 0
141 :widths: 56 6 113
142
143 * - ``V4L2_DEC_CMD_START``
144 - 0
145 - Start the decoder. When the decoder is already running or paused,
146 this command will just change the playback speed. That means that
147 calling ``V4L2_DEC_CMD_START`` when the decoder was paused will
148 *not* resume the decoder. You have to explicitly call
149 ``V4L2_DEC_CMD_RESUME`` for that. This command has one flag:
150 ``V4L2_DEC_CMD_START_MUTE_AUDIO``. If set, then audio will be
151 muted when playing back at a non-standard speed.
152
153 For a device implementing the :ref:`decoder`, once the drain sequence
154 is initiated with the ``V4L2_DEC_CMD_STOP`` command, it must be driven
155 to completion before this command can be invoked. Any attempt to
156 invoke the command while the drain sequence is in progress will trigger
157 an ``EBUSY`` error code. The command may be also used to restart the
158 decoder in case of an implicit stop initiated by the decoder itself,
159 without the ``V4L2_DEC_CMD_STOP`` being called explicitly. See
160 :ref:`decoder` for more details.
161 * - ``V4L2_DEC_CMD_STOP``
162 - 1
163 - Stop the decoder. When the decoder is already stopped, this
164 command does nothing. This command has two flags: if
165 ``V4L2_DEC_CMD_STOP_TO_BLACK`` is set, then the decoder will set
166 the picture to black after it stopped decoding. Otherwise the last
167 image will repeat. If
168 ``V4L2_DEC_CMD_STOP_IMMEDIATELY`` is set, then the decoder stops
169 immediately (ignoring the ``pts`` value), otherwise it will keep
170 decoding until timestamp >= pts or until the last of the pending
171 data from its internal buffers was decoded.
172
173 For a device implementing the :ref:`decoder`, the command will initiate
174 the drain sequence as documented in :ref:`decoder`. No flags or other
175 arguments are accepted in this case. Any attempt to invoke the command
176 again before the sequence completes will trigger an ``EBUSY`` error
177 code.
178 * - ``V4L2_DEC_CMD_PAUSE``
179 - 2
180 - Pause the decoder. When the decoder has not been started yet, the
181 driver will return an ``EPERM`` error code. When the decoder is
182 already paused, this command does nothing. This command has one
183 flag: if ``V4L2_DEC_CMD_PAUSE_TO_BLACK`` is set, then set the
184 decoder output to black when paused.
185 * - ``V4L2_DEC_CMD_RESUME``
186 - 3
187 - Resume decoding after a PAUSE command. When the decoder has not
188 been started yet, the driver will return an ``EPERM`` error code. When
189 the decoder is already running, this command does nothing. No
190 flags are defined for this command.
191 * - ``V4L2_DEC_CMD_FLUSH``
192 - 4
193 - Flush any held capture buffers. Only valid for stateless decoders.
194 This command is typically used when the application reached the
195 end of the stream and the last output buffer had the
196 ``V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF`` flag set. This would prevent
197 dequeueing the capture buffer containing the last decoded frame.
198 So this command can be used to explicitly flush that final decoded
199 frame. This command does nothing if there are no held capture buffers.
200
201 Return Value
202 ============
203
204 On success 0 is returned, on error -1 and the ``errno`` variable is set
205 appropriately. The generic error codes are described at the
206 :ref:`Generic Error Codes <gen-errors>` chapter.
207
208 EBUSY
209 A drain sequence of a device implementing the :ref:`decoder` is still in
210 progress. It is not allowed to issue another decoder command until it
211 completes.
212
213 EINVAL
214 The ``cmd`` field is invalid.
215
216 EPERM
217 The application sent a PAUSE or RESUME command when the decoder was
218 not running.
219

3. 한국어 전문 번역

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

이름, 호출 형식과 인자

1-34

`VIDIOC_DECODER_CMD`는 오디오·비디오 디코더에 명령을 실행하고, `VIDIOC_TRY_DECODER_CMD`는 같은 명령을 실제로 실행하지 않은 채 지원 여부와 인자 유효성을 시험합니다. 두 호출 모두 `struct v4l2_decoder_cmd *argp`를 사용합니다.

`fd`는 `open()`이 반환한 파일 디스크립터이고, `argp`는 응용 프로그램이 모든 필드를 초기화한 `struct v4l2_decoder_cmd`를 가리킵니다.

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

.. _VIDIOC_DECODER_CMD:

************************************************
ioctl VIDIOC_DECODER_CMD, VIDIOC_TRY_DECODER_CMD
************************************************

Name
====

VIDIOC_DECODER_CMD - VIDIOC_TRY_DECODER_CMD - Execute an decoder command

Synopsis
========

.. c:macro:: VIDIOC_DECODER_CMD

``int ioctl(int fd, VIDIOC_DECODER_CMD, struct v4l2_decoder_cmd *argp)``

.. c:macro:: VIDIOC_TRY_DECODER_CMD

``int ioctl(int fd, VIDIOC_TRY_DECODER_CMD, struct v4l2_decoder_cmd *argp)``

Arguments
=========

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

``argp``
    pointer to struct :c:type:`v4l2_decoder_cmd`.

명령 전송과 암시적 시작·정지

35-61

`cmd`에는 디코더 명령 코드를 넣고 일부 명령은 `flags`로 추가 동작을 지정합니다. `VIDIOC_TRY_DECODER_CMD`는 드라이버가 명령을 받아들일지 확인할 때 사용하며 디코더 상태 자체는 바꾸지 않습니다.

아직 시작하지 않은 디코더에 `write()` 또는 `VIDIOC_STREAMON`을 호출하면 암시적 START 명령이 전달됩니다. 스트리밍 파일 디스크립터를 `close()`하거나 `VIDIOC_STREAMOFF`를 호출하면 암시적 즉시 STOP이 전달되고 버퍼링된 모든 데이터가 폐기됩니다. 두 규칙은 mem2mem 디코더의 양쪽 큐 모두에 적용됩니다.

이 ioctl은 원칙적으로 선택 기능이며 Linux 3.3에서 도입됐습니다. 다만 stateful mem2mem 디코더에는 필수입니다.

명시적·암시적 상태 제어
write 또는 VIDIOC_STREAMON -> 아직 미시작이면 implicit STARTVIDIOC_DECODER_CMD -> 명시적 명령close 또는 VIDIOC_STREAMOFF -> immediate STOP과 버퍼 폐기

스트리밍 API와 디코더 명령 사이의 대응입니다.

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

These ioctls control an audio/video (usually MPEG-) decoder.
``VIDIOC_DECODER_CMD`` sends a command to the decoder,
``VIDIOC_TRY_DECODER_CMD`` can be used to try a command without actually
executing it. To send a command applications must initialize all fields
of a struct :c:type:`v4l2_decoder_cmd` and call
``VIDIOC_DECODER_CMD`` or ``VIDIOC_TRY_DECODER_CMD`` with a pointer to
this structure.

The ``cmd`` field must contain the command code. Some commands use the
``flags`` field for additional information.

A :c:func:`write()` or :ref:`VIDIOC_STREAMON`
call sends an implicit START command to the decoder if it has not been
started yet. Applies to both queues of mem2mem decoders.

A :c:func:`close()` or :ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>`
call of a streaming file descriptor sends an implicit immediate STOP
command to the decoder, and all buffered data is discarded. Applies to both
queues of mem2mem decoders.

In principle, these ioctls are optional, not all drivers may support them. They were
introduced in Linux 3.3. They are, however, mandatory for stateful mem2mem decoders
(as further documented in :ref:`decoder`).

v4l2_decoder_cmd 구조체

62-131

구조체의 `cmd`와 `flags` 뒤에는 명령별 추가 인자를 담는 익명 union이 있습니다. 해당 명령에 정의된 플래그가 없으면 드라이버와 응용 프로그램 모두 `flags`를 0으로 설정해야 합니다.

START의 `speed`는 정상 속도의 1/1000 단위입니다. 1000은 정방향 정상 재생, -1000은 역방향 정상 재생입니다. 특수값 0은 1000의 축약이고, 1은 한 프레임 전진, -1은 한 프레임 후진입니다.

START의 `format`은 응용 프로그램이 아니라 드라이버가 설정합니다. `V4L2_DEC_START_FMT_NONE`은 제한 없음, `V4L2_DEC_START_FMT_GOP`는 완전한 GOP 단위가 필요함을 뜻합니다. 역재생에서 GOP 제한이 있으면 응용 프로그램은 파일의 마지막 GOP부터 그 이전 GOP 순서로 공급해야 합니다.

STOP의 `pts`는 정지할 프레젠테이션 타임스탬프입니다. 이미 그 시각을 지났으면 즉시 정지하고, 0이면 마지막 프레임을 디코딩한 뒤 정지합니다. `raw.data[16]`은 미래 확장용이므로 드라이버와 응용 프로그램 모두 0으로 설정해야 합니다.

struct v4l2_decoder_cmd
영역필드형식의미
공통`cmd``__u32`실행하거나 시험할 디코더 명령
공통`flags``__u32`명령별 추가 플래그; 정의가 없으면 0
`start``speed``__s32`정상 속도의 1/1000 단위 재생 속도와 방향
`start``format``__u32`드라이버가 반환하는 GOP 형식 제한
`stop``pts``__u64`정지 목표 PTS; 0이면 마지막 프레임 뒤 정지
`raw``data[16]``__u32[16]`예약 배열이며 0으로 초기화

명령 공통 필드와 union의 START·STOP 데이터를 원문 순서대로 정리합니다.

.. tabularcolumns:: |p{2.0cm}|p{1.1cm}|p{2.2cm}|p{11.8cm}|

.. c:type:: v4l2_decoder_cmd

.. cssclass:: longtable

.. flat-table:: struct v4l2_decoder_cmd
    :header-rows:  0
    :stub-columns: 0
    :widths: 1 1 1 3

    * - __u32
      - ``cmd``
      -
      - The decoder command, see :ref:`decoder-cmds`.
    * - __u32
      - ``flags``
      -
      - Flags to go with the command. If no flags are defined for this
	command, drivers and applications must set this field to zero.
    * - union {
      - (anonymous)
    * - struct
      - ``start``
      -
      - Structure containing additional data for the
	``V4L2_DEC_CMD_START`` command.
    * -
      - __s32
      - ``speed``
      - Playback speed and direction. The playback speed is defined as
	``speed``/1000 of the normal speed. So 1000 is normal playback.
	Negative numbers denote reverse playback, so -1000 does reverse
	playback at normal speed. Speeds -1, 0 and 1 have special
	meanings: speed 0 is shorthand for 1000 (normal playback). A speed
	of 1 steps just one frame forward, a speed of -1 steps just one
	frame back.
    * -
      - __u32
      - ``format``
      - Format restrictions. This field is set by the driver, not the
	application. Possible values are ``V4L2_DEC_START_FMT_NONE`` if
	there are no format restrictions or ``V4L2_DEC_START_FMT_GOP`` if
	the decoder operates on full GOPs (*Group Of Pictures*). This is
	usually the case for reverse playback: the decoder needs full
	GOPs, which it can then play in reverse order. So to implement
	reverse playback the application must feed the decoder the last
	GOP in the video file, then the GOP before that, etc. etc.
    * - struct
      - ``stop``
      -
      - Structure containing additional data for the ``V4L2_DEC_CMD_STOP``
	command.
    * -
      - __u64
      - ``pts``
      - Stop playback at this ``pts`` or immediately if the playback is
	already past that timestamp. Leave to 0 if you want to stop after
	the last frame was decoded.
    * - struct
      - ``raw``
    * -
      - __u32
      - ``data``\ [16]
      - Reserved for future extensions. Drivers and applications must set
	the array to zero.
    * - }
      -

START와 STOP 명령

132-177

`V4L2_DEC_CMD_START` 값은 0이며 디코더를 시작합니다. 이미 실행 중이거나 일시 정지 중이면 재생 속도만 바꾸므로, PAUSE 상태에서 START를 호출해도 재개되지 않습니다. 재개에는 `V4L2_DEC_CMD_RESUME`이 필요합니다. `V4L2_DEC_CMD_START_MUTE_AUDIO`는 비표준 속도 재생 중 오디오를 음소거합니다.

stateful 디코더에서 STOP으로 drain을 시작했다면 완료되기 전 START를 호출할 수 없고 `EBUSY`가 발생합니다. 디코더가 자체적으로 암시적 정지를 수행한 경우에는 명시적 STOP 없이 START로 다시 시작할 수 있습니다.

`V4L2_DEC_CMD_STOP` 값은 1입니다. 이미 정지 상태면 아무 일도 하지 않습니다. `V4L2_DEC_CMD_STOP_TO_BLACK`은 정지 후 검은 화면을 출력하며, 플래그가 없으면 마지막 영상을 반복합니다. `V4L2_DEC_CMD_STOP_IMMEDIATELY`는 `pts`를 무시하고 즉시 정지합니다. 그렇지 않으면 timestamp가 pts 이상이 되거나 내부 보류 데이터가 모두 디코딩될 때까지 계속합니다.

stateful 디코더에서는 STOP이 drain sequence를 시작하며 플래그나 다른 인자를 받지 않습니다. 완료 전에 STOP을 다시 호출하면 `EBUSY`입니다.

START·STOP 명령
명령주요 동작플래그
`V4L2_DEC_CMD_START`0시작 또는 속도 변경; PAUSE는 재개하지 않음`V4L2_DEC_CMD_START_MUTE_AUDIO`
`V4L2_DEC_CMD_STOP`1정지 또는 stateful drain 시작`STOP_TO_BLACK`, `STOP_IMMEDIATELY`

상태 전이와 플래그를 비교합니다.

stateful drain 규칙
V4L2_DEC_CMD_STOPdrain sequence 진행중간 명령은 EBUSYdrain 완료START 등 다음 명령 허용

drain 중에는 다른 디코더 명령을 허용하지 않습니다.

.. tabularcolumns:: |p{5.6cm}|p{0.6cm}|p{11.1cm}|

.. cssclass:: longtable

.. _decoder-cmds:

.. flat-table:: Decoder Commands
    :header-rows:  0
    :stub-columns: 0
    :widths: 56 6 113

    * - ``V4L2_DEC_CMD_START``
      - 0
      - Start the decoder. When the decoder is already running or paused,
	this command will just change the playback speed. That means that
	calling ``V4L2_DEC_CMD_START`` when the decoder was paused will
	*not* resume the decoder. You have to explicitly call
	``V4L2_DEC_CMD_RESUME`` for that. This command has one flag:
	``V4L2_DEC_CMD_START_MUTE_AUDIO``. If set, then audio will be
	muted when playing back at a non-standard speed.

	For a device implementing the :ref:`decoder`, once the drain sequence
	is initiated with the ``V4L2_DEC_CMD_STOP`` command, it must be driven
	to completion before this command can be invoked.  Any attempt to
	invoke the command while the drain sequence is in progress will trigger
	an ``EBUSY`` error code.  The command may be also used to restart the
	decoder in case of an implicit stop initiated by the decoder itself,
	without the ``V4L2_DEC_CMD_STOP`` being called explicitly. See
	:ref:`decoder` for more details.
    * - ``V4L2_DEC_CMD_STOP``
      - 1
      - Stop the decoder. When the decoder is already stopped, this
	command does nothing. This command has two flags: if
	``V4L2_DEC_CMD_STOP_TO_BLACK`` is set, then the decoder will set
	the picture to black after it stopped decoding. Otherwise the last
	image will repeat. If
	``V4L2_DEC_CMD_STOP_IMMEDIATELY`` is set, then the decoder stops
	immediately (ignoring the ``pts`` value), otherwise it will keep
	decoding until timestamp >= pts or until the last of the pending
	data from its internal buffers was decoded.

	For a device implementing the :ref:`decoder`, the command will initiate
	the drain sequence as documented in :ref:`decoder`.  No flags or other
	arguments are accepted in this case. Any attempt to invoke the command
	again before the sequence completes will trigger an ``EBUSY`` error
	code.

PAUSE, RESUME과 FLUSH 명령

178-200

`V4L2_DEC_CMD_PAUSE` 값은 2입니다. 디코더가 시작되지 않았다면 `EPERM`, 이미 일시 정지 상태면 아무 일도 하지 않습니다. `V4L2_DEC_CMD_PAUSE_TO_BLACK`을 설정하면 일시 정지 중 출력 화면을 검게 만듭니다.

`V4L2_DEC_CMD_RESUME` 값은 3이며 PAUSE 뒤 디코딩을 재개합니다. 시작 전에는 `EPERM`, 이미 실행 중이면 아무 일도 하지 않으며 정의된 플래그가 없습니다.

`V4L2_DEC_CMD_FLUSH` 값은 4이며 stateless 디코더에서만 유효합니다. 스트림 끝의 마지막 출력 버퍼에 `V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF`가 있어 마지막 디코딩 프레임의 capture 버퍼를 dequeue할 수 없을 때, 보류된 최종 프레임을 명시적으로 내보냅니다. 보류 capture 버퍼가 없으면 아무 일도 하지 않습니다.

PAUSE·RESUME·FLUSH 명령
명령동작제약
`V4L2_DEC_CMD_PAUSE`2디코더 일시 정지미시작이면 EPERM; 선택적으로 검은 화면
`V4L2_DEC_CMD_RESUME`3PAUSE 뒤 재개미시작이면 EPERM; 플래그 없음
`V4L2_DEC_CMD_FLUSH`4보류 capture 버퍼 배출stateless 디코더 전용

실행 전 상태와 적용 대상을 구분합니다.

    * - ``V4L2_DEC_CMD_PAUSE``
      - 2
      - Pause the decoder. When the decoder has not been started yet, the
	driver will return an ``EPERM`` error code. When the decoder is
	already paused, this command does nothing. This command has one
	flag: if ``V4L2_DEC_CMD_PAUSE_TO_BLACK`` is set, then set the
	decoder output to black when paused.
    * - ``V4L2_DEC_CMD_RESUME``
      - 3
      - Resume decoding after a PAUSE command. When the decoder has not
	been started yet, the driver will return an ``EPERM`` error code. When
	the decoder is already running, this command does nothing. No
	flags are defined for this command.
    * - ``V4L2_DEC_CMD_FLUSH``
      - 4
      - Flush any held capture buffers. Only valid for stateless decoders.
	This command is typically used when the application reached the
	end of the stream and the last output buffer had the
	``V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF`` flag set. This would prevent
	dequeueing the capture buffer containing the last decoded frame.
	So this command can be used to explicitly flush that final decoded
	frame. This command does nothing if there are no held capture buffers.

반환값과 오류

201-218

성공하면 0을 반환하고 실패하면 -1과 적절한 `errno`를 반환합니다. 공통 오류는 Generic Error Codes 절을 따릅니다.

디코더 명령 오류
errno의미
`EBUSY`stateful 디코더 drain sequence가 아직 진행 중이라 다른 명령을 허용하지 않음
`EINVAL``cmd` 필드가 유효하지 않음
`EPERM`디코더가 실행 중이 아닌데 PAUSE 또는 RESUME을 보냄

명령 상태와 인자 오류를 구분합니다.

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.

EBUSY
    A drain sequence of a device implementing the :ref:`decoder` is still in
    progress. It is not allowed to issue another decoder command until it
    completes.

EINVAL
    The ``cmd`` field is invalid.

EPERM
    The application sent a PAUSE or RESUME command when the decoder was
    not running.