diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2011-11-24 07:55:53 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-02-14 10:42:34 -0500 |
commit | 6b4f12523db46536c750473abdd380763cb0409b (patch) | |
tree | 5ef2e19da577e29256c77a55141f50df2f6511ba /Documentation/DocBook | |
parent | a45c0ad51d344dad18c6fb67304b4f87cf0ffd59 (diff) |
[media] v4l spec: document VIDIOC_(TRY_)DECODER_CMD
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'Documentation/DocBook')
-rw-r--r-- | Documentation/DocBook/media/v4l/v4l2.xml | 1 | ||||
-rw-r--r-- | Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml | 256 | ||||
-rw-r--r-- | Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml | 9 |
3 files changed, 262 insertions, 4 deletions
diff --git a/Documentation/DocBook/media/v4l/v4l2.xml b/Documentation/DocBook/media/v4l/v4l2.xml index dce3fef15bc9..dcf9e33b695f 100644 --- a/Documentation/DocBook/media/v4l/v4l2.xml +++ b/Documentation/DocBook/media/v4l/v4l2.xml | |||
@@ -480,6 +480,7 @@ and discussions on the V4L mailing list.</revremark> | |||
480 | &sub-cropcap; | 480 | &sub-cropcap; |
481 | &sub-dbg-g-chip-ident; | 481 | &sub-dbg-g-chip-ident; |
482 | &sub-dbg-g-register; | 482 | &sub-dbg-g-register; |
483 | &sub-decoder-cmd; | ||
483 | &sub-dqevent; | 484 | &sub-dqevent; |
484 | &sub-encoder-cmd; | 485 | &sub-encoder-cmd; |
485 | &sub-enumaudio; | 486 | &sub-enumaudio; |
diff --git a/Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml b/Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml new file mode 100644 index 000000000000..466fe27d3ffe --- /dev/null +++ b/Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml | |||
@@ -0,0 +1,256 @@ | |||
1 | <refentry id="vidioc-decoder-cmd"> | ||
2 | <refmeta> | ||
3 | <refentrytitle>ioctl VIDIOC_DECODER_CMD, VIDIOC_TRY_DECODER_CMD</refentrytitle> | ||
4 | &manvol; | ||
5 | </refmeta> | ||
6 | |||
7 | <refnamediv> | ||
8 | <refname>VIDIOC_DECODER_CMD</refname> | ||
9 | <refname>VIDIOC_TRY_DECODER_CMD</refname> | ||
10 | <refpurpose>Execute an decoder command</refpurpose> | ||
11 | </refnamediv> | ||
12 | |||
13 | <refsynopsisdiv> | ||
14 | <funcsynopsis> | ||
15 | <funcprototype> | ||
16 | <funcdef>int <function>ioctl</function></funcdef> | ||
17 | <paramdef>int <parameter>fd</parameter></paramdef> | ||
18 | <paramdef>int <parameter>request</parameter></paramdef> | ||
19 | <paramdef>struct v4l2_decoder_cmd *<parameter>argp</parameter></paramdef> | ||
20 | </funcprototype> | ||
21 | </funcsynopsis> | ||
22 | </refsynopsisdiv> | ||
23 | |||
24 | <refsect1> | ||
25 | <title>Arguments</title> | ||
26 | |||
27 | <variablelist> | ||
28 | <varlistentry> | ||
29 | <term><parameter>fd</parameter></term> | ||
30 | <listitem> | ||
31 | <para>&fd;</para> | ||
32 | </listitem> | ||
33 | </varlistentry> | ||
34 | <varlistentry> | ||
35 | <term><parameter>request</parameter></term> | ||
36 | <listitem> | ||
37 | <para>VIDIOC_DECODER_CMD, VIDIOC_TRY_DECODER_CMD</para> | ||
38 | </listitem> | ||
39 | </varlistentry> | ||
40 | <varlistentry> | ||
41 | <term><parameter>argp</parameter></term> | ||
42 | <listitem> | ||
43 | <para></para> | ||
44 | </listitem> | ||
45 | </varlistentry> | ||
46 | </variablelist> | ||
47 | </refsect1> | ||
48 | |||
49 | <refsect1> | ||
50 | <title>Description</title> | ||
51 | |||
52 | <note> | ||
53 | <title>Experimental</title> | ||
54 | |||
55 | <para>This is an <link linkend="experimental">experimental</link> | ||
56 | interface and may change in the future.</para> | ||
57 | </note> | ||
58 | |||
59 | <para>These ioctls control an audio/video (usually MPEG-) decoder. | ||
60 | <constant>VIDIOC_DECODER_CMD</constant> sends a command to the | ||
61 | decoder, <constant>VIDIOC_TRY_DECODER_CMD</constant> can be used to | ||
62 | try a command without actually executing it. To send a command applications | ||
63 | must initialize all fields of a &v4l2-decoder-cmd; and call | ||
64 | <constant>VIDIOC_DECODER_CMD</constant> or <constant>VIDIOC_TRY_DECODER_CMD</constant> | ||
65 | with a pointer to this structure.</para> | ||
66 | |||
67 | <para>The <structfield>cmd</structfield> field must contain the | ||
68 | command code. Some commands use the <structfield>flags</structfield> field for | ||
69 | additional information. | ||
70 | </para> | ||
71 | |||
72 | <para>A <function>write</function>() or &VIDIOC-STREAMON; call sends an implicit | ||
73 | START command to the decoder if it has not been started yet. | ||
74 | </para> | ||
75 | |||
76 | <para>A <function>close</function>() or &VIDIOC-STREAMOFF; call of a streaming | ||
77 | file descriptor sends an implicit immediate STOP command to the decoder, and all | ||
78 | buffered data is discarded.</para> | ||
79 | |||
80 | <para>These ioctls are optional, not all drivers may support | ||
81 | them. They were introduced in Linux 3.3.</para> | ||
82 | |||
83 | <table pgwide="1" frame="none" id="v4l2-decoder-cmd"> | ||
84 | <title>struct <structname>v4l2_decoder_cmd</structname></title> | ||
85 | <tgroup cols="5"> | ||
86 | &cs-str; | ||
87 | <tbody valign="top"> | ||
88 | <row> | ||
89 | <entry>__u32</entry> | ||
90 | <entry><structfield>cmd</structfield></entry> | ||
91 | <entry></entry> | ||
92 | <entry></entry> | ||
93 | <entry>The decoder command, see <xref linkend="decoder-cmds" />.</entry> | ||
94 | </row> | ||
95 | <row> | ||
96 | <entry>__u32</entry> | ||
97 | <entry><structfield>flags</structfield></entry> | ||
98 | <entry></entry> | ||
99 | <entry></entry> | ||
100 | <entry>Flags to go with the command. If no flags are defined for | ||
101 | this command, drivers and applications must set this field to zero.</entry> | ||
102 | </row> | ||
103 | <row> | ||
104 | <entry>union</entry> | ||
105 | <entry>(anonymous)</entry> | ||
106 | <entry></entry> | ||
107 | <entry></entry> | ||
108 | <entry></entry> | ||
109 | </row> | ||
110 | <row> | ||
111 | <entry></entry> | ||
112 | <entry>struct</entry> | ||
113 | <entry><structfield>start</structfield></entry> | ||
114 | <entry></entry> | ||
115 | <entry>Structure containing additional data for the | ||
116 | <constant>V4L2_DEC_CMD_START</constant> command.</entry> | ||
117 | </row> | ||
118 | <row> | ||
119 | <entry></entry> | ||
120 | <entry></entry> | ||
121 | <entry>__u32</entry> | ||
122 | <entry><structfield>speed</structfield></entry> | ||
123 | <entry>Playback speed and direction. The playback speed is defined as | ||
124 | <structfield>speed</structfield>/1000 of the normal speed. So 1000 is normal playback. | ||
125 | Negative numbers denote reverse playback, so -1000 does reverse playback at normal | ||
126 | speed. Speeds -1, 0 and 1 have special meanings: speed 0 is shorthand for 1000 | ||
127 | (normal playback). A speed of 1 steps just one frame forward, a speed of -1 steps | ||
128 | just one frame back. | ||
129 | </entry> | ||
130 | </row> | ||
131 | <row> | ||
132 | <entry></entry> | ||
133 | <entry></entry> | ||
134 | <entry>__u32</entry> | ||
135 | <entry><structfield>format</structfield></entry> | ||
136 | <entry>Format restrictions. This field is set by the driver, not the | ||
137 | application. Possible values are <constant>V4L2_DEC_START_FMT_NONE</constant> if | ||
138 | there are no format restrictions or <constant>V4L2_DEC_START_FMT_GOP</constant> | ||
139 | if the decoder operates on full GOPs (<wordasword>Group Of Pictures</wordasword>). | ||
140 | This is usually the case for reverse playback: the decoder needs full GOPs, which | ||
141 | it can then play in reverse order. So to implement reverse playback the application | ||
142 | must feed the decoder the last GOP in the video file, then the GOP before that, etc. etc. | ||
143 | </entry> | ||
144 | </row> | ||
145 | <row> | ||
146 | <entry></entry> | ||
147 | <entry>struct</entry> | ||
148 | <entry><structfield>stop</structfield></entry> | ||
149 | <entry></entry> | ||
150 | <entry>Structure containing additional data for the | ||
151 | <constant>V4L2_DEC_CMD_STOP</constant> command.</entry> | ||
152 | </row> | ||
153 | <row> | ||
154 | <entry></entry> | ||
155 | <entry></entry> | ||
156 | <entry>__u64</entry> | ||
157 | <entry><structfield>pts</structfield></entry> | ||
158 | <entry>Stop playback at this <structfield>pts</structfield> or immediately | ||
159 | if the playback is already past that timestamp. Leave to 0 if you want to stop after the | ||
160 | last frame was decoded. | ||
161 | </entry> | ||
162 | </row> | ||
163 | <row> | ||
164 | <entry></entry> | ||
165 | <entry>struct</entry> | ||
166 | <entry><structfield>raw</structfield></entry> | ||
167 | <entry></entry> | ||
168 | <entry></entry> | ||
169 | </row> | ||
170 | <row> | ||
171 | <entry></entry> | ||
172 | <entry></entry> | ||
173 | <entry>__u32</entry> | ||
174 | <entry><structfield>data</structfield>[16]</entry> | ||
175 | <entry>Reserved for future extensions. Drivers and | ||
176 | applications must set the array to zero.</entry> | ||
177 | </row> | ||
178 | </tbody> | ||
179 | </tgroup> | ||
180 | </table> | ||
181 | |||
182 | <table pgwide="1" frame="none" id="decoder-cmds"> | ||
183 | <title>Decoder Commands</title> | ||
184 | <tgroup cols="3"> | ||
185 | &cs-def; | ||
186 | <tbody valign="top"> | ||
187 | <row> | ||
188 | <entry><constant>V4L2_DEC_CMD_START</constant></entry> | ||
189 | <entry>0</entry> | ||
190 | <entry>Start the decoder. When the decoder is already | ||
191 | running or paused, this command will just change the playback speed. | ||
192 | That means that calling <constant>V4L2_DEC_CMD_START</constant> when | ||
193 | the decoder was paused will <emphasis>not</emphasis> resume the decoder. | ||
194 | You have to explicitly call <constant>V4L2_DEC_CMD_RESUME</constant> for that. | ||
195 | This command has one flag: | ||
196 | <constant>V4L2_DEC_CMD_START_MUTE_AUDIO</constant>. If set, then audio will | ||
197 | be muted when playing back at a non-standard speed. | ||
198 | </entry> | ||
199 | </row> | ||
200 | <row> | ||
201 | <entry><constant>V4L2_DEC_CMD_STOP</constant></entry> | ||
202 | <entry>1</entry> | ||
203 | <entry>Stop the decoder. When the decoder is already stopped, | ||
204 | this command does nothing. This command has two flags: | ||
205 | if <constant>V4L2_DEC_CMD_STOP_TO_BLACK</constant> is set, then the decoder will | ||
206 | set the picture to black after it stopped decoding. Otherwise the last image will | ||
207 | repeat. If <constant>V4L2_DEC_CMD_STOP_IMMEDIATELY</constant> is set, then the decoder | ||
208 | stops immediately (ignoring the <structfield>pts</structfield> value), otherwise it | ||
209 | will keep decoding until timestamp >= pts or until the last of the pending data from | ||
210 | its internal buffers was decoded. | ||
211 | </entry> | ||
212 | </row> | ||
213 | <row> | ||
214 | <entry><constant>V4L2_DEC_CMD_PAUSE</constant></entry> | ||
215 | <entry>2</entry> | ||
216 | <entry>Pause the decoder. When the decoder has not been | ||
217 | started yet, the driver will return an &EPERM;. When the decoder is | ||
218 | already paused, this command does nothing. This command has one flag: | ||
219 | if <constant>V4L2_DEC_CMD_PAUSE_TO_BLACK</constant> is set, then set the | ||
220 | decoder output to black when paused. | ||
221 | </entry> | ||
222 | </row> | ||
223 | <row> | ||
224 | <entry><constant>V4L2_DEC_CMD_RESUME</constant></entry> | ||
225 | <entry>3</entry> | ||
226 | <entry>Resume decoding after a PAUSE command. When the | ||
227 | decoder has not been started yet, the driver will return an &EPERM;. | ||
228 | When the decoder is already running, this command does nothing. No | ||
229 | flags are defined for this command.</entry> | ||
230 | </row> | ||
231 | </tbody> | ||
232 | </tgroup> | ||
233 | </table> | ||
234 | |||
235 | </refsect1> | ||
236 | |||
237 | <refsect1> | ||
238 | &return-value; | ||
239 | |||
240 | <variablelist> | ||
241 | <varlistentry> | ||
242 | <term><errorcode>EINVAL</errorcode></term> | ||
243 | <listitem> | ||
244 | <para>The <structfield>cmd</structfield> field is invalid.</para> | ||
245 | </listitem> | ||
246 | </varlistentry> | ||
247 | <varlistentry> | ||
248 | <term><errorcode>EPERM</errorcode></term> | ||
249 | <listitem> | ||
250 | <para>The application sent a PAUSE or RESUME command when | ||
251 | the decoder was not running.</para> | ||
252 | </listitem> | ||
253 | </varlistentry> | ||
254 | </variablelist> | ||
255 | </refsect1> | ||
256 | </refentry> | ||
diff --git a/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml b/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml index af7f3f2a36dd..f431b3ba79bd 100644 --- a/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml +++ b/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml | |||
@@ -74,15 +74,16 @@ only used by the STOP command and contains one bit: If the | |||
74 | encoding will continue until the end of the current <wordasword>Group | 74 | encoding will continue until the end of the current <wordasword>Group |
75 | Of Pictures</wordasword>, otherwise it will stop immediately.</para> | 75 | Of Pictures</wordasword>, otherwise it will stop immediately.</para> |
76 | 76 | ||
77 | <para>A <function>read</function>() call sends a START command to | 77 | <para>A <function>read</function>() or &VIDIOC-STREAMON; call sends an implicit |
78 | the encoder if it has not been started yet. After a STOP command, | 78 | START command to the encoder if it has not been started yet. After a STOP command, |
79 | <function>read</function>() calls will read the remaining data | 79 | <function>read</function>() calls will read the remaining data |
80 | buffered by the driver. When the buffer is empty, | 80 | buffered by the driver. When the buffer is empty, |
81 | <function>read</function>() will return zero and the next | 81 | <function>read</function>() will return zero and the next |
82 | <function>read</function>() call will restart the encoder.</para> | 82 | <function>read</function>() call will restart the encoder.</para> |
83 | 83 | ||
84 | <para>A <function>close</function>() call sends an immediate STOP | 84 | <para>A <function>close</function>() or &VIDIOC-STREAMOFF; call of a streaming |
85 | to the encoder, and all buffered data is discarded.</para> | 85 | file descriptor sends an implicit immediate STOP to the encoder, and all buffered |
86 | data is discarded.</para> | ||
86 | 87 | ||
87 | <para>These ioctls are optional, not all drivers may support | 88 | <para>These ioctls are optional, not all drivers may support |
88 | them. They were introduced in Linux 2.6.21.</para> | 89 | them. They were introduced in Linux 2.6.21.</para> |