blob: f46450610412755c892960ca616805681e5386e8 [file] [log] [blame]
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -03001 <section id="control">
2 <title>User Controls</title>
3
4 <para>Devices typically have a number of user-settable controls
5such as brightness, saturation and so on, which would be presented to
6the user on a graphical user interface. But, different devices
7will have different controls available, and furthermore, the range of
8possible values, and the default value will vary from device to
9device. The control ioctls provide the information and a mechanism to
10create a nice user interface for these controls that will work
11correctly with any device.</para>
12
13 <para>All controls are accessed using an ID value. V4L2 defines
14several IDs for specific purposes. Drivers can also implement their
15own custom controls using <constant>V4L2_CID_PRIVATE_BASE</constant>
16and higher values. The pre-defined control IDs have the prefix
17<constant>V4L2_CID_</constant>, and are listed in <xref
18linkend="control-id" />. The ID is used when querying the attributes of
19a control, and when getting or setting the current value.</para>
20
21 <para>Generally applications should present controls to the user
22without assumptions about their purpose. Each control comes with a
23name string the user is supposed to understand. When the purpose is
24non-intuitive the driver writer should provide a user manual, a user
25interface plug-in or a driver specific panel application. Predefined
26IDs were introduced to change a few controls programmatically, for
27example to mute a device during a channel switch.</para>
28
29 <para>Drivers may enumerate different controls after switching
30the current video input or output, tuner or modulator, or audio input
31or output. Different in the sense of other bounds, another default and
32current value, step size or other menu items. A control with a certain
33<emphasis>custom</emphasis> ID can also change name and
34type.<footnote>
35 <para>It will be more convenient for applications if drivers
36make use of the <constant>V4L2_CTRL_FLAG_DISABLED</constant> flag, but
37that was never required.</para>
38 </footnote> Control values are stored globally, they do not
39change when switching except to stay within the reported bounds. They
40also do not change &eg; when the device is opened or closed, when the
41tuner radio frequency is changed or generally never without
42application request. Since V4L2 specifies no event mechanism, panel
43applications intended to cooperate with other panel applications (be
44they built into a larger application, as a TV viewer) may need to
45regularly poll control values to update their user
46interface.<footnote>
47 <para>Applications could call an ioctl to request events.
48After another process called &VIDIOC-S-CTRL; or another ioctl changing
49shared properties the &func-select; function would indicate
50readability until any ioctl (querying the properties) is
51called.</para>
52 </footnote></para>
53
54 <table pgwide="1" frame="none" id="control-id">
55 <title>Control IDs</title>
56 <tgroup cols="3">
57 &cs-def;
58 <thead>
59 <row>
60 <entry>ID</entry>
61 <entry>Type</entry>
62 <entry>Description</entry>
63 </row>
64 </thead>
65 <tbody valign="top">
66 <row>
67 <entry><constant>V4L2_CID_BASE</constant></entry>
68 <entry></entry>
69 <entry>First predefined ID, equal to
70<constant>V4L2_CID_BRIGHTNESS</constant>.</entry>
71 </row>
72 <row>
73 <entry><constant>V4L2_CID_USER_BASE</constant></entry>
74 <entry></entry>
75 <entry>Synonym of <constant>V4L2_CID_BASE</constant>.</entry>
76 </row>
77 <row>
78 <entry><constant>V4L2_CID_BRIGHTNESS</constant></entry>
79 <entry>integer</entry>
80 <entry>Picture brightness, or more precisely, the black
81level.</entry>
82 </row>
83 <row>
84 <entry><constant>V4L2_CID_CONTRAST</constant></entry>
85 <entry>integer</entry>
86 <entry>Picture contrast or luma gain.</entry>
87 </row>
88 <row>
89 <entry><constant>V4L2_CID_SATURATION</constant></entry>
90 <entry>integer</entry>
91 <entry>Picture color saturation or chroma gain.</entry>
92 </row>
93 <row>
94 <entry><constant>V4L2_CID_HUE</constant></entry>
95 <entry>integer</entry>
96 <entry>Hue or color balance.</entry>
97 </row>
98 <row>
99 <entry><constant>V4L2_CID_AUDIO_VOLUME</constant></entry>
100 <entry>integer</entry>
101 <entry>Overall audio volume. Note some drivers also
102provide an OSS or ALSA mixer interface.</entry>
103 </row>
104 <row>
105 <entry><constant>V4L2_CID_AUDIO_BALANCE</constant></entry>
106 <entry>integer</entry>
107 <entry>Audio stereo balance. Minimum corresponds to all
108the way left, maximum to right.</entry>
109 </row>
110 <row>
111 <entry><constant>V4L2_CID_AUDIO_BASS</constant></entry>
112 <entry>integer</entry>
113 <entry>Audio bass adjustment.</entry>
114 </row>
115 <row>
116 <entry><constant>V4L2_CID_AUDIO_TREBLE</constant></entry>
117 <entry>integer</entry>
118 <entry>Audio treble adjustment.</entry>
119 </row>
120 <row>
121 <entry><constant>V4L2_CID_AUDIO_MUTE</constant></entry>
122 <entry>boolean</entry>
123 <entry>Mute audio, &ie; set the volume to zero, however
124without affecting <constant>V4L2_CID_AUDIO_VOLUME</constant>. Like
125ALSA drivers, V4L2 drivers must mute at load time to avoid excessive
126noise. Actually the entire device should be reset to a low power
127consumption state.</entry>
128 </row>
129 <row>
130 <entry><constant>V4L2_CID_AUDIO_LOUDNESS</constant></entry>
131 <entry>boolean</entry>
132 <entry>Loudness mode (bass boost).</entry>
133 </row>
134 <row>
135 <entry><constant>V4L2_CID_BLACK_LEVEL</constant></entry>
136 <entry>integer</entry>
137 <entry>Another name for brightness (not a synonym of
138<constant>V4L2_CID_BRIGHTNESS</constant>). This control is deprecated
139and should not be used in new drivers and applications.</entry>
140 </row>
141 <row>
142 <entry><constant>V4L2_CID_AUTO_WHITE_BALANCE</constant></entry>
143 <entry>boolean</entry>
144 <entry>Automatic white balance (cameras).</entry>
145 </row>
146 <row>
147 <entry><constant>V4L2_CID_DO_WHITE_BALANCE</constant></entry>
148 <entry>button</entry>
149 <entry>This is an action control. When set (the value is
150ignored), the device will do a white balance and then hold the current
151setting. Contrast this with the boolean
152<constant>V4L2_CID_AUTO_WHITE_BALANCE</constant>, which, when
153activated, keeps adjusting the white balance.</entry>
154 </row>
155 <row>
156 <entry><constant>V4L2_CID_RED_BALANCE</constant></entry>
157 <entry>integer</entry>
158 <entry>Red chroma balance.</entry>
159 </row>
160 <row>
161 <entry><constant>V4L2_CID_BLUE_BALANCE</constant></entry>
162 <entry>integer</entry>
163 <entry>Blue chroma balance.</entry>
164 </row>
165 <row>
166 <entry><constant>V4L2_CID_GAMMA</constant></entry>
167 <entry>integer</entry>
168 <entry>Gamma adjust.</entry>
169 </row>
170 <row>
171 <entry><constant>V4L2_CID_WHITENESS</constant></entry>
172 <entry>integer</entry>
173 <entry>Whiteness for grey-scale devices. This is a synonym
174for <constant>V4L2_CID_GAMMA</constant>. This control is deprecated
175and should not be used in new drivers and applications.</entry>
176 </row>
177 <row>
178 <entry><constant>V4L2_CID_EXPOSURE</constant></entry>
179 <entry>integer</entry>
180 <entry>Exposure (cameras). [Unit?]</entry>
181 </row>
182 <row>
183 <entry><constant>V4L2_CID_AUTOGAIN</constant></entry>
184 <entry>boolean</entry>
185 <entry>Automatic gain/exposure control.</entry>
186 </row>
187 <row>
188 <entry><constant>V4L2_CID_GAIN</constant></entry>
189 <entry>integer</entry>
190 <entry>Gain control.</entry>
191 </row>
192 <row>
193 <entry><constant>V4L2_CID_HFLIP</constant></entry>
194 <entry>boolean</entry>
195 <entry>Mirror the picture horizontally.</entry>
196 </row>
197 <row>
198 <entry><constant>V4L2_CID_VFLIP</constant></entry>
199 <entry>boolean</entry>
200 <entry>Mirror the picture vertically.</entry>
201 </row>
202 <row>
203 <entry><constant>V4L2_CID_HCENTER_DEPRECATED</constant> (formerly <constant>V4L2_CID_HCENTER</constant>)</entry>
204 <entry>integer</entry>
205 <entry>Horizontal image centering. This control is
206deprecated. New drivers and applications should use the <link
207linkend="camera-controls">Camera class controls</link>
208<constant>V4L2_CID_PAN_ABSOLUTE</constant>,
209<constant>V4L2_CID_PAN_RELATIVE</constant> and
210<constant>V4L2_CID_PAN_RESET</constant> instead.</entry>
211 </row>
212 <row>
213 <entry><constant>V4L2_CID_VCENTER_DEPRECATED</constant>
214 (formerly <constant>V4L2_CID_VCENTER</constant>)</entry>
215 <entry>integer</entry>
216 <entry>Vertical image centering. Centering is intended to
217<emphasis>physically</emphasis> adjust cameras. For image cropping see
218<xref linkend="crop" />, for clipping <xref linkend="overlay" />. This
219control is deprecated. New drivers and applications should use the
220<link linkend="camera-controls">Camera class controls</link>
221<constant>V4L2_CID_TILT_ABSOLUTE</constant>,
222<constant>V4L2_CID_TILT_RELATIVE</constant> and
223<constant>V4L2_CID_TILT_RESET</constant> instead.</entry>
224 </row>
225 <row id="v4l2-power-line-frequency">
226 <entry><constant>V4L2_CID_POWER_LINE_FREQUENCY</constant></entry>
227 <entry>enum</entry>
228 <entry>Enables a power line frequency filter to avoid
229flicker. Possible values for <constant>enum v4l2_power_line_frequency</constant> are:
230<constant>V4L2_CID_POWER_LINE_FREQUENCY_DISABLED</constant> (0),
231<constant>V4L2_CID_POWER_LINE_FREQUENCY_50HZ</constant> (1) and
232<constant>V4L2_CID_POWER_LINE_FREQUENCY_60HZ</constant> (2).</entry>
233 </row>
234 <row>
235 <entry><constant>V4L2_CID_HUE_AUTO</constant></entry>
236 <entry>boolean</entry>
237 <entry>Enables automatic hue control by the device. The
238effect of setting <constant>V4L2_CID_HUE</constant> while automatic
239hue control is enabled is undefined, drivers should ignore such
240request.</entry>
241 </row>
242 <row>
243 <entry><constant>V4L2_CID_WHITE_BALANCE_TEMPERATURE</constant></entry>
244 <entry>integer</entry>
245 <entry>This control specifies the white balance settings
246as a color temperature in Kelvin. A driver should have a minimum of
2472800 (incandescent) to 6500 (daylight). For more information about
248color temperature see <ulink
249url="http://en.wikipedia.org/wiki/Color_temperature">Wikipedia</ulink>.</entry>
250 </row>
251 <row>
252 <entry><constant>V4L2_CID_SHARPNESS</constant></entry>
253 <entry>integer</entry>
254 <entry>Adjusts the sharpness filters in a camera. The
255minimum value disables the filters, higher values give a sharper
256picture.</entry>
257 </row>
258 <row>
259 <entry><constant>V4L2_CID_BACKLIGHT_COMPENSATION</constant></entry>
260 <entry>integer</entry>
261 <entry>Adjusts the backlight compensation in a camera. The
262minimum value disables backlight compensation.</entry>
263 </row>
264 <row>
265 <entry><constant>V4L2_CID_CHROMA_AGC</constant></entry>
266 <entry>boolean</entry>
267 <entry>Chroma automatic gain control.</entry>
268 </row>
269 <row>
270 <entry><constant>V4L2_CID_COLOR_KILLER</constant></entry>
271 <entry>boolean</entry>
272 <entry>Enable the color killer (&ie; force a black &amp; white image in case of a weak video signal).</entry>
273 </row>
274 <row id="v4l2-colorfx">
275 <entry><constant>V4L2_CID_COLORFX</constant></entry>
276 <entry>enum</entry>
277 <entry>Selects a color effect. Possible values for
278<constant>enum v4l2_colorfx</constant> are:
279<constant>V4L2_COLORFX_NONE</constant> (0),
280<constant>V4L2_COLORFX_BW</constant> (1) and
281<constant>V4L2_COLORFX_SEPIA</constant> (2).</entry>
282 </row>
283 <row>
Vaibhav Hiremathbd977802009-11-09 10:04:06 -0300284 <entry><constant>V4L2_CID_ROTATE</constant></entry>
285 <entry>integer</entry>
286 <entry>Rotates the image by specified angle. Common angles are 90,
287 270 and 180. Rotating the image to 90 and 270 will reverse the height
288 and width of the display window. It is necessary to set the new height and
289 width of the picture using the &VIDIOC-S-FMT; ioctl according to
290 the rotation angle selected.</entry>
291 </row>
292 <row>
293 <entry><constant>V4L2_CID_BG_COLOR</constant></entry>
294 <entry>integer</entry>
295 <entry>Sets the background color on the current output device.
296 Background color needs to be specified in the RGB24 format. The
297 supplied 32 bit value is interpreted as bits 0-7 Red color information,
298 bits 8-15 Green color information, bits 16-23 Blue color
299 information and bits 24-31 must be zero.</entry>
300 </row>
301 <row>
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300302 <entry><constant>V4L2_CID_LASTP1</constant></entry>
303 <entry></entry>
304 <entry>End of the predefined control IDs (currently
Vaibhav Hiremathbd977802009-11-09 10:04:06 -0300305<constant>V4L2_CID_BG_COLOR</constant> + 1).</entry>
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300306 </row>
307 <row>
308 <entry><constant>V4L2_CID_PRIVATE_BASE</constant></entry>
309 <entry></entry>
310 <entry>ID of the first custom (driver specific) control.
311Applications depending on particular custom controls should check the
312driver name and version, see <xref linkend="querycap" />.</entry>
313 </row>
314 </tbody>
315 </tgroup>
316 </table>
317
318 <para>Applications can enumerate the available controls with the
319&VIDIOC-QUERYCTRL; and &VIDIOC-QUERYMENU; ioctls, get and set a
320control value with the &VIDIOC-G-CTRL; and &VIDIOC-S-CTRL; ioctls.
321Drivers must implement <constant>VIDIOC_QUERYCTRL</constant>,
322<constant>VIDIOC_G_CTRL</constant> and
323<constant>VIDIOC_S_CTRL</constant> when the device has one or more
324controls, <constant>VIDIOC_QUERYMENU</constant> when it has one or
325more menu type controls.</para>
326
327 <example>
328 <title>Enumerating all controls</title>
329
330 <programlisting>
331&v4l2-queryctrl; queryctrl;
332&v4l2-querymenu; querymenu;
333
334static void
335enumerate_menu (void)
336{
337 printf (" Menu items:\n");
338
339 memset (&amp;querymenu, 0, sizeof (querymenu));
340 querymenu.id = queryctrl.id;
341
342 for (querymenu.index = queryctrl.minimum;
343 querymenu.index &lt;= queryctrl.maximum;
344 querymenu.index++) {
345 if (0 == ioctl (fd, &VIDIOC-QUERYMENU;, &amp;querymenu)) {
346 printf (" %s\n", querymenu.name);
347 } else {
348 perror ("VIDIOC_QUERYMENU");
349 exit (EXIT_FAILURE);
350 }
351 }
352}
353
354memset (&amp;queryctrl, 0, sizeof (queryctrl));
355
356for (queryctrl.id = V4L2_CID_BASE;
357 queryctrl.id &lt; V4L2_CID_LASTP1;
358 queryctrl.id++) {
359 if (0 == ioctl (fd, &VIDIOC-QUERYCTRL;, &amp;queryctrl)) {
360 if (queryctrl.flags &amp; V4L2_CTRL_FLAG_DISABLED)
361 continue;
362
363 printf ("Control %s\n", queryctrl.name);
364
365 if (queryctrl.type == V4L2_CTRL_TYPE_MENU)
366 enumerate_menu ();
367 } else {
368 if (errno == EINVAL)
369 continue;
370
371 perror ("VIDIOC_QUERYCTRL");
372 exit (EXIT_FAILURE);
373 }
374}
375
376for (queryctrl.id = V4L2_CID_PRIVATE_BASE;;
377 queryctrl.id++) {
378 if (0 == ioctl (fd, &VIDIOC-QUERYCTRL;, &amp;queryctrl)) {
379 if (queryctrl.flags &amp; V4L2_CTRL_FLAG_DISABLED)
380 continue;
381
382 printf ("Control %s\n", queryctrl.name);
383
384 if (queryctrl.type == V4L2_CTRL_TYPE_MENU)
385 enumerate_menu ();
386 } else {
387 if (errno == EINVAL)
388 break;
389
390 perror ("VIDIOC_QUERYCTRL");
391 exit (EXIT_FAILURE);
392 }
393}
394</programlisting>
395 </example>
396
397 <example>
398 <title>Changing controls</title>
399
400 <programlisting>
401&v4l2-queryctrl; queryctrl;
402&v4l2-control; control;
403
404memset (&amp;queryctrl, 0, sizeof (queryctrl));
405queryctrl.id = V4L2_CID_BRIGHTNESS;
406
407if (-1 == ioctl (fd, &VIDIOC-QUERYCTRL;, &amp;queryctrl)) {
408 if (errno != EINVAL) {
409 perror ("VIDIOC_QUERYCTRL");
410 exit (EXIT_FAILURE);
411 } else {
412 printf ("V4L2_CID_BRIGHTNESS is not supported\n");
413 }
414} else if (queryctrl.flags &amp; V4L2_CTRL_FLAG_DISABLED) {
415 printf ("V4L2_CID_BRIGHTNESS is not supported\n");
416} else {
417 memset (&amp;control, 0, sizeof (control));
418 control.id = V4L2_CID_BRIGHTNESS;
419 control.value = queryctrl.default_value;
420
421 if (-1 == ioctl (fd, &VIDIOC-S-CTRL;, &amp;control)) {
422 perror ("VIDIOC_S_CTRL");
423 exit (EXIT_FAILURE);
424 }
425}
426
427memset (&amp;control, 0, sizeof (control));
428control.id = V4L2_CID_CONTRAST;
429
430if (0 == ioctl (fd, &VIDIOC-G-CTRL;, &amp;control)) {
431 control.value += 1;
432
433 /* The driver may clamp the value or return ERANGE, ignored here */
434
435 if (-1 == ioctl (fd, &VIDIOC-S-CTRL;, &amp;control)
436 &amp;&amp; errno != ERANGE) {
437 perror ("VIDIOC_S_CTRL");
438 exit (EXIT_FAILURE);
439 }
440/* Ignore if V4L2_CID_CONTRAST is unsupported */
441} else if (errno != EINVAL) {
442 perror ("VIDIOC_G_CTRL");
443 exit (EXIT_FAILURE);
444}
445
446control.id = V4L2_CID_AUDIO_MUTE;
447control.value = TRUE; /* silence */
448
449/* Errors ignored */
450ioctl (fd, VIDIOC_S_CTRL, &amp;control);
451</programlisting>
452 </example>
453 </section>
454
455 <section id="extended-controls">
456 <title>Extended Controls</title>
457
458 <section>
459 <title>Introduction</title>
460
461 <para>The control mechanism as originally designed was meant
462to be used for user settings (brightness, saturation, etc). However,
463it turned out to be a very useful model for implementing more
464complicated driver APIs where each driver implements only a subset of
465a larger API.</para>
466
467 <para>The MPEG encoding API was the driving force behind
468designing and implementing this extended control mechanism: the MPEG
469standard is quite large and the currently supported hardware MPEG
470encoders each only implement a subset of this standard. Further more,
471many parameters relating to how the video is encoded into an MPEG
472stream are specific to the MPEG encoding chip since the MPEG standard
473only defines the format of the resulting MPEG stream, not how the
474video is actually encoded into that format.</para>
475
476 <para>Unfortunately, the original control API lacked some
477features needed for these new uses and so it was extended into the
478(not terribly originally named) extended control API.</para>
479
480 <para>Even though the MPEG encoding API was the first effort
481to use the Extended Control API, nowadays there are also other classes
482of Extended Controls, such as Camera Controls and FM Transmitter Controls.
483The Extended Controls API as well as all Extended Controls classes are
484described in the following text.</para>
485 </section>
486
487 <section>
488 <title>The Extended Control API</title>
489
490 <para>Three new ioctls are available: &VIDIOC-G-EXT-CTRLS;,
491&VIDIOC-S-EXT-CTRLS; and &VIDIOC-TRY-EXT-CTRLS;. These ioctls act on
492arrays of controls (as opposed to the &VIDIOC-G-CTRL; and
493&VIDIOC-S-CTRL; ioctls that act on a single control). This is needed
494since it is often required to atomically change several controls at
495once.</para>
496
497 <para>Each of the new ioctls expects a pointer to a
498&v4l2-ext-controls;. This structure contains a pointer to the control
499array, a count of the number of controls in that array and a control
500class. Control classes are used to group similar controls into a
501single class. For example, control class
502<constant>V4L2_CTRL_CLASS_USER</constant> contains all user controls
503(&ie; all controls that can also be set using the old
504<constant>VIDIOC_S_CTRL</constant> ioctl). Control class
505<constant>V4L2_CTRL_CLASS_MPEG</constant> contains all controls
506relating to MPEG encoding, etc.</para>
507
508 <para>All controls in the control array must belong to the
509specified control class. An error is returned if this is not the
510case.</para>
511
512 <para>It is also possible to use an empty control array (count
513== 0) to check whether the specified control class is
514supported.</para>
515
516 <para>The control array is a &v4l2-ext-control; array. The
517<structname>v4l2_ext_control</structname> structure is very similar to
518&v4l2-control;, except for the fact that it also allows for 64-bit
519values and pointers to be passed.</para>
520
521 <para>It is important to realize that due to the flexibility of
522controls it is necessary to check whether the control you want to set
523actually is supported in the driver and what the valid range of values
524is. So use the &VIDIOC-QUERYCTRL; and &VIDIOC-QUERYMENU; ioctls to
525check this. Also note that it is possible that some of the menu
526indices in a control of type <constant>V4L2_CTRL_TYPE_MENU</constant>
527may not be supported (<constant>VIDIOC_QUERYMENU</constant> will
528return an error). A good example is the list of supported MPEG audio
529bitrates. Some drivers only support one or two bitrates, others
530support a wider range.</para>
531 </section>
532
533 <section>
534 <title>Enumerating Extended Controls</title>
535
536 <para>The recommended way to enumerate over the extended
537controls is by using &VIDIOC-QUERYCTRL; in combination with the
538<constant>V4L2_CTRL_FLAG_NEXT_CTRL</constant> flag:</para>
539
540 <informalexample>
541 <programlisting>
542&v4l2-queryctrl; qctrl;
543
544qctrl.id = V4L2_CTRL_FLAG_NEXT_CTRL;
545while (0 == ioctl (fd, &VIDIOC-QUERYCTRL;, &amp;qctrl)) {
546 /* ... */
547 qctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL;
548}
549</programlisting>
550 </informalexample>
551
552 <para>The initial control ID is set to 0 ORed with the
553<constant>V4L2_CTRL_FLAG_NEXT_CTRL</constant> flag. The
554<constant>VIDIOC_QUERYCTRL</constant> ioctl will return the first
555control with a higher ID than the specified one. When no such controls
556are found an error is returned.</para>
557
558 <para>If you want to get all controls within a specific control
559class, then you can set the initial
560<structfield>qctrl.id</structfield> value to the control class and add
561an extra check to break out of the loop when a control of another
562control class is found:</para>
563
564 <informalexample>
565 <programlisting>
566qctrl.id = V4L2_CTRL_CLASS_MPEG | V4L2_CTRL_FLAG_NEXT_CTRL;
567while (0 == ioctl (fd, &VIDIOC-QUERYCTRL;, &amp;qctrl)) {
568 if (V4L2_CTRL_ID2CLASS (qctrl.id) != V4L2_CTRL_CLASS_MPEG)
569 break;
570 /* ... */
571 qctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL;
572 }
573</programlisting>
574 </informalexample>
575
576 <para>The 32-bit <structfield>qctrl.id</structfield> value is
577subdivided into three bit ranges: the top 4 bits are reserved for
578flags (&eg; <constant>V4L2_CTRL_FLAG_NEXT_CTRL</constant>) and are not
579actually part of the ID. The remaining 28 bits form the control ID, of
580which the most significant 12 bits define the control class and the
581least significant 16 bits identify the control within the control
582class. It is guaranteed that these last 16 bits are always non-zero
583for controls. The range of 0x1000 and up are reserved for
584driver-specific controls. The macro
585<constant>V4L2_CTRL_ID2CLASS(id)</constant> returns the control class
586ID based on a control ID.</para>
587
588 <para>If the driver does not support extended controls, then
589<constant>VIDIOC_QUERYCTRL</constant> will fail when used in
590combination with <constant>V4L2_CTRL_FLAG_NEXT_CTRL</constant>. In
591that case the old method of enumerating control should be used (see
5921.8). But if it is supported, then it is guaranteed to enumerate over
593all controls, including driver-private controls.</para>
594 </section>
595
596 <section>
597 <title>Creating Control Panels</title>
598
599 <para>It is possible to create control panels for a graphical
600user interface where the user can select the various controls.
601Basically you will have to iterate over all controls using the method
602described above. Each control class starts with a control of type
603<constant>V4L2_CTRL_TYPE_CTRL_CLASS</constant>.
604<constant>VIDIOC_QUERYCTRL</constant> will return the name of this
605control class which can be used as the title of a tab page within a
606control panel.</para>
607
608 <para>The flags field of &v4l2-queryctrl; also contains hints on
609the behavior of the control. See the &VIDIOC-QUERYCTRL; documentation
610for more details.</para>
611 </section>
612
613 <section id="mpeg-controls">
614 <title>MPEG Control Reference</title>
615
616 <para>Below all controls within the MPEG control class are
617described. First the generic controls, then controls specific for
618certain hardware.</para>
619
620 <section>
621 <title>Generic MPEG Controls</title>
622
623 <table pgwide="1" frame="none" id="mpeg-control-id">
624 <title>MPEG Control IDs</title>
625 <tgroup cols="4">
626 <colspec colname="c1" colwidth="1*" />
627 <colspec colname="c2" colwidth="6*" />
628 <colspec colname="c3" colwidth="2*" />
629 <colspec colname="c4" colwidth="6*" />
630 <spanspec namest="c1" nameend="c2" spanname="id" />
631 <spanspec namest="c2" nameend="c4" spanname="descr" />
632 <thead>
633 <row>
634 <entry spanname="id" align="left">ID</entry>
635 <entry align="left">Type</entry>
636 </row><row rowsep="1"><entry spanname="descr" align="left">Description</entry>
637 </row>
638 </thead>
639 <tbody valign="top">
640 <row><entry></entry></row>
641 <row>
642 <entry spanname="id"><constant>V4L2_CID_MPEG_CLASS</constant>&nbsp;</entry>
643 <entry>class</entry>
644 </row><row><entry spanname="descr">The MPEG class
645descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a
646description of this control class. This description can be used as the
647caption of a Tab page in a GUI, for example.</entry>
648 </row>
649 <row><entry></entry></row>
650 <row id="v4l2-mpeg-stream-type">
651 <entry spanname="id"><constant>V4L2_CID_MPEG_STREAM_TYPE</constant>&nbsp;</entry>
652 <entry>enum&nbsp;v4l2_mpeg_stream_type</entry>
653 </row><row><entry spanname="descr">The MPEG-1, -2 or -4
654output stream type. One cannot assume anything here. Each hardware
655MPEG encoder tends to support different subsets of the available MPEG
656stream types. The currently defined stream types are:</entry>
657 </row>
658 <row>
659 <entrytbl spanname="descr" cols="2">
660 <tbody valign="top">
661 <row>
662 <entry><constant>V4L2_MPEG_STREAM_TYPE_MPEG2_PS</constant>&nbsp;</entry>
663 <entry>MPEG-2 program stream</entry>
664 </row>
665 <row>
666 <entry><constant>V4L2_MPEG_STREAM_TYPE_MPEG2_TS</constant>&nbsp;</entry>
667 <entry>MPEG-2 transport stream</entry>
668 </row>
669 <row>
670 <entry><constant>V4L2_MPEG_STREAM_TYPE_MPEG1_SS</constant>&nbsp;</entry>
671 <entry>MPEG-1 system stream</entry>
672 </row>
673 <row>
674 <entry><constant>V4L2_MPEG_STREAM_TYPE_MPEG2_DVD</constant>&nbsp;</entry>
675 <entry>MPEG-2 DVD-compatible stream</entry>
676 </row>
677 <row>
678 <entry><constant>V4L2_MPEG_STREAM_TYPE_MPEG1_VCD</constant>&nbsp;</entry>
679 <entry>MPEG-1 VCD-compatible stream</entry>
680 </row>
681 <row>
682 <entry><constant>V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD</constant>&nbsp;</entry>
683 <entry>MPEG-2 SVCD-compatible stream</entry>
684 </row>
685 </tbody>
686 </entrytbl>
687 </row>
688 <row><entry></entry></row>
689 <row>
690 <entry spanname="id"><constant>V4L2_CID_MPEG_STREAM_PID_PMT</constant>&nbsp;</entry>
691 <entry>integer</entry>
692 </row><row><entry spanname="descr">Program Map Table
693Packet ID for the MPEG transport stream (default 16)</entry>
694 </row>
695 <row><entry></entry></row>
696 <row>
697 <entry spanname="id"><constant>V4L2_CID_MPEG_STREAM_PID_AUDIO</constant>&nbsp;</entry>
698 <entry>integer</entry>
699 </row><row><entry spanname="descr">Audio Packet ID for
700the MPEG transport stream (default 256)</entry>
701 </row>
702 <row><entry></entry></row>
703 <row>
704 <entry spanname="id"><constant>V4L2_CID_MPEG_STREAM_PID_VIDEO</constant>&nbsp;</entry>
705 <entry>integer</entry>
706 </row><row><entry spanname="descr">Video Packet ID for
707the MPEG transport stream (default 260)</entry>
708 </row>
709 <row><entry></entry></row>
710 <row>
711 <entry spanname="id"><constant>V4L2_CID_MPEG_STREAM_PID_PCR</constant>&nbsp;</entry>
712 <entry>integer</entry>
713 </row><row><entry spanname="descr">Packet ID for the
714MPEG transport stream carrying PCR fields (default 259)</entry>
715 </row>
716 <row><entry></entry></row>
717 <row>
718 <entry spanname="id"><constant>V4L2_CID_MPEG_STREAM_PES_ID_AUDIO</constant>&nbsp;</entry>
719 <entry>integer</entry>
720 </row><row><entry spanname="descr">Audio ID for MPEG
721PES</entry>
722 </row>
723 <row><entry></entry></row>
724 <row>
725 <entry spanname="id"><constant>V4L2_CID_MPEG_STREAM_PES_ID_VIDEO</constant>&nbsp;</entry>
726 <entry>integer</entry>
727 </row><row><entry spanname="descr">Video ID for MPEG
728PES</entry>
729 </row>
730 <row><entry></entry></row>
731 <row id="v4l2-mpeg-stream-vbi-fmt">
732 <entry spanname="id"><constant>V4L2_CID_MPEG_STREAM_VBI_FMT</constant>&nbsp;</entry>
733 <entry>enum&nbsp;v4l2_mpeg_stream_vbi_fmt</entry>
734 </row><row><entry spanname="descr">Some cards can embed
735VBI data (&eg; Closed Caption, Teletext) into the MPEG stream. This
736control selects whether VBI data should be embedded, and if so, what
737embedding method should be used. The list of possible VBI formats
738depends on the driver. The currently defined VBI format types
739are:</entry>
740 </row>
741 <row>
742 <entrytbl spanname="descr" cols="2">
743 <tbody valign="top">
744 <row>
745 <entry><constant>V4L2_MPEG_STREAM_VBI_FMT_NONE</constant>&nbsp;</entry>
746 <entry>No VBI in the MPEG stream</entry>
747 </row>
748 <row>
749 <entry><constant>V4L2_MPEG_STREAM_VBI_FMT_IVTV</constant>&nbsp;</entry>
750 <entry>VBI in private packets, IVTV format (documented
751in the kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.vbi</filename>)</entry>
752 </row>
753 </tbody>
754 </entrytbl>
755 </row>
756 <row><entry></entry></row>
757 <row id="v4l2-mpeg-audio-sampling-freq">
758 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ</constant>&nbsp;</entry>
759 <entry>enum&nbsp;v4l2_mpeg_audio_sampling_freq</entry>
760 </row><row><entry spanname="descr">MPEG Audio sampling
761frequency. Possible values are:</entry>
762 </row>
763 <row>
764 <entrytbl spanname="descr" cols="2">
765 <tbody valign="top">
766 <row>
767 <entry><constant>V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100</constant>&nbsp;</entry>
768 <entry>44.1 kHz</entry>
769 </row>
770 <row>
771 <entry><constant>V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000</constant>&nbsp;</entry>
772 <entry>48 kHz</entry>
773 </row>
774 <row>
775 <entry><constant>V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000</constant>&nbsp;</entry>
776 <entry>32 kHz</entry>
777 </row>
778 </tbody>
779 </entrytbl>
780 </row>
781 <row><entry></entry></row>
782 <row id="v4l2-mpeg-audio-encoding">
783 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_ENCODING</constant>&nbsp;</entry>
784 <entry>enum&nbsp;v4l2_mpeg_audio_encoding</entry>
785 </row><row><entry spanname="descr">MPEG Audio encoding.
786Possible values are:</entry>
787 </row>
788 <row>
789 <entrytbl spanname="descr" cols="2">
790 <tbody valign="top">
791 <row>
792 <entry><constant>V4L2_MPEG_AUDIO_ENCODING_LAYER_1</constant>&nbsp;</entry>
793 <entry>MPEG-1/2 Layer I encoding</entry>
794 </row>
795 <row>
796 <entry><constant>V4L2_MPEG_AUDIO_ENCODING_LAYER_2</constant>&nbsp;</entry>
797 <entry>MPEG-1/2 Layer II encoding</entry>
798 </row>
799 <row>
800 <entry><constant>V4L2_MPEG_AUDIO_ENCODING_LAYER_3</constant>&nbsp;</entry>
801 <entry>MPEG-1/2 Layer III encoding</entry>
802 </row>
803 <row>
804 <entry><constant>V4L2_MPEG_AUDIO_ENCODING_AAC</constant>&nbsp;</entry>
805 <entry>MPEG-2/4 AAC (Advanced Audio Coding)</entry>
806 </row>
807 <row>
808 <entry><constant>V4L2_MPEG_AUDIO_ENCODING_AC3</constant>&nbsp;</entry>
809 <entry>AC-3 aka ATSC A/52 encoding</entry>
810 </row>
811 </tbody>
812 </entrytbl>
813 </row>
814 <row><entry></entry></row>
815 <row id="v4l2-mpeg-audio-l1-bitrate">
816 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_L1_BITRATE</constant>&nbsp;</entry>
817 <entry>enum&nbsp;v4l2_mpeg_audio_l1_bitrate</entry>
818 </row><row><entry spanname="descr">MPEG-1/2 Layer I bitrate.
819Possible values are:</entry>
820 </row>
821 <row>
822 <entrytbl spanname="descr" cols="2">
823 <tbody valign="top">
824 <row>
825 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_32K</constant>&nbsp;</entry>
826 <entry>32 kbit/s</entry></row>
827 <row>
828 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_64K</constant>&nbsp;</entry>
829 <entry>64 kbit/s</entry>
830 </row>
831 <row>
832 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_96K</constant>&nbsp;</entry>
833 <entry>96 kbit/s</entry>
834 </row>
835 <row>
836 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_128K</constant>&nbsp;</entry>
837 <entry>128 kbit/s</entry>
838 </row>
839 <row>
840 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_160K</constant>&nbsp;</entry>
841 <entry>160 kbit/s</entry>
842 </row>
843 <row>
844 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_192K</constant>&nbsp;</entry>
845 <entry>192 kbit/s</entry>
846 </row>
847 <row>
848 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_224K</constant>&nbsp;</entry>
849 <entry>224 kbit/s</entry>
850 </row>
851 <row>
852 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_256K</constant>&nbsp;</entry>
853 <entry>256 kbit/s</entry>
854 </row>
855 <row>
856 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_288K</constant>&nbsp;</entry>
857 <entry>288 kbit/s</entry>
858 </row>
859 <row>
860 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_320K</constant>&nbsp;</entry>
861 <entry>320 kbit/s</entry>
862 </row>
863 <row>
864 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_352K</constant>&nbsp;</entry>
865 <entry>352 kbit/s</entry>
866 </row>
867 <row>
868 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_384K</constant>&nbsp;</entry>
869 <entry>384 kbit/s</entry>
870 </row>
871 <row>
872 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_416K</constant>&nbsp;</entry>
873 <entry>416 kbit/s</entry>
874 </row>
875 <row>
876 <entry><constant>V4L2_MPEG_AUDIO_L1_BITRATE_448K</constant>&nbsp;</entry>
877 <entry>448 kbit/s</entry>
878 </row>
879 </tbody>
880 </entrytbl>
881 </row>
882 <row><entry></entry></row>
883 <row id="v4l2-mpeg-audio-l2-bitrate">
884 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_L2_BITRATE</constant>&nbsp;</entry>
885 <entry>enum&nbsp;v4l2_mpeg_audio_l2_bitrate</entry>
886 </row><row><entry spanname="descr">MPEG-1/2 Layer II bitrate.
887Possible values are:</entry>
888 </row>
889 <row>
890 <entrytbl spanname="descr" cols="2">
891 <tbody valign="top">
892 <row>
893 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_32K</constant>&nbsp;</entry>
894 <entry>32 kbit/s</entry>
895 </row>
896 <row>
897 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_48K</constant>&nbsp;</entry>
898 <entry>48 kbit/s</entry>
899 </row>
900 <row>
901 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_56K</constant>&nbsp;</entry>
902 <entry>56 kbit/s</entry>
903 </row>
904 <row>
905 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_64K</constant>&nbsp;</entry>
906 <entry>64 kbit/s</entry>
907 </row>
908 <row>
909 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_80K</constant>&nbsp;</entry>
910 <entry>80 kbit/s</entry>
911 </row>
912 <row>
913 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_96K</constant>&nbsp;</entry>
914 <entry>96 kbit/s</entry>
915 </row>
916 <row>
917 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_112K</constant>&nbsp;</entry>
918 <entry>112 kbit/s</entry>
919 </row>
920 <row>
921 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_128K</constant>&nbsp;</entry>
922 <entry>128 kbit/s</entry>
923 </row>
924 <row>
925 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_160K</constant>&nbsp;</entry>
926 <entry>160 kbit/s</entry>
927 </row>
928 <row>
929 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_192K</constant>&nbsp;</entry>
930 <entry>192 kbit/s</entry>
931 </row>
932 <row>
933 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_224K</constant>&nbsp;</entry>
934 <entry>224 kbit/s</entry>
935 </row>
936 <row>
937 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_256K</constant>&nbsp;</entry>
938 <entry>256 kbit/s</entry>
939 </row>
940 <row>
941 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_320K</constant>&nbsp;</entry>
942 <entry>320 kbit/s</entry>
943 </row>
944 <row>
945 <entry><constant>V4L2_MPEG_AUDIO_L2_BITRATE_384K</constant>&nbsp;</entry>
946 <entry>384 kbit/s</entry>
947 </row>
948 </tbody>
949 </entrytbl>
950 </row>
951 <row><entry></entry></row>
952 <row id="v4l2-mpeg-audio-l3-bitrate">
953 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_L3_BITRATE</constant>&nbsp;</entry>
954 <entry>enum&nbsp;v4l2_mpeg_audio_l3_bitrate</entry>
955 </row><row><entry spanname="descr">MPEG-1/2 Layer III bitrate.
956Possible values are:</entry>
957 </row>
958 <row>
959 <entrytbl spanname="descr" cols="2">
960 <tbody valign="top">
961 <row>
962 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_32K</constant>&nbsp;</entry>
963 <entry>32 kbit/s</entry>
964 </row>
965 <row>
966 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_40K</constant>&nbsp;</entry>
967 <entry>40 kbit/s</entry>
968 </row>
969 <row>
970 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_48K</constant>&nbsp;</entry>
971 <entry>48 kbit/s</entry>
972 </row>
973 <row>
974 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_56K</constant>&nbsp;</entry>
975 <entry>56 kbit/s</entry>
976 </row>
977 <row>
978 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_64K</constant>&nbsp;</entry>
979 <entry>64 kbit/s</entry>
980 </row>
981 <row>
982 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_80K</constant>&nbsp;</entry>
983 <entry>80 kbit/s</entry>
984 </row>
985 <row>
986 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_96K</constant>&nbsp;</entry>
987 <entry>96 kbit/s</entry>
988 </row>
989 <row>
990 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_112K</constant>&nbsp;</entry>
991 <entry>112 kbit/s</entry>
992 </row>
993 <row>
994 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_128K</constant>&nbsp;</entry>
995 <entry>128 kbit/s</entry>
996 </row>
997 <row>
998 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_160K</constant>&nbsp;</entry>
999 <entry>160 kbit/s</entry>
1000 </row>
1001 <row>
1002 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_192K</constant>&nbsp;</entry>
1003 <entry>192 kbit/s</entry>
1004 </row>
1005 <row>
1006 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_224K</constant>&nbsp;</entry>
1007 <entry>224 kbit/s</entry>
1008 </row>
1009 <row>
1010 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_256K</constant>&nbsp;</entry>
1011 <entry>256 kbit/s</entry>
1012 </row>
1013 <row>
1014 <entry><constant>V4L2_MPEG_AUDIO_L3_BITRATE_320K</constant>&nbsp;</entry>
1015 <entry>320 kbit/s</entry>
1016 </row>
1017 </tbody>
1018 </entrytbl>
1019 </row>
1020 <row><entry></entry></row>
1021 <row>
1022 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_AAC_BITRATE</constant>&nbsp;</entry>
1023 <entry>integer</entry>
1024 </row><row><entry spanname="descr">AAC bitrate in bits per second.</entry>
1025 </row>
1026 <row><entry></entry></row>
1027 <row id="v4l2-mpeg-audio-ac3-bitrate">
1028 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_AC3_BITRATE</constant>&nbsp;</entry>
1029 <entry>enum&nbsp;v4l2_mpeg_audio_ac3_bitrate</entry>
1030 </row><row><entry spanname="descr">AC-3 bitrate.
1031Possible values are:</entry>
1032 </row>
1033 <row>
1034 <entrytbl spanname="descr" cols="2">
1035 <tbody valign="top">
1036 <row>
1037 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_32K</constant>&nbsp;</entry>
1038 <entry>32 kbit/s</entry>
1039 </row>
1040 <row>
1041 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_40K</constant>&nbsp;</entry>
1042 <entry>40 kbit/s</entry>
1043 </row>
1044 <row>
1045 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_48K</constant>&nbsp;</entry>
1046 <entry>48 kbit/s</entry>
1047 </row>
1048 <row>
1049 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_56K</constant>&nbsp;</entry>
1050 <entry>56 kbit/s</entry>
1051 </row>
1052 <row>
1053 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_64K</constant>&nbsp;</entry>
1054 <entry>64 kbit/s</entry>
1055 </row>
1056 <row>
1057 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_80K</constant>&nbsp;</entry>
1058 <entry>80 kbit/s</entry>
1059 </row>
1060 <row>
1061 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_96K</constant>&nbsp;</entry>
1062 <entry>96 kbit/s</entry>
1063 </row>
1064 <row>
1065 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_112K</constant>&nbsp;</entry>
1066 <entry>112 kbit/s</entry>
1067 </row>
1068 <row>
1069 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_128K</constant>&nbsp;</entry>
1070 <entry>128 kbit/s</entry>
1071 </row>
1072 <row>
1073 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_160K</constant>&nbsp;</entry>
1074 <entry>160 kbit/s</entry>
1075 </row>
1076 <row>
1077 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_192K</constant>&nbsp;</entry>
1078 <entry>192 kbit/s</entry>
1079 </row>
1080 <row>
1081 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_224K</constant>&nbsp;</entry>
1082 <entry>224 kbit/s</entry>
1083 </row>
1084 <row>
1085 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_256K</constant>&nbsp;</entry>
1086 <entry>256 kbit/s</entry>
1087 </row>
1088 <row>
1089 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_320K</constant>&nbsp;</entry>
1090 <entry>320 kbit/s</entry>
1091 </row>
1092 <row>
1093 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_384K</constant>&nbsp;</entry>
1094 <entry>384 kbit/s</entry>
1095 </row>
1096 <row>
1097 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_448K</constant>&nbsp;</entry>
1098 <entry>448 kbit/s</entry>
1099 </row>
1100 <row>
1101 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_512K</constant>&nbsp;</entry>
1102 <entry>512 kbit/s</entry>
1103 </row>
1104 <row>
1105 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_576K</constant>&nbsp;</entry>
1106 <entry>576 kbit/s</entry>
1107 </row>
1108 <row>
1109 <entry><constant>V4L2_MPEG_AUDIO_AC3_BITRATE_640K</constant>&nbsp;</entry>
1110 <entry>640 kbit/s</entry>
1111 </row>
1112 </tbody>
1113 </entrytbl>
1114 </row>
1115 <row><entry></entry></row>
1116 <row id="v4l2-mpeg-audio-mode">
1117 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_MODE</constant>&nbsp;</entry>
1118 <entry>enum&nbsp;v4l2_mpeg_audio_mode</entry>
1119 </row><row><entry spanname="descr">MPEG Audio mode.
1120Possible values are:</entry>
1121 </row>
1122 <row>
1123 <entrytbl spanname="descr" cols="2">
1124 <tbody valign="top">
1125 <row>
1126 <entry><constant>V4L2_MPEG_AUDIO_MODE_STEREO</constant>&nbsp;</entry>
1127 <entry>Stereo</entry>
1128 </row>
1129 <row>
1130 <entry><constant>V4L2_MPEG_AUDIO_MODE_JOINT_STEREO</constant>&nbsp;</entry>
1131 <entry>Joint Stereo</entry>
1132 </row>
1133 <row>
1134 <entry><constant>V4L2_MPEG_AUDIO_MODE_DUAL</constant>&nbsp;</entry>
1135 <entry>Bilingual</entry>
1136 </row>
1137 <row>
1138 <entry><constant>V4L2_MPEG_AUDIO_MODE_MONO</constant>&nbsp;</entry>
1139 <entry>Mono</entry>
1140 </row>
1141 </tbody>
1142 </entrytbl>
1143 </row>
1144 <row><entry></entry></row>
1145 <row id="v4l2-mpeg-audio-mode-extension">
1146 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_MODE_EXTENSION</constant>&nbsp;</entry>
1147 <entry>enum&nbsp;v4l2_mpeg_audio_mode_extension</entry>
1148 </row><row><entry spanname="descr">Joint Stereo
1149audio mode extension. In Layer I and II they indicate which subbands
1150are in intensity stereo. All other subbands are coded in stereo. Layer
1151III is not (yet) supported. Possible values
1152are:</entry>
1153 </row>
1154 <row>
1155 <entrytbl spanname="descr" cols="2">
1156 <tbody valign="top">
1157 <row>
1158 <entry><constant>V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4</constant>&nbsp;</entry>
1159 <entry>Subbands 4-31 in intensity stereo</entry>
1160 </row>
1161 <row>
1162 <entry><constant>V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8</constant>&nbsp;</entry>
1163 <entry>Subbands 8-31 in intensity stereo</entry>
1164 </row>
1165 <row>
1166 <entry><constant>V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12</constant>&nbsp;</entry>
1167 <entry>Subbands 12-31 in intensity stereo</entry>
1168 </row>
1169 <row>
1170 <entry><constant>V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16</constant>&nbsp;</entry>
1171 <entry>Subbands 16-31 in intensity stereo</entry>
1172 </row>
1173 </tbody>
1174 </entrytbl>
1175 </row>
1176 <row><entry></entry></row>
1177 <row id="v4l2-mpeg-audio-emphasis">
1178 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_EMPHASIS</constant>&nbsp;</entry>
1179 <entry>enum&nbsp;v4l2_mpeg_audio_emphasis</entry>
1180 </row><row><entry spanname="descr">Audio Emphasis.
1181Possible values are:</entry>
1182 </row>
1183 <row>
1184 <entrytbl spanname="descr" cols="2">
1185 <tbody valign="top">
1186 <row>
1187 <entry><constant>V4L2_MPEG_AUDIO_EMPHASIS_NONE</constant>&nbsp;</entry>
1188 <entry>None</entry>
1189 </row>
1190 <row>
1191 <entry><constant>V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS</constant>&nbsp;</entry>
1192 <entry>50/15 microsecond emphasis</entry>
1193 </row>
1194 <row>
1195 <entry><constant>V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17</constant>&nbsp;</entry>
1196 <entry>CCITT J.17</entry>
1197 </row>
1198 </tbody>
1199 </entrytbl>
1200 </row>
1201 <row><entry></entry></row>
1202 <row id="v4l2-mpeg-audio-crc">
1203 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_CRC</constant>&nbsp;</entry>
1204 <entry>enum&nbsp;v4l2_mpeg_audio_crc</entry>
1205 </row><row><entry spanname="descr">CRC method. Possible
1206values are:</entry>
1207 </row>
1208 <row>
1209 <entrytbl spanname="descr" cols="2">
1210 <tbody valign="top">
1211 <row>
1212 <entry><constant>V4L2_MPEG_AUDIO_CRC_NONE</constant>&nbsp;</entry>
1213 <entry>None</entry>
1214 </row>
1215 <row>
1216 <entry><constant>V4L2_MPEG_AUDIO_CRC_CRC16</constant>&nbsp;</entry>
1217 <entry>16 bit parity check</entry>
1218 </row>
1219 </tbody>
1220 </entrytbl>
1221 </row>
1222 <row><entry></entry></row>
1223 <row>
1224 <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_MUTE</constant>&nbsp;</entry>
1225 <entry>boolean</entry>
1226 </row><row><entry spanname="descr">Mutes the audio when
1227capturing. This is not done by muting audio hardware, which can still
1228produce a slight hiss, but in the encoder itself, guaranteeing a fixed
1229and reproducable audio bitstream. 0 = unmuted, 1 = muted.</entry>
1230 </row>
1231 <row><entry></entry></row>
1232 <row id="v4l2-mpeg-video-encoding">
1233 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_ENCODING</constant>&nbsp;</entry>
1234 <entry>enum&nbsp;v4l2_mpeg_video_encoding</entry>
1235 </row><row><entry spanname="descr">MPEG Video encoding
1236method. Possible values are:</entry>
1237 </row>
1238 <row>
1239 <entrytbl spanname="descr" cols="2">
1240 <tbody valign="top">
1241 <row>
1242 <entry><constant>V4L2_MPEG_VIDEO_ENCODING_MPEG_1</constant>&nbsp;</entry>
1243 <entry>MPEG-1 Video encoding</entry>
1244 </row>
1245 <row>
1246 <entry><constant>V4L2_MPEG_VIDEO_ENCODING_MPEG_2</constant>&nbsp;</entry>
1247 <entry>MPEG-2 Video encoding</entry>
1248 </row>
1249 <row>
1250 <entry><constant>V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC</constant>&nbsp;</entry>
1251 <entry>MPEG-4 AVC (H.264) Video encoding</entry>
1252 </row>
1253 </tbody>
1254 </entrytbl>
1255 </row>
1256 <row><entry></entry></row>
1257 <row id="v4l2-mpeg-video-aspect">
1258 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_ASPECT</constant>&nbsp;</entry>
1259 <entry>enum&nbsp;v4l2_mpeg_video_aspect</entry>
1260 </row><row><entry spanname="descr">Video aspect.
1261Possible values are:</entry>
1262 </row>
1263 <row>
1264 <entrytbl spanname="descr" cols="2">
1265 <tbody valign="top">
1266 <row>
1267 <entry><constant>V4L2_MPEG_VIDEO_ASPECT_1x1</constant>&nbsp;</entry>
1268 </row>
1269 <row>
1270 <entry><constant>V4L2_MPEG_VIDEO_ASPECT_4x3</constant>&nbsp;</entry>
1271 </row>
1272 <row>
1273 <entry><constant>V4L2_MPEG_VIDEO_ASPECT_16x9</constant>&nbsp;</entry>
1274 </row>
1275 <row>
1276 <entry><constant>V4L2_MPEG_VIDEO_ASPECT_221x100</constant>&nbsp;</entry>
1277 </row>
1278 </tbody>
1279 </entrytbl>
1280 </row>
1281 <row><entry></entry></row>
1282 <row>
1283 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_B_FRAMES</constant>&nbsp;</entry>
1284 <entry>integer</entry>
1285 </row><row><entry spanname="descr">Number of B-Frames
1286(default 2)</entry>
1287 </row>
1288 <row><entry></entry></row>
1289 <row>
1290 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_GOP_SIZE</constant>&nbsp;</entry>
1291 <entry>integer</entry>
1292 </row><row><entry spanname="descr">GOP size (default
129312)</entry>
1294 </row>
1295 <row><entry></entry></row>
1296 <row>
1297 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_GOP_CLOSURE</constant>&nbsp;</entry>
1298 <entry>boolean</entry>
1299 </row><row><entry spanname="descr">GOP closure (default
13001)</entry>
1301 </row>
1302 <row><entry></entry></row>
1303 <row>
1304 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_PULLDOWN</constant>&nbsp;</entry>
1305 <entry>boolean</entry>
1306 </row><row><entry spanname="descr">Enable 3:2 pulldown
1307(default 0)</entry>
1308 </row>
1309 <row><entry></entry></row>
1310 <row id="v4l2-mpeg-video-bitrate-mode">
1311 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_BITRATE_MODE</constant>&nbsp;</entry>
1312 <entry>enum&nbsp;v4l2_mpeg_video_bitrate_mode</entry>
1313 </row><row><entry spanname="descr">Video bitrate mode.
1314Possible values are:</entry>
1315 </row>
1316 <row>
1317 <entrytbl spanname="descr" cols="2">
1318 <tbody valign="top">
1319 <row>
1320 <entry><constant>V4L2_MPEG_VIDEO_BITRATE_MODE_VBR</constant>&nbsp;</entry>
1321 <entry>Variable bitrate</entry>
1322 </row>
1323 <row>
1324 <entry><constant>V4L2_MPEG_VIDEO_BITRATE_MODE_CBR</constant>&nbsp;</entry>
1325 <entry>Constant bitrate</entry>
1326 </row>
1327 </tbody>
1328 </entrytbl>
1329 </row>
1330 <row><entry></entry></row>
1331 <row>
1332 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_BITRATE</constant>&nbsp;</entry>
1333 <entry>integer</entry>
1334 </row><row><entry spanname="descr">Video bitrate in bits
1335per second.</entry>
1336 </row>
1337 <row><entry></entry></row>
1338 <row>
1339 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_BITRATE_PEAK</constant>&nbsp;</entry>
1340 <entry>integer</entry>
1341 </row><row><entry spanname="descr">Peak video bitrate in
1342bits per second. Must be larger or equal to the average video bitrate.
1343It is ignored if the video bitrate mode is set to constant
1344bitrate.</entry>
1345 </row>
1346 <row><entry></entry></row>
1347 <row>
1348 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION</constant>&nbsp;</entry>
1349 <entry>integer</entry>
1350 </row><row><entry spanname="descr">For every captured
1351frame, skip this many subsequent frames (default 0).</entry>
1352 </row>
1353 <row><entry></entry></row>
1354 <row>
1355 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MUTE</constant>&nbsp;</entry>
1356 <entry>boolean</entry>
1357 </row>
1358 <row><entry spanname="descr">"Mutes" the video to a
1359fixed color when capturing. This is useful for testing, to produce a
1360fixed video bitstream. 0 = unmuted, 1 = muted.</entry>
1361 </row>
1362 <row><entry></entry></row>
1363 <row>
1364 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MUTE_YUV</constant>&nbsp;</entry>
1365 <entry>integer</entry>
1366 </row><row><entry spanname="descr">Sets the "mute" color
1367of the video. The supplied 32-bit integer is interpreted as follows (bit
13680 = least significant bit):</entry>
1369 </row>
1370 <row>
1371 <entrytbl spanname="descr" cols="2">
1372 <tbody valign="top">
1373 <row>
1374 <entry>Bit 0:7</entry>
1375 <entry>V chrominance information</entry>
1376 </row>
1377 <row>
1378 <entry>Bit 8:15</entry>
1379 <entry>U chrominance information</entry>
1380 </row>
1381 <row>
1382 <entry>Bit 16:23</entry>
1383 <entry>Y luminance information</entry>
1384 </row>
1385 <row>
1386 <entry>Bit 24:31</entry>
1387 <entry>Must be zero.</entry>
1388 </row>
1389 </tbody>
1390 </entrytbl>
1391 </row>
1392 </tbody>
1393 </tgroup>
1394 </table>
1395 </section>
1396
1397 <section>
1398 <title>CX2341x MPEG Controls</title>
1399
1400 <para>The following MPEG class controls deal with MPEG
1401encoding settings that are specific to the Conexant CX23415 and
1402CX23416 MPEG encoding chips.</para>
1403
1404 <table pgwide="1" frame="none" id="cx2341x-control-id">
1405 <title>CX2341x Control IDs</title>
1406 <tgroup cols="4">
1407 <colspec colname="c1" colwidth="1*" />
1408 <colspec colname="c2" colwidth="6*" />
1409 <colspec colname="c3" colwidth="2*" />
1410 <colspec colname="c4" colwidth="6*" />
1411 <spanspec namest="c1" nameend="c2" spanname="id" />
1412 <spanspec namest="c2" nameend="c4" spanname="descr" />
1413 <thead>
1414 <row>
1415 <entry spanname="id" align="left">ID</entry>
1416 <entry align="left">Type</entry>
1417 </row><row><entry spanname="descr" align="left">Description</entry>
1418 </row>
1419 </thead>
1420 <tbody valign="top">
1421 <row><entry></entry></row>
1422 <row id="v4l2-mpeg-cx2341x-video-spatial-filter-mode">
1423 <entry spanname="id"><constant>V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE</constant>&nbsp;</entry>
1424 <entry>enum&nbsp;v4l2_mpeg_cx2341x_video_spatial_filter_mode</entry>
1425 </row><row><entry spanname="descr">Sets the Spatial
1426Filter mode (default <constant>MANUAL</constant>). Possible values
1427are:</entry>
1428 </row>
1429 <row>
1430 <entrytbl spanname="descr" cols="2">
1431 <tbody valign="top">
1432 <row>
1433 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL</constant>&nbsp;</entry>
1434 <entry>Choose the filter manually</entry>
1435 </row>
1436 <row>
1437 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO</constant>&nbsp;</entry>
1438 <entry>Choose the filter automatically</entry>
1439 </row>
1440 </tbody>
1441 </entrytbl>
1442 </row>
1443 <row><entry></entry></row>
1444 <row>
1445 <entry spanname="id"><constant>V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER</constant>&nbsp;</entry>
1446 <entry>integer&nbsp;(0-15)</entry>
1447 </row><row><entry spanname="descr">The setting for the
1448Spatial Filter. 0 = off, 15 = maximum. (Default is 0.)</entry>
1449 </row>
1450 <row><entry></entry></row>
1451 <row id="luma-spatial-filter-type">
1452 <entry spanname="id"><constant>V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE</constant>&nbsp;</entry>
1453 <entry>enum&nbsp;v4l2_mpeg_cx2341x_video_luma_spatial_filter_type</entry>
1454 </row><row><entry spanname="descr">Select the algorithm
1455to use for the Luma Spatial Filter (default
1456<constant>1D_HOR</constant>). Possible values:</entry>
1457 </row>
1458 <row>
1459 <entrytbl spanname="descr" cols="2">
1460 <tbody valign="top">
1461 <row>
1462 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF</constant>&nbsp;</entry>
1463 <entry>No filter</entry>
1464 </row>
1465 <row>
1466 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR</constant>&nbsp;</entry>
1467 <entry>One-dimensional horizontal</entry>
1468 </row>
1469 <row>
1470 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT</constant>&nbsp;</entry>
1471 <entry>One-dimensional vertical</entry>
1472 </row>
1473 <row>
1474 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE</constant>&nbsp;</entry>
1475 <entry>Two-dimensional separable</entry>
1476 </row>
1477 <row>
1478 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE</constant>&nbsp;</entry>
1479 <entry>Two-dimensional symmetrical
1480non-separable</entry>
1481 </row>
1482 </tbody>
1483 </entrytbl>
1484 </row>
1485 <row><entry></entry></row>
1486 <row id="chroma-spatial-filter-type">
1487 <entry spanname="id"><constant>V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE</constant>&nbsp;</entry>
1488 <entry>enum&nbsp;v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type</entry>
1489 </row><row><entry spanname="descr">Select the algorithm
1490for the Chroma Spatial Filter (default <constant>1D_HOR</constant>).
1491Possible values are:</entry>
1492 </row>
1493 <row>
1494 <entrytbl spanname="descr" cols="2">
1495 <tbody valign="top">
1496 <row>
1497 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF</constant>&nbsp;</entry>
1498 <entry>No filter</entry>
1499 </row>
1500 <row>
1501 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR</constant>&nbsp;</entry>
1502 <entry>One-dimensional horizontal</entry>
1503 </row>
1504 </tbody>
1505 </entrytbl>
1506 </row>
1507 <row><entry></entry></row>
1508 <row id="v4l2-mpeg-cx2341x-video-temporal-filter-mode">
1509 <entry spanname="id"><constant>V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE</constant>&nbsp;</entry>
1510 <entry>enum&nbsp;v4l2_mpeg_cx2341x_video_temporal_filter_mode</entry>
1511 </row><row><entry spanname="descr">Sets the Temporal
1512Filter mode (default <constant>MANUAL</constant>). Possible values
1513are:</entry>
1514 </row>
1515 <row>
1516 <entrytbl spanname="descr" cols="2">
1517 <tbody valign="top">
1518 <row>
1519 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL</constant>&nbsp;</entry>
1520 <entry>Choose the filter manually</entry>
1521 </row>
1522 <row>
1523 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO</constant>&nbsp;</entry>
1524 <entry>Choose the filter automatically</entry>
1525 </row>
1526 </tbody>
1527 </entrytbl>
1528 </row>
1529 <row><entry></entry></row>
1530 <row>
1531 <entry spanname="id"><constant>V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER</constant>&nbsp;</entry>
1532 <entry>integer&nbsp;(0-31)</entry>
1533 </row><row><entry spanname="descr">The setting for the
1534Temporal Filter. 0 = off, 31 = maximum. (Default is 8 for full-scale
1535capturing and 0 for scaled capturing.)</entry>
1536 </row>
1537 <row><entry></entry></row>
1538 <row id="v4l2-mpeg-cx2341x-video-median-filter-type">
1539 <entry spanname="id"><constant>V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE</constant>&nbsp;</entry>
1540 <entry>enum&nbsp;v4l2_mpeg_cx2341x_video_median_filter_type</entry>
1541 </row><row><entry spanname="descr">Median Filter Type
1542(default <constant>OFF</constant>). Possible values are:</entry>
1543 </row>
1544 <row>
1545 <entrytbl spanname="descr" cols="2">
1546 <tbody valign="top">
1547 <row>
1548 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF</constant>&nbsp;</entry>
1549 <entry>No filter</entry>
1550 </row>
1551 <row>
1552 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR</constant>&nbsp;</entry>
1553 <entry>Horizontal filter</entry>
1554 </row>
1555 <row>
1556 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT</constant>&nbsp;</entry>
1557 <entry>Vertical filter</entry>
1558 </row>
1559 <row>
1560 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT</constant>&nbsp;</entry>
1561 <entry>Horizontal and vertical filter</entry>
1562 </row>
1563 <row>
1564 <entry><constant>V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG</constant>&nbsp;</entry>
1565 <entry>Diagonal filter</entry>
1566 </row>
1567 </tbody>
1568 </entrytbl>
1569 </row>
1570 <row><entry></entry></row>
1571 <row>
1572 <entry spanname="id"><constant>V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM</constant>&nbsp;</entry>
1573 <entry>integer&nbsp;(0-255)</entry>
1574 </row><row><entry spanname="descr">Threshold above which
1575the luminance median filter is enabled (default 0)</entry>
1576 </row>
1577 <row><entry></entry></row>
1578 <row>
1579 <entry spanname="id"><constant>V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP</constant>&nbsp;</entry>
1580 <entry>integer&nbsp;(0-255)</entry>
1581 </row><row><entry spanname="descr">Threshold below which
1582the luminance median filter is enabled (default 255)</entry>
1583 </row>
1584 <row><entry></entry></row>
1585 <row>
1586 <entry spanname="id"><constant>V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM</constant>&nbsp;</entry>
1587 <entry>integer&nbsp;(0-255)</entry>
1588 </row><row><entry spanname="descr">Threshold above which
1589the chroma median filter is enabled (default 0)</entry>
1590 </row>
1591 <row><entry></entry></row>
1592 <row>
1593 <entry spanname="id"><constant>V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP</constant>&nbsp;</entry>
1594 <entry>integer&nbsp;(0-255)</entry>
1595 </row><row><entry spanname="descr">Threshold below which
1596the chroma median filter is enabled (default 255)</entry>
1597 </row>
1598 <row><entry></entry></row>
1599 <row>
1600 <entry spanname="id"><constant>V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS</constant>&nbsp;</entry>
1601 <entry>boolean</entry>
1602 </row>
1603 <row><entry spanname="descr">The CX2341X MPEG encoder
1604can insert one empty MPEG-2 PES packet into the stream between every
1605four video frames. The packet size is 2048 bytes, including the
1606packet_start_code_prefix and stream_id fields. The stream_id is 0xBF
1607(private stream 2). The payload consists of 0x00 bytes, to be filled
1608in by the application. 0 = do not insert, 1 = insert packets.</entry>
1609 </row>
1610 </tbody>
1611 </tgroup>
1612 </table>
1613 </section>
1614 </section>
1615
1616 <section id="camera-controls">
1617 <title>Camera Control Reference</title>
1618
1619 <para>The Camera class includes controls for mechanical (or
1620equivalent digital) features of a device such as controllable lenses
1621or sensors.</para>
1622
1623 <table pgwide="1" frame="none" id="camera-control-id">
1624 <title>Camera Control IDs</title>
1625 <tgroup cols="4">
1626 <colspec colname="c1" colwidth="1*" />
1627 <colspec colname="c2" colwidth="6*" />
1628 <colspec colname="c3" colwidth="2*" />
1629 <colspec colname="c4" colwidth="6*" />
1630 <spanspec namest="c1" nameend="c2" spanname="id" />
1631 <spanspec namest="c2" nameend="c4" spanname="descr" />
1632 <thead>
1633 <row>
1634 <entry spanname="id" align="left">ID</entry>
1635 <entry align="left">Type</entry>
1636 </row><row rowsep="1"><entry spanname="descr" align="left">Description</entry>
1637 </row>
1638 </thead>
1639 <tbody valign="top">
1640 <row><entry></entry></row>
1641 <row>
1642 <entry spanname="id"><constant>V4L2_CID_CAMERA_CLASS</constant>&nbsp;</entry>
1643 <entry>class</entry>
1644 </row><row><entry spanname="descr">The Camera class
1645descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a
1646description of this control class.</entry>
1647 </row>
1648 <row><entry></entry></row>
1649
1650 <row id="v4l2-exposure-auto-type">
1651 <entry spanname="id"><constant>V4L2_CID_EXPOSURE_AUTO</constant>&nbsp;</entry>
1652 <entry>enum&nbsp;v4l2_exposure_auto_type</entry>
1653 </row><row><entry spanname="descr">Enables automatic
1654adjustments of the exposure time and/or iris aperture. The effect of
1655manual changes of the exposure time or iris aperture while these
1656features are enabled is undefined, drivers should ignore such
1657requests. Possible values are:</entry>
1658 </row>
1659 <row>
1660 <entrytbl spanname="descr" cols="2">
1661 <tbody valign="top">
1662 <row>
1663 <entry><constant>V4L2_EXPOSURE_AUTO</constant>&nbsp;</entry>
1664 <entry>Automatic exposure time, automatic iris
1665aperture.</entry>
1666 </row>
1667 <row>
1668 <entry><constant>V4L2_EXPOSURE_MANUAL</constant>&nbsp;</entry>
1669 <entry>Manual exposure time, manual iris.</entry>
1670 </row>
1671 <row>
1672 <entry><constant>V4L2_EXPOSURE_SHUTTER_PRIORITY</constant>&nbsp;</entry>
1673 <entry>Manual exposure time, auto iris.</entry>
1674 </row>
1675 <row>
1676 <entry><constant>V4L2_EXPOSURE_APERTURE_PRIORITY</constant>&nbsp;</entry>
1677 <entry>Auto exposure time, manual iris.</entry>
1678 </row>
1679 </tbody>
1680 </entrytbl>
1681 </row>
1682 <row><entry></entry></row>
1683
1684 <row>
1685 <entry spanname="id"><constant>V4L2_CID_EXPOSURE_ABSOLUTE</constant>&nbsp;</entry>
1686 <entry>integer</entry>
1687 </row><row><entry spanname="descr">Determines the exposure
1688time of the camera sensor. The exposure time is limited by the frame
1689interval. Drivers should interpret the values as 100 &micro;s units,
1690where the value 1 stands for 1/10000th of a second, 10000 for 1 second
1691and 100000 for 10 seconds.</entry>
1692 </row>
1693 <row><entry></entry></row>
1694
1695 <row>
1696 <entry spanname="id"><constant>V4L2_CID_EXPOSURE_AUTO_PRIORITY</constant>&nbsp;</entry>
1697 <entry>boolean</entry>
1698 </row><row><entry spanname="descr">When
1699<constant>V4L2_CID_EXPOSURE_AUTO</constant> is set to
1700<constant>AUTO</constant> or <constant>APERTURE_PRIORITY</constant>,
1701this control determines if the device may dynamically vary the frame
1702rate. By default this feature is disabled (0) and the frame rate must
1703remain constant.</entry>
1704 </row>
1705 <row><entry></entry></row>
1706
1707 <row>
1708 <entry spanname="id"><constant>V4L2_CID_PAN_RELATIVE</constant>&nbsp;</entry>
1709 <entry>integer</entry>
1710 </row><row><entry spanname="descr">This control turns the
1711camera horizontally by the specified amount. The unit is undefined. A
1712positive value moves the camera to the right (clockwise when viewed
1713from above), a negative value to the left. A value of zero does not
1714cause motion. This is a write-only control.</entry>
1715 </row>
1716 <row><entry></entry></row>
1717
1718 <row>
1719 <entry spanname="id"><constant>V4L2_CID_TILT_RELATIVE</constant>&nbsp;</entry>
1720 <entry>integer</entry>
1721 </row><row><entry spanname="descr">This control turns the
1722camera vertically by the specified amount. The unit is undefined. A
1723positive value moves the camera up, a negative value down. A value of
1724zero does not cause motion. This is a write-only control.</entry>
1725 </row>
1726 <row><entry></entry></row>
1727
1728 <row>
1729 <entry spanname="id"><constant>V4L2_CID_PAN_RESET</constant>&nbsp;</entry>
1730 <entry>button</entry>
1731 </row><row><entry spanname="descr">When this control is set,
1732the camera moves horizontally to the default position.</entry>
1733 </row>
1734 <row><entry></entry></row>
1735
1736 <row>
1737 <entry spanname="id"><constant>V4L2_CID_TILT_RESET</constant>&nbsp;</entry>
1738 <entry>button</entry>
1739 </row><row><entry spanname="descr">When this control is set,
1740the camera moves vertically to the default position.</entry>
1741 </row>
1742 <row><entry></entry></row>
1743
1744 <row>
1745 <entry spanname="id"><constant>V4L2_CID_PAN_ABSOLUTE</constant>&nbsp;</entry>
1746 <entry>integer</entry>
1747 </row><row><entry spanname="descr">This control
1748turns the camera horizontally to the specified position. Positive
1749values move the camera to the right (clockwise when viewed from above),
1750negative values to the left. Drivers should interpret the values as arc
1751seconds, with valid values between -180 * 3600 and +180 * 3600
1752inclusive.</entry>
1753 </row>
1754 <row><entry></entry></row>
1755
1756 <row>
1757 <entry spanname="id"><constant>V4L2_CID_TILT_ABSOLUTE</constant>&nbsp;</entry>
1758 <entry>integer</entry>
1759 </row><row><entry spanname="descr">This control
1760turns the camera vertically to the specified position. Positive values
1761move the camera up, negative values down. Drivers should interpret the
1762values as arc seconds, with valid values between -180 * 3600 and +180
1763* 3600 inclusive.</entry>
1764 </row>
1765 <row><entry></entry></row>
1766
1767 <row>
1768 <entry spanname="id"><constant>V4L2_CID_FOCUS_ABSOLUTE</constant>&nbsp;</entry>
1769 <entry>integer</entry>
1770 </row><row><entry spanname="descr">This control sets the
1771focal point of the camera to the specified position. The unit is
1772undefined. Positive values set the focus closer to the camera,
1773negative values towards infinity.</entry>
1774 </row>
1775 <row><entry></entry></row>
1776
1777 <row>
1778 <entry spanname="id"><constant>V4L2_CID_FOCUS_RELATIVE</constant>&nbsp;</entry>
1779 <entry>integer</entry>
1780 </row><row><entry spanname="descr">This control moves the
1781focal point of the camera by the specified amount. The unit is
1782undefined. Positive values move the focus closer to the camera,
1783negative values towards infinity. This is a write-only control.</entry>
1784 </row>
1785 <row><entry></entry></row>
1786
1787 <row>
1788 <entry spanname="id"><constant>V4L2_CID_FOCUS_AUTO</constant>&nbsp;</entry>
1789 <entry>boolean</entry>
1790 </row><row><entry spanname="descr">Enables automatic focus
1791adjustments. The effect of manual focus adjustments while this feature
1792is enabled is undefined, drivers should ignore such requests.</entry>
1793 </row>
1794 <row><entry></entry></row>
1795
1796 <row>
1797 <entry spanname="id"><constant>V4L2_CID_ZOOM_ABSOLUTE</constant>&nbsp;</entry>
1798 <entry>integer</entry>
1799 </row><row><entry spanname="descr">Specify the objective lens
1800focal length as an absolute value. The zoom unit is driver-specific and its
1801value should be a positive integer.</entry>
1802 </row>
1803 <row><entry></entry></row>
1804
1805 <row>
1806 <entry spanname="id"><constant>V4L2_CID_ZOOM_RELATIVE</constant>&nbsp;</entry>
1807 <entry>integer</entry>
1808 </row><row><entry spanname="descr">Specify the objective lens
1809focal length relatively to the current value. Positive values move the zoom
1810lens group towards the telephoto direction, negative values towards the
1811wide-angle direction. The zoom unit is driver-specific. This is a write-only control.</entry>
1812 </row>
1813 <row><entry></entry></row>
1814
1815 <row>
1816 <entry spanname="id"><constant>V4L2_CID_ZOOM_CONTINUOUS</constant>&nbsp;</entry>
1817 <entry>integer</entry>
1818 </row><row><entry spanname="descr">Move the objective lens group
1819at the specified speed until it reaches physical device limits or until an
1820explicit request to stop the movement. A positive value moves the zoom lens
1821group towards the telephoto direction. A value of zero stops the zoom lens
1822group movement. A negative value moves the zoom lens group towards the
1823wide-angle direction. The zoom speed unit is driver-specific.</entry>
1824 </row>
1825 <row><entry></entry></row>
1826
1827 <row>
1828 <entry spanname="id"><constant>V4L2_CID_PRIVACY</constant>&nbsp;</entry>
1829 <entry>boolean</entry>
1830 </row><row><entry spanname="descr">Prevent video from being acquired
1831by the camera. When this control is set to <constant>TRUE</constant> (1), no
1832image can be captured by the camera. Common means to enforce privacy are
1833mechanical obturation of the sensor and firmware image processing, but the
1834device is not restricted to these methods. Devices that implement the privacy
1835control must support read access and may support write access.</entry>
1836 </row>
1837
1838 <row>
1839 <entry spanname="id"><constant>V4L2_CID_BAND_STOP_FILTER</constant>&nbsp;</entry>
1840 <entry>integer</entry>
1841 </row><row><entry spanname="descr">Switch the band-stop filter of a
1842camera sensor on or off, or specify its strength. Such band-stop filters can
1843be used, for example, to filter out the fluorescent light component.</entry>
1844 </row>
1845 <row><entry></entry></row>
1846 </tbody>
1847 </tgroup>
1848 </table>
1849 </section>
1850
1851 <section id="fm-tx-controls">
1852 <title>FM Transmitter Control Reference</title>
1853
1854 <para>The FM Transmitter (FM_TX) class includes controls for common features of
1855FM transmissions capable devices. Currently this class includes parameters for audio
1856compression, pilot tone generation, audio deviation limiter, RDS transmission and
1857tuning power features.</para>
1858
1859 <table pgwide="1" frame="none" id="fm-tx-control-id">
1860 <title>FM_TX Control IDs</title>
1861
1862 <tgroup cols="4">
1863 <colspec colname="c1" colwidth="1*" />
1864 <colspec colname="c2" colwidth="6*" />
1865 <colspec colname="c3" colwidth="2*" />
1866 <colspec colname="c4" colwidth="6*" />
1867 <spanspec namest="c1" nameend="c2" spanname="id" />
1868 <spanspec namest="c2" nameend="c4" spanname="descr" />
1869 <thead>
1870 <row>
1871 <entry spanname="id" align="left">ID</entry>
1872 <entry align="left">Type</entry>
1873 </row><row rowsep="1"><entry spanname="descr" align="left">Description</entry>
1874 </row>
1875 </thead>
1876 <tbody valign="top">
1877 <row><entry></entry></row>
1878 <row>
1879 <entry spanname="id"><constant>V4L2_CID_FM_TX_CLASS</constant>&nbsp;</entry>
1880 <entry>class</entry>
1881 </row><row><entry spanname="descr">The FM_TX class
1882descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a
1883description of this control class.</entry>
1884 </row>
1885 <row>
1886 <entry spanname="id"><constant>V4L2_CID_RDS_TX_DEVIATION</constant>&nbsp;</entry>
1887 <entry>integer</entry>
1888 </row>
1889 <row><entry spanname="descr">Configures RDS signal frequency deviation level in Hz.
1890The range and step are driver-specific.</entry>
1891 </row>
1892 <row>
1893 <entry spanname="id"><constant>V4L2_CID_RDS_TX_PI</constant>&nbsp;</entry>
1894 <entry>integer</entry>
1895 </row>
1896 <row><entry spanname="descr">Sets the RDS Programme Identification field
1897for transmission.</entry>
1898 </row>
1899 <row>
1900 <entry spanname="id"><constant>V4L2_CID_RDS_TX_PTY</constant>&nbsp;</entry>
1901 <entry>integer</entry>
1902 </row>
1903 <row><entry spanname="descr">Sets the RDS Programme Type field for transmission.
1904This encodes up to 31 pre-defined programme types.</entry>
1905 </row>
1906 <row>
1907 <entry spanname="id"><constant>V4L2_CID_RDS_TX_PS_NAME</constant>&nbsp;</entry>
1908 <entry>string</entry>
1909 </row>
1910 <row><entry spanname="descr">Sets the Programme Service name (PS_NAME) for transmission.
1911It is intended for static display on a receiver. It is the primary aid to listeners in programme service
1912identification and selection. In Annex E of <xref linkend="en50067" />, the RDS specification,
1913there is a full description of the correct character encoding for Programme Service name strings.
1914Also from RDS specification, PS is usually a single eight character text. However, it is also possible
1915to find receivers which can scroll strings sized as 8 x N characters. So, this control must be configured
1916with steps of 8 characters. The result is it must always contain a string with size multiple of 8.</entry>
1917 </row>
1918 <row>
1919 <entry spanname="id"><constant>V4L2_CID_RDS_TX_RADIO_TEXT</constant>&nbsp;</entry>
1920 <entry>string</entry>
1921 </row>
1922 <row><entry spanname="descr">Sets the Radio Text info for transmission. It is a textual description of
1923what is being broadcasted. RDS Radio Text can be applied when broadcaster wishes to transmit longer PS names,
1924programme-related information or any other text. In these cases, RadioText should be used in addition to
1925<constant>V4L2_CID_RDS_TX_PS_NAME</constant>. The encoding for Radio Text strings is also fully described
1926in Annex E of <xref linkend="en50067" />. The length of Radio Text strings depends on which RDS Block is being
1927used to transmit it, either 32 (2A block) or 64 (2B block). However, it is also possible
1928to find receivers which can scroll strings sized as 32 x N or 64 x N characters. So, this control must be configured
1929with steps of 32 or 64 characters. The result is it must always contain a string with size multiple of 32 or 64. </entry>
1930 </row>
1931 <row>
1932 <entry spanname="id"><constant>V4L2_CID_AUDIO_LIMITER_ENABLED</constant>&nbsp;</entry>
1933 <entry>boolean</entry>
1934 </row>
1935 <row><entry spanname="descr">Enables or disables the audio deviation limiter feature.
1936The limiter is useful when trying to maximize the audio volume, minimize receiver-generated
1937distortion and prevent overmodulation.
1938</entry>
1939 </row>
1940 <row>
1941 <entry spanname="id"><constant>V4L2_CID_AUDIO_LIMITER_RELEASE_TIME</constant>&nbsp;</entry>
1942 <entry>integer</entry>
1943 </row>
1944 <row><entry spanname="descr">Sets the audio deviation limiter feature release time.
1945Unit is in useconds. Step and range are driver-specific.</entry>
1946 </row>
1947 <row>
1948 <entry spanname="id"><constant>V4L2_CID_AUDIO_LIMITER_DEVIATION</constant>&nbsp;</entry>
1949 <entry>integer</entry>
1950 </row>
1951 <row><entry spanname="descr">Configures audio frequency deviation level in Hz.
1952The range and step are driver-specific.</entry>
1953 </row>
1954 <row>
1955 <entry spanname="id"><constant>V4L2_CID_AUDIO_COMPRESSION_ENABLED</constant>&nbsp;</entry>
1956 <entry>boolean</entry>
1957 </row>
1958 <row><entry spanname="descr">Enables or disables the audio compression feature.
1959This feature amplifies signals below the threshold by a fixed gain and compresses audio
1960signals above the threshold by the ratio of Threshold/(Gain + Threshold).</entry>
1961 </row>
1962 <row>
1963 <entry spanname="id"><constant>V4L2_CID_AUDIO_COMPRESSION_GAIN</constant>&nbsp;</entry>
1964 <entry>integer</entry>
1965 </row>
1966 <row><entry spanname="descr">Sets the gain for audio compression feature. It is
1967a dB value. The range and step are driver-specific.</entry>
1968 </row>
1969 <row>
1970 <entry spanname="id"><constant>V4L2_CID_AUDIO_COMPRESSION_THRESHOLD</constant>&nbsp;</entry>
1971 <entry>integer</entry>
1972 </row>
1973 <row><entry spanname="descr">Sets the threshold level for audio compression freature.
1974It is a dB value. The range and step are driver-specific.</entry>
1975 </row>
1976 <row>
1977 <entry spanname="id"><constant>V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME</constant>&nbsp;</entry>
1978 <entry>integer</entry>
1979 </row>
1980 <row><entry spanname="descr">Sets the attack time for audio compression feature.
1981It is a useconds value. The range and step are driver-specific.</entry>
1982 </row>
1983 <row>
1984 <entry spanname="id"><constant>V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME</constant>&nbsp;</entry>
1985 <entry>integer</entry>
1986 </row>
1987 <row><entry spanname="descr">Sets the release time for audio compression feature.
1988It is a useconds value. The range and step are driver-specific.</entry>
1989 </row>
1990 <row>
1991 <entry spanname="id"><constant>V4L2_CID_PILOT_TONE_ENABLED</constant>&nbsp;</entry>
1992 <entry>boolean</entry>
1993 </row>
1994 <row><entry spanname="descr">Enables or disables the pilot tone generation feature.</entry>
1995 </row>
1996 <row>
1997 <entry spanname="id"><constant>V4L2_CID_PILOT_TONE_DEVIATION</constant>&nbsp;</entry>
1998 <entry>integer</entry>
1999 </row>
2000 <row><entry spanname="descr">Configures pilot tone frequency deviation level. Unit is
2001in Hz. The range and step are driver-specific.</entry>
2002 </row>
2003 <row>
2004 <entry spanname="id"><constant>V4L2_CID_PILOT_TONE_FREQUENCY</constant>&nbsp;</entry>
2005 <entry>integer</entry>
2006 </row>
2007 <row><entry spanname="descr">Configures pilot tone frequency value. Unit is
2008in Hz. The range and step are driver-specific.</entry>
2009 </row>
2010 <row>
2011 <entry spanname="id"><constant>V4L2_CID_TUNE_PREEMPHASIS</constant>&nbsp;</entry>
2012 <entry>integer</entry>
2013 </row>
2014 <row id="v4l2-preemphasis"><entry spanname="descr">Configures the pre-emphasis value for broadcasting.
2015A pre-emphasis filter is applied to the broadcast to accentuate the high audio frequencies.
2016Depending on the region, a time constant of either 50 or 75 useconds is used. The enum&nbsp;v4l2_preemphasis
2017defines possible values for pre-emphasis. Here they are:</entry>
2018 </row><row>
2019 <entrytbl spanname="descr" cols="2">
2020 <tbody valign="top">
2021 <row>
2022 <entry><constant>V4L2_PREEMPHASIS_DISABLED</constant>&nbsp;</entry>
2023 <entry>No pre-emphasis is applied.</entry>
2024 </row>
2025 <row>
2026 <entry><constant>V4L2_PREEMPHASIS_50_uS</constant>&nbsp;</entry>
2027 <entry>A pre-emphasis of 50 uS is used.</entry>
2028 </row>
2029 <row>
2030 <entry><constant>V4L2_PREEMPHASIS_75_uS</constant>&nbsp;</entry>
2031 <entry>A pre-emphasis of 75 uS is used.</entry>
2032 </row>
2033 </tbody>
2034 </entrytbl>
2035
2036 </row>
2037 <row>
2038 <entry spanname="id"><constant>V4L2_CID_TUNE_POWER_LEVEL</constant>&nbsp;</entry>
2039 <entry>integer</entry>
2040 </row>
2041 <row><entry spanname="descr">Sets the output power level for signal transmission.
2042Unit is in dBuV. Range and step are driver-specific.</entry>
2043 </row>
2044 <row>
2045 <entry spanname="id"><constant>V4L2_CID_TUNE_ANTENNA_CAPACITOR</constant>&nbsp;</entry>
2046 <entry>integer</entry>
2047 </row>
2048 <row><entry spanname="descr">This selects the value of antenna tuning capacitor
2049manually or automatically if set to zero. Unit, range and step are driver-specific.</entry>
2050 </row>
2051 <row><entry></entry></row>
2052 </tbody>
2053 </tgroup>
2054 </table>
2055
2056<para>For more details about RDS specification, refer to
2057<xref linkend="en50067" /> document, from CENELEC.</para>
2058 </section>
2059</section>
2060
2061 <!--
2062Local Variables:
2063mode: sgml
2064sgml-parent-document: "common.sgml"
2065indent-tabs-mode: nil
2066End:
2067 -->