Merge tag 'asoc-fix-v5.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brooni...
[sfrench/cifs-2.6.git] / Documentation / media / uapi / v4l / extended-controls.rst
1 .. Permission is granted to copy, distribute and/or modify this
2 .. document under the terms of the GNU Free Documentation License,
3 .. Version 1.1 or any later version published by the Free Software
4 .. Foundation, with no Invariant Sections, no Front-Cover Texts
5 .. and no Back-Cover Texts. A copy of the license is included at
6 .. Documentation/media/uapi/fdl-appendix.rst.
7 ..
8 .. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
9
10 .. _extended-controls:
11
12 *****************
13 Extended Controls
14 *****************
15
16
17 Introduction
18 ============
19
20 The control mechanism as originally designed was meant to be used for
21 user settings (brightness, saturation, etc). However, it turned out to
22 be a very useful model for implementing more complicated driver APIs
23 where each driver implements only a subset of a larger API.
24
25 The MPEG encoding API was the driving force behind designing and
26 implementing this extended control mechanism: the MPEG standard is quite
27 large and the currently supported hardware MPEG encoders each only
28 implement a subset of this standard. Further more, many parameters
29 relating to how the video is encoded into an MPEG stream are specific to
30 the MPEG encoding chip since the MPEG standard only defines the format
31 of the resulting MPEG stream, not how the video is actually encoded into
32 that format.
33
34 Unfortunately, the original control API lacked some features needed for
35 these new uses and so it was extended into the (not terribly originally
36 named) extended control API.
37
38 Even though the MPEG encoding API was the first effort to use the
39 Extended Control API, nowadays there are also other classes of Extended
40 Controls, such as Camera Controls and FM Transmitter Controls. The
41 Extended Controls API as well as all Extended Controls classes are
42 described in the following text.
43
44
45 The Extended Control API
46 ========================
47
48 Three new ioctls are available:
49 :ref:`VIDIOC_G_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>`,
50 :ref:`VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` and
51 :ref:`VIDIOC_TRY_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>`. These ioctls act
52 on arrays of controls (as opposed to the
53 :ref:`VIDIOC_G_CTRL <VIDIOC_G_CTRL>` and
54 :ref:`VIDIOC_S_CTRL <VIDIOC_G_CTRL>` ioctls that act on a single
55 control). This is needed since it is often required to atomically change
56 several controls at once.
57
58 Each of the new ioctls expects a pointer to a struct
59 :c:type:`v4l2_ext_controls`. This structure
60 contains a pointer to the control array, a count of the number of
61 controls in that array and a control class. Control classes are used to
62 group similar controls into a single class. For example, control class
63 ``V4L2_CTRL_CLASS_USER`` contains all user controls (i. e. all controls
64 that can also be set using the old :ref:`VIDIOC_S_CTRL <VIDIOC_G_CTRL>`
65 ioctl). Control class ``V4L2_CTRL_CLASS_MPEG`` contains all controls
66 relating to MPEG encoding, etc.
67
68 All controls in the control array must belong to the specified control
69 class. An error is returned if this is not the case.
70
71 It is also possible to use an empty control array (``count`` == 0) to check
72 whether the specified control class is supported.
73
74 The control array is a struct
75 :c:type:`v4l2_ext_control` array. The
76 struct :c:type:`v4l2_ext_control` is very similar to
77 struct :c:type:`v4l2_control`, except for the fact that
78 it also allows for 64-bit values and pointers to be passed.
79
80 Since the struct :c:type:`v4l2_ext_control` supports
81 pointers it is now also possible to have controls with compound types
82 such as N-dimensional arrays and/or structures. You need to specify the
83 ``V4L2_CTRL_FLAG_NEXT_COMPOUND`` when enumerating controls to actually
84 be able to see such compound controls. In other words, these controls
85 with compound types should only be used programmatically.
86
87 Since such compound controls need to expose more information about
88 themselves than is possible with
89 :ref:`VIDIOC_QUERYCTRL` the
90 :ref:`VIDIOC_QUERY_EXT_CTRL <VIDIOC_QUERYCTRL>` ioctl was added. In
91 particular, this ioctl gives the dimensions of the N-dimensional array
92 if this control consists of more than one element.
93
94 .. note::
95
96    #. It is important to realize that due to the flexibility of controls it is
97       necessary to check whether the control you want to set actually is
98       supported in the driver and what the valid range of values is. So use
99       the :ref:`VIDIOC_QUERYCTRL` (or :ref:`VIDIOC_QUERY_EXT_CTRL
100       <VIDIOC_QUERYCTRL>`) and :ref:`VIDIOC_QUERYMENU <VIDIOC_QUERYCTRL>`
101       ioctls to check this.
102
103    #. It is possible that some of the menu indices in a control of
104       type ``V4L2_CTRL_TYPE_MENU`` may not be supported (``VIDIOC_QUERYMENU``
105       will return an error). A good example is the list of supported MPEG
106       audio bitrates. Some drivers only support one or two bitrates, others
107       support a wider range.
108
109 All controls use machine endianness.
110
111
112 Enumerating Extended Controls
113 =============================
114
115 The recommended way to enumerate over the extended controls is by using
116 :ref:`VIDIOC_QUERYCTRL` in combination with the
117 ``V4L2_CTRL_FLAG_NEXT_CTRL`` flag:
118
119
120 .. code-block:: c
121
122     struct v4l2_queryctrl qctrl;
123
124     qctrl.id = V4L2_CTRL_FLAG_NEXT_CTRL;
125     while (0 == ioctl (fd, VIDIOC_QUERYCTRL, &qctrl)) {
126         /* ... */
127         qctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL;
128     }
129
130 The initial control ID is set to 0 ORed with the
131 ``V4L2_CTRL_FLAG_NEXT_CTRL`` flag. The ``VIDIOC_QUERYCTRL`` ioctl will
132 return the first control with a higher ID than the specified one. When
133 no such controls are found an error is returned.
134
135 If you want to get all controls within a specific control class, then
136 you can set the initial ``qctrl.id`` value to the control class and add
137 an extra check to break out of the loop when a control of another
138 control class is found:
139
140
141 .. code-block:: c
142
143     qctrl.id = V4L2_CTRL_CLASS_MPEG | V4L2_CTRL_FLAG_NEXT_CTRL;
144     while (0 == ioctl(fd, VIDIOC_QUERYCTRL, &qctrl)) {
145         if (V4L2_CTRL_ID2CLASS(qctrl.id) != V4L2_CTRL_CLASS_MPEG)
146             break;
147             /* ... */
148         qctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL;
149     }
150
151 The 32-bit ``qctrl.id`` value is subdivided into three bit ranges: the
152 top 4 bits are reserved for flags (e. g. ``V4L2_CTRL_FLAG_NEXT_CTRL``)
153 and are not actually part of the ID. The remaining 28 bits form the
154 control ID, of which the most significant 12 bits define the control
155 class and the least significant 16 bits identify the control within the
156 control class. It is guaranteed that these last 16 bits are always
157 non-zero for controls. The range of 0x1000 and up are reserved for
158 driver-specific controls. The macro ``V4L2_CTRL_ID2CLASS(id)`` returns
159 the control class ID based on a control ID.
160
161 If the driver does not support extended controls, then
162 ``VIDIOC_QUERYCTRL`` will fail when used in combination with
163 ``V4L2_CTRL_FLAG_NEXT_CTRL``. In that case the old method of enumerating
164 control should be used (see :ref:`enum_all_controls`). But if it is
165 supported, then it is guaranteed to enumerate over all controls,
166 including driver-private controls.
167
168
169 Creating Control Panels
170 =======================
171
172 It is possible to create control panels for a graphical user interface
173 where the user can select the various controls. Basically you will have
174 to iterate over all controls using the method described above. Each
175 control class starts with a control of type
176 ``V4L2_CTRL_TYPE_CTRL_CLASS``. ``VIDIOC_QUERYCTRL`` will return the name
177 of this control class which can be used as the title of a tab page
178 within a control panel.
179
180 The flags field of struct :ref:`v4l2_queryctrl <v4l2-queryctrl>` also
181 contains hints on the behavior of the control. See the
182 :ref:`VIDIOC_QUERYCTRL` documentation for more
183 details.
184
185
186 .. _mpeg-controls:
187
188 Codec Control Reference
189 =======================
190
191 Below all controls within the Codec control class are described. First
192 the generic controls, then controls specific for certain hardware.
193
194 .. note::
195
196    These controls are applicable to all codecs and not just MPEG. The
197    defines are prefixed with V4L2_CID_MPEG/V4L2_MPEG as the controls
198    were originally made for MPEG codecs and later extended to cover all
199    encoding formats.
200
201
202 Generic Codec Controls
203 ----------------------
204
205
206 .. _mpeg-control-id:
207
208 Codec Control IDs
209 ^^^^^^^^^^^^^^^^^
210
211 ``V4L2_CID_MPEG_CLASS (class)``
212     The Codec class descriptor. Calling
213     :ref:`VIDIOC_QUERYCTRL` for this control will
214     return a description of this control class. This description can be
215     used as the caption of a Tab page in a GUI, for example.
216
217 .. _v4l2-mpeg-stream-type:
218
219 ``V4L2_CID_MPEG_STREAM_TYPE``
220     (enum)
221
222 enum v4l2_mpeg_stream_type -
223     The MPEG-1, -2 or -4 output stream type. One cannot assume anything
224     here. Each hardware MPEG encoder tends to support different subsets
225     of the available MPEG stream types. This control is specific to
226     multiplexed MPEG streams. The currently defined stream types are:
227
228
229
230 .. flat-table::
231     :header-rows:  0
232     :stub-columns: 0
233
234     * - ``V4L2_MPEG_STREAM_TYPE_MPEG2_PS``
235       - MPEG-2 program stream
236     * - ``V4L2_MPEG_STREAM_TYPE_MPEG2_TS``
237       - MPEG-2 transport stream
238     * - ``V4L2_MPEG_STREAM_TYPE_MPEG1_SS``
239       - MPEG-1 system stream
240     * - ``V4L2_MPEG_STREAM_TYPE_MPEG2_DVD``
241       - MPEG-2 DVD-compatible stream
242     * - ``V4L2_MPEG_STREAM_TYPE_MPEG1_VCD``
243       - MPEG-1 VCD-compatible stream
244     * - ``V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD``
245       - MPEG-2 SVCD-compatible stream
246
247
248
249 ``V4L2_CID_MPEG_STREAM_PID_PMT (integer)``
250     Program Map Table Packet ID for the MPEG transport stream (default
251     16)
252
253 ``V4L2_CID_MPEG_STREAM_PID_AUDIO (integer)``
254     Audio Packet ID for the MPEG transport stream (default 256)
255
256 ``V4L2_CID_MPEG_STREAM_PID_VIDEO (integer)``
257     Video Packet ID for the MPEG transport stream (default 260)
258
259 ``V4L2_CID_MPEG_STREAM_PID_PCR (integer)``
260     Packet ID for the MPEG transport stream carrying PCR fields (default
261     259)
262
263 ``V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (integer)``
264     Audio ID for MPEG PES
265
266 ``V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (integer)``
267     Video ID for MPEG PES
268
269 .. _v4l2-mpeg-stream-vbi-fmt:
270
271 ``V4L2_CID_MPEG_STREAM_VBI_FMT``
272     (enum)
273
274 enum v4l2_mpeg_stream_vbi_fmt -
275     Some cards can embed VBI data (e. g. Closed Caption, Teletext) into
276     the MPEG stream. This control selects whether VBI data should be
277     embedded, and if so, what embedding method should be used. The list
278     of possible VBI formats depends on the driver. The currently defined
279     VBI format types are:
280
281
282
283 .. tabularcolumns:: |p{6 cm}|p{11.5cm}|
284
285 .. flat-table::
286     :header-rows:  0
287     :stub-columns: 0
288
289     * - ``V4L2_MPEG_STREAM_VBI_FMT_NONE``
290       - No VBI in the MPEG stream
291     * - ``V4L2_MPEG_STREAM_VBI_FMT_IVTV``
292       - VBI in private packets, IVTV format (documented in the kernel
293         sources in the file
294         ``Documentation/media/v4l-drivers/cx2341x.rst``)
295
296
297
298 .. _v4l2-mpeg-audio-sampling-freq:
299
300 ``V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ``
301     (enum)
302
303 enum v4l2_mpeg_audio_sampling_freq -
304     MPEG Audio sampling frequency. Possible values are:
305
306
307
308 .. flat-table::
309     :header-rows:  0
310     :stub-columns: 0
311
312     * - ``V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100``
313       - 44.1 kHz
314     * - ``V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000``
315       - 48 kHz
316     * - ``V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000``
317       - 32 kHz
318
319
320
321 .. _v4l2-mpeg-audio-encoding:
322
323 ``V4L2_CID_MPEG_AUDIO_ENCODING``
324     (enum)
325
326 enum v4l2_mpeg_audio_encoding -
327     MPEG Audio encoding. This control is specific to multiplexed MPEG
328     streams. Possible values are:
329
330
331
332 .. flat-table::
333     :header-rows:  0
334     :stub-columns: 0
335
336     * - ``V4L2_MPEG_AUDIO_ENCODING_LAYER_1``
337       - MPEG-1/2 Layer I encoding
338     * - ``V4L2_MPEG_AUDIO_ENCODING_LAYER_2``
339       - MPEG-1/2 Layer II encoding
340     * - ``V4L2_MPEG_AUDIO_ENCODING_LAYER_3``
341       - MPEG-1/2 Layer III encoding
342     * - ``V4L2_MPEG_AUDIO_ENCODING_AAC``
343       - MPEG-2/4 AAC (Advanced Audio Coding)
344     * - ``V4L2_MPEG_AUDIO_ENCODING_AC3``
345       - AC-3 aka ATSC A/52 encoding
346
347
348
349 .. _v4l2-mpeg-audio-l1-bitrate:
350
351 ``V4L2_CID_MPEG_AUDIO_L1_BITRATE``
352     (enum)
353
354 enum v4l2_mpeg_audio_l1_bitrate -
355     MPEG-1/2 Layer I bitrate. Possible values are:
356
357
358
359 .. flat-table::
360     :header-rows:  0
361     :stub-columns: 0
362
363     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_32K``
364       - 32 kbit/s
365     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_64K``
366       - 64 kbit/s
367     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_96K``
368       - 96 kbit/s
369     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_128K``
370       - 128 kbit/s
371     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_160K``
372       - 160 kbit/s
373     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_192K``
374       - 192 kbit/s
375     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_224K``
376       - 224 kbit/s
377     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_256K``
378       - 256 kbit/s
379     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_288K``
380       - 288 kbit/s
381     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_320K``
382       - 320 kbit/s
383     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_352K``
384       - 352 kbit/s
385     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_384K``
386       - 384 kbit/s
387     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_416K``
388       - 416 kbit/s
389     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_448K``
390       - 448 kbit/s
391
392
393
394 .. _v4l2-mpeg-audio-l2-bitrate:
395
396 ``V4L2_CID_MPEG_AUDIO_L2_BITRATE``
397     (enum)
398
399 enum v4l2_mpeg_audio_l2_bitrate -
400     MPEG-1/2 Layer II bitrate. Possible values are:
401
402
403
404 .. flat-table::
405     :header-rows:  0
406     :stub-columns: 0
407
408     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_32K``
409       - 32 kbit/s
410     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_48K``
411       - 48 kbit/s
412     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_56K``
413       - 56 kbit/s
414     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_64K``
415       - 64 kbit/s
416     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_80K``
417       - 80 kbit/s
418     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_96K``
419       - 96 kbit/s
420     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_112K``
421       - 112 kbit/s
422     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_128K``
423       - 128 kbit/s
424     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_160K``
425       - 160 kbit/s
426     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_192K``
427       - 192 kbit/s
428     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_224K``
429       - 224 kbit/s
430     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_256K``
431       - 256 kbit/s
432     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_320K``
433       - 320 kbit/s
434     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_384K``
435       - 384 kbit/s
436
437
438
439 .. _v4l2-mpeg-audio-l3-bitrate:
440
441 ``V4L2_CID_MPEG_AUDIO_L3_BITRATE``
442     (enum)
443
444 enum v4l2_mpeg_audio_l3_bitrate -
445     MPEG-1/2 Layer III bitrate. Possible values are:
446
447
448
449 .. flat-table::
450     :header-rows:  0
451     :stub-columns: 0
452
453     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_32K``
454       - 32 kbit/s
455     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_40K``
456       - 40 kbit/s
457     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_48K``
458       - 48 kbit/s
459     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_56K``
460       - 56 kbit/s
461     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_64K``
462       - 64 kbit/s
463     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_80K``
464       - 80 kbit/s
465     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_96K``
466       - 96 kbit/s
467     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_112K``
468       - 112 kbit/s
469     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_128K``
470       - 128 kbit/s
471     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_160K``
472       - 160 kbit/s
473     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_192K``
474       - 192 kbit/s
475     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_224K``
476       - 224 kbit/s
477     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_256K``
478       - 256 kbit/s
479     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_320K``
480       - 320 kbit/s
481
482
483
484 ``V4L2_CID_MPEG_AUDIO_AAC_BITRATE (integer)``
485     AAC bitrate in bits per second.
486
487 .. _v4l2-mpeg-audio-ac3-bitrate:
488
489 ``V4L2_CID_MPEG_AUDIO_AC3_BITRATE``
490     (enum)
491
492 enum v4l2_mpeg_audio_ac3_bitrate -
493     AC-3 bitrate. Possible values are:
494
495
496
497 .. flat-table::
498     :header-rows:  0
499     :stub-columns: 0
500
501     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_32K``
502       - 32 kbit/s
503     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_40K``
504       - 40 kbit/s
505     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_48K``
506       - 48 kbit/s
507     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_56K``
508       - 56 kbit/s
509     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_64K``
510       - 64 kbit/s
511     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_80K``
512       - 80 kbit/s
513     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_96K``
514       - 96 kbit/s
515     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_112K``
516       - 112 kbit/s
517     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_128K``
518       - 128 kbit/s
519     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_160K``
520       - 160 kbit/s
521     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_192K``
522       - 192 kbit/s
523     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_224K``
524       - 224 kbit/s
525     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_256K``
526       - 256 kbit/s
527     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_320K``
528       - 320 kbit/s
529     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_384K``
530       - 384 kbit/s
531     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_448K``
532       - 448 kbit/s
533     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_512K``
534       - 512 kbit/s
535     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_576K``
536       - 576 kbit/s
537     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_640K``
538       - 640 kbit/s
539
540
541
542 .. _v4l2-mpeg-audio-mode:
543
544 ``V4L2_CID_MPEG_AUDIO_MODE``
545     (enum)
546
547 enum v4l2_mpeg_audio_mode -
548     MPEG Audio mode. Possible values are:
549
550
551
552 .. flat-table::
553     :header-rows:  0
554     :stub-columns: 0
555
556     * - ``V4L2_MPEG_AUDIO_MODE_STEREO``
557       - Stereo
558     * - ``V4L2_MPEG_AUDIO_MODE_JOINT_STEREO``
559       - Joint Stereo
560     * - ``V4L2_MPEG_AUDIO_MODE_DUAL``
561       - Bilingual
562     * - ``V4L2_MPEG_AUDIO_MODE_MONO``
563       - Mono
564
565
566
567 .. _v4l2-mpeg-audio-mode-extension:
568
569 ``V4L2_CID_MPEG_AUDIO_MODE_EXTENSION``
570     (enum)
571
572 enum v4l2_mpeg_audio_mode_extension -
573     Joint Stereo audio mode extension. In Layer I and II they indicate
574     which subbands are in intensity stereo. All other subbands are coded
575     in stereo. Layer III is not (yet) supported. Possible values are:
576
577
578
579 .. flat-table::
580     :header-rows:  0
581     :stub-columns: 0
582
583     * - ``V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4``
584       - Subbands 4-31 in intensity stereo
585     * - ``V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8``
586       - Subbands 8-31 in intensity stereo
587     * - ``V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12``
588       - Subbands 12-31 in intensity stereo
589     * - ``V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16``
590       - Subbands 16-31 in intensity stereo
591
592
593
594 .. _v4l2-mpeg-audio-emphasis:
595
596 ``V4L2_CID_MPEG_AUDIO_EMPHASIS``
597     (enum)
598
599 enum v4l2_mpeg_audio_emphasis -
600     Audio Emphasis. Possible values are:
601
602
603
604 .. flat-table::
605     :header-rows:  0
606     :stub-columns: 0
607
608     * - ``V4L2_MPEG_AUDIO_EMPHASIS_NONE``
609       - None
610     * - ``V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS``
611       - 50/15 microsecond emphasis
612     * - ``V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17``
613       - CCITT J.17
614
615
616
617 .. _v4l2-mpeg-audio-crc:
618
619 ``V4L2_CID_MPEG_AUDIO_CRC``
620     (enum)
621
622 enum v4l2_mpeg_audio_crc -
623     CRC method. Possible values are:
624
625
626
627 .. flat-table::
628     :header-rows:  0
629     :stub-columns: 0
630
631     * - ``V4L2_MPEG_AUDIO_CRC_NONE``
632       - None
633     * - ``V4L2_MPEG_AUDIO_CRC_CRC16``
634       - 16 bit parity check
635
636
637
638 ``V4L2_CID_MPEG_AUDIO_MUTE (boolean)``
639     Mutes the audio when capturing. This is not done by muting audio
640     hardware, which can still produce a slight hiss, but in the encoder
641     itself, guaranteeing a fixed and reproducible audio bitstream. 0 =
642     unmuted, 1 = muted.
643
644 .. _v4l2-mpeg-audio-dec-playback:
645
646 ``V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK``
647     (enum)
648
649 enum v4l2_mpeg_audio_dec_playback -
650     Determines how monolingual audio should be played back. Possible
651     values are:
652
653
654
655 .. tabularcolumns:: |p{9.0cm}|p{8.5cm}|
656
657 .. flat-table::
658     :header-rows:  0
659     :stub-columns: 0
660
661     * - ``V4L2_MPEG_AUDIO_DEC_PLAYBACK_AUTO``
662       - Automatically determines the best playback mode.
663     * - ``V4L2_MPEG_AUDIO_DEC_PLAYBACK_STEREO``
664       - Stereo playback.
665     * - ``V4L2_MPEG_AUDIO_DEC_PLAYBACK_LEFT``
666       - Left channel playback.
667     * - ``V4L2_MPEG_AUDIO_DEC_PLAYBACK_RIGHT``
668       - Right channel playback.
669     * - ``V4L2_MPEG_AUDIO_DEC_PLAYBACK_MONO``
670       - Mono playback.
671     * - ``V4L2_MPEG_AUDIO_DEC_PLAYBACK_SWAPPED_STEREO``
672       - Stereo playback with swapped left and right channels.
673
674
675
676 .. _v4l2-mpeg-audio-dec-multilingual-playback:
677
678 ``V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK``
679     (enum)
680
681 enum v4l2_mpeg_audio_dec_playback -
682     Determines how multilingual audio should be played back.
683
684 .. _v4l2-mpeg-video-encoding:
685
686 ``V4L2_CID_MPEG_VIDEO_ENCODING``
687     (enum)
688
689 enum v4l2_mpeg_video_encoding -
690     MPEG Video encoding method. This control is specific to multiplexed
691     MPEG streams. Possible values are:
692
693
694
695 .. flat-table::
696     :header-rows:  0
697     :stub-columns: 0
698
699     * - ``V4L2_MPEG_VIDEO_ENCODING_MPEG_1``
700       - MPEG-1 Video encoding
701     * - ``V4L2_MPEG_VIDEO_ENCODING_MPEG_2``
702       - MPEG-2 Video encoding
703     * - ``V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC``
704       - MPEG-4 AVC (H.264) Video encoding
705
706
707
708 .. _v4l2-mpeg-video-aspect:
709
710 ``V4L2_CID_MPEG_VIDEO_ASPECT``
711     (enum)
712
713 enum v4l2_mpeg_video_aspect -
714     Video aspect. Possible values are:
715
716
717
718 .. flat-table::
719     :header-rows:  0
720     :stub-columns: 0
721
722     * - ``V4L2_MPEG_VIDEO_ASPECT_1x1``
723     * - ``V4L2_MPEG_VIDEO_ASPECT_4x3``
724     * - ``V4L2_MPEG_VIDEO_ASPECT_16x9``
725     * - ``V4L2_MPEG_VIDEO_ASPECT_221x100``
726
727
728
729 ``V4L2_CID_MPEG_VIDEO_B_FRAMES (integer)``
730     Number of B-Frames (default 2)
731
732 ``V4L2_CID_MPEG_VIDEO_GOP_SIZE (integer)``
733     GOP size (default 12)
734
735 ``V4L2_CID_MPEG_VIDEO_GOP_CLOSURE (boolean)``
736     GOP closure (default 1)
737
738 ``V4L2_CID_MPEG_VIDEO_PULLDOWN (boolean)``
739     Enable 3:2 pulldown (default 0)
740
741 .. _v4l2-mpeg-video-bitrate-mode:
742
743 ``V4L2_CID_MPEG_VIDEO_BITRATE_MODE``
744     (enum)
745
746 enum v4l2_mpeg_video_bitrate_mode -
747     Video bitrate mode. Possible values are:
748
749
750
751 .. flat-table::
752     :header-rows:  0
753     :stub-columns: 0
754
755     * - ``V4L2_MPEG_VIDEO_BITRATE_MODE_VBR``
756       - Variable bitrate
757     * - ``V4L2_MPEG_VIDEO_BITRATE_MODE_CBR``
758       - Constant bitrate
759
760
761
762 ``V4L2_CID_MPEG_VIDEO_BITRATE (integer)``
763     Video bitrate in bits per second.
764
765 ``V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (integer)``
766     Peak video bitrate in bits per second. Must be larger or equal to
767     the average video bitrate. It is ignored if the video bitrate mode
768     is set to constant bitrate.
769
770 ``V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (integer)``
771     For every captured frame, skip this many subsequent frames (default
772     0).
773
774 ``V4L2_CID_MPEG_VIDEO_MUTE (boolean)``
775     "Mutes" the video to a fixed color when capturing. This is useful
776     for testing, to produce a fixed video bitstream. 0 = unmuted, 1 =
777     muted.
778
779 ``V4L2_CID_MPEG_VIDEO_MUTE_YUV (integer)``
780     Sets the "mute" color of the video. The supplied 32-bit integer is
781     interpreted as follows (bit 0 = least significant bit):
782
783
784
785 .. flat-table::
786     :header-rows:  0
787     :stub-columns: 0
788
789     * - Bit 0:7
790       - V chrominance information
791     * - Bit 8:15
792       - U chrominance information
793     * - Bit 16:23
794       - Y luminance information
795     * - Bit 24:31
796       - Must be zero.
797
798
799
800 .. _v4l2-mpeg-video-dec-pts:
801
802 ``V4L2_CID_MPEG_VIDEO_DEC_PTS (integer64)``
803     This read-only control returns the 33-bit video Presentation Time
804     Stamp as defined in ITU T-REC-H.222.0 and ISO/IEC 13818-1 of the
805     currently displayed frame. This is the same PTS as is used in
806     :ref:`VIDIOC_DECODER_CMD`.
807
808 .. _v4l2-mpeg-video-dec-frame:
809
810 ``V4L2_CID_MPEG_VIDEO_DEC_FRAME (integer64)``
811     This read-only control returns the frame counter of the frame that
812     is currently displayed (decoded). This value is reset to 0 whenever
813     the decoder is started.
814
815 ``V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE (boolean)``
816     If enabled the decoder expects to receive a single slice per buffer,
817     otherwise the decoder expects a single frame in per buffer.
818     Applicable to the decoder, all codecs.
819
820 ``V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE (boolean)``
821     Enable writing sample aspect ratio in the Video Usability
822     Information. Applicable to the H264 encoder.
823
824 .. _v4l2-mpeg-video-h264-vui-sar-idc:
825
826 ``V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC``
827     (enum)
828
829 enum v4l2_mpeg_video_h264_vui_sar_idc -
830     VUI sample aspect ratio indicator for H.264 encoding. The value is
831     defined in the table E-1 in the standard. Applicable to the H264
832     encoder.
833
834
835
836 .. flat-table::
837     :header-rows:  0
838     :stub-columns: 0
839
840     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED``
841       - Unspecified
842     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_1x1``
843       - 1x1
844     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_12x11``
845       - 12x11
846     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_10x11``
847       - 10x11
848     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_16x11``
849       - 16x11
850     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_40x33``
851       - 40x33
852     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_24x11``
853       - 24x11
854     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_20x11``
855       - 20x11
856     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_32x11``
857       - 32x11
858     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_80x33``
859       - 80x33
860     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_18x11``
861       - 18x11
862     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_15x11``
863       - 15x11
864     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_64x33``
865       - 64x33
866     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_160x99``
867       - 160x99
868     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_4x3``
869       - 4x3
870     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_3x2``
871       - 3x2
872     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1``
873       - 2x1
874     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED``
875       - Extended SAR
876
877
878
879 ``V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH (integer)``
880     Extended sample aspect ratio width for H.264 VUI encoding.
881     Applicable to the H264 encoder.
882
883 ``V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT (integer)``
884     Extended sample aspect ratio height for H.264 VUI encoding.
885     Applicable to the H264 encoder.
886
887 .. _v4l2-mpeg-video-h264-level:
888
889 ``V4L2_CID_MPEG_VIDEO_H264_LEVEL``
890     (enum)
891
892 enum v4l2_mpeg_video_h264_level -
893     The level information for the H264 video elementary stream.
894     Applicable to the H264 encoder. Possible values are:
895
896
897
898 .. flat-table::
899     :header-rows:  0
900     :stub-columns: 0
901
902     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_1_0``
903       - Level 1.0
904     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_1B``
905       - Level 1B
906     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_1_1``
907       - Level 1.1
908     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_1_2``
909       - Level 1.2
910     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_1_3``
911       - Level 1.3
912     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_2_0``
913       - Level 2.0
914     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_2_1``
915       - Level 2.1
916     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_2_2``
917       - Level 2.2
918     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_3_0``
919       - Level 3.0
920     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_3_1``
921       - Level 3.1
922     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_3_2``
923       - Level 3.2
924     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_4_0``
925       - Level 4.0
926     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_4_1``
927       - Level 4.1
928     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_4_2``
929       - Level 4.2
930     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_5_0``
931       - Level 5.0
932     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_5_1``
933       - Level 5.1
934
935
936
937 .. _v4l2-mpeg-video-mpeg4-level:
938
939 ``V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL``
940     (enum)
941
942 enum v4l2_mpeg_video_mpeg4_level -
943     The level information for the MPEG4 elementary stream. Applicable to
944     the MPEG4 encoder. Possible values are:
945
946
947
948 .. flat-table::
949     :header-rows:  0
950     :stub-columns: 0
951
952     * - ``V4L2_MPEG_VIDEO_MPEG4_LEVEL_0``
953       - Level 0
954     * - ``V4L2_MPEG_VIDEO_MPEG4_LEVEL_0B``
955       - Level 0b
956     * - ``V4L2_MPEG_VIDEO_MPEG4_LEVEL_1``
957       - Level 1
958     * - ``V4L2_MPEG_VIDEO_MPEG4_LEVEL_2``
959       - Level 2
960     * - ``V4L2_MPEG_VIDEO_MPEG4_LEVEL_3``
961       - Level 3
962     * - ``V4L2_MPEG_VIDEO_MPEG4_LEVEL_3B``
963       - Level 3b
964     * - ``V4L2_MPEG_VIDEO_MPEG4_LEVEL_4``
965       - Level 4
966     * - ``V4L2_MPEG_VIDEO_MPEG4_LEVEL_5``
967       - Level 5
968
969
970
971 .. _v4l2-mpeg-video-h264-profile:
972
973 ``V4L2_CID_MPEG_VIDEO_H264_PROFILE``
974     (enum)
975
976 enum v4l2_mpeg_video_h264_profile -
977     The profile information for H264. Applicable to the H264 encoder.
978     Possible values are:
979
980
981
982 .. flat-table::
983     :header-rows:  0
984     :stub-columns: 0
985
986     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE``
987       - Baseline profile
988     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE``
989       - Constrained Baseline profile
990     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_MAIN``
991       - Main profile
992     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED``
993       - Extended profile
994     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH``
995       - High profile
996     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10``
997       - High 10 profile
998     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422``
999       - High 422 profile
1000     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE``
1001       - High 444 Predictive profile
1002     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10_INTRA``
1003       - High 10 Intra profile
1004     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422_INTRA``
1005       - High 422 Intra profile
1006     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_INTRA``
1007       - High 444 Intra profile
1008     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_CAVLC_444_INTRA``
1009       - CAVLC 444 Intra profile
1010     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_BASELINE``
1011       - Scalable Baseline profile
1012     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH``
1013       - Scalable High profile
1014     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH_INTRA``
1015       - Scalable High Intra profile
1016     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_STEREO_HIGH``
1017       - Stereo High profile
1018     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_MULTIVIEW_HIGH``
1019       - Multiview High profile
1020
1021
1022
1023 .. _v4l2-mpeg-video-mpeg4-profile:
1024
1025 ``V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE``
1026     (enum)
1027
1028 enum v4l2_mpeg_video_mpeg4_profile -
1029     The profile information for MPEG4. Applicable to the MPEG4 encoder.
1030     Possible values are:
1031
1032
1033
1034 .. flat-table::
1035     :header-rows:  0
1036     :stub-columns: 0
1037
1038     * - ``V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE``
1039       - Simple profile
1040     * - ``V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE``
1041       - Advanced Simple profile
1042     * - ``V4L2_MPEG_VIDEO_MPEG4_PROFILE_CORE``
1043       - Core profile
1044     * - ``V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE_SCALABLE``
1045       - Simple Scalable profile
1046     * - ``V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY``
1047       -
1048
1049
1050
1051 ``V4L2_CID_MPEG_VIDEO_MAX_REF_PIC (integer)``
1052     The maximum number of reference pictures used for encoding.
1053     Applicable to the encoder.
1054
1055 .. _v4l2-mpeg-video-multi-slice-mode:
1056
1057 ``V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE``
1058     (enum)
1059
1060 enum v4l2_mpeg_video_multi_slice_mode -
1061     Determines how the encoder should handle division of frame into
1062     slices. Applicable to the encoder. Possible values are:
1063
1064
1065
1066 .. tabularcolumns:: |p{8.7cm}|p{8.8cm}|
1067
1068 .. flat-table::
1069     :header-rows:  0
1070     :stub-columns: 0
1071
1072     * - ``V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE``
1073       - Single slice per frame.
1074     * - ``V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_MB``
1075       - Multiple slices with set maximum number of macroblocks per slice.
1076     * - ``V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES``
1077       - Multiple slice with set maximum size in bytes per slice.
1078
1079
1080
1081 ``V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB (integer)``
1082     The maximum number of macroblocks in a slice. Used when
1083     ``V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE`` is set to
1084     ``V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_MB``. Applicable to the
1085     encoder.
1086
1087 ``V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES (integer)``
1088     The maximum size of a slice in bytes. Used when
1089     ``V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE`` is set to
1090     ``V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES``. Applicable to the
1091     encoder.
1092
1093 .. _v4l2-mpeg-video-h264-loop-filter-mode:
1094
1095 ``V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE``
1096     (enum)
1097
1098 enum v4l2_mpeg_video_h264_loop_filter_mode -
1099     Loop filter mode for H264 encoder. Possible values are:
1100
1101
1102
1103 .. tabularcolumns:: |p{14.0cm}|p{3.5cm}|
1104
1105 .. flat-table::
1106     :header-rows:  0
1107     :stub-columns: 0
1108
1109     * - ``V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED``
1110       - Loop filter is enabled.
1111     * - ``V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED``
1112       - Loop filter is disabled.
1113     * - ``V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY``
1114       - Loop filter is disabled at the slice boundary.
1115
1116
1117
1118 ``V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA (integer)``
1119     Loop filter alpha coefficient, defined in the H264 standard.
1120     This value corresponds to the slice_alpha_c0_offset_div2 slice header
1121     field, and should be in the range of -6 to +6, inclusive. The actual alpha
1122     offset FilterOffsetA is twice this value.
1123     Applicable to the H264 encoder.
1124
1125 ``V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA (integer)``
1126     Loop filter beta coefficient, defined in the H264 standard.
1127     This corresponds to the slice_beta_offset_div2 slice header field, and
1128     should be in the range of -6 to +6, inclusive. The actual beta offset
1129     FilterOffsetB is twice this value.
1130     Applicable to the H264 encoder.
1131
1132 .. _v4l2-mpeg-video-h264-entropy-mode:
1133
1134 ``V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE``
1135     (enum)
1136
1137 enum v4l2_mpeg_video_h264_entropy_mode -
1138     Entropy coding mode for H264 - CABAC/CAVALC. Applicable to the H264
1139     encoder. Possible values are:
1140
1141
1142
1143 .. flat-table::
1144     :header-rows:  0
1145     :stub-columns: 0
1146
1147     * - ``V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC``
1148       - Use CAVLC entropy coding.
1149     * - ``V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC``
1150       - Use CABAC entropy coding.
1151
1152
1153
1154 ``V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM (boolean)``
1155     Enable 8X8 transform for H264. Applicable to the H264 encoder.
1156
1157 ``V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB (integer)``
1158     Cyclic intra macroblock refresh. This is the number of continuous
1159     macroblocks refreshed every frame. Each frame a successive set of
1160     macroblocks is refreshed until the cycle completes and starts from
1161     the top of the frame. Applicable to H264, H263 and MPEG4 encoder.
1162
1163 ``V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE (boolean)``
1164     Frame level rate control enable. If this control is disabled then
1165     the quantization parameter for each frame type is constant and set
1166     with appropriate controls (e.g.
1167     ``V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP``). If frame rate control is
1168     enabled then quantization parameter is adjusted to meet the chosen
1169     bitrate. Minimum and maximum value for the quantization parameter
1170     can be set with appropriate controls (e.g.
1171     ``V4L2_CID_MPEG_VIDEO_H263_MIN_QP``). Applicable to encoders.
1172
1173 ``V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE (boolean)``
1174     Macroblock level rate control enable. Applicable to the MPEG4 and
1175     H264 encoders.
1176
1177 ``V4L2_CID_MPEG_VIDEO_MPEG4_QPEL (boolean)``
1178     Quarter pixel motion estimation for MPEG4. Applicable to the MPEG4
1179     encoder.
1180
1181 ``V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (integer)``
1182     Quantization parameter for an I frame for H263. Valid range: from 1
1183     to 31.
1184
1185 ``V4L2_CID_MPEG_VIDEO_H263_MIN_QP (integer)``
1186     Minimum quantization parameter for H263. Valid range: from 1 to 31.
1187
1188 ``V4L2_CID_MPEG_VIDEO_H263_MAX_QP (integer)``
1189     Maximum quantization parameter for H263. Valid range: from 1 to 31.
1190
1191 ``V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (integer)``
1192     Quantization parameter for an P frame for H263. Valid range: from 1
1193     to 31.
1194
1195 ``V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP (integer)``
1196     Quantization parameter for an B frame for H263. Valid range: from 1
1197     to 31.
1198
1199 ``V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP (integer)``
1200     Quantization parameter for an I frame for H264. Valid range: from 0
1201     to 51.
1202
1203 ``V4L2_CID_MPEG_VIDEO_H264_MIN_QP (integer)``
1204     Minimum quantization parameter for H264. Valid range: from 0 to 51.
1205
1206 ``V4L2_CID_MPEG_VIDEO_H264_MAX_QP (integer)``
1207     Maximum quantization parameter for H264. Valid range: from 0 to 51.
1208
1209 ``V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP (integer)``
1210     Quantization parameter for an P frame for H264. Valid range: from 0
1211     to 51.
1212
1213 ``V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP (integer)``
1214     Quantization parameter for an B frame for H264. Valid range: from 0
1215     to 51.
1216
1217 ``V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (integer)``
1218     Quantization parameter for an I frame for MPEG4. Valid range: from 1
1219     to 31.
1220
1221 ``V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP (integer)``
1222     Minimum quantization parameter for MPEG4. Valid range: from 1 to 31.
1223
1224 ``V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP (integer)``
1225     Maximum quantization parameter for MPEG4. Valid range: from 1 to 31.
1226
1227 ``V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (integer)``
1228     Quantization parameter for an P frame for MPEG4. Valid range: from 1
1229     to 31.
1230
1231 ``V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (integer)``
1232     Quantization parameter for an B frame for MPEG4. Valid range: from 1
1233     to 31.
1234
1235 ``V4L2_CID_MPEG_VIDEO_VBV_SIZE (integer)``
1236     The Video Buffer Verifier size in kilobytes, it is used as a
1237     limitation of frame skip. The VBV is defined in the standard as a
1238     mean to verify that the produced stream will be successfully
1239     decoded. The standard describes it as "Part of a hypothetical
1240     decoder that is conceptually connected to the output of the encoder.
1241     Its purpose is to provide a constraint on the variability of the
1242     data rate that an encoder or editing process may produce.".
1243     Applicable to the MPEG1, MPEG2, MPEG4 encoders.
1244
1245 .. _v4l2-mpeg-video-vbv-delay:
1246
1247 ``V4L2_CID_MPEG_VIDEO_VBV_DELAY (integer)``
1248     Sets the initial delay in milliseconds for VBV buffer control.
1249
1250 .. _v4l2-mpeg-video-hor-search-range:
1251
1252 ``V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE (integer)``
1253     Horizontal search range defines maximum horizontal search area in
1254     pixels to search and match for the present Macroblock (MB) in the
1255     reference picture. This V4L2 control macro is used to set horizontal
1256     search range for motion estimation module in video encoder.
1257
1258 .. _v4l2-mpeg-video-vert-search-range:
1259
1260 ``V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE (integer)``
1261     Vertical search range defines maximum vertical search area in pixels
1262     to search and match for the present Macroblock (MB) in the reference
1263     picture. This V4L2 control macro is used to set vertical search
1264     range for motion estimation module in video encoder.
1265
1266 .. _v4l2-mpeg-video-force-key-frame:
1267
1268 ``V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME (button)``
1269     Force a key frame for the next queued buffer. Applicable to
1270     encoders. This is a general, codec-agnostic keyframe control.
1271
1272 ``V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE (integer)``
1273     The Coded Picture Buffer size in kilobytes, it is used as a
1274     limitation of frame skip. The CPB is defined in the H264 standard as
1275     a mean to verify that the produced stream will be successfully
1276     decoded. Applicable to the H264 encoder.
1277
1278 ``V4L2_CID_MPEG_VIDEO_H264_I_PERIOD (integer)``
1279     Period between I-frames in the open GOP for H264. In case of an open
1280     GOP this is the period between two I-frames. The period between IDR
1281     (Instantaneous Decoding Refresh) frames is taken from the GOP_SIZE
1282     control. An IDR frame, which stands for Instantaneous Decoding
1283     Refresh is an I-frame after which no prior frames are referenced.
1284     This means that a stream can be restarted from an IDR frame without
1285     the need to store or decode any previous frames. Applicable to the
1286     H264 encoder.
1287
1288 .. _v4l2-mpeg-video-header-mode:
1289
1290 ``V4L2_CID_MPEG_VIDEO_HEADER_MODE``
1291     (enum)
1292
1293 enum v4l2_mpeg_video_header_mode -
1294     Determines whether the header is returned as the first buffer or is
1295     it returned together with the first frame. Applicable to encoders.
1296     Possible values are:
1297
1298
1299
1300 .. tabularcolumns:: |p{10.3cm}|p{7.2cm}|
1301
1302 .. flat-table::
1303     :header-rows:  0
1304     :stub-columns: 0
1305
1306     * - ``V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE``
1307       - The stream header is returned separately in the first buffer.
1308     * - ``V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME``
1309       - The stream header is returned together with the first encoded
1310         frame.
1311
1312
1313
1314 ``V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER (boolean)``
1315     Repeat the video sequence headers. Repeating these headers makes
1316     random access to the video stream easier. Applicable to the MPEG1, 2
1317     and 4 encoder.
1318
1319 ``V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER (boolean)``
1320     Enabled the deblocking post processing filter for MPEG4 decoder.
1321     Applicable to the MPEG4 decoder.
1322
1323 ``V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_RES (integer)``
1324     vop_time_increment_resolution value for MPEG4. Applicable to the
1325     MPEG4 encoder.
1326
1327 ``V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_INC (integer)``
1328     vop_time_increment value for MPEG4. Applicable to the MPEG4
1329     encoder.
1330
1331 ``V4L2_CID_MPEG_VIDEO_H264_SEI_FRAME_PACKING (boolean)``
1332     Enable generation of frame packing supplemental enhancement
1333     information in the encoded bitstream. The frame packing SEI message
1334     contains the arrangement of L and R planes for 3D viewing.
1335     Applicable to the H264 encoder.
1336
1337 ``V4L2_CID_MPEG_VIDEO_H264_SEI_FP_CURRENT_FRAME_0 (boolean)``
1338     Sets current frame as frame0 in frame packing SEI. Applicable to the
1339     H264 encoder.
1340
1341 .. _v4l2-mpeg-video-h264-sei-fp-arrangement-type:
1342
1343 ``V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE``
1344     (enum)
1345
1346 enum v4l2_mpeg_video_h264_sei_fp_arrangement_type -
1347     Frame packing arrangement type for H264 SEI. Applicable to the H264
1348     encoder. Possible values are:
1349
1350 .. tabularcolumns:: |p{12cm}|p{5.5cm}|
1351
1352 .. flat-table::
1353     :header-rows:  0
1354     :stub-columns: 0
1355
1356     * - ``V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_CHEKERBOARD``
1357       - Pixels are alternatively from L and R.
1358     * - ``V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_COLUMN``
1359       - L and R are interlaced by column.
1360     * - ``V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_ROW``
1361       - L and R are interlaced by row.
1362     * - ``V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_SIDE_BY_SIDE``
1363       - L is on the left, R on the right.
1364     * - ``V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TOP_BOTTOM``
1365       - L is on top, R on bottom.
1366     * - ``V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TEMPORAL``
1367       - One view per frame.
1368
1369
1370
1371 ``V4L2_CID_MPEG_VIDEO_H264_FMO (boolean)``
1372     Enables flexible macroblock ordering in the encoded bitstream. It is
1373     a technique used for restructuring the ordering of macroblocks in
1374     pictures. Applicable to the H264 encoder.
1375
1376 .. _v4l2-mpeg-video-h264-fmo-map-type:
1377
1378 ``V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE``
1379    (enum)
1380
1381 enum v4l2_mpeg_video_h264_fmo_map_type -
1382     When using FMO, the map type divides the image in different scan
1383     patterns of macroblocks. Applicable to the H264 encoder. Possible
1384     values are:
1385
1386 .. tabularcolumns:: |p{12.5cm}|p{5.0cm}|
1387
1388 .. flat-table::
1389     :header-rows:  0
1390     :stub-columns: 0
1391
1392     * - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_INTERLEAVED_SLICES``
1393       - Slices are interleaved one after other with macroblocks in run
1394         length order.
1395     * - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_SCATTERED_SLICES``
1396       - Scatters the macroblocks based on a mathematical function known to
1397         both encoder and decoder.
1398     * - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_FOREGROUND_WITH_LEFT_OVER``
1399       - Macroblocks arranged in rectangular areas or regions of interest.
1400     * - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_BOX_OUT``
1401       - Slice groups grow in a cyclic way from centre to outwards.
1402     * - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_RASTER_SCAN``
1403       - Slice groups grow in raster scan pattern from left to right.
1404     * - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_WIPE_SCAN``
1405       - Slice groups grow in wipe scan pattern from top to bottom.
1406     * - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_EXPLICIT``
1407       - User defined map type.
1408
1409
1410
1411 ``V4L2_CID_MPEG_VIDEO_H264_FMO_SLICE_GROUP (integer)``
1412     Number of slice groups in FMO. Applicable to the H264 encoder.
1413
1414 .. _v4l2-mpeg-video-h264-fmo-change-direction:
1415
1416 ``V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_DIRECTION``
1417     (enum)
1418
1419 enum v4l2_mpeg_video_h264_fmo_change_dir -
1420     Specifies a direction of the slice group change for raster and wipe
1421     maps. Applicable to the H264 encoder. Possible values are:
1422
1423
1424
1425 .. flat-table::
1426     :header-rows:  0
1427     :stub-columns: 0
1428
1429     * - ``V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_RIGHT``
1430       - Raster scan or wipe right.
1431     * - ``V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_LEFT``
1432       - Reverse raster scan or wipe left.
1433
1434
1435
1436 ``V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_RATE (integer)``
1437     Specifies the size of the first slice group for raster and wipe map.
1438     Applicable to the H264 encoder.
1439
1440 ``V4L2_CID_MPEG_VIDEO_H264_FMO_RUN_LENGTH (integer)``
1441     Specifies the number of consecutive macroblocks for the interleaved
1442     map. Applicable to the H264 encoder.
1443
1444 ``V4L2_CID_MPEG_VIDEO_H264_ASO (boolean)``
1445     Enables arbitrary slice ordering in encoded bitstream. Applicable to
1446     the H264 encoder.
1447
1448 ``V4L2_CID_MPEG_VIDEO_H264_ASO_SLICE_ORDER (integer)``
1449     Specifies the slice order in ASO. Applicable to the H264 encoder.
1450     The supplied 32-bit integer is interpreted as follows (bit 0 = least
1451     significant bit):
1452
1453
1454
1455 .. flat-table::
1456     :header-rows:  0
1457     :stub-columns: 0
1458
1459     * - Bit 0:15
1460       - Slice ID
1461     * - Bit 16:32
1462       - Slice position or order
1463
1464
1465
1466 ``V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING (boolean)``
1467     Enables H264 hierarchical coding. Applicable to the H264 encoder.
1468
1469 .. _v4l2-mpeg-video-h264-hierarchical-coding-type:
1470
1471 ``V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE``
1472     (enum)
1473
1474 enum v4l2_mpeg_video_h264_hierarchical_coding_type -
1475     Specifies the hierarchical coding type. Applicable to the H264
1476     encoder. Possible values are:
1477
1478
1479
1480 .. flat-table::
1481     :header-rows:  0
1482     :stub-columns: 0
1483
1484     * - ``V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_B``
1485       - Hierarchical B coding.
1486     * - ``V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_P``
1487       - Hierarchical P coding.
1488
1489
1490
1491 ``V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER (integer)``
1492     Specifies the number of hierarchical coding layers. Applicable to
1493     the H264 encoder.
1494
1495 ``V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP (integer)``
1496     Specifies a user defined QP for each layer. Applicable to the H264
1497     encoder. The supplied 32-bit integer is interpreted as follows (bit
1498     0 = least significant bit):
1499
1500
1501
1502 .. flat-table::
1503     :header-rows:  0
1504     :stub-columns: 0
1505
1506     * - Bit 0:15
1507       - QP value
1508     * - Bit 16:32
1509       - Layer number
1510
1511
1512
1513 .. _v4l2-mpeg-mpeg2:
1514
1515 ``V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS (struct)``
1516     Specifies the slice parameters (as extracted from the bitstream) for the
1517     associated MPEG-2 slice data. This includes the necessary parameters for
1518     configuring a stateless hardware decoding pipeline for MPEG-2.
1519     The bitstream parameters are defined according to :ref:`mpeg2part2`.
1520
1521     .. note::
1522
1523        This compound control is not yet part of the public kernel API and
1524        it is expected to change.
1525
1526 .. c:type:: v4l2_ctrl_mpeg2_slice_params
1527
1528 .. cssclass:: longtable
1529
1530 .. flat-table:: struct v4l2_ctrl_mpeg2_slice_params
1531     :header-rows:  0
1532     :stub-columns: 0
1533     :widths:       1 1 2
1534
1535     * - __u32
1536       - ``bit_size``
1537       - Size (in bits) of the current slice data.
1538     * - __u32
1539       - ``data_bit_offset``
1540       - Offset (in bits) to the video data in the current slice data.
1541     * - struct :c:type:`v4l2_mpeg2_sequence`
1542       - ``sequence``
1543       - Structure with MPEG-2 sequence metadata, merging relevant fields from
1544         the sequence header and sequence extension parts of the bitstream.
1545     * - struct :c:type:`v4l2_mpeg2_picture`
1546       - ``picture``
1547       - Structure with MPEG-2 picture metadata, merging relevant fields from
1548         the picture header and picture coding extension parts of the bitstream.
1549     * - __u8
1550       - ``quantiser_scale_code``
1551       - Code used to determine the quantization scale to use for the IDCT.
1552     * - __u8
1553       - ``backward_ref_index``
1554       - Index for the V4L2 buffer to use as backward reference, used with
1555         B-coded and P-coded frames.
1556     * - __u8
1557       - ``forward_ref_index``
1558       - Index for the V4L2 buffer to use as forward reference, used with
1559         B-coded frames.
1560
1561 .. c:type:: v4l2_mpeg2_sequence
1562
1563 .. cssclass:: longtable
1564
1565 .. flat-table:: struct v4l2_mpeg2_sequence
1566     :header-rows:  0
1567     :stub-columns: 0
1568     :widths:       1 1 2
1569
1570     * - __u16
1571       - ``horizontal_size``
1572       - The width of the displayable part of the frame's luminance component.
1573     * - __u16
1574       - ``vertical_size``
1575       - The height of the displayable part of the frame's luminance component.
1576     * - __u32
1577       - ``vbv_buffer_size``
1578       - Used to calculate the required size of the video buffering verifier,
1579         defined (in bits) as: 16 * 1024 * vbv_buffer_size.
1580     * - __u8
1581       - ``profile_and_level_indication``
1582       - The current profile and level indication as extracted from the
1583         bitstream.
1584     * - __u8
1585       - ``progressive_sequence``
1586       - Indication that all the frames for the sequence are progressive instead
1587         of interlaced.
1588     * - __u8
1589       - ``chroma_format``
1590       - The chrominance sub-sampling format (1: 4:2:0, 2: 4:2:2, 3: 4:4:4).
1591
1592 .. c:type:: v4l2_mpeg2_picture
1593
1594 .. cssclass:: longtable
1595
1596 .. flat-table:: struct v4l2_mpeg2_picture
1597     :header-rows:  0
1598     :stub-columns: 0
1599     :widths:       1 1 2
1600
1601     * - __u8
1602       - ``picture_coding_type``
1603       - Picture coding type for the frame covered by the current slice
1604         (V4L2_MPEG2_PICTURE_CODING_TYPE_I, V4L2_MPEG2_PICTURE_CODING_TYPE_P or
1605         V4L2_MPEG2_PICTURE_CODING_TYPE_B).
1606     * - __u8
1607       - ``f_code[2][2]``
1608       - Motion vector codes.
1609     * - __u8
1610       - ``intra_dc_precision``
1611       - Precision of Discrete Cosine transform (0: 8 bits precision,
1612         1: 9 bits precision, 2: 10 bits precision, 3: 11 bits precision).
1613     * - __u8
1614       - ``picture_structure``
1615       - Picture structure (1: interlaced top field, 2: interlaced bottom field,
1616         3: progressive frame).
1617     * - __u8
1618       - ``top_field_first``
1619       - If set to 1 and interlaced stream, top field is output first.
1620     * - __u8
1621       - ``frame_pred_frame_dct``
1622       - If set to 1, only frame-DCT and frame prediction are used.
1623     * - __u8
1624       - ``concealment_motion_vectors``
1625       -  If set to 1, motion vectors are coded for intra macroblocks.
1626     * - __u8
1627       - ``q_scale_type``
1628       - This flag affects the inverse quantization process.
1629     * - __u8
1630       - ``intra_vlc_format``
1631       - This flag affects the decoding of transform coefficient data.
1632     * - __u8
1633       - ``alternate_scan``
1634       - This flag affects the decoding of transform coefficient data.
1635     * - __u8
1636       - ``repeat_first_field``
1637       - This flag affects the decoding process of progressive frames.
1638     * - __u8
1639       - ``progressive_frame``
1640       - Indicates whether the current frame is progressive.
1641
1642 ``V4L2_CID_MPEG_VIDEO_MPEG2_QUANTIZATION (struct)``
1643     Specifies quantization matrices (as extracted from the bitstream) for the
1644     associated MPEG-2 slice data.
1645
1646     .. note::
1647
1648        This compound control is not yet part of the public kernel API and
1649        it is expected to change.
1650
1651 .. c:type:: v4l2_ctrl_mpeg2_quantization
1652
1653 .. cssclass:: longtable
1654
1655 .. flat-table:: struct v4l2_ctrl_mpeg2_quantization
1656     :header-rows:  0
1657     :stub-columns: 0
1658     :widths:       1 1 2
1659
1660     * - __u8
1661       - ``load_intra_quantiser_matrix``
1662       - One bit to indicate whether to load the ``intra_quantiser_matrix`` data.
1663     * - __u8
1664       - ``load_non_intra_quantiser_matrix``
1665       - One bit to indicate whether to load the ``non_intra_quantiser_matrix``
1666         data.
1667     * - __u8
1668       - ``load_chroma_intra_quantiser_matrix``
1669       - One bit to indicate whether to load the
1670         ``chroma_intra_quantiser_matrix`` data, only relevant for non-4:2:0 YUV
1671         formats.
1672     * - __u8
1673       - ``load_chroma_non_intra_quantiser_matrix``
1674       - One bit to indicate whether to load the
1675         ``chroma_non_intra_quantiser_matrix`` data, only relevant for non-4:2:0
1676         YUV formats.
1677     * - __u8
1678       - ``intra_quantiser_matrix[64]``
1679       - The quantization matrix coefficients for intra-coded frames, in zigzag
1680         scanning order. It is relevant for both luma and chroma components,
1681         although it can be superseded by the chroma-specific matrix for
1682         non-4:2:0 YUV formats.
1683     * - __u8
1684       - ``non_intra_quantiser_matrix[64]``
1685       - The quantization matrix coefficients for non-intra-coded frames, in
1686         zigzag scanning order. It is relevant for both luma and chroma
1687         components, although it can be superseded by the chroma-specific matrix
1688         for non-4:2:0 YUV formats.
1689     * - __u8
1690       - ``chroma_intra_quantiser_matrix[64]``
1691       - The quantization matrix coefficients for the chominance component of
1692         intra-coded frames, in zigzag scanning order. Only relevant for
1693         non-4:2:0 YUV formats.
1694     * - __u8
1695       - ``chroma_non_intra_quantiser_matrix[64]``
1696       - The quantization matrix coefficients for the chrominance component of
1697         non-intra-coded frames, in zigzag scanning order. Only relevant for
1698         non-4:2:0 YUV formats.
1699
1700 MFC 5.1 MPEG Controls
1701 ---------------------
1702
1703 The following MPEG class controls deal with MPEG decoding and encoding
1704 settings that are specific to the Multi Format Codec 5.1 device present
1705 in the S5P family of SoCs by Samsung.
1706
1707
1708 .. _mfc51-control-id:
1709
1710 MFC 5.1 Control IDs
1711 ^^^^^^^^^^^^^^^^^^^
1712
1713 ``V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE (boolean)``
1714     If the display delay is enabled then the decoder is forced to return
1715     a CAPTURE buffer (decoded frame) after processing a certain number
1716     of OUTPUT buffers. The delay can be set through
1717     ``V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY``. This
1718     feature can be used for example for generating thumbnails of videos.
1719     Applicable to the H264 decoder.
1720
1721 ``V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY (integer)``
1722     Display delay value for H264 decoder. The decoder is forced to
1723     return a decoded frame after the set 'display delay' number of
1724     frames. If this number is low it may result in frames returned out
1725     of dispaly order, in addition the hardware may still be using the
1726     returned buffer as a reference picture for subsequent frames.
1727
1728 ``V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P (integer)``
1729     The number of reference pictures used for encoding a P picture.
1730     Applicable to the H264 encoder.
1731
1732 ``V4L2_CID_MPEG_MFC51_VIDEO_PADDING (boolean)``
1733     Padding enable in the encoder - use a color instead of repeating
1734     border pixels. Applicable to encoders.
1735
1736 ``V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV (integer)``
1737     Padding color in the encoder. Applicable to encoders. The supplied
1738     32-bit integer is interpreted as follows (bit 0 = least significant
1739     bit):
1740
1741
1742
1743 .. flat-table::
1744     :header-rows:  0
1745     :stub-columns: 0
1746
1747     * - Bit 0:7
1748       - V chrominance information
1749     * - Bit 8:15
1750       - U chrominance information
1751     * - Bit 16:23
1752       - Y luminance information
1753     * - Bit 24:31
1754       - Must be zero.
1755
1756
1757
1758 ``V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF (integer)``
1759     Reaction coefficient for MFC rate control. Applicable to encoders.
1760
1761     .. note::
1762
1763        #. Valid only when the frame level RC is enabled.
1764
1765        #. For tight CBR, this field must be small (ex. 2 ~ 10). For
1766           VBR, this field must be large (ex. 100 ~ 1000).
1767
1768        #. It is not recommended to use the greater number than
1769           FRAME_RATE * (10^9 / BIT_RATE).
1770
1771 ``V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK (boolean)``
1772     Adaptive rate control for dark region. Valid only when H.264 and
1773     macroblock level RC is enabled
1774     (``V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE``). Applicable to the H264
1775     encoder.
1776
1777 ``V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH (boolean)``
1778     Adaptive rate control for smooth region. Valid only when H.264 and
1779     macroblock level RC is enabled
1780     (``V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE``). Applicable to the H264
1781     encoder.
1782
1783 ``V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC (boolean)``
1784     Adaptive rate control for static region. Valid only when H.264 and
1785     macroblock level RC is enabled
1786     (``V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE``). Applicable to the H264
1787     encoder.
1788
1789 ``V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY (boolean)``
1790     Adaptive rate control for activity region. Valid only when H.264 and
1791     macroblock level RC is enabled
1792     (``V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE``). Applicable to the H264
1793     encoder.
1794
1795 .. _v4l2-mpeg-mfc51-video-frame-skip-mode:
1796
1797 ``V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE``
1798     (enum)
1799
1800 enum v4l2_mpeg_mfc51_video_frame_skip_mode -
1801     Indicates in what conditions the encoder should skip frames. If
1802     encoding a frame would cause the encoded stream to be larger then a
1803     chosen data limit then the frame will be skipped. Possible values
1804     are:
1805
1806
1807 .. tabularcolumns:: |p{9.0cm}|p{8.5cm}|
1808
1809 .. flat-table::
1810     :header-rows:  0
1811     :stub-columns: 0
1812
1813     * - ``V4L2_MPEG_MFC51_FRAME_SKIP_MODE_DISABLED``
1814       - Frame skip mode is disabled.
1815     * - ``V4L2_MPEG_MFC51_FRAME_SKIP_MODE_LEVEL_LIMIT``
1816       - Frame skip mode enabled and buffer limit is set by the chosen
1817         level and is defined by the standard.
1818     * - ``V4L2_MPEG_MFC51_FRAME_SKIP_MODE_BUF_LIMIT``
1819       - Frame skip mode enabled and buffer limit is set by the VBV
1820         (MPEG1/2/4) or CPB (H264) buffer size control.
1821
1822
1823
1824 ``V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT (integer)``
1825     Enable rate-control with fixed target bit. If this setting is
1826     enabled, then the rate control logic of the encoder will calculate
1827     the average bitrate for a GOP and keep it below or equal the set
1828     bitrate target. Otherwise the rate control logic calculates the
1829     overall average bitrate for the stream and keeps it below or equal
1830     to the set bitrate. In the first case the average bitrate for the
1831     whole stream will be smaller then the set bitrate. This is caused
1832     because the average is calculated for smaller number of frames, on
1833     the other hand enabling this setting will ensure that the stream
1834     will meet tight bandwidth constraints. Applicable to encoders.
1835
1836 .. _v4l2-mpeg-mfc51-video-force-frame-type:
1837
1838 ``V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE``
1839     (enum)
1840
1841 enum v4l2_mpeg_mfc51_video_force_frame_type -
1842     Force a frame type for the next queued buffer. Applicable to
1843     encoders. Possible values are:
1844
1845
1846
1847 .. flat-table::
1848     :header-rows:  0
1849     :stub-columns: 0
1850
1851     * - ``V4L2_MPEG_MFC51_FORCE_FRAME_TYPE_DISABLED``
1852       - Forcing a specific frame type disabled.
1853     * - ``V4L2_MPEG_MFC51_FORCE_FRAME_TYPE_I_FRAME``
1854       - Force an I-frame.
1855     * - ``V4L2_MPEG_MFC51_FORCE_FRAME_TYPE_NOT_CODED``
1856       - Force a non-coded frame.
1857
1858
1859
1860
1861 CX2341x MPEG Controls
1862 ---------------------
1863
1864 The following MPEG class controls deal with MPEG encoding settings that
1865 are specific to the Conexant CX23415 and CX23416 MPEG encoding chips.
1866
1867
1868 .. _cx2341x-control-id:
1869
1870 CX2341x Control IDs
1871 ^^^^^^^^^^^^^^^^^^^
1872
1873 .. _v4l2-mpeg-cx2341x-video-spatial-filter-mode:
1874
1875 ``V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE``
1876     (enum)
1877
1878 enum v4l2_mpeg_cx2341x_video_spatial_filter_mode -
1879     Sets the Spatial Filter mode (default ``MANUAL``). Possible values
1880     are:
1881
1882
1883
1884 .. flat-table::
1885     :header-rows:  0
1886     :stub-columns: 0
1887
1888     * - ``V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL``
1889       - Choose the filter manually
1890     * - ``V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO``
1891       - Choose the filter automatically
1892
1893
1894
1895 ``V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER (integer (0-15))``
1896     The setting for the Spatial Filter. 0 = off, 15 = maximum. (Default
1897     is 0.)
1898
1899 .. _luma-spatial-filter-type:
1900
1901 ``V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE``
1902     (enum)
1903
1904 enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type -
1905     Select the algorithm to use for the Luma Spatial Filter (default
1906     ``1D_HOR``). Possible values:
1907
1908
1909
1910 .. tabularcolumns:: |p{14.5cm}|p{3.0cm}|
1911
1912 .. flat-table::
1913     :header-rows:  0
1914     :stub-columns: 0
1915
1916     * - ``V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF``
1917       - No filter
1918     * - ``V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR``
1919       - One-dimensional horizontal
1920     * - ``V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT``
1921       - One-dimensional vertical
1922     * - ``V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE``
1923       - Two-dimensional separable
1924     * - ``V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE``
1925       - Two-dimensional symmetrical non-separable
1926
1927
1928
1929 .. _chroma-spatial-filter-type:
1930
1931 ``V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE``
1932     (enum)
1933
1934 enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type -
1935     Select the algorithm for the Chroma Spatial Filter (default
1936     ``1D_HOR``). Possible values are:
1937
1938
1939
1940 .. flat-table::
1941     :header-rows:  0
1942     :stub-columns: 0
1943
1944     * - ``V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF``
1945       - No filter
1946     * - ``V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR``
1947       - One-dimensional horizontal
1948
1949
1950
1951 .. _v4l2-mpeg-cx2341x-video-temporal-filter-mode:
1952
1953 ``V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE``
1954     (enum)
1955
1956 enum v4l2_mpeg_cx2341x_video_temporal_filter_mode -
1957     Sets the Temporal Filter mode (default ``MANUAL``). Possible values
1958     are:
1959
1960
1961
1962 .. flat-table::
1963     :header-rows:  0
1964     :stub-columns: 0
1965
1966     * - ``V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL``
1967       - Choose the filter manually
1968     * - ``V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO``
1969       - Choose the filter automatically
1970
1971
1972
1973 ``V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER (integer (0-31))``
1974     The setting for the Temporal Filter. 0 = off, 31 = maximum. (Default
1975     is 8 for full-scale capturing and 0 for scaled capturing.)
1976
1977 .. _v4l2-mpeg-cx2341x-video-median-filter-type:
1978
1979 ``V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE``
1980     (enum)
1981
1982 enum v4l2_mpeg_cx2341x_video_median_filter_type -
1983     Median Filter Type (default ``OFF``). Possible values are:
1984
1985
1986
1987 .. flat-table::
1988     :header-rows:  0
1989     :stub-columns: 0
1990
1991     * - ``V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF``
1992       - No filter
1993     * - ``V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR``
1994       - Horizontal filter
1995     * - ``V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT``
1996       - Vertical filter
1997     * - ``V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT``
1998       - Horizontal and vertical filter
1999     * - ``V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG``
2000       - Diagonal filter
2001
2002
2003
2004 ``V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM (integer (0-255))``
2005     Threshold above which the luminance median filter is enabled
2006     (default 0)
2007
2008 ``V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (integer (0-255))``
2009     Threshold below which the luminance median filter is enabled
2010     (default 255)
2011
2012 ``V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (integer (0-255))``
2013     Threshold above which the chroma median filter is enabled (default
2014     0)
2015
2016 ``V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (integer (0-255))``
2017     Threshold below which the chroma median filter is enabled (default
2018     255)
2019
2020 ``V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (boolean)``
2021     The CX2341X MPEG encoder can insert one empty MPEG-2 PES packet into
2022     the stream between every four video frames. The packet size is 2048
2023     bytes, including the packet_start_code_prefix and stream_id
2024     fields. The stream_id is 0xBF (private stream 2). The payload
2025     consists of 0x00 bytes, to be filled in by the application. 0 = do
2026     not insert, 1 = insert packets.
2027
2028
2029 VPX Control Reference
2030 ---------------------
2031
2032 The VPX controls include controls for encoding parameters of VPx video
2033 codec.
2034
2035
2036 .. _vpx-control-id:
2037
2038 VPX Control IDs
2039 ^^^^^^^^^^^^^^^
2040
2041 .. _v4l2-vpx-num-partitions:
2042
2043 ``V4L2_CID_MPEG_VIDEO_VPX_NUM_PARTITIONS``
2044     (enum)
2045
2046 enum v4l2_vp8_num_partitions -
2047     The number of token partitions to use in VP8 encoder. Possible
2048     values are:
2049
2050
2051
2052 .. flat-table::
2053     :header-rows:  0
2054     :stub-columns: 0
2055
2056     * - ``V4L2_CID_MPEG_VIDEO_VPX_1_PARTITION``
2057       - 1 coefficient partition
2058     * - ``V4L2_CID_MPEG_VIDEO_VPX_2_PARTITIONS``
2059       - 2 coefficient partitions
2060     * - ``V4L2_CID_MPEG_VIDEO_VPX_4_PARTITIONS``
2061       - 4 coefficient partitions
2062     * - ``V4L2_CID_MPEG_VIDEO_VPX_8_PARTITIONS``
2063       - 8 coefficient partitions
2064
2065
2066
2067 ``V4L2_CID_MPEG_VIDEO_VPX_IMD_DISABLE_4X4 (boolean)``
2068     Setting this prevents intra 4x4 mode in the intra mode decision.
2069
2070 .. _v4l2-vpx-num-ref-frames:
2071
2072 ``V4L2_CID_MPEG_VIDEO_VPX_NUM_REF_FRAMES``
2073     (enum)
2074
2075 enum v4l2_vp8_num_ref_frames -
2076     The number of reference pictures for encoding P frames. Possible
2077     values are:
2078
2079 .. tabularcolumns:: |p{7.9cm}|p{9.6cm}|
2080
2081 .. flat-table::
2082     :header-rows:  0
2083     :stub-columns: 0
2084
2085     * - ``V4L2_CID_MPEG_VIDEO_VPX_1_REF_FRAME``
2086       - Last encoded frame will be searched
2087     * - ``V4L2_CID_MPEG_VIDEO_VPX_2_REF_FRAME``
2088       - Two frames will be searched among the last encoded frame, the
2089         golden frame and the alternate reference (altref) frame. The
2090         encoder implementation will decide which two are chosen.
2091     * - ``V4L2_CID_MPEG_VIDEO_VPX_3_REF_FRAME``
2092       - The last encoded frame, the golden frame and the altref frame will
2093         be searched.
2094
2095
2096
2097 ``V4L2_CID_MPEG_VIDEO_VPX_FILTER_LEVEL (integer)``
2098     Indicates the loop filter level. The adjustment of the loop filter
2099     level is done via a delta value against a baseline loop filter
2100     value.
2101
2102 ``V4L2_CID_MPEG_VIDEO_VPX_FILTER_SHARPNESS (integer)``
2103     This parameter affects the loop filter. Anything above zero weakens
2104     the deblocking effect on the loop filter.
2105
2106 ``V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_REF_PERIOD (integer)``
2107     Sets the refresh period for the golden frame. The period is defined
2108     in number of frames. For a value of 'n', every nth frame starting
2109     from the first key frame will be taken as a golden frame. For eg.
2110     for encoding sequence of 0, 1, 2, 3, 4, 5, 6, 7 where the golden
2111     frame refresh period is set as 4, the frames 0, 4, 8 etc will be
2112     taken as the golden frames as frame 0 is always a key frame.
2113
2114 .. _v4l2-vpx-golden-frame-sel:
2115
2116 ``V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_SEL``
2117     (enum)
2118
2119 enum v4l2_vp8_golden_frame_sel -
2120     Selects the golden frame for encoding. Possible values are:
2121
2122 .. raw:: latex
2123
2124     \footnotesize
2125
2126 .. tabularcolumns:: |p{9.0cm}|p{8.0cm}|
2127
2128 .. flat-table::
2129     :header-rows:  0
2130     :stub-columns: 0
2131
2132     * - ``V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_PREV``
2133       - Use the (n-2)th frame as a golden frame, current frame index being
2134         'n'.
2135     * - ``V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_REF_PERIOD``
2136       - Use the previous specific frame indicated by
2137         ``V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_REF_PERIOD`` as a
2138         golden frame.
2139
2140 .. raw:: latex
2141
2142     \normalsize
2143
2144
2145 ``V4L2_CID_MPEG_VIDEO_VPX_MIN_QP (integer)``
2146     Minimum quantization parameter for VP8.
2147
2148 ``V4L2_CID_MPEG_VIDEO_VPX_MAX_QP (integer)``
2149     Maximum quantization parameter for VP8.
2150
2151 ``V4L2_CID_MPEG_VIDEO_VPX_I_FRAME_QP (integer)``
2152     Quantization parameter for an I frame for VP8.
2153
2154 ``V4L2_CID_MPEG_VIDEO_VPX_P_FRAME_QP (integer)``
2155     Quantization parameter for a P frame for VP8.
2156
2157 .. _v4l2-mpeg-video-vp8-profile:
2158
2159 ``V4L2_CID_MPEG_VIDEO_VP8_PROFILE``
2160     (enum)
2161
2162 enum v4l2_mpeg_video_vp8_profile -
2163     This control allows selecting the profile for VP8 encoder.
2164     This is also used to enumerate supported profiles by VP8 encoder or decoder.
2165     Possible values are:
2166
2167 .. flat-table::
2168     :header-rows:  0
2169     :stub-columns: 0
2170
2171     * - ``V4L2_MPEG_VIDEO_VP8_PROFILE_0``
2172       - Profile 0
2173     * - ``V4L2_MPEG_VIDEO_VP8_PROFILE_1``
2174       - Profile 1
2175     * - ``V4L2_MPEG_VIDEO_VP8_PROFILE_2``
2176       - Profile 2
2177     * - ``V4L2_MPEG_VIDEO_VP8_PROFILE_3``
2178       - Profile 3
2179
2180 .. _v4l2-mpeg-video-vp9-profile:
2181
2182 ``V4L2_CID_MPEG_VIDEO_VP9_PROFILE``
2183     (enum)
2184
2185 enum v4l2_mpeg_video_vp9_profile -
2186     This control allows selecting the profile for VP9 encoder.
2187     This is also used to enumerate supported profiles by VP9 encoder or decoder.
2188     Possible values are:
2189
2190 .. flat-table::
2191     :header-rows:  0
2192     :stub-columns: 0
2193
2194     * - ``V4L2_MPEG_VIDEO_VP9_PROFILE_0``
2195       - Profile 0
2196     * - ``V4L2_MPEG_VIDEO_VP9_PROFILE_1``
2197       - Profile 1
2198     * - ``V4L2_MPEG_VIDEO_VP9_PROFILE_2``
2199       - Profile 2
2200     * - ``V4L2_MPEG_VIDEO_VP9_PROFILE_3``
2201       - Profile 3
2202
2203
2204 High Efficiency Video Coding (HEVC/H.265) Control Reference
2205 -----------------------------------------------------------
2206
2207 The HEVC/H.265 controls include controls for encoding parameters of HEVC/H.265
2208 video codec.
2209
2210
2211 .. _hevc-control-id:
2212
2213 HEVC/H.265 Control IDs
2214 ^^^^^^^^^^^^^^^^^^^^^^
2215
2216 ``V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP (integer)``
2217     Minimum quantization parameter for HEVC.
2218     Valid range: from 0 to 51.
2219
2220 ``V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP (integer)``
2221     Maximum quantization parameter for HEVC.
2222     Valid range: from 0 to 51.
2223
2224 ``V4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_QP (integer)``
2225     Quantization parameter for an I frame for HEVC.
2226     Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
2227     V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
2228
2229 ``V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_QP (integer)``
2230     Quantization parameter for a P frame for HEVC.
2231     Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
2232     V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
2233
2234 ``V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP (integer)``
2235     Quantization parameter for a B frame for HEVC.
2236     Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
2237     V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
2238
2239 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_QP (boolean)``
2240     HIERARCHICAL_QP allows the host to specify the quantization parameter
2241     values for each temporal layer through HIERARCHICAL_QP_LAYER. This is
2242     valid only if HIERARCHICAL_CODING_LAYER is greater than 1. Setting the
2243     control value to 1 enables setting of the QP values for the layers.
2244
2245 .. _v4l2-hevc-hier-coding-type:
2246
2247 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_TYPE``
2248     (enum)
2249
2250 enum v4l2_mpeg_video_hevc_hier_coding_type -
2251     Selects the hierarchical coding type for encoding. Possible values are:
2252
2253 .. raw:: latex
2254
2255     \footnotesize
2256
2257 .. tabularcolumns:: |p{9.0cm}|p{8.0cm}|
2258
2259 .. flat-table::
2260     :header-rows:  0
2261     :stub-columns: 0
2262
2263     * - ``V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_B``
2264       - Use the B frame for hierarchical coding.
2265     * - ``V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_P``
2266       - Use the P frame for hierarchical coding.
2267
2268 .. raw:: latex
2269
2270     \normalsize
2271
2272
2273 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER (integer)``
2274     Selects the hierarchical coding layer. In normal encoding
2275     (non-hierarchial coding), it should be zero. Possible values are [0, 6].
2276     0 indicates HIERARCHICAL CODING LAYER 0, 1 indicates HIERARCHICAL CODING
2277     LAYER 1 and so on.
2278
2279 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L0_QP (integer)``
2280     Indicates quantization parameter for hierarchical coding layer 0.
2281     Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
2282     V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
2283
2284 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L1_QP (integer)``
2285     Indicates quantization parameter for hierarchical coding layer 1.
2286     Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
2287     V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
2288
2289 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L2_QP (integer)``
2290     Indicates quantization parameter for hierarchical coding layer 2.
2291     Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
2292     V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
2293
2294 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L3_QP (integer)``
2295     Indicates quantization parameter for hierarchical coding layer 3.
2296     Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
2297     V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
2298
2299 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L4_QP (integer)``
2300     Indicates quantization parameter for hierarchical coding layer 4.
2301     Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
2302     V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
2303
2304 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L5_QP (integer)``
2305     Indicates quantization parameter for hierarchical coding layer 5.
2306     Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
2307     V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
2308
2309 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L6_QP (integer)``
2310     Indicates quantization parameter for hierarchical coding layer 6.
2311     Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
2312     V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
2313
2314 .. _v4l2-hevc-profile:
2315
2316 ``V4L2_CID_MPEG_VIDEO_HEVC_PROFILE``
2317     (enum)
2318
2319 enum v4l2_mpeg_video_hevc_profile -
2320     Select the desired profile for HEVC encoder.
2321
2322 .. raw:: latex
2323
2324     \footnotesize
2325
2326 .. tabularcolumns:: |p{9.0cm}|p{8.0cm}|
2327
2328 .. flat-table::
2329     :header-rows:  0
2330     :stub-columns: 0
2331
2332     * - ``V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN``
2333       - Main profile.
2334     * - ``V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE``
2335       - Main still picture profile.
2336     * - ``V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10``
2337       - Main 10 profile.
2338
2339 .. raw:: latex
2340
2341     \normalsize
2342
2343
2344 .. _v4l2-hevc-level:
2345
2346 ``V4L2_CID_MPEG_VIDEO_HEVC_LEVEL``
2347     (enum)
2348
2349 enum v4l2_mpeg_video_hevc_level -
2350     Selects the desired level for HEVC encoder.
2351
2352 .. raw:: latex
2353
2354     \footnotesize
2355
2356 .. tabularcolumns:: |p{9.0cm}|p{8.0cm}|
2357
2358 .. flat-table::
2359     :header-rows:  0
2360     :stub-columns: 0
2361
2362     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_1``
2363       - Level 1.0
2364     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_2``
2365       - Level 2.0
2366     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_2_1``
2367       - Level 2.1
2368     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_3``
2369       - Level 3.0
2370     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_3_1``
2371       - Level 3.1
2372     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_4``
2373       - Level 4.0
2374     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_4_1``
2375       - Level 4.1
2376     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_5``
2377       - Level 5.0
2378     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_5_1``
2379       - Level 5.1
2380     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_5_2``
2381       - Level 5.2
2382     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_6``
2383       - Level 6.0
2384     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_6_1``
2385       - Level 6.1
2386     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_6_2``
2387       - Level 6.2
2388
2389 .. raw:: latex
2390
2391     \normalsize
2392
2393
2394 ``V4L2_CID_MPEG_VIDEO_HEVC_FRAME_RATE_RESOLUTION (integer)``
2395     Indicates the number of evenly spaced subintervals, called ticks, within
2396     one second. This is a 16 bit unsigned integer and has a maximum value up to
2397     0xffff and a minimum value of 1.
2398
2399 .. _v4l2-hevc-tier:
2400
2401 ``V4L2_CID_MPEG_VIDEO_HEVC_TIER``
2402     (enum)
2403
2404 enum v4l2_mpeg_video_hevc_tier -
2405     TIER_FLAG specifies tiers information of the HEVC encoded picture. Tier
2406     were made to deal with applications that differ in terms of maximum bit
2407     rate. Setting the flag to 0 selects HEVC tier as Main tier and setting
2408     this flag to 1 indicates High tier. High tier is for applications requiring
2409     high bit rates.
2410
2411 .. raw:: latex
2412
2413     \footnotesize
2414
2415 .. tabularcolumns:: |p{9.0cm}|p{8.0cm}|
2416
2417 .. flat-table::
2418     :header-rows:  0
2419     :stub-columns: 0
2420
2421     * - ``V4L2_MPEG_VIDEO_HEVC_TIER_MAIN``
2422       - Main tier.
2423     * - ``V4L2_MPEG_VIDEO_HEVC_TIER_HIGH``
2424       - High tier.
2425
2426 .. raw:: latex
2427
2428     \normalsize
2429
2430
2431 ``V4L2_CID_MPEG_VIDEO_HEVC_MAX_PARTITION_DEPTH (integer)``
2432     Selects HEVC maximum coding unit depth.
2433
2434 .. _v4l2-hevc-loop-filter-mode:
2435
2436 ``V4L2_CID_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE``
2437     (enum)
2438
2439 enum v4l2_mpeg_video_hevc_loop_filter_mode -
2440     Loop filter mode for HEVC encoder. Possible values are:
2441
2442 .. raw:: latex
2443
2444     \footnotesize
2445
2446 .. tabularcolumns:: |p{10.7cm}|p{6.3cm}|
2447
2448 .. flat-table::
2449     :header-rows:  0
2450     :stub-columns: 0
2451
2452     * - ``V4L2_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE_DISABLED``
2453       - Loop filter is disabled.
2454     * - ``V4L2_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE_ENABLED``
2455       - Loop filter is enabled.
2456     * - ``V4L2_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY``
2457       - Loop filter is disabled at the slice boundary.
2458
2459 .. raw:: latex
2460
2461     \normalsize
2462
2463
2464 ``V4L2_CID_MPEG_VIDEO_HEVC_LF_BETA_OFFSET_DIV2 (integer)``
2465     Selects HEVC loop filter beta offset. The valid range is [-6, +6].
2466
2467 ``V4L2_CID_MPEG_VIDEO_HEVC_LF_TC_OFFSET_DIV2 (integer)``
2468     Selects HEVC loop filter tc offset. The valid range is [-6, +6].
2469
2470 .. _v4l2-hevc-refresh-type:
2471
2472 ``V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_TYPE``
2473     (enum)
2474
2475 enum v4l2_mpeg_video_hevc_hier_refresh_type -
2476     Selects refresh type for HEVC encoder.
2477     Host has to specify the period into
2478     V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_PERIOD.
2479
2480 .. raw:: latex
2481
2482     \footnotesize
2483
2484 .. tabularcolumns:: |p{8.0cm}|p{9.0cm}|
2485
2486 .. flat-table::
2487     :header-rows:  0
2488     :stub-columns: 0
2489
2490     * - ``V4L2_MPEG_VIDEO_HEVC_REFRESH_NONE``
2491       - Use the B frame for hierarchical coding.
2492     * - ``V4L2_MPEG_VIDEO_HEVC_REFRESH_CRA``
2493       - Use CRA (Clean Random Access Unit) picture encoding.
2494     * - ``V4L2_MPEG_VIDEO_HEVC_REFRESH_IDR``
2495       - Use IDR (Instantaneous Decoding Refresh) picture encoding.
2496
2497 .. raw:: latex
2498
2499     \normalsize
2500
2501
2502 ``V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_PERIOD (integer)``
2503     Selects the refresh period for HEVC encoder.
2504     This specifies the number of I pictures between two CRA/IDR pictures.
2505     This is valid only if REFRESH_TYPE is not 0.
2506
2507 ``V4L2_CID_MPEG_VIDEO_HEVC_LOSSLESS_CU (boolean)``
2508     Indicates HEVC lossless encoding. Setting it to 0 disables lossless
2509     encoding. Setting it to 1 enables lossless encoding.
2510
2511 ``V4L2_CID_MPEG_VIDEO_HEVC_CONST_INTRA_PRED (boolean)``
2512     Indicates constant intra prediction for HEVC encoder. Specifies the
2513     constrained intra prediction in which intra largest coding unit (LCU)
2514     prediction is performed by using residual data and decoded samples of
2515     neighboring intra LCU only. Setting the value to 1 enables constant intra
2516     prediction and setting the value to 0 disables constant intra prediction.
2517
2518 ``V4L2_CID_MPEG_VIDEO_HEVC_WAVEFRONT (boolean)``
2519     Indicates wavefront parallel processing for HEVC encoder. Setting it to 0
2520     disables the feature and setting it to 1 enables the wavefront parallel
2521     processing.
2522
2523 ``V4L2_CID_MPEG_VIDEO_HEVC_GENERAL_PB (boolean)``
2524     Setting the value to 1 enables combination of P and B frame for HEVC
2525     encoder.
2526
2527 ``V4L2_CID_MPEG_VIDEO_HEVC_TEMPORAL_ID (boolean)``
2528     Indicates temporal identifier for HEVC encoder which is enabled by
2529     setting the value to 1.
2530
2531 ``V4L2_CID_MPEG_VIDEO_HEVC_STRONG_SMOOTHING (boolean)``
2532     Indicates bi-linear interpolation is conditionally used in the intra
2533     prediction filtering process in the CVS when set to 1. Indicates bi-linear
2534     interpolation is not used in the CVS when set to 0.
2535
2536 ``V4L2_CID_MPEG_VIDEO_HEVC_MAX_NUM_MERGE_MV_MINUS1 (integer)``
2537     Indicates maximum number of merge candidate motion vectors.
2538     Values are from 0 to 4.
2539
2540 ``V4L2_CID_MPEG_VIDEO_HEVC_TMV_PREDICTION (boolean)``
2541     Indicates temporal motion vector prediction for HEVC encoder. Setting it to
2542     1 enables the prediction. Setting it to 0 disables the prediction.
2543
2544 ``V4L2_CID_MPEG_VIDEO_HEVC_WITHOUT_STARTCODE (boolean)``
2545     Specifies if HEVC generates a stream with a size of the length field
2546     instead of start code pattern. The size of the length field is configurable
2547     through the V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD control. Setting
2548     the value to 0 disables encoding without startcode pattern. Setting the
2549     value to 1 will enables encoding without startcode pattern.
2550
2551 .. _v4l2-hevc-size-of-length-field:
2552
2553 ``V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD``
2554 (enum)
2555
2556 enum v4l2_mpeg_video_hevc_size_of_length_field -
2557     Indicates the size of length field.
2558     This is valid when encoding WITHOUT_STARTCODE_ENABLE is enabled.
2559
2560 .. raw:: latex
2561
2562     \footnotesize
2563
2564 .. tabularcolumns:: |p{6.0cm}|p{11.0cm}|
2565
2566 .. flat-table::
2567     :header-rows:  0
2568     :stub-columns: 0
2569
2570     * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_0``
2571       - Generate start code pattern (Normal).
2572     * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_1``
2573       - Generate size of length field instead of start code pattern and length is 1.
2574     * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_2``
2575       - Generate size of length field instead of start code pattern and length is 2.
2576     * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_4``
2577       - Generate size of length field instead of start code pattern and length is 4.
2578
2579 .. raw:: latex
2580
2581     \normalsize
2582
2583 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L0_BR (integer)``
2584     Indicates bit rate for hierarchical coding layer 0 for HEVC encoder.
2585
2586 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L1_BR (integer)``
2587     Indicates bit rate for hierarchical coding layer 1 for HEVC encoder.
2588
2589 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L2_BR (integer)``
2590     Indicates bit rate for hierarchical coding layer 2 for HEVC encoder.
2591
2592 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L3_BR (integer)``
2593     Indicates bit rate for hierarchical coding layer 3 for HEVC encoder.
2594
2595 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L4_BR (integer)``
2596     Indicates bit rate for hierarchical coding layer 4 for HEVC encoder.
2597
2598 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L5_BR (integer)``
2599     Indicates bit rate for hierarchical coding layer 5 for HEVC encoder.
2600
2601 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L6_BR (integer)``
2602     Indicates bit rate for hierarchical coding layer 6 for HEVC encoder.
2603
2604 ``V4L2_CID_MPEG_VIDEO_REF_NUMBER_FOR_PFRAMES (integer)``
2605     Selects number of P reference pictures required for HEVC encoder.
2606     P-Frame can use 1 or 2 frames for reference.
2607
2608 ``V4L2_CID_MPEG_VIDEO_PREPEND_SPSPPS_TO_IDR (integer)``
2609     Indicates whether to generate SPS and PPS at every IDR. Setting it to 0
2610     disables generating SPS and PPS at every IDR. Setting it to one enables
2611     generating SPS and PPS at every IDR.
2612
2613
2614 .. _camera-controls:
2615
2616 Camera Control Reference
2617 ========================
2618
2619 The Camera class includes controls for mechanical (or equivalent
2620 digital) features of a device such as controllable lenses or sensors.
2621
2622
2623 .. _camera-control-id:
2624
2625 Camera Control IDs
2626 ------------------
2627
2628 ``V4L2_CID_CAMERA_CLASS (class)``
2629     The Camera class descriptor. Calling
2630     :ref:`VIDIOC_QUERYCTRL` for this control will
2631     return a description of this control class.
2632
2633 .. _v4l2-exposure-auto-type:
2634
2635 ``V4L2_CID_EXPOSURE_AUTO``
2636     (enum)
2637
2638 enum v4l2_exposure_auto_type -
2639     Enables automatic adjustments of the exposure time and/or iris
2640     aperture. The effect of manual changes of the exposure time or iris
2641     aperture while these features are enabled is undefined, drivers
2642     should ignore such requests. Possible values are:
2643
2644
2645
2646 .. flat-table::
2647     :header-rows:  0
2648     :stub-columns: 0
2649
2650     * - ``V4L2_EXPOSURE_AUTO``
2651       - Automatic exposure time, automatic iris aperture.
2652     * - ``V4L2_EXPOSURE_MANUAL``
2653       - Manual exposure time, manual iris.
2654     * - ``V4L2_EXPOSURE_SHUTTER_PRIORITY``
2655       - Manual exposure time, auto iris.
2656     * - ``V4L2_EXPOSURE_APERTURE_PRIORITY``
2657       - Auto exposure time, manual iris.
2658
2659
2660
2661 ``V4L2_CID_EXPOSURE_ABSOLUTE (integer)``
2662     Determines the exposure time of the camera sensor. The exposure time
2663     is limited by the frame interval. Drivers should interpret the
2664     values as 100 Âµs units, where the value 1 stands for 1/10000th of a
2665     second, 10000 for 1 second and 100000 for 10 seconds.
2666
2667 ``V4L2_CID_EXPOSURE_AUTO_PRIORITY (boolean)``
2668     When ``V4L2_CID_EXPOSURE_AUTO`` is set to ``AUTO`` or
2669     ``APERTURE_PRIORITY``, this control determines if the device may
2670     dynamically vary the frame rate. By default this feature is disabled
2671     (0) and the frame rate must remain constant.
2672
2673 ``V4L2_CID_AUTO_EXPOSURE_BIAS (integer menu)``
2674     Determines the automatic exposure compensation, it is effective only
2675     when ``V4L2_CID_EXPOSURE_AUTO`` control is set to ``AUTO``,
2676     ``SHUTTER_PRIORITY`` or ``APERTURE_PRIORITY``. It is expressed in
2677     terms of EV, drivers should interpret the values as 0.001 EV units,
2678     where the value 1000 stands for +1 EV.
2679
2680     Increasing the exposure compensation value is equivalent to
2681     decreasing the exposure value (EV) and will increase the amount of
2682     light at the image sensor. The camera performs the exposure
2683     compensation by adjusting absolute exposure time and/or aperture.
2684
2685 .. _v4l2-exposure-metering:
2686
2687 ``V4L2_CID_EXPOSURE_METERING``
2688     (enum)
2689
2690 enum v4l2_exposure_metering -
2691     Determines how the camera measures the amount of light available for
2692     the frame exposure. Possible values are:
2693
2694 .. tabularcolumns:: |p{8.5cm}|p{9.0cm}|
2695
2696 .. flat-table::
2697     :header-rows:  0
2698     :stub-columns: 0
2699
2700     * - ``V4L2_EXPOSURE_METERING_AVERAGE``
2701       - Use the light information coming from the entire frame and average
2702         giving no weighting to any particular portion of the metered area.
2703     * - ``V4L2_EXPOSURE_METERING_CENTER_WEIGHTED``
2704       - Average the light information coming from the entire frame giving
2705         priority to the center of the metered area.
2706     * - ``V4L2_EXPOSURE_METERING_SPOT``
2707       - Measure only very small area at the center of the frame.
2708     * - ``V4L2_EXPOSURE_METERING_MATRIX``
2709       - A multi-zone metering. The light intensity is measured in several
2710         points of the frame and the results are combined. The algorithm of
2711         the zones selection and their significance in calculating the
2712         final value is device dependent.
2713
2714
2715
2716 ``V4L2_CID_PAN_RELATIVE (integer)``
2717     This control turns the camera horizontally by the specified amount.
2718     The unit is undefined. A positive value moves the camera to the
2719     right (clockwise when viewed from above), a negative value to the
2720     left. A value of zero does not cause motion. This is a write-only
2721     control.
2722
2723 ``V4L2_CID_TILT_RELATIVE (integer)``
2724     This control turns the camera vertically by the specified amount.
2725     The unit is undefined. A positive value moves the camera up, a
2726     negative value down. A value of zero does not cause motion. This is
2727     a write-only control.
2728
2729 ``V4L2_CID_PAN_RESET (button)``
2730     When this control is set, the camera moves horizontally to the
2731     default position.
2732
2733 ``V4L2_CID_TILT_RESET (button)``
2734     When this control is set, the camera moves vertically to the default
2735     position.
2736
2737 ``V4L2_CID_PAN_ABSOLUTE (integer)``
2738     This control turns the camera horizontally to the specified
2739     position. Positive values move the camera to the right (clockwise
2740     when viewed from above), negative values to the left. Drivers should
2741     interpret the values as arc seconds, with valid values between -180
2742     * 3600 and +180 * 3600 inclusive.
2743
2744 ``V4L2_CID_TILT_ABSOLUTE (integer)``
2745     This control turns the camera vertically to the specified position.
2746     Positive values move the camera up, negative values down. Drivers
2747     should interpret the values as arc seconds, with valid values
2748     between -180 * 3600 and +180 * 3600 inclusive.
2749
2750 ``V4L2_CID_FOCUS_ABSOLUTE (integer)``
2751     This control sets the focal point of the camera to the specified
2752     position. The unit is undefined. Positive values set the focus
2753     closer to the camera, negative values towards infinity.
2754
2755 ``V4L2_CID_FOCUS_RELATIVE (integer)``
2756     This control moves the focal point of the camera by the specified
2757     amount. The unit is undefined. Positive values move the focus closer
2758     to the camera, negative values towards infinity. This is a
2759     write-only control.
2760
2761 ``V4L2_CID_FOCUS_AUTO (boolean)``
2762     Enables continuous automatic focus adjustments. The effect of manual
2763     focus adjustments while this feature is enabled is undefined,
2764     drivers should ignore such requests.
2765
2766 ``V4L2_CID_AUTO_FOCUS_START (button)``
2767     Starts single auto focus process. The effect of setting this control
2768     when ``V4L2_CID_FOCUS_AUTO`` is set to ``TRUE`` (1) is undefined,
2769     drivers should ignore such requests.
2770
2771 ``V4L2_CID_AUTO_FOCUS_STOP (button)``
2772     Aborts automatic focusing started with ``V4L2_CID_AUTO_FOCUS_START``
2773     control. It is effective only when the continuous autofocus is
2774     disabled, that is when ``V4L2_CID_FOCUS_AUTO`` control is set to
2775     ``FALSE`` (0).
2776
2777 .. _v4l2-auto-focus-status:
2778
2779 ``V4L2_CID_AUTO_FOCUS_STATUS (bitmask)``
2780     The automatic focus status. This is a read-only control.
2781
2782     Setting ``V4L2_LOCK_FOCUS`` lock bit of the ``V4L2_CID_3A_LOCK``
2783     control may stop updates of the ``V4L2_CID_AUTO_FOCUS_STATUS``
2784     control value.
2785
2786 .. tabularcolumns:: |p{6.5cm}|p{11.0cm}|
2787
2788 .. flat-table::
2789     :header-rows:  0
2790     :stub-columns: 0
2791
2792     * - ``V4L2_AUTO_FOCUS_STATUS_IDLE``
2793       - Automatic focus is not active.
2794     * - ``V4L2_AUTO_FOCUS_STATUS_BUSY``
2795       - Automatic focusing is in progress.
2796     * - ``V4L2_AUTO_FOCUS_STATUS_REACHED``
2797       - Focus has been reached.
2798     * - ``V4L2_AUTO_FOCUS_STATUS_FAILED``
2799       - Automatic focus has failed, the driver will not transition from
2800         this state until another action is performed by an application.
2801
2802
2803
2804 .. _v4l2-auto-focus-range:
2805
2806 ``V4L2_CID_AUTO_FOCUS_RANGE``
2807     (enum)
2808
2809 enum v4l2_auto_focus_range -
2810     Determines auto focus distance range for which lens may be adjusted.
2811
2812 .. tabularcolumns:: |p{6.5cm}|p{11.0cm}|
2813
2814 .. flat-table::
2815     :header-rows:  0
2816     :stub-columns: 0
2817
2818     * - ``V4L2_AUTO_FOCUS_RANGE_AUTO``
2819       - The camera automatically selects the focus range.
2820     * - ``V4L2_AUTO_FOCUS_RANGE_NORMAL``
2821       - Normal distance range, limited for best automatic focus
2822         performance.
2823     * - ``V4L2_AUTO_FOCUS_RANGE_MACRO``
2824       - Macro (close-up) auto focus. The camera will use its minimum
2825         possible distance for auto focus.
2826     * - ``V4L2_AUTO_FOCUS_RANGE_INFINITY``
2827       - The lens is set to focus on an object at infinite distance.
2828
2829
2830
2831 ``V4L2_CID_ZOOM_ABSOLUTE (integer)``
2832     Specify the objective lens focal length as an absolute value. The
2833     zoom unit is driver-specific and its value should be a positive
2834     integer.
2835
2836 ``V4L2_CID_ZOOM_RELATIVE (integer)``
2837     Specify the objective lens focal length relatively to the current
2838     value. Positive values move the zoom lens group towards the
2839     telephoto direction, negative values towards the wide-angle
2840     direction. The zoom unit is driver-specific. This is a write-only
2841     control.
2842
2843 ``V4L2_CID_ZOOM_CONTINUOUS (integer)``
2844     Move the objective lens group at the specified speed until it
2845     reaches physical device limits or until an explicit request to stop
2846     the movement. A positive value moves the zoom lens group towards the
2847     telephoto direction. A value of zero stops the zoom lens group
2848     movement. A negative value moves the zoom lens group towards the
2849     wide-angle direction. The zoom speed unit is driver-specific.
2850
2851 ``V4L2_CID_IRIS_ABSOLUTE (integer)``
2852     This control sets the camera's aperture to the specified value. The
2853     unit is undefined. Larger values open the iris wider, smaller values
2854     close it.
2855
2856 ``V4L2_CID_IRIS_RELATIVE (integer)``
2857     This control modifies the camera's aperture by the specified amount.
2858     The unit is undefined. Positive values open the iris one step
2859     further, negative values close it one step further. This is a
2860     write-only control.
2861
2862 ``V4L2_CID_PRIVACY (boolean)``
2863     Prevent video from being acquired by the camera. When this control
2864     is set to ``TRUE`` (1), no image can be captured by the camera.
2865     Common means to enforce privacy are mechanical obturation of the
2866     sensor and firmware image processing, but the device is not
2867     restricted to these methods. Devices that implement the privacy
2868     control must support read access and may support write access.
2869
2870 ``V4L2_CID_BAND_STOP_FILTER (integer)``
2871     Switch the band-stop filter of a camera sensor on or off, or specify
2872     its strength. Such band-stop filters can be used, for example, to
2873     filter out the fluorescent light component.
2874
2875 .. _v4l2-auto-n-preset-white-balance:
2876
2877 ``V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE``
2878     (enum)
2879
2880 enum v4l2_auto_n_preset_white_balance -
2881     Sets white balance to automatic, manual or a preset. The presets
2882     determine color temperature of the light as a hint to the camera for
2883     white balance adjustments resulting in most accurate color
2884     representation. The following white balance presets are listed in
2885     order of increasing color temperature.
2886
2887 .. tabularcolumns:: |p{7.0 cm}|p{10.5cm}|
2888
2889 .. flat-table::
2890     :header-rows:  0
2891     :stub-columns: 0
2892
2893     * - ``V4L2_WHITE_BALANCE_MANUAL``
2894       - Manual white balance.
2895     * - ``V4L2_WHITE_BALANCE_AUTO``
2896       - Automatic white balance adjustments.
2897     * - ``V4L2_WHITE_BALANCE_INCANDESCENT``
2898       - White balance setting for incandescent (tungsten) lighting. It
2899         generally cools down the colors and corresponds approximately to
2900         2500...3500 K color temperature range.
2901     * - ``V4L2_WHITE_BALANCE_FLUORESCENT``
2902       - White balance preset for fluorescent lighting. It corresponds
2903         approximately to 4000...5000 K color temperature.
2904     * - ``V4L2_WHITE_BALANCE_FLUORESCENT_H``
2905       - With this setting the camera will compensate for fluorescent H
2906         lighting.
2907     * - ``V4L2_WHITE_BALANCE_HORIZON``
2908       - White balance setting for horizon daylight. It corresponds
2909         approximately to 5000 K color temperature.
2910     * - ``V4L2_WHITE_BALANCE_DAYLIGHT``
2911       - White balance preset for daylight (with clear sky). It corresponds
2912         approximately to 5000...6500 K color temperature.
2913     * - ``V4L2_WHITE_BALANCE_FLASH``
2914       - With this setting the camera will compensate for the flash light.
2915         It slightly warms up the colors and corresponds roughly to
2916         5000...5500 K color temperature.
2917     * - ``V4L2_WHITE_BALANCE_CLOUDY``
2918       - White balance preset for moderately overcast sky. This option
2919         corresponds approximately to 6500...8000 K color temperature
2920         range.
2921     * - ``V4L2_WHITE_BALANCE_SHADE``
2922       - White balance preset for shade or heavily overcast sky. It
2923         corresponds approximately to 9000...10000 K color temperature.
2924
2925
2926
2927 .. _v4l2-wide-dynamic-range:
2928
2929 ``V4L2_CID_WIDE_DYNAMIC_RANGE (boolean)``
2930     Enables or disables the camera's wide dynamic range feature. This
2931     feature allows to obtain clear images in situations where intensity
2932     of the illumination varies significantly throughout the scene, i.e.
2933     there are simultaneously very dark and very bright areas. It is most
2934     commonly realized in cameras by combining two subsequent frames with
2935     different exposure times.  [#f1]_
2936
2937 .. _v4l2-image-stabilization:
2938
2939 ``V4L2_CID_IMAGE_STABILIZATION (boolean)``
2940     Enables or disables image stabilization.
2941
2942 ``V4L2_CID_ISO_SENSITIVITY (integer menu)``
2943     Determines ISO equivalent of an image sensor indicating the sensor's
2944     sensitivity to light. The numbers are expressed in arithmetic scale,
2945     as per :ref:`iso12232` standard, where doubling the sensor
2946     sensitivity is represented by doubling the numerical ISO value.
2947     Applications should interpret the values as standard ISO values
2948     multiplied by 1000, e.g. control value 800 stands for ISO 0.8.
2949     Drivers will usually support only a subset of standard ISO values.
2950     The effect of setting this control while the
2951     ``V4L2_CID_ISO_SENSITIVITY_AUTO`` control is set to a value other
2952     than ``V4L2_CID_ISO_SENSITIVITY_MANUAL`` is undefined, drivers
2953     should ignore such requests.
2954
2955 .. _v4l2-iso-sensitivity-auto-type:
2956
2957 ``V4L2_CID_ISO_SENSITIVITY_AUTO``
2958     (enum)
2959
2960 enum v4l2_iso_sensitivity_type -
2961     Enables or disables automatic ISO sensitivity adjustments.
2962
2963
2964
2965 .. flat-table::
2966     :header-rows:  0
2967     :stub-columns: 0
2968
2969     * - ``V4L2_CID_ISO_SENSITIVITY_MANUAL``
2970       - Manual ISO sensitivity.
2971     * - ``V4L2_CID_ISO_SENSITIVITY_AUTO``
2972       - Automatic ISO sensitivity adjustments.
2973
2974
2975
2976 .. _v4l2-scene-mode:
2977
2978 ``V4L2_CID_SCENE_MODE``
2979     (enum)
2980
2981 enum v4l2_scene_mode -
2982     This control allows to select scene programs as the camera automatic
2983     modes optimized for common shooting scenes. Within these modes the
2984     camera determines best exposure, aperture, focusing, light metering,
2985     white balance and equivalent sensitivity. The controls of those
2986     parameters are influenced by the scene mode control. An exact
2987     behavior in each mode is subject to the camera specification.
2988
2989     When the scene mode feature is not used, this control should be set
2990     to ``V4L2_SCENE_MODE_NONE`` to make sure the other possibly related
2991     controls are accessible. The following scene programs are defined:
2992
2993 .. tabularcolumns:: |p{6.0cm}|p{11.5cm}|
2994
2995 .. flat-table::
2996     :header-rows:  0
2997     :stub-columns: 0
2998
2999     * - ``V4L2_SCENE_MODE_NONE``
3000       - The scene mode feature is disabled.
3001     * - ``V4L2_SCENE_MODE_BACKLIGHT``
3002       - Backlight. Compensates for dark shadows when light is coming from
3003         behind a subject, also by automatically turning on the flash.
3004     * - ``V4L2_SCENE_MODE_BEACH_SNOW``
3005       - Beach and snow. This mode compensates for all-white or bright
3006         scenes, which tend to look gray and low contrast, when camera's
3007         automatic exposure is based on an average scene brightness. To
3008         compensate, this mode automatically slightly overexposes the
3009         frames. The white balance may also be adjusted to compensate for
3010         the fact that reflected snow looks bluish rather than white.
3011     * - ``V4L2_SCENE_MODE_CANDLELIGHT``
3012       - Candle light. The camera generally raises the ISO sensitivity and
3013         lowers the shutter speed. This mode compensates for relatively
3014         close subject in the scene. The flash is disabled in order to
3015         preserve the ambiance of the light.
3016     * - ``V4L2_SCENE_MODE_DAWN_DUSK``
3017       - Dawn and dusk. Preserves the colors seen in low natural light
3018         before dusk and after down. The camera may turn off the flash, and
3019         automatically focus at infinity. It will usually boost saturation
3020         and lower the shutter speed.
3021     * - ``V4L2_SCENE_MODE_FALL_COLORS``
3022       - Fall colors. Increases saturation and adjusts white balance for
3023         color enhancement. Pictures of autumn leaves get saturated reds
3024         and yellows.
3025     * - ``V4L2_SCENE_MODE_FIREWORKS``
3026       - Fireworks. Long exposure times are used to capture the expanding
3027         burst of light from a firework. The camera may invoke image
3028         stabilization.
3029     * - ``V4L2_SCENE_MODE_LANDSCAPE``
3030       - Landscape. The camera may choose a small aperture to provide deep
3031         depth of field and long exposure duration to help capture detail
3032         in dim light conditions. The focus is fixed at infinity. Suitable
3033         for distant and wide scenery.
3034     * - ``V4L2_SCENE_MODE_NIGHT``
3035       - Night, also known as Night Landscape. Designed for low light
3036         conditions, it preserves detail in the dark areas without blowing
3037         out bright objects. The camera generally sets itself to a
3038         medium-to-high ISO sensitivity, with a relatively long exposure
3039         time, and turns flash off. As such, there will be increased image
3040         noise and the possibility of blurred image.
3041     * - ``V4L2_SCENE_MODE_PARTY_INDOOR``
3042       - Party and indoor. Designed to capture indoor scenes that are lit
3043         by indoor background lighting as well as the flash. The camera
3044         usually increases ISO sensitivity, and adjusts exposure for the
3045         low light conditions.
3046     * - ``V4L2_SCENE_MODE_PORTRAIT``
3047       - Portrait. The camera adjusts the aperture so that the depth of
3048         field is reduced, which helps to isolate the subject against a
3049         smooth background. Most cameras recognize the presence of faces in
3050         the scene and focus on them. The color hue is adjusted to enhance
3051         skin tones. The intensity of the flash is often reduced.
3052     * - ``V4L2_SCENE_MODE_SPORTS``
3053       - Sports. Significantly increases ISO and uses a fast shutter speed
3054         to freeze motion of rapidly-moving subjects. Increased image noise
3055         may be seen in this mode.
3056     * - ``V4L2_SCENE_MODE_SUNSET``
3057       - Sunset. Preserves deep hues seen in sunsets and sunrises. It bumps
3058         up the saturation.
3059     * - ``V4L2_SCENE_MODE_TEXT``
3060       - Text. It applies extra contrast and sharpness, it is typically a
3061         black-and-white mode optimized for readability. Automatic focus
3062         may be switched to close-up mode and this setting may also involve
3063         some lens-distortion correction.
3064
3065
3066
3067 ``V4L2_CID_3A_LOCK (bitmask)``
3068     This control locks or unlocks the automatic focus, exposure and
3069     white balance. The automatic adjustments can be paused independently
3070     by setting the corresponding lock bit to 1. The camera then retains
3071     the settings until the lock bit is cleared. The following lock bits
3072     are defined:
3073
3074     When a given algorithm is not enabled, drivers should ignore
3075     requests to lock it and should return no error. An example might be
3076     an application setting bit ``V4L2_LOCK_WHITE_BALANCE`` when the
3077     ``V4L2_CID_AUTO_WHITE_BALANCE`` control is set to ``FALSE``. The
3078     value of this control may be changed by exposure, white balance or
3079     focus controls.
3080
3081
3082
3083 .. flat-table::
3084     :header-rows:  0
3085     :stub-columns: 0
3086
3087     * - ``V4L2_LOCK_EXPOSURE``
3088       - Automatic exposure adjustments lock.
3089     * - ``V4L2_LOCK_WHITE_BALANCE``
3090       - Automatic white balance adjustments lock.
3091     * - ``V4L2_LOCK_FOCUS``
3092       - Automatic focus lock.
3093
3094
3095
3096 ``V4L2_CID_PAN_SPEED (integer)``
3097     This control turns the camera horizontally at the specific speed.
3098     The unit is undefined. A positive value moves the camera to the
3099     right (clockwise when viewed from above), a negative value to the
3100     left. A value of zero stops the motion if one is in progress and has
3101     no effect otherwise.
3102
3103 ``V4L2_CID_TILT_SPEED (integer)``
3104     This control turns the camera vertically at the specified speed. The
3105     unit is undefined. A positive value moves the camera up, a negative
3106     value down. A value of zero stops the motion if one is in progress
3107     and has no effect otherwise.
3108
3109
3110 .. _fm-tx-controls:
3111
3112 FM Transmitter Control Reference
3113 ================================
3114
3115 The FM Transmitter (FM_TX) class includes controls for common features
3116 of FM transmissions capable devices. Currently this class includes
3117 parameters for audio compression, pilot tone generation, audio deviation
3118 limiter, RDS transmission and tuning power features.
3119
3120
3121 .. _fm-tx-control-id:
3122
3123 FM_TX Control IDs
3124 -----------------
3125
3126 ``V4L2_CID_FM_TX_CLASS (class)``
3127     The FM_TX class descriptor. Calling
3128     :ref:`VIDIOC_QUERYCTRL` for this control will
3129     return a description of this control class.
3130
3131 ``V4L2_CID_RDS_TX_DEVIATION (integer)``
3132     Configures RDS signal frequency deviation level in Hz. The range and
3133     step are driver-specific.
3134
3135 ``V4L2_CID_RDS_TX_PI (integer)``
3136     Sets the RDS Programme Identification field for transmission.
3137
3138 ``V4L2_CID_RDS_TX_PTY (integer)``
3139     Sets the RDS Programme Type field for transmission. This encodes up
3140     to 31 pre-defined programme types.
3141
3142 ``V4L2_CID_RDS_TX_PS_NAME (string)``
3143     Sets the Programme Service name (PS_NAME) for transmission. It is
3144     intended for static display on a receiver. It is the primary aid to
3145     listeners in programme service identification and selection. In
3146     Annex E of :ref:`iec62106`, the RDS specification, there is a full
3147     description of the correct character encoding for Programme Service
3148     name strings. Also from RDS specification, PS is usually a single
3149     eight character text. However, it is also possible to find receivers
3150     which can scroll strings sized as 8 x N characters. So, this control
3151     must be configured with steps of 8 characters. The result is it must
3152     always contain a string with size multiple of 8.
3153
3154 ``V4L2_CID_RDS_TX_RADIO_TEXT (string)``
3155     Sets the Radio Text info for transmission. It is a textual
3156     description of what is being broadcasted. RDS Radio Text can be
3157     applied when broadcaster wishes to transmit longer PS names,
3158     programme-related information or any other text. In these cases,
3159     RadioText should be used in addition to ``V4L2_CID_RDS_TX_PS_NAME``.
3160     The encoding for Radio Text strings is also fully described in Annex
3161     E of :ref:`iec62106`. The length of Radio Text strings depends on
3162     which RDS Block is being used to transmit it, either 32 (2A block)
3163     or 64 (2B block). However, it is also possible to find receivers
3164     which can scroll strings sized as 32 x N or 64 x N characters. So,
3165     this control must be configured with steps of 32 or 64 characters.
3166     The result is it must always contain a string with size multiple of
3167     32 or 64.
3168
3169 ``V4L2_CID_RDS_TX_MONO_STEREO (boolean)``
3170     Sets the Mono/Stereo bit of the Decoder Identification code. If set,
3171     then the audio was recorded as stereo.
3172
3173 ``V4L2_CID_RDS_TX_ARTIFICIAL_HEAD (boolean)``
3174     Sets the
3175     `Artificial Head <http://en.wikipedia.org/wiki/Artificial_head>`__
3176     bit of the Decoder Identification code. If set, then the audio was
3177     recorded using an artificial head.
3178
3179 ``V4L2_CID_RDS_TX_COMPRESSED (boolean)``
3180     Sets the Compressed bit of the Decoder Identification code. If set,
3181     then the audio is compressed.
3182
3183 ``V4L2_CID_RDS_TX_DYNAMIC_PTY (boolean)``
3184     Sets the Dynamic PTY bit of the Decoder Identification code. If set,
3185     then the PTY code is dynamically switched.
3186
3187 ``V4L2_CID_RDS_TX_TRAFFIC_ANNOUNCEMENT (boolean)``
3188     If set, then a traffic announcement is in progress.
3189
3190 ``V4L2_CID_RDS_TX_TRAFFIC_PROGRAM (boolean)``
3191     If set, then the tuned programme carries traffic announcements.
3192
3193 ``V4L2_CID_RDS_TX_MUSIC_SPEECH (boolean)``
3194     If set, then this channel broadcasts music. If cleared, then it
3195     broadcasts speech. If the transmitter doesn't make this distinction,
3196     then it should be set.
3197
3198 ``V4L2_CID_RDS_TX_ALT_FREQS_ENABLE (boolean)``
3199     If set, then transmit alternate frequencies.
3200
3201 ``V4L2_CID_RDS_TX_ALT_FREQS (__u32 array)``
3202     The alternate frequencies in kHz units. The RDS standard allows for
3203     up to 25 frequencies to be defined. Drivers may support fewer
3204     frequencies so check the array size.
3205
3206 ``V4L2_CID_AUDIO_LIMITER_ENABLED (boolean)``
3207     Enables or disables the audio deviation limiter feature. The limiter
3208     is useful when trying to maximize the audio volume, minimize
3209     receiver-generated distortion and prevent overmodulation.
3210
3211 ``V4L2_CID_AUDIO_LIMITER_RELEASE_TIME (integer)``
3212     Sets the audio deviation limiter feature release time. Unit is in
3213     useconds. Step and range are driver-specific.
3214
3215 ``V4L2_CID_AUDIO_LIMITER_DEVIATION (integer)``
3216     Configures audio frequency deviation level in Hz. The range and step
3217     are driver-specific.
3218
3219 ``V4L2_CID_AUDIO_COMPRESSION_ENABLED (boolean)``
3220     Enables or disables the audio compression feature. This feature
3221     amplifies signals below the threshold by a fixed gain and compresses
3222     audio signals above the threshold by the ratio of Threshold/(Gain +
3223     Threshold).
3224
3225 ``V4L2_CID_AUDIO_COMPRESSION_GAIN (integer)``
3226     Sets the gain for audio compression feature. It is a dB value. The
3227     range and step are driver-specific.
3228
3229 ``V4L2_CID_AUDIO_COMPRESSION_THRESHOLD (integer)``
3230     Sets the threshold level for audio compression freature. It is a dB
3231     value. The range and step are driver-specific.
3232
3233 ``V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME (integer)``
3234     Sets the attack time for audio compression feature. It is a useconds
3235     value. The range and step are driver-specific.
3236
3237 ``V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME (integer)``
3238     Sets the release time for audio compression feature. It is a
3239     useconds value. The range and step are driver-specific.
3240
3241 ``V4L2_CID_PILOT_TONE_ENABLED (boolean)``
3242     Enables or disables the pilot tone generation feature.
3243
3244 ``V4L2_CID_PILOT_TONE_DEVIATION (integer)``
3245     Configures pilot tone frequency deviation level. Unit is in Hz. The
3246     range and step are driver-specific.
3247
3248 ``V4L2_CID_PILOT_TONE_FREQUENCY (integer)``
3249     Configures pilot tone frequency value. Unit is in Hz. The range and
3250     step are driver-specific.
3251
3252 ``V4L2_CID_TUNE_PREEMPHASIS``
3253     (enum)
3254
3255 enum v4l2_preemphasis -
3256     Configures the pre-emphasis value for broadcasting. A pre-emphasis
3257     filter is applied to the broadcast to accentuate the high audio
3258     frequencies. Depending on the region, a time constant of either 50
3259     or 75 useconds is used. The enum v4l2_preemphasis defines possible
3260     values for pre-emphasis. Here they are:
3261
3262
3263
3264 .. flat-table::
3265     :header-rows:  0
3266     :stub-columns: 0
3267
3268     * - ``V4L2_PREEMPHASIS_DISABLED``
3269       - No pre-emphasis is applied.
3270     * - ``V4L2_PREEMPHASIS_50_uS``
3271       - A pre-emphasis of 50 uS is used.
3272     * - ``V4L2_PREEMPHASIS_75_uS``
3273       - A pre-emphasis of 75 uS is used.
3274
3275
3276
3277 ``V4L2_CID_TUNE_POWER_LEVEL (integer)``
3278     Sets the output power level for signal transmission. Unit is in
3279     dBuV. Range and step are driver-specific.
3280
3281 ``V4L2_CID_TUNE_ANTENNA_CAPACITOR (integer)``
3282     This selects the value of antenna tuning capacitor manually or
3283     automatically if set to zero. Unit, range and step are
3284     driver-specific.
3285
3286 For more details about RDS specification, refer to :ref:`iec62106`
3287 document, from CENELEC.
3288
3289
3290 .. _flash-controls:
3291
3292 Flash Control Reference
3293 =======================
3294
3295 The V4L2 flash controls are intended to provide generic access to flash
3296 controller devices. Flash controller devices are typically used in
3297 digital cameras.
3298
3299 The interface can support both LED and xenon flash devices. As of
3300 writing this, there is no xenon flash driver using this interface.
3301
3302
3303 .. _flash-controls-use-cases:
3304
3305 Supported use cases
3306 -------------------
3307
3308
3309 Unsynchronised LED flash (software strobe)
3310 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3311
3312 Unsynchronised LED flash is controlled directly by the host as the
3313 sensor. The flash must be enabled by the host before the exposure of the
3314 image starts and disabled once it ends. The host is fully responsible
3315 for the timing of the flash.
3316
3317 Example of such device: Nokia N900.
3318
3319
3320 Synchronised LED flash (hardware strobe)
3321 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3322
3323 The synchronised LED flash is pre-programmed by the host (power and
3324 timeout) but controlled by the sensor through a strobe signal from the
3325 sensor to the flash.
3326
3327 The sensor controls the flash duration and timing. This information
3328 typically must be made available to the sensor.
3329
3330
3331 LED flash as torch
3332 ^^^^^^^^^^^^^^^^^^
3333
3334 LED flash may be used as torch in conjunction with another use case
3335 involving camera or individually.
3336
3337
3338 .. _flash-control-id:
3339
3340 Flash Control IDs
3341 """""""""""""""""
3342
3343 ``V4L2_CID_FLASH_CLASS (class)``
3344     The FLASH class descriptor.
3345
3346 ``V4L2_CID_FLASH_LED_MODE (menu)``
3347     Defines the mode of the flash LED, the high-power white LED attached
3348     to the flash controller. Setting this control may not be possible in
3349     presence of some faults. See V4L2_CID_FLASH_FAULT.
3350
3351
3352
3353 .. flat-table::
3354     :header-rows:  0
3355     :stub-columns: 0
3356
3357     * - ``V4L2_FLASH_LED_MODE_NONE``
3358       - Off.
3359     * - ``V4L2_FLASH_LED_MODE_FLASH``
3360       - Flash mode.
3361     * - ``V4L2_FLASH_LED_MODE_TORCH``
3362       - Torch mode. See V4L2_CID_FLASH_TORCH_INTENSITY.
3363
3364
3365
3366 ``V4L2_CID_FLASH_STROBE_SOURCE (menu)``
3367     Defines the source of the flash LED strobe.
3368
3369 .. tabularcolumns:: |p{7.0cm}|p{10.5cm}|
3370
3371 .. flat-table::
3372     :header-rows:  0
3373     :stub-columns: 0
3374
3375     * - ``V4L2_FLASH_STROBE_SOURCE_SOFTWARE``
3376       - The flash strobe is triggered by using the
3377         V4L2_CID_FLASH_STROBE control.
3378     * - ``V4L2_FLASH_STROBE_SOURCE_EXTERNAL``
3379       - The flash strobe is triggered by an external source. Typically
3380         this is a sensor, which makes it possible to synchronises the
3381         flash strobe start to exposure start.
3382
3383
3384
3385 ``V4L2_CID_FLASH_STROBE (button)``
3386     Strobe flash. Valid when V4L2_CID_FLASH_LED_MODE is set to
3387     V4L2_FLASH_LED_MODE_FLASH and V4L2_CID_FLASH_STROBE_SOURCE
3388     is set to V4L2_FLASH_STROBE_SOURCE_SOFTWARE. Setting this
3389     control may not be possible in presence of some faults. See
3390     V4L2_CID_FLASH_FAULT.
3391
3392 ``V4L2_CID_FLASH_STROBE_STOP (button)``
3393     Stop flash strobe immediately.
3394
3395 ``V4L2_CID_FLASH_STROBE_STATUS (boolean)``
3396     Strobe status: whether the flash is strobing at the moment or not.
3397     This is a read-only control.
3398
3399 ``V4L2_CID_FLASH_TIMEOUT (integer)``
3400     Hardware timeout for flash. The flash strobe is stopped after this
3401     period of time has passed from the start of the strobe.
3402
3403 ``V4L2_CID_FLASH_INTENSITY (integer)``
3404     Intensity of the flash strobe when the flash LED is in flash mode
3405     (V4L2_FLASH_LED_MODE_FLASH). The unit should be milliamps (mA)
3406     if possible.
3407
3408 ``V4L2_CID_FLASH_TORCH_INTENSITY (integer)``
3409     Intensity of the flash LED in torch mode
3410     (V4L2_FLASH_LED_MODE_TORCH). The unit should be milliamps (mA)
3411     if possible. Setting this control may not be possible in presence of
3412     some faults. See V4L2_CID_FLASH_FAULT.
3413
3414 ``V4L2_CID_FLASH_INDICATOR_INTENSITY (integer)``
3415     Intensity of the indicator LED. The indicator LED may be fully
3416     independent of the flash LED. The unit should be microamps (uA) if
3417     possible.
3418
3419 ``V4L2_CID_FLASH_FAULT (bitmask)``
3420     Faults related to the flash. The faults tell about specific problems
3421     in the flash chip itself or the LEDs attached to it. Faults may
3422     prevent further use of some of the flash controls. In particular,
3423     V4L2_CID_FLASH_LED_MODE is set to V4L2_FLASH_LED_MODE_NONE
3424     if the fault affects the flash LED. Exactly which faults have such
3425     an effect is chip dependent. Reading the faults resets the control
3426     and returns the chip to a usable state if possible.
3427
3428 .. tabularcolumns:: |p{8.0cm}|p{9.5cm}|
3429
3430 .. flat-table::
3431     :header-rows:  0
3432     :stub-columns: 0
3433
3434     * - ``V4L2_FLASH_FAULT_OVER_VOLTAGE``
3435       - Flash controller voltage to the flash LED has exceeded the limit
3436         specific to the flash controller.
3437     * - ``V4L2_FLASH_FAULT_TIMEOUT``
3438       - The flash strobe was still on when the timeout set by the user ---
3439         V4L2_CID_FLASH_TIMEOUT control --- has expired. Not all flash
3440         controllers may set this in all such conditions.
3441     * - ``V4L2_FLASH_FAULT_OVER_TEMPERATURE``
3442       - The flash controller has overheated.
3443     * - ``V4L2_FLASH_FAULT_SHORT_CIRCUIT``
3444       - The short circuit protection of the flash controller has been
3445         triggered.
3446     * - ``V4L2_FLASH_FAULT_OVER_CURRENT``
3447       - Current in the LED power supply has exceeded the limit specific to
3448         the flash controller.
3449     * - ``V4L2_FLASH_FAULT_INDICATOR``
3450       - The flash controller has detected a short or open circuit
3451         condition on the indicator LED.
3452     * - ``V4L2_FLASH_FAULT_UNDER_VOLTAGE``
3453       - Flash controller voltage to the flash LED has been below the
3454         minimum limit specific to the flash controller.
3455     * - ``V4L2_FLASH_FAULT_INPUT_VOLTAGE``
3456       - The input voltage of the flash controller is below the limit under
3457         which strobing the flash at full current will not be possible.The
3458         condition persists until this flag is no longer set.
3459     * - ``V4L2_FLASH_FAULT_LED_OVER_TEMPERATURE``
3460       - The temperature of the LED has exceeded its allowed upper limit.
3461
3462
3463
3464 ``V4L2_CID_FLASH_CHARGE (boolean)``
3465     Enable or disable charging of the xenon flash capacitor.
3466
3467 ``V4L2_CID_FLASH_READY (boolean)``
3468     Is the flash ready to strobe? Xenon flashes require their capacitors
3469     charged before strobing. LED flashes often require a cooldown period
3470     after strobe during which another strobe will not be possible. This
3471     is a read-only control.
3472
3473
3474 .. _jpeg-controls:
3475
3476 JPEG Control Reference
3477 ======================
3478
3479 The JPEG class includes controls for common features of JPEG encoders
3480 and decoders. Currently it includes features for codecs implementing
3481 progressive baseline DCT compression process with Huffman entrophy
3482 coding.
3483
3484
3485 .. _jpeg-control-id:
3486
3487 JPEG Control IDs
3488 ----------------
3489
3490 ``V4L2_CID_JPEG_CLASS (class)``
3491     The JPEG class descriptor. Calling
3492     :ref:`VIDIOC_QUERYCTRL` for this control will
3493     return a description of this control class.
3494
3495 ``V4L2_CID_JPEG_CHROMA_SUBSAMPLING (menu)``
3496     The chroma subsampling factors describe how each component of an
3497     input image is sampled, in respect to maximum sample rate in each
3498     spatial dimension. See :ref:`itu-t81`, clause A.1.1. for more
3499     details. The ``V4L2_CID_JPEG_CHROMA_SUBSAMPLING`` control determines
3500     how Cb and Cr components are downsampled after converting an input
3501     image from RGB to Y'CbCr color space.
3502
3503 .. tabularcolumns:: |p{7.0cm}|p{10.5cm}|
3504
3505 .. flat-table::
3506     :header-rows:  0
3507     :stub-columns: 0
3508
3509     * - ``V4L2_JPEG_CHROMA_SUBSAMPLING_444``
3510       - No chroma subsampling, each pixel has Y, Cr and Cb values.
3511     * - ``V4L2_JPEG_CHROMA_SUBSAMPLING_422``
3512       - Horizontally subsample Cr, Cb components by a factor of 2.
3513     * - ``V4L2_JPEG_CHROMA_SUBSAMPLING_420``
3514       - Subsample Cr, Cb components horizontally and vertically by 2.
3515     * - ``V4L2_JPEG_CHROMA_SUBSAMPLING_411``
3516       - Horizontally subsample Cr, Cb components by a factor of 4.
3517     * - ``V4L2_JPEG_CHROMA_SUBSAMPLING_410``
3518       - Subsample Cr, Cb components horizontally by 4 and vertically by 2.
3519     * - ``V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY``
3520       - Use only luminance component.
3521
3522
3523
3524 ``V4L2_CID_JPEG_RESTART_INTERVAL (integer)``
3525     The restart interval determines an interval of inserting RSTm
3526     markers (m = 0..7). The purpose of these markers is to additionally
3527     reinitialize the encoder process, in order to process blocks of an
3528     image independently. For the lossy compression processes the restart
3529     interval unit is MCU (Minimum Coded Unit) and its value is contained
3530     in DRI (Define Restart Interval) marker. If
3531     ``V4L2_CID_JPEG_RESTART_INTERVAL`` control is set to 0, DRI and RSTm
3532     markers will not be inserted.
3533
3534 .. _jpeg-quality-control:
3535
3536 ``V4L2_CID_JPEG_COMPRESSION_QUALITY (integer)``
3537     ``V4L2_CID_JPEG_COMPRESSION_QUALITY`` control determines trade-off
3538     between image quality and size. It provides simpler method for
3539     applications to control image quality, without a need for direct
3540     reconfiguration of luminance and chrominance quantization tables. In
3541     cases where a driver uses quantization tables configured directly by
3542     an application, using interfaces defined elsewhere,
3543     ``V4L2_CID_JPEG_COMPRESSION_QUALITY`` control should be set by
3544     driver to 0.
3545
3546     The value range of this control is driver-specific. Only positive,
3547     non-zero values are meaningful. The recommended range is 1 - 100,
3548     where larger values correspond to better image quality.
3549
3550 .. _jpeg-active-marker-control:
3551
3552 ``V4L2_CID_JPEG_ACTIVE_MARKER (bitmask)``
3553     Specify which JPEG markers are included in compressed stream. This
3554     control is valid only for encoders.
3555
3556
3557
3558 .. flat-table::
3559     :header-rows:  0
3560     :stub-columns: 0
3561
3562     * - ``V4L2_JPEG_ACTIVE_MARKER_APP0``
3563       - Application data segment APP\ :sub:`0`.
3564     * - ``V4L2_JPEG_ACTIVE_MARKER_APP1``
3565       - Application data segment APP\ :sub:`1`.
3566     * - ``V4L2_JPEG_ACTIVE_MARKER_COM``
3567       - Comment segment.
3568     * - ``V4L2_JPEG_ACTIVE_MARKER_DQT``
3569       - Quantization tables segment.
3570     * - ``V4L2_JPEG_ACTIVE_MARKER_DHT``
3571       - Huffman tables segment.
3572
3573
3574
3575 For more details about JPEG specification, refer to :ref:`itu-t81`,
3576 :ref:`jfif`, :ref:`w3c-jpeg-jfif`.
3577
3578
3579 .. _image-source-controls:
3580
3581 Image Source Control Reference
3582 ==============================
3583
3584 The Image Source control class is intended for low-level control of
3585 image source devices such as image sensors. The devices feature an
3586 analogue to digital converter and a bus transmitter to transmit the
3587 image data out of the device.
3588
3589
3590 .. _image-source-control-id:
3591
3592 Image Source Control IDs
3593 ------------------------
3594
3595 ``V4L2_CID_IMAGE_SOURCE_CLASS (class)``
3596     The IMAGE_SOURCE class descriptor.
3597
3598 ``V4L2_CID_VBLANK (integer)``
3599     Vertical blanking. The idle period after every frame during which no
3600     image data is produced. The unit of vertical blanking is a line.
3601     Every line has length of the image width plus horizontal blanking at
3602     the pixel rate defined by ``V4L2_CID_PIXEL_RATE`` control in the
3603     same sub-device.
3604
3605 ``V4L2_CID_HBLANK (integer)``
3606     Horizontal blanking. The idle period after every line of image data
3607     during which no image data is produced. The unit of horizontal
3608     blanking is pixels.
3609
3610 ``V4L2_CID_ANALOGUE_GAIN (integer)``
3611     Analogue gain is gain affecting all colour components in the pixel
3612     matrix. The gain operation is performed in the analogue domain
3613     before A/D conversion.
3614
3615 ``V4L2_CID_TEST_PATTERN_RED (integer)``
3616     Test pattern red colour component.
3617
3618 ``V4L2_CID_TEST_PATTERN_GREENR (integer)``
3619     Test pattern green (next to red) colour component.
3620
3621 ``V4L2_CID_TEST_PATTERN_BLUE (integer)``
3622     Test pattern blue colour component.
3623
3624 ``V4L2_CID_TEST_PATTERN_GREENB (integer)``
3625     Test pattern green (next to blue) colour component.
3626
3627
3628 .. _image-process-controls:
3629
3630 Image Process Control Reference
3631 ===============================
3632
3633 The Image Process control class is intended for low-level control of
3634 image processing functions. Unlike ``V4L2_CID_IMAGE_SOURCE_CLASS``, the
3635 controls in this class affect processing the image, and do not control
3636 capturing of it.
3637
3638
3639 .. _image-process-control-id:
3640
3641 Image Process Control IDs
3642 -------------------------
3643
3644 ``V4L2_CID_IMAGE_PROC_CLASS (class)``
3645     The IMAGE_PROC class descriptor.
3646
3647 ``V4L2_CID_LINK_FREQ (integer menu)``
3648     Data bus frequency. Together with the media bus pixel code, bus type
3649     (clock cycles per sample), the data bus frequency defines the pixel
3650     rate (``V4L2_CID_PIXEL_RATE``) in the pixel array (or possibly
3651     elsewhere, if the device is not an image sensor). The frame rate can
3652     be calculated from the pixel clock, image width and height and
3653     horizontal and vertical blanking. While the pixel rate control may
3654     be defined elsewhere than in the subdev containing the pixel array,
3655     the frame rate cannot be obtained from that information. This is
3656     because only on the pixel array it can be assumed that the vertical
3657     and horizontal blanking information is exact: no other blanking is
3658     allowed in the pixel array. The selection of frame rate is performed
3659     by selecting the desired horizontal and vertical blanking. The unit
3660     of this control is Hz.
3661
3662 ``V4L2_CID_PIXEL_RATE (64-bit integer)``
3663     Pixel rate in the source pads of the subdev. This control is
3664     read-only and its unit is pixels / second.
3665
3666 ``V4L2_CID_TEST_PATTERN (menu)``
3667     Some capture/display/sensor devices have the capability to generate
3668     test pattern images. These hardware specific test patterns can be
3669     used to test if a device is working properly.
3670
3671 ``V4L2_CID_DEINTERLACING_MODE (menu)``
3672     The video deinterlacing mode (such as Bob, Weave, ...). The menu items are
3673     driver specific and are documented in :ref:`v4l-drivers`.
3674
3675 ``V4L2_CID_DIGITAL_GAIN (integer)``
3676     Digital gain is the value by which all colour components
3677     are multiplied by. Typically the digital gain applied is the
3678     control value divided by e.g. 0x100, meaning that to get no
3679     digital gain the control value needs to be 0x100. The no-gain
3680     configuration is also typically the default.
3681
3682
3683 .. _dv-controls:
3684
3685 Digital Video Control Reference
3686 ===============================
3687
3688 The Digital Video control class is intended to control receivers and
3689 transmitters for `VGA <http://en.wikipedia.org/wiki/Vga>`__,
3690 `DVI <http://en.wikipedia.org/wiki/Digital_Visual_Interface>`__
3691 (Digital Visual Interface), HDMI (:ref:`hdmi`) and DisplayPort
3692 (:ref:`dp`). These controls are generally expected to be private to
3693 the receiver or transmitter subdevice that implements them, so they are
3694 only exposed on the ``/dev/v4l-subdev*`` device node.
3695
3696 .. note::
3697
3698    Note that these devices can have multiple input or output pads which are
3699    hooked up to e.g. HDMI connectors. Even though the subdevice will
3700    receive or transmit video from/to only one of those pads, the other pads
3701    can still be active when it comes to EDID (Extended Display
3702    Identification Data, :ref:`vesaedid`) and HDCP (High-bandwidth Digital
3703    Content Protection System, :ref:`hdcp`) processing, allowing the
3704    device to do the fairly slow EDID/HDCP handling in advance. This allows
3705    for quick switching between connectors.
3706
3707 These pads appear in several of the controls in this section as
3708 bitmasks, one bit for each pad. Bit 0 corresponds to pad 0, bit 1 to pad
3709 1, etc. The maximum value of the control is the set of valid pads.
3710
3711
3712 .. _dv-control-id:
3713
3714 Digital Video Control IDs
3715 -------------------------
3716
3717 ``V4L2_CID_DV_CLASS (class)``
3718     The Digital Video class descriptor.
3719
3720 ``V4L2_CID_DV_TX_HOTPLUG (bitmask)``
3721     Many connectors have a hotplug pin which is high if EDID information
3722     is available from the source. This control shows the state of the
3723     hotplug pin as seen by the transmitter. Each bit corresponds to an
3724     output pad on the transmitter. If an output pad does not have an
3725     associated hotplug pin, then the bit for that pad will be 0. This
3726     read-only control is applicable to DVI-D, HDMI and DisplayPort
3727     connectors.
3728
3729 ``V4L2_CID_DV_TX_RXSENSE (bitmask)``
3730     Rx Sense is the detection of pull-ups on the TMDS clock lines. This
3731     normally means that the sink has left/entered standby (i.e. the
3732     transmitter can sense that the receiver is ready to receive video).
3733     Each bit corresponds to an output pad on the transmitter. If an
3734     output pad does not have an associated Rx Sense, then the bit for
3735     that pad will be 0. This read-only control is applicable to DVI-D
3736     and HDMI devices.
3737
3738 ``V4L2_CID_DV_TX_EDID_PRESENT (bitmask)``
3739     When the transmitter sees the hotplug signal from the receiver it
3740     will attempt to read the EDID. If set, then the transmitter has read
3741     at least the first block (= 128 bytes). Each bit corresponds to an
3742     output pad on the transmitter. If an output pad does not support
3743     EDIDs, then the bit for that pad will be 0. This read-only control
3744     is applicable to VGA, DVI-A/D, HDMI and DisplayPort connectors.
3745
3746 ``V4L2_CID_DV_TX_MODE``
3747     (enum)
3748
3749 enum v4l2_dv_tx_mode -
3750     HDMI transmitters can transmit in DVI-D mode (just video) or in HDMI
3751     mode (video + audio + auxiliary data). This control selects which
3752     mode to use: V4L2_DV_TX_MODE_DVI_D or V4L2_DV_TX_MODE_HDMI.
3753     This control is applicable to HDMI connectors.
3754
3755 ``V4L2_CID_DV_TX_RGB_RANGE``
3756     (enum)
3757
3758 enum v4l2_dv_rgb_range -
3759     Select the quantization range for RGB output. V4L2_DV_RANGE_AUTO
3760     follows the RGB quantization range specified in the standard for the
3761     video interface (ie. :ref:`cea861` for HDMI).
3762     V4L2_DV_RANGE_LIMITED and V4L2_DV_RANGE_FULL override the
3763     standard to be compatible with sinks that have not implemented the
3764     standard correctly (unfortunately quite common for HDMI and DVI-D).
3765     Full range allows all possible values to be used whereas limited
3766     range sets the range to (16 << (N-8)) - (235 << (N-8)) where N is
3767     the number of bits per component. This control is applicable to VGA,
3768     DVI-A/D, HDMI and DisplayPort connectors.
3769
3770 ``V4L2_CID_DV_TX_IT_CONTENT_TYPE``
3771     (enum)
3772
3773 enum v4l2_dv_it_content_type -
3774     Configures the IT Content Type of the transmitted video. This
3775     information is sent over HDMI and DisplayPort connectors as part of
3776     the AVI InfoFrame. The term 'IT Content' is used for content that
3777     originates from a computer as opposed to content from a TV broadcast
3778     or an analog source. The enum v4l2_dv_it_content_type defines
3779     the possible content types:
3780
3781 .. tabularcolumns:: |p{7.0cm}|p{10.5cm}|
3782
3783 .. flat-table::
3784     :header-rows:  0
3785     :stub-columns: 0
3786
3787     * - ``V4L2_DV_IT_CONTENT_TYPE_GRAPHICS``
3788       - Graphics content. Pixel data should be passed unfiltered and
3789         without analog reconstruction.
3790     * - ``V4L2_DV_IT_CONTENT_TYPE_PHOTO``
3791       - Photo content. The content is derived from digital still pictures.
3792         The content should be passed through with minimal scaling and
3793         picture enhancements.
3794     * - ``V4L2_DV_IT_CONTENT_TYPE_CINEMA``
3795       - Cinema content.
3796     * - ``V4L2_DV_IT_CONTENT_TYPE_GAME``
3797       - Game content. Audio and video latency should be minimized.
3798     * - ``V4L2_DV_IT_CONTENT_TYPE_NO_ITC``
3799       - No IT Content information is available and the ITC bit in the AVI
3800         InfoFrame is set to 0.
3801
3802
3803
3804 ``V4L2_CID_DV_RX_POWER_PRESENT (bitmask)``
3805     Detects whether the receiver receives power from the source (e.g.
3806     HDMI carries 5V on one of the pins). This is often used to power an
3807     eeprom which contains EDID information, such that the source can
3808     read the EDID even if the sink is in standby/power off. Each bit
3809     corresponds to an input pad on the receiver. If an input pad
3810     cannot detect whether power is present, then the bit for that pad
3811     will be 0. This read-only control is applicable to DVI-D, HDMI and
3812     DisplayPort connectors.
3813
3814 ``V4L2_CID_DV_RX_RGB_RANGE``
3815     (enum)
3816
3817 enum v4l2_dv_rgb_range -
3818     Select the quantization range for RGB input. V4L2_DV_RANGE_AUTO
3819     follows the RGB quantization range specified in the standard for the
3820     video interface (ie. :ref:`cea861` for HDMI).
3821     V4L2_DV_RANGE_LIMITED and V4L2_DV_RANGE_FULL override the
3822     standard to be compatible with sources that have not implemented the
3823     standard correctly (unfortunately quite common for HDMI and DVI-D).
3824     Full range allows all possible values to be used whereas limited
3825     range sets the range to (16 << (N-8)) - (235 << (N-8)) where N is
3826     the number of bits per component. This control is applicable to VGA,
3827     DVI-A/D, HDMI and DisplayPort connectors.
3828
3829 ``V4L2_CID_DV_RX_IT_CONTENT_TYPE``
3830     (enum)
3831
3832 enum v4l2_dv_it_content_type -
3833     Reads the IT Content Type of the received video. This information is
3834     sent over HDMI and DisplayPort connectors as part of the AVI
3835     InfoFrame. The term 'IT Content' is used for content that originates
3836     from a computer as opposed to content from a TV broadcast or an
3837     analog source. See ``V4L2_CID_DV_TX_IT_CONTENT_TYPE`` for the
3838     available content types.
3839
3840
3841 .. _fm-rx-controls:
3842
3843 FM Receiver Control Reference
3844 =============================
3845
3846 The FM Receiver (FM_RX) class includes controls for common features of
3847 FM Reception capable devices.
3848
3849
3850 .. _fm-rx-control-id:
3851
3852 FM_RX Control IDs
3853 -----------------
3854
3855 ``V4L2_CID_FM_RX_CLASS (class)``
3856     The FM_RX class descriptor. Calling
3857     :ref:`VIDIOC_QUERYCTRL` for this control will
3858     return a description of this control class.
3859
3860 ``V4L2_CID_RDS_RECEPTION (boolean)``
3861     Enables/disables RDS reception by the radio tuner
3862
3863 ``V4L2_CID_RDS_RX_PTY (integer)``
3864     Gets RDS Programme Type field. This encodes up to 31 pre-defined
3865     programme types.
3866
3867 ``V4L2_CID_RDS_RX_PS_NAME (string)``
3868     Gets the Programme Service name (PS_NAME). It is intended for
3869     static display on a receiver. It is the primary aid to listeners in
3870     programme service identification and selection. In Annex E of
3871     :ref:`iec62106`, the RDS specification, there is a full
3872     description of the correct character encoding for Programme Service
3873     name strings. Also from RDS specification, PS is usually a single
3874     eight character text. However, it is also possible to find receivers
3875     which can scroll strings sized as 8 x N characters. So, this control
3876     must be configured with steps of 8 characters. The result is it must
3877     always contain a string with size multiple of 8.
3878
3879 ``V4L2_CID_RDS_RX_RADIO_TEXT (string)``
3880     Gets the Radio Text info. It is a textual description of what is
3881     being broadcasted. RDS Radio Text can be applied when broadcaster
3882     wishes to transmit longer PS names, programme-related information or
3883     any other text. In these cases, RadioText can be used in addition to
3884     ``V4L2_CID_RDS_RX_PS_NAME``. The encoding for Radio Text strings is
3885     also fully described in Annex E of :ref:`iec62106`. The length of
3886     Radio Text strings depends on which RDS Block is being used to
3887     transmit it, either 32 (2A block) or 64 (2B block). However, it is
3888     also possible to find receivers which can scroll strings sized as 32
3889     x N or 64 x N characters. So, this control must be configured with
3890     steps of 32 or 64 characters. The result is it must always contain a
3891     string with size multiple of 32 or 64.
3892
3893 ``V4L2_CID_RDS_RX_TRAFFIC_ANNOUNCEMENT (boolean)``
3894     If set, then a traffic announcement is in progress.
3895
3896 ``V4L2_CID_RDS_RX_TRAFFIC_PROGRAM (boolean)``
3897     If set, then the tuned programme carries traffic announcements.
3898
3899 ``V4L2_CID_RDS_RX_MUSIC_SPEECH (boolean)``
3900     If set, then this channel broadcasts music. If cleared, then it
3901     broadcasts speech. If the transmitter doesn't make this distinction,
3902     then it will be set.
3903
3904 ``V4L2_CID_TUNE_DEEMPHASIS``
3905     (enum)
3906
3907 enum v4l2_deemphasis -
3908     Configures the de-emphasis value for reception. A de-emphasis filter
3909     is applied to the broadcast to accentuate the high audio
3910     frequencies. Depending on the region, a time constant of either 50
3911     or 75 useconds is used. The enum v4l2_deemphasis defines possible
3912     values for de-emphasis. Here they are:
3913
3914
3915
3916 .. flat-table::
3917     :header-rows:  0
3918     :stub-columns: 0
3919
3920     * - ``V4L2_DEEMPHASIS_DISABLED``
3921       - No de-emphasis is applied.
3922     * - ``V4L2_DEEMPHASIS_50_uS``
3923       - A de-emphasis of 50 uS is used.
3924     * - ``V4L2_DEEMPHASIS_75_uS``
3925       - A de-emphasis of 75 uS is used.
3926
3927
3928
3929
3930 .. _detect-controls:
3931
3932 Detect Control Reference
3933 ========================
3934
3935 The Detect class includes controls for common features of various motion
3936 or object detection capable devices.
3937
3938
3939 .. _detect-control-id:
3940
3941 Detect Control IDs
3942 ------------------
3943
3944 ``V4L2_CID_DETECT_CLASS (class)``
3945     The Detect class descriptor. Calling
3946     :ref:`VIDIOC_QUERYCTRL` for this control will
3947     return a description of this control class.
3948
3949 ``V4L2_CID_DETECT_MD_MODE (menu)``
3950     Sets the motion detection mode.
3951
3952 .. tabularcolumns:: |p{7.5cm}|p{10.0cm}|
3953
3954 .. flat-table::
3955     :header-rows:  0
3956     :stub-columns: 0
3957
3958     * - ``V4L2_DETECT_MD_MODE_DISABLED``
3959       - Disable motion detection.
3960     * - ``V4L2_DETECT_MD_MODE_GLOBAL``
3961       - Use a single motion detection threshold.
3962     * - ``V4L2_DETECT_MD_MODE_THRESHOLD_GRID``
3963       - The image is divided into a grid, each cell with its own motion
3964         detection threshold. These thresholds are set through the
3965         ``V4L2_CID_DETECT_MD_THRESHOLD_GRID`` matrix control.
3966     * - ``V4L2_DETECT_MD_MODE_REGION_GRID``
3967       - The image is divided into a grid, each cell with its own region
3968         value that specifies which per-region motion detection thresholds
3969         should be used. Each region has its own thresholds. How these
3970         per-region thresholds are set up is driver-specific. The region
3971         values for the grid are set through the
3972         ``V4L2_CID_DETECT_MD_REGION_GRID`` matrix control.
3973
3974
3975
3976 ``V4L2_CID_DETECT_MD_GLOBAL_THRESHOLD (integer)``
3977     Sets the global motion detection threshold to be used with the
3978     ``V4L2_DETECT_MD_MODE_GLOBAL`` motion detection mode.
3979
3980 ``V4L2_CID_DETECT_MD_THRESHOLD_GRID (__u16 matrix)``
3981     Sets the motion detection thresholds for each cell in the grid. To
3982     be used with the ``V4L2_DETECT_MD_MODE_THRESHOLD_GRID`` motion
3983     detection mode. Matrix element (0, 0) represents the cell at the
3984     top-left of the grid.
3985
3986 ``V4L2_CID_DETECT_MD_REGION_GRID (__u8 matrix)``
3987     Sets the motion detection region value for each cell in the grid. To
3988     be used with the ``V4L2_DETECT_MD_MODE_REGION_GRID`` motion
3989     detection mode. Matrix element (0, 0) represents the cell at the
3990     top-left of the grid.
3991
3992
3993 .. _rf-tuner-controls:
3994
3995 RF Tuner Control Reference
3996 ==========================
3997
3998 The RF Tuner (RF_TUNER) class includes controls for common features of
3999 devices having RF tuner.
4000
4001 In this context, RF tuner is radio receiver circuit between antenna and
4002 demodulator. It receives radio frequency (RF) from the antenna and
4003 converts that received signal to lower intermediate frequency (IF) or
4004 baseband frequency (BB). Tuners that could do baseband output are often
4005 called Zero-IF tuners. Older tuners were typically simple PLL tuners
4006 inside a metal box, while newer ones are highly integrated chips
4007 without a metal box "silicon tuners". These controls are mostly
4008 applicable for new feature rich silicon tuners, just because older
4009 tuners does not have much adjustable features.
4010
4011 For more information about RF tuners see
4012 `Tuner (radio) <http://en.wikipedia.org/wiki/Tuner_%28radio%29>`__
4013 and `RF front end <http://en.wikipedia.org/wiki/RF_front_end>`__
4014 from Wikipedia.
4015
4016
4017 .. _rf-tuner-control-id:
4018
4019 RF_TUNER Control IDs
4020 --------------------
4021
4022 ``V4L2_CID_RF_TUNER_CLASS (class)``
4023     The RF_TUNER class descriptor. Calling
4024     :ref:`VIDIOC_QUERYCTRL` for this control will
4025     return a description of this control class.
4026
4027 ``V4L2_CID_RF_TUNER_BANDWIDTH_AUTO (boolean)``
4028     Enables/disables tuner radio channel bandwidth configuration. In
4029     automatic mode bandwidth configuration is performed by the driver.
4030
4031 ``V4L2_CID_RF_TUNER_BANDWIDTH (integer)``
4032     Filter(s) on tuner signal path are used to filter signal according
4033     to receiving party needs. Driver configures filters to fulfill
4034     desired bandwidth requirement. Used when
4035     V4L2_CID_RF_TUNER_BANDWIDTH_AUTO is not set. Unit is in Hz. The
4036     range and step are driver-specific.
4037
4038 ``V4L2_CID_RF_TUNER_LNA_GAIN_AUTO (boolean)``
4039     Enables/disables LNA automatic gain control (AGC)
4040
4041 ``V4L2_CID_RF_TUNER_MIXER_GAIN_AUTO (boolean)``
4042     Enables/disables mixer automatic gain control (AGC)
4043
4044 ``V4L2_CID_RF_TUNER_IF_GAIN_AUTO (boolean)``
4045     Enables/disables IF automatic gain control (AGC)
4046
4047 ``V4L2_CID_RF_TUNER_RF_GAIN (integer)``
4048     The RF amplifier is the very first amplifier on the receiver signal
4049     path, just right after the antenna input. The difference between the
4050     LNA gain and the RF gain in this document is that the LNA gain is
4051     integrated in the tuner chip while the RF gain is a separate chip.
4052     There may be both RF and LNA gain controls in the same device. The
4053     range and step are driver-specific.
4054
4055 ``V4L2_CID_RF_TUNER_LNA_GAIN (integer)``
4056     LNA (low noise amplifier) gain is first gain stage on the RF tuner
4057     signal path. It is located very close to tuner antenna input. Used
4058     when ``V4L2_CID_RF_TUNER_LNA_GAIN_AUTO`` is not set. See
4059     ``V4L2_CID_RF_TUNER_RF_GAIN`` to understand how RF gain and LNA gain
4060     differs from the each others. The range and step are
4061     driver-specific.
4062
4063 ``V4L2_CID_RF_TUNER_MIXER_GAIN (integer)``
4064     Mixer gain is second gain stage on the RF tuner signal path. It is
4065     located inside mixer block, where RF signal is down-converted by the
4066     mixer. Used when ``V4L2_CID_RF_TUNER_MIXER_GAIN_AUTO`` is not set.
4067     The range and step are driver-specific.
4068
4069 ``V4L2_CID_RF_TUNER_IF_GAIN (integer)``
4070     IF gain is last gain stage on the RF tuner signal path. It is
4071     located on output of RF tuner. It controls signal level of
4072     intermediate frequency output or baseband output. Used when
4073     ``V4L2_CID_RF_TUNER_IF_GAIN_AUTO`` is not set. The range and step
4074     are driver-specific.
4075
4076 ``V4L2_CID_RF_TUNER_PLL_LOCK (boolean)``
4077     Is synthesizer PLL locked? RF tuner is receiving given frequency
4078     when that control is set. This is a read-only control.
4079
4080 .. [#f1]
4081    This control may be changed to a menu control in the future, if more
4082    options are required.