1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Appendix C. Video For Linux Two Header File</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API"><link rel="up" href="v4l2spec.html" title="Part I. Video for Linux Two API Specification"><link rel="prev" href="apb.html" title="Appendix B. Common definitions for V4L2 and V4L2 subdev interfaces"><link rel="next" href="capture-example.html" title="Appendix D. Video Capture Example"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix C. Video For Linux Two Header File</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apb.html">Prev</a> </td><th width="60%" align="center">Part I. Video for Linux Two API Specification</th><td width="20%" align="right"> <a accesskey="n" href="capture-example.html">Next</a></td></tr></table><hr></div><div class="appendix"><div class="titlepage"><div><div><h2 class="title"><a name="videodev"></a>Appendix C. Video For Linux Two Header File</h2></div></div></div><pre class="programlisting">
2/*
3 *  Video for Linux Two header file
4 *
5 *  Copyright (C) 1999-2012 the contributors
6 *
7 *  This program is free software; you can redistribute it and/or modify
8 *  it under the terms of the GNU General Public License as published by
9 *  the Free Software Foundation; either version 2 of the License, or
10 *  (at your option) any later version.
11 *
12 *  This program is distributed in the hope that it will be useful,
13 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 *  GNU General Public License for more details.
16 *
17 *  Alternatively you can redistribute this file under the terms of the
18 *  BSD license as stated below:
19 *
20 *  Redistribution and use in source and binary forms, with or without
21 *  modification, are permitted provided that the following conditions
22 *  are met:
23 *  1. Redistributions of source code must retain the above copyright
24 *     notice, this list of conditions and the following disclaimer.
25 *  2. Redistributions in binary form must reproduce the above copyright
26 *     notice, this list of conditions and the following disclaimer in
27 *     the documentation and/or other materials provided with the
28 *     distribution.
29 *  3. The names of its contributors may not be used to endorse or promote
30 *     products derived from this software without specific prior written
31 *     permission.
32 *
33 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
34 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
35 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
36 *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
37 *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
38 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
39 *  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
40 *  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
41 *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
42 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
43 *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44 *
45 *      Header file for v4l or V4L2 drivers and applications
46 * with public API.
47 * All kernel-specific stuff were moved to media/v4l2-dev.h, so
48 * no #if __KERNEL tests are allowed here
49 *
50 *      See http://linuxtv.org for more info
51 *
52 *      Author: Bill Dirks &lt;bill@thedirks.org&gt;
53 *              Justin Schoeman
54 *              Hans Verkuil &lt;hverkuil@xs4all.nl&gt;
55 *              et al.
56 */
57#ifndef _UAPI__LINUX_VIDEODEV2_H
58#define _UAPI__LINUX_VIDEODEV2_H
59
60#ifndef __KERNEL__
61#include &lt;sys/time.h&gt;
62#endif
63#include &lt;linux/compiler.h&gt;
64#include &lt;linux/ioctl.h&gt;
65#include &lt;linux/types.h&gt;
66#include &lt;linux/v4l2-common.h&gt;
67#include &lt;linux/v4l2-controls.h&gt;
68
69/*
70 * Common stuff for both V4L1 and V4L2
71 * Moved from videodev.h
72 */
73#define VIDEO_MAX_FRAME               32
74#define VIDEO_MAX_PLANES               8
75
76/*
77 *      M I S C E L L A N E O U S
78 */
79
80/*  Four-character-code (FOURCC) */
81#define v4l2_fourcc(a, b, c, d)\
82        ((__u32)(a) | ((__u32)(b) &lt;&lt; 8) | ((__u32)(c) &lt;&lt; 16) | ((__u32)(d) &lt;&lt; 24))
83#define v4l2_fourcc_be(a, b, c, d)      (v4l2_fourcc(a, b, c, d) | (1 &lt;&lt; 31))
84
85/*
86 *      E N U M S
87 */
88enum <a class="link" href="field-order.html#v4l2-field" title="Table 3.9. enum v4l2_field">v4l2_field</a> {
89        V4L2_FIELD_ANY           = 0, /* driver can choose from none,
90                                         top, bottom, interlaced
91                                         depending on whatever it thinks
92                                         is approximate ... */
93        V4L2_FIELD_NONE          = 1, /* this device has no fields ... */
94        V4L2_FIELD_TOP           = 2, /* top field only */
95        V4L2_FIELD_BOTTOM        = 3, /* bottom field only */
96        V4L2_FIELD_INTERLACED    = 4, /* both fields interlaced */
97        V4L2_FIELD_SEQ_TB        = 5, /* both fields sequential into one
98                                         buffer, top-bottom order */
99        V4L2_FIELD_SEQ_BT        = 6, /* same as above + bottom-top order */
100        V4L2_FIELD_ALTERNATE     = 7, /* both fields alternating into
101                                         separate buffers */
102        V4L2_FIELD_INTERLACED_TB = 8, /* both fields interlaced, top field
103                                         first and the top field is
104                                         transmitted first */
105        V4L2_FIELD_INTERLACED_BT = 9, /* both fields interlaced, top field
106                                         first and the bottom field is
107                                         transmitted first */
108};
109#define V4L2_FIELD_HAS_TOP(field)       \
110        ((field) == V4L2_FIELD_TOP      ||\
111         (field) == V4L2_FIELD_INTERLACED ||\
112         (field) == V4L2_FIELD_INTERLACED_TB ||\
113         (field) == V4L2_FIELD_INTERLACED_BT ||\
114         (field) == V4L2_FIELD_SEQ_TB   ||\
115         (field) == V4L2_FIELD_SEQ_BT)
116#define V4L2_FIELD_HAS_BOTTOM(field)    \
117        ((field) == V4L2_FIELD_BOTTOM   ||\
118         (field) == V4L2_FIELD_INTERLACED ||\
119         (field) == V4L2_FIELD_INTERLACED_TB ||\
120         (field) == V4L2_FIELD_INTERLACED_BT ||\
121         (field) == V4L2_FIELD_SEQ_TB   ||\
122         (field) == V4L2_FIELD_SEQ_BT)
123#define V4L2_FIELD_HAS_BOTH(field)      \
124        ((field) == V4L2_FIELD_INTERLACED ||\
125         (field) == V4L2_FIELD_INTERLACED_TB ||\
126         (field) == V4L2_FIELD_INTERLACED_BT ||\
127         (field) == V4L2_FIELD_SEQ_TB ||\
128         (field) == V4L2_FIELD_SEQ_BT)
129#define V4L2_FIELD_HAS_T_OR_B(field)    \
130        ((field) == V4L2_FIELD_BOTTOM ||\
131         (field) == V4L2_FIELD_TOP ||\
132         (field) == V4L2_FIELD_ALTERNATE)
133
134enum <a class="link" href="buffer.html#v4l2-buf-type" title="Table 3.3. enum v4l2_buf_type">v4l2_buf_type</a> {
135        V4L2_BUF_TYPE_VIDEO_CAPTURE        = 1,
136        V4L2_BUF_TYPE_VIDEO_OUTPUT         = 2,
137        V4L2_BUF_TYPE_VIDEO_OVERLAY        = 3,
138        V4L2_BUF_TYPE_VBI_CAPTURE          = 4,
139        V4L2_BUF_TYPE_VBI_OUTPUT           = 5,
140        V4L2_BUF_TYPE_SLICED_VBI_CAPTURE   = 6,
141        V4L2_BUF_TYPE_SLICED_VBI_OUTPUT    = 7,
142#if 1
143        /* Experimental */
144        V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8,
145#endif
146        V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9,
147        V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE  = 10,
148        V4L2_BUF_TYPE_SDR_CAPTURE          = 11,
149        V4L2_BUF_TYPE_SDR_OUTPUT           = 12,
150        /* Deprecated, do not use */
151        V4L2_BUF_TYPE_PRIVATE              = 0x80,
152};
153
154#define V4L2_TYPE_IS_MULTIPLANAR(type)                  \
155        ((type) == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE   \
156         || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
157
158#define V4L2_TYPE_IS_OUTPUT(type)                               \
159        ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT                   \
160         || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE         \
161         || (type) == V4L2_BUF_TYPE_VIDEO_OVERLAY               \
162         || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY        \
163         || (type) == V4L2_BUF_TYPE_VBI_OUTPUT                  \
164         || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT           \
165         || (type) == V4L2_BUF_TYPE_SDR_OUTPUT)
166
167enum <a class="link" href="vidioc-g-tuner.html#v4l2-tuner-type" title="Table A.88. enum v4l2_tuner_type">v4l2_tuner_type</a> {
168        V4L2_TUNER_RADIO             = 1,
169        V4L2_TUNER_ANALOG_TV         = 2,
170        V4L2_TUNER_DIGITAL_TV        = 3,
171        V4L2_TUNER_SDR               = 4,
172        V4L2_TUNER_RF                = 5,
173};
174
175/* Deprecated, do not use */
176#define V4L2_TUNER_ADC  V4L2_TUNER_SDR
177
178enum <a class="link" href="buffer.html#v4l2-memory" title="Table 3.5. enum v4l2_memory">v4l2_memory</a> {
179        V4L2_MEMORY_MMAP             = 1,
180        V4L2_MEMORY_USERPTR          = 2,
181        V4L2_MEMORY_OVERLAY          = 3,
182        V4L2_MEMORY_DMABUF           = 4,
183};
184
185/* see also http://vektor.theorem.ca/graphics/ycbcr/ */
186enum <a class="link" href="ch02s05.html#v4l2-colorspace" title="Table 2.4. V4L2 Colorspaces">v4l2_colorspace</a> {
187        /*
188         * Default colorspace, i.e.ie; let the driver figure it out.
189         * Can only be used with video capture.
190         */
191        V4L2_COLORSPACE_DEFAULT       = 0,
192
193        /* SMPTE 170M: used for broadcast NTSC/PAL SDTV */
194        V4L2_COLORSPACE_SMPTE170M     = 1,
195
196        /* Obsolete pre-1998 SMPTE 240M HDTV standard, superseded by Rec 709 */
197        V4L2_COLORSPACE_SMPTE240M     = 2,
198
199        /* Rec.709: used for HDTV */
200        V4L2_COLORSPACE_REC709        = 3,
201
202        /*
203         * Deprecated, do not use. No driver will ever return this. This was
204         * based on a misunderstanding of the bt878 datasheet.
205         */
206        V4L2_COLORSPACE_BT878         = 4,
207
208        /*
209         * NTSC 1953 colorspace. This only makes sense when dealing with
210         * really, really old NTSC recordings. Superseded by SMPTE 170M.
211         */
212        V4L2_COLORSPACE_470_SYSTEM_M  = 5,
213
214        /*
215         * EBU Tech 3213 PAL/SECAM colorspace. This only makes sense when
216         * dealing with really old PAL/SECAM recordings. Superseded by
217         * SMPTE 170M.
218         */
219        V4L2_COLORSPACE_470_SYSTEM_BG = 6,
220
221        /*
222         * Effectively shorthand for V4L2_COLORSPACE_SRGB, V4L2_YCBCR_ENC_601
223         * and V4L2_QUANTIZATION_FULL_RANGE. To be used for (Motion-)JPEG.
224         */
225        V4L2_COLORSPACE_JPEG          = 7,
226
227        /* For RGB colorspaces such as produces by most webcams. */
228        V4L2_COLORSPACE_SRGB          = 8,
229
230        /* AdobeRGB colorspace */
231        V4L2_COLORSPACE_ADOBERGB      = 9,
232
233        /* BT.2020 colorspace, used for UHDTV. */
234        V4L2_COLORSPACE_BT2020        = 10,
235
236        /* Raw colorspace: for RAW unprocessed images */
237        V4L2_COLORSPACE_RAW           = 11,
238
239        /* DCI-P3 colorspace, used by cinema projectors */
240        V4L2_COLORSPACE_DCI_P3        = 12,
241};
242
243/*
244 * Determine how COLORSPACE_DEFAULT should map to a proper colorspace.
245 * This depends on whether this is a SDTV image (use SMPTE 170M), an
246 * HDTV image (use Rec. 709), or something else (use sRGB).
247 */
248#define V4L2_MAP_COLORSPACE_DEFAULT(is_sdtv, is_hdtv) \
249        ((is_sdtv) ? V4L2_COLORSPACE_SMPTE170M : \
250         ((is_hdtv) ? V4L2_COLORSPACE_REC709 : V4L2_COLORSPACE_SRGB))
251
252enum <a class="link" href="ch02s05.html#v4l2-xfer-func" title="Table 2.5. V4L2 Transfer Function">v4l2_xfer_func</a> {
253        /*
254         * Mapping of V4L2_XFER_FUNC_DEFAULT to actual transfer functions
255         * for the various colorspaces:
256         *
257         * V4L2_COLORSPACE_SMPTE170M, V4L2_COLORSPACE_470_SYSTEM_M,
258         * V4L2_COLORSPACE_470_SYSTEM_BG, V4L2_COLORSPACE_REC709 and
259         * V4L2_COLORSPACE_BT2020: V4L2_XFER_FUNC_709
260         *
261         * V4L2_COLORSPACE_SRGB, V4L2_COLORSPACE_JPEG: V4L2_XFER_FUNC_SRGB
262         *
263         * V4L2_COLORSPACE_ADOBERGB: V4L2_XFER_FUNC_ADOBERGB
264         *
265         * V4L2_COLORSPACE_SMPTE240M: V4L2_XFER_FUNC_SMPTE240M
266         *
267         * V4L2_COLORSPACE_RAW: V4L2_XFER_FUNC_NONE
268         *
269         * V4L2_COLORSPACE_DCI_P3: V4L2_XFER_FUNC_DCI_P3
270         */
271        V4L2_XFER_FUNC_DEFAULT     = 0,
272        V4L2_XFER_FUNC_709         = 1,
273        V4L2_XFER_FUNC_SRGB        = 2,
274        V4L2_XFER_FUNC_ADOBERGB    = 3,
275        V4L2_XFER_FUNC_SMPTE240M   = 4,
276        V4L2_XFER_FUNC_NONE        = 5,
277        V4L2_XFER_FUNC_DCI_P3      = 6,
278        V4L2_XFER_FUNC_SMPTE2084   = 7,
279};
280
281/*
282 * Determine how XFER_FUNC_DEFAULT should map to a proper transfer function.
283 * This depends on the colorspace.
284 */
285#define V4L2_MAP_XFER_FUNC_DEFAULT(colsp) \
286        ((colsp) == V4L2_COLORSPACE_ADOBERGB ? V4L2_XFER_FUNC_ADOBERGB : \
287         ((colsp) == V4L2_COLORSPACE_SMPTE240M ? V4L2_XFER_FUNC_SMPTE240M : \
288          ((colsp) == V4L2_COLORSPACE_DCI_P3 ? V4L2_XFER_FUNC_DCI_P3 : \
289           ((colsp) == V4L2_COLORSPACE_RAW ? V4L2_XFER_FUNC_NONE : \
290            ((colsp) == V4L2_COLORSPACE_SRGB || (colsp) == V4L2_COLORSPACE_JPEG ? \
291             V4L2_XFER_FUNC_SRGB : V4L2_XFER_FUNC_709)))))
292
293enum <a class="link" href="ch02s05.html#v4l2-ycbcr-encoding" title="Table 2.6. V4L2 Y'CbCr Encodings">v4l2_ycbcr_encoding</a> {
294        /*
295         * Mapping of V4L2_YCBCR_ENC_DEFAULT to actual encodings for the
296         * various colorspaces:
297         *
298         * V4L2_COLORSPACE_SMPTE170M, V4L2_COLORSPACE_470_SYSTEM_M,
299         * V4L2_COLORSPACE_470_SYSTEM_BG, V4L2_COLORSPACE_ADOBERGB and
300         * V4L2_COLORSPACE_JPEG: V4L2_YCBCR_ENC_601
301         *
302         * V4L2_COLORSPACE_REC709 and V4L2_COLORSPACE_DCI_P3: V4L2_YCBCR_ENC_709
303         *
304         * V4L2_COLORSPACE_SRGB: V4L2_YCBCR_ENC_SYCC
305         *
306         * V4L2_COLORSPACE_BT2020: V4L2_YCBCR_ENC_BT2020
307         *
308         * V4L2_COLORSPACE_SMPTE240M: V4L2_YCBCR_ENC_SMPTE240M
309         */
310        V4L2_YCBCR_ENC_DEFAULT        = 0,
311
312        /* ITU-R 601 -- SDTV */
313        V4L2_YCBCR_ENC_601            = 1,
314
315        /* Rec. 709 -- HDTV */
316        V4L2_YCBCR_ENC_709            = 2,
317
318        /* ITU-R 601/EN 61966-2-4 Extended Gamut -- SDTV */
319        V4L2_YCBCR_ENC_XV601          = 3,
320
321        /* Rec. 709/EN 61966-2-4 Extended Gamut -- HDTV */
322        V4L2_YCBCR_ENC_XV709          = 4,
323
324        /* sYCC (Y'CbCr encoding of sRGB) */
325        V4L2_YCBCR_ENC_SYCC           = 5,
326
327        /* BT.2020 Non-constant Luminance Y'CbCr */
328        V4L2_YCBCR_ENC_BT2020         = 6,
329
330        /* BT.2020 Constant Luminance Y'CbcCrc */
331        V4L2_YCBCR_ENC_BT2020_CONST_LUM = 7,
332
333        /* SMPTE 240M -- Obsolete HDTV */
334        V4L2_YCBCR_ENC_SMPTE240M      = 8,
335};
336
337/*
338 * Determine how YCBCR_ENC_DEFAULT should map to a proper Y'CbCr encoding.
339 * This depends on the colorspace.
340 */
341#define V4L2_MAP_YCBCR_ENC_DEFAULT(colsp) \
342        (((colsp) == V4L2_COLORSPACE_REC709 || \
343          (colsp) == V4L2_COLORSPACE_DCI_P3) ? V4L2_YCBCR_ENC_709 : \
344         ((colsp) == V4L2_COLORSPACE_BT2020 ? V4L2_YCBCR_ENC_BT2020 : \
345          ((colsp) == V4L2_COLORSPACE_SMPTE240M ? V4L2_YCBCR_ENC_SMPTE240M : \
346           V4L2_YCBCR_ENC_601)))
347
348enum <a class="link" href="ch02s05.html#v4l2-quantization" title="Table 2.7. V4L2 Quantization Methods">v4l2_quantization</a> {
349        /*
350         * The default for R'G'B' quantization is always full range, except
351         * for the BT2020 colorspace. For Y'CbCr the quantization is always
352         * limited range, except for COLORSPACE_JPEG, SYCC, XV601 or XV709:
353         * those are full range.
354         */
355        V4L2_QUANTIZATION_DEFAULT     = 0,
356        V4L2_QUANTIZATION_FULL_RANGE  = 1,
357        V4L2_QUANTIZATION_LIM_RANGE   = 2,
358};
359
360/*
361 * Determine how QUANTIZATION_DEFAULT should map to a proper quantization.
362 * This depends on whether the image is RGB or not, the colorspace and the
363 * Y'CbCr encoding.
364 */
365#define V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb, colsp, ycbcr_enc) \
366        (((is_rgb) &amp;&amp; (colsp) == V4L2_COLORSPACE_BT2020) ? V4L2_QUANTIZATION_LIM_RANGE : \
367         (((is_rgb) || (ycbcr_enc) == V4L2_YCBCR_ENC_XV601 || \
368          (ycbcr_enc) == V4L2_YCBCR_ENC_XV709 || (colsp) == V4L2_COLORSPACE_JPEG) ? \
369         V4L2_QUANTIZATION_FULL_RANGE : V4L2_QUANTIZATION_LIM_RANGE))
370
371enum <a class="link" href="vidioc-g-priority.html#v4l2-priority" title="Table A.83. enum v4l2_priority">v4l2_priority</a> {
372        V4L2_PRIORITY_UNSET       = 0,  /* not initialized */
373        V4L2_PRIORITY_BACKGROUND  = 1,
374        V4L2_PRIORITY_INTERACTIVE = 2,
375        V4L2_PRIORITY_RECORD      = 3,
376        V4L2_PRIORITY_DEFAULT     = V4L2_PRIORITY_INTERACTIVE,
377};
378
379struct <a class="link" href="overlay.html#v4l2-rect" title="Table 4.3. struct v4l2_rect">v4l2_rect</a> {
380        __s32   left;
381        __s32   top;
382        __u32   width;
383        __u32   height;
384};
385
386struct <a class="link" href="vidioc-enumstd.html#v4l2-fract" title="Table A.47. struct v4l2_fract">v4l2_fract</a> {
387        __u32   numerator;
388        __u32   denominator;
389};
390
391/**
392  * struct <a class="link" href="vidioc-querycap.html#v4l2-capability" title="Table A.93. struct v4l2_capability">v4l2_capability</a> - Describes V4L2 device caps returned by VIDIOC_QUERYCAP
393  *
394  * @driver:       name of the driver module (e.g. "bttv")
395  * @card:         name of the card (e.g. "Hauppauge WinTV")
396  * @bus_info:     name of the bus (e.g. "PCI:" + pci_name(pci_dev) )
397  * @version:      KERNEL_VERSION
398  * @capabilities: capabilities of the physical device as a whole
399  * @device_caps:  capabilities accessed via this particular device (node)
400  * @reserved:     reserved fields for future extensions
401  */
402struct <a class="link" href="vidioc-querycap.html#v4l2-capability" title="Table A.93. struct v4l2_capability">v4l2_capability</a> {
403        __u8    driver[16];
404        __u8    card[32];
405        __u8    bus_info[32];
406        __u32   version;
407        __u32   capabilities;
408        __u32   device_caps;
409        __u32   reserved[3];
410};
411
412/* Values for 'capabilities' field */
413#define V4L2_CAP_VIDEO_CAPTURE          0x00000001  /* Is a video capture device */
414#define V4L2_CAP_VIDEO_OUTPUT           0x00000002  /* Is a video output device */
415#define V4L2_CAP_VIDEO_OVERLAY          0x00000004  /* Can do video overlay */
416#define V4L2_CAP_VBI_CAPTURE            0x00000010  /* Is a raw VBI capture device */
417#define V4L2_CAP_VBI_OUTPUT             0x00000020  /* Is a raw VBI output device */
418#define V4L2_CAP_SLICED_VBI_CAPTURE     0x00000040  /* Is a sliced VBI capture device */
419#define V4L2_CAP_SLICED_VBI_OUTPUT      0x00000080  /* Is a sliced VBI output device */
420#define V4L2_CAP_RDS_CAPTURE            0x00000100  /* RDS data capture */
421#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY   0x00000200  /* Can do video output overlay */
422#define V4L2_CAP_HW_FREQ_SEEK           0x00000400  /* Can do hardware frequency seek  */
423#define V4L2_CAP_RDS_OUTPUT             0x00000800  /* Is an RDS encoder */
424
425/* Is a video capture device that supports multiplanar formats */
426#define V4L2_CAP_VIDEO_CAPTURE_MPLANE   0x00001000
427/* Is a video output device that supports multiplanar formats */
428#define V4L2_CAP_VIDEO_OUTPUT_MPLANE    0x00002000
429/* Is a video mem-to-mem device that supports multiplanar formats */
430#define V4L2_CAP_VIDEO_M2M_MPLANE       0x00004000
431/* Is a video mem-to-mem device */
432#define V4L2_CAP_VIDEO_M2M              0x00008000
433
434#define V4L2_CAP_TUNER                  0x00010000  /* has a tuner */
435#define V4L2_CAP_AUDIO                  0x00020000  /* has audio support */
436#define V4L2_CAP_RADIO                  0x00040000  /* is a radio device */
437#define V4L2_CAP_MODULATOR              0x00080000  /* has a modulator */
438
439#define V4L2_CAP_SDR_CAPTURE            0x00100000  /* Is a SDR capture device */
440#define V4L2_CAP_EXT_PIX_FORMAT         0x00200000  /* Supports the extended pixel format */
441#define V4L2_CAP_SDR_OUTPUT             0x00400000  /* Is a SDR output device */
442
443#define V4L2_CAP_READWRITE              0x01000000  /* read/write systemcalls */
444#define V4L2_CAP_ASYNCIO                0x02000000  /* async I/O */
445#define V4L2_CAP_STREAMING              0x04000000  /* streaming I/O ioctls */
446
447#define V4L2_CAP_DEVICE_CAPS            0x80000000  /* sets device capabilities field */
448
449/*
450 *      V I D E O   I M A G E   F O R M A T
451 */
452struct <a class="link" href="pixfmt.html#v4l2-pix-format" title="Table 2.1. struct v4l2_pix_format">v4l2_pix_format</a> {
453        __u32                   width;
454        __u32                   height;
455        __u32                   pixelformat;
456        __u32                   field;          /* enum <a class="link" href="field-order.html#v4l2-field" title="Table 3.9. enum v4l2_field">v4l2_field</a> */
457        __u32                   bytesperline;   /* for padding, zero if unused */
458        __u32                   sizeimage;
459        __u32                   colorspace;     /* enum <a class="link" href="ch02s05.html#v4l2-colorspace" title="Table 2.4. V4L2 Colorspaces">v4l2_colorspace</a> */
460        __u32                   priv;           /* private data, depends on pixelformat */
461        __u32                   flags;          /* format flags (V4L2_PIX_FMT_FLAG_*) */
462        __u32                   ycbcr_enc;      /* enum <a class="link" href="ch02s05.html#v4l2-ycbcr-encoding" title="Table 2.6. V4L2 Y'CbCr Encodings">v4l2_ycbcr_encoding</a> */
463        __u32                   quantization;   /* enum <a class="link" href="ch02s05.html#v4l2-quantization" title="Table 2.7. V4L2 Quantization Methods">v4l2_quantization</a> */
464        __u32                   xfer_func;      /* enum <a class="link" href="ch02s05.html#v4l2-xfer-func" title="Table 2.5. V4L2 Transfer Function">v4l2_xfer_func</a> */
465};
466
467/*      Pixel format         FOURCC                          depth  Description  */
468
469/* RGB formats */
470#define <a class="link" href="packed-rgb.html#V4L2-PIX-FMT-RGB332">V4L2_PIX_FMT_RGB332</a>  v4l2_fourcc('R', 'G', 'B', '1') /*  8  RGB-3-3-2     */
471#define <a class="link" href="packed-rgb.html#V4L2-PIX-FMT-RGB444">V4L2_PIX_FMT_RGB444</a>  v4l2_fourcc('R', '4', '4', '4') /* 16  xxxxrrrr ggggbbbb */
472#define <a class="link" href="packed-rgb.html#V4L2-PIX-FMT-ARGB444">V4L2_PIX_FMT_ARGB444</a> v4l2_fourcc('A', 'R', '1', '2') /* 16  aaaarrrr ggggbbbb */
473#define <a class="link" href="packed-rgb.html#V4L2-PIX-FMT-XRGB444">V4L2_PIX_FMT_XRGB444</a> v4l2_fourcc('X', 'R', '1', '2') /* 16  xxxxrrrr ggggbbbb */
474#define <a class="link" href="packed-rgb.html#V4L2-PIX-FMT-RGB555">V4L2_PIX_FMT_RGB555</a>  v4l2_fourcc('R', 'G', 'B', 'O') /* 16  RGB-5-5-5     */
475#define <a class="link" href="packed-rgb.html#V4L2-PIX-FMT-ARGB555">V4L2_PIX_FMT_ARGB555</a> v4l2_fourcc('A', 'R', '1', '5') /* 16  ARGB-1-5-5-5  */
476#define <a class="link" href="packed-rgb.html#V4L2-PIX-FMT-XRGB555">V4L2_PIX_FMT_XRGB555</a> v4l2_fourcc('X', 'R', '1', '5') /* 16  XRGB-1-5-5-5  */
477#define <a class="link" href="packed-rgb.html#V4L2-PIX-FMT-RGB565">V4L2_PIX_FMT_RGB565</a>  v4l2_fourcc('R', 'G', 'B', 'P') /* 16  RGB-5-6-5     */
478#define <a class="link" href="packed-rgb.html#V4L2-PIX-FMT-RGB555X">V4L2_PIX_FMT_RGB555X</a> v4l2_fourcc('R', 'G', 'B', 'Q') /* 16  RGB-5-5-5 BE  */
479#define <a class="link" href="packed-rgb.html#V4L2-PIX-FMT-ARGB555X">V4L2_PIX_FMT_ARGB555X</a> v4l2_fourcc_be('A', 'R', '1', '5') /* 16  ARGB-5-5-5 BE */
480#define <a class="link" href="packed-rgb.html#V4L2-PIX-FMT-XRGB555X">V4L2_PIX_FMT_XRGB555X</a> v4l2_fourcc_be('X', 'R', '1', '5') /* 16  XRGB-5-5-5 BE */
481#define <a class="link" href="packed-rgb.html#V4L2-PIX-FMT-RGB565X">V4L2_PIX_FMT_RGB565X</a> v4l2_fourcc('R', 'G', 'B', 'R') /* 16  RGB-5-6-5 BE  */
482#define <a class="link" href="packed-rgb.html#V4L2-PIX-FMT-BGR666">V4L2_PIX_FMT_BGR666</a>  v4l2_fourcc('B', 'G', 'R', 'H') /* 18  BGR-6-6-6     */
483#define <a class="link" href="packed-rgb.html#V4L2-PIX-FMT-BGR24">V4L2_PIX_FMT_BGR24</a>   v4l2_fourcc('B', 'G', 'R', '3') /* 24  BGR-8-8-8     */
484#define <a class="link" href="packed-rgb.html#V4L2-PIX-FMT-RGB24">V4L2_PIX_FMT_RGB24</a>   v4l2_fourcc('R', 'G', 'B', '3') /* 24  RGB-8-8-8     */
485#define <a class="link" href="packed-rgb.html#V4L2-PIX-FMT-BGR32">V4L2_PIX_FMT_BGR32</a>   v4l2_fourcc('B', 'G', 'R', '4') /* 32  BGR-8-8-8-8   */
486#define <a class="link" href="packed-rgb.html#V4L2-PIX-FMT-ABGR32">V4L2_PIX_FMT_ABGR32</a>  v4l2_fourcc('A', 'R', '2', '4') /* 32  BGRA-8-8-8-8  */
487#define <a class="link" href="packed-rgb.html#V4L2-PIX-FMT-XBGR32">V4L2_PIX_FMT_XBGR32</a>  v4l2_fourcc('X', 'R', '2', '4') /* 32  BGRX-8-8-8-8  */
488#define <a class="link" href="packed-rgb.html#V4L2-PIX-FMT-RGB32">V4L2_PIX_FMT_RGB32</a>   v4l2_fourcc('R', 'G', 'B', '4') /* 32  RGB-8-8-8-8   */
489#define <a class="link" href="packed-rgb.html#V4L2-PIX-FMT-ARGB32">V4L2_PIX_FMT_ARGB32</a>  v4l2_fourcc('B', 'A', '2', '4') /* 32  ARGB-8-8-8-8  */
490#define <a class="link" href="packed-rgb.html#V4L2-PIX-FMT-XRGB32">V4L2_PIX_FMT_XRGB32</a>  v4l2_fourcc('B', 'X', '2', '4') /* 32  XRGB-8-8-8-8  */
491
492/* Grey formats */
493#define <a class="link" href="V4L2-PIX-FMT-GREY.html" title="V4L2_PIX_FMT_GREY ('GREY')">V4L2_PIX_FMT_GREY</a>    v4l2_fourcc('G', 'R', 'E', 'Y') /*  8  Greyscale     */
494#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-Y4">V4L2_PIX_FMT_Y4</a>      v4l2_fourcc('Y', '0', '4', ' ') /*  4  Greyscale     */
495#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-Y6">V4L2_PIX_FMT_Y6</a>      v4l2_fourcc('Y', '0', '6', ' ') /*  6  Greyscale     */
496#define <a class="link" href="V4L2-PIX-FMT-Y10.html" title="V4L2_PIX_FMT_Y10 ('Y10 ')">V4L2_PIX_FMT_Y10</a>     v4l2_fourcc('Y', '1', '0', ' ') /* 10  Greyscale     */
497#define <a class="link" href="V4L2-PIX-FMT-Y12.html" title="V4L2_PIX_FMT_Y12 ('Y12 ')">V4L2_PIX_FMT_Y12</a>     v4l2_fourcc('Y', '1', '2', ' ') /* 12  Greyscale     */
498#define <a class="link" href="V4L2-PIX-FMT-Y16.html" title="V4L2_PIX_FMT_Y16 ('Y16 ')">V4L2_PIX_FMT_Y16</a>     v4l2_fourcc('Y', '1', '6', ' ') /* 16  Greyscale     */
499#define <a class="link" href="V4L2-PIX-FMT-Y16-BE.html" title="V4L2_PIX_FMT_Y16_BE ('Y16 ' | (1 &lt;&lt; 31))">V4L2_PIX_FMT_Y16_BE</a>  v4l2_fourcc_be('Y', '1', '6', ' ') /* 16  Greyscale BE  */
500
501/* Grey bit-packed formats */
502#define <a class="link" href="V4L2-PIX-FMT-Y10BPACK.html" title="V4L2_PIX_FMT_Y10BPACK ('Y10B')">V4L2_PIX_FMT_Y10BPACK</a>    v4l2_fourcc('Y', '1', '0', 'B') /* 10  Greyscale bit-packed */
503
504/* Palette formats */
505#define <a class="link" href="pixfmt-indexed.html#V4L2-PIX-FMT-PAL8">V4L2_PIX_FMT_PAL8</a>    v4l2_fourcc('P', 'A', 'L', '8') /*  8  8-bit palette */
506
507/* Chrominance formats */
508#define <a class="link" href="V4L2-PIX-FMT-UV8.html" title="V4L2_PIX_FMT_UV8 ('UV8')">V4L2_PIX_FMT_UV8</a>     v4l2_fourcc('U', 'V', '8', ' ') /*  8  UV 4:4 */
509
510/* Luminance+Chrominance formats */
511#define <a class="link" href="re28.html#V4L2-PIX-FMT-YVU410">V4L2_PIX_FMT_YVU410</a>  v4l2_fourcc('Y', 'V', 'U', '9') /*  9  YVU 4:1:0     */
512#define <a class="link" href="re25.html#V4L2-PIX-FMT-YVU420">V4L2_PIX_FMT_YVU420</a>  v4l2_fourcc('Y', 'V', '1', '2') /* 12  YVU 4:2:0     */
513#define <a class="link" href="V4L2-PIX-FMT-YUYV.html" title="V4L2_PIX_FMT_YUYV ('YUYV')">V4L2_PIX_FMT_YUYV</a>    v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16  YUV 4:2:2     */
514#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-YYUV">V4L2_PIX_FMT_YYUV</a>    v4l2_fourcc('Y', 'Y', 'U', 'V') /* 16  YUV 4:2:2     */
515#define <a class="link" href="V4L2-PIX-FMT-YVYU.html" title="V4L2_PIX_FMT_YVYU ('YVYU')">V4L2_PIX_FMT_YVYU</a>    v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */
516#define <a class="link" href="V4L2-PIX-FMT-UYVY.html" title="V4L2_PIX_FMT_UYVY ('UYVY')">V4L2_PIX_FMT_UYVY</a>    v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16  YUV 4:2:2     */
517#define <a class="link" href="V4L2-PIX-FMT-VYUY.html" title="V4L2_PIX_FMT_VYUY ('VYUY')">V4L2_PIX_FMT_VYUY</a>    v4l2_fourcc('V', 'Y', 'U', 'Y') /* 16  YUV 4:2:2     */
518#define <a class="link" href="V4L2-PIX-FMT-YUV422P.html" title="V4L2_PIX_FMT_YUV422P ('422P')">V4L2_PIX_FMT_YUV422P</a> v4l2_fourcc('4', '2', '2', 'P') /* 16  YVU422 planar */
519#define <a class="link" href="V4L2-PIX-FMT-YUV411P.html" title="V4L2_PIX_FMT_YUV411P ('411P')">V4L2_PIX_FMT_YUV411P</a> v4l2_fourcc('4', '1', '1', 'P') /* 16  YVU411 planar */
520#define <a class="link" href="V4L2-PIX-FMT-Y41P.html" title="V4L2_PIX_FMT_Y41P ('Y41P')">V4L2_PIX_FMT_Y41P</a>    v4l2_fourcc('Y', '4', '1', 'P') /* 12  YUV 4:1:1     */
521#define <a class="link" href="packed-yuv.html#V4L2-PIX-FMT-YUV444">V4L2_PIX_FMT_YUV444</a>  v4l2_fourcc('Y', '4', '4', '4') /* 16  xxxxyyyy uuuuvvvv */
522#define <a class="link" href="packed-yuv.html#V4L2-PIX-FMT-YUV555">V4L2_PIX_FMT_YUV555</a>  v4l2_fourcc('Y', 'U', 'V', 'O') /* 16  YUV-5-5-5     */
523#define <a class="link" href="packed-yuv.html#V4L2-PIX-FMT-YUV565">V4L2_PIX_FMT_YUV565</a>  v4l2_fourcc('Y', 'U', 'V', 'P') /* 16  YUV-5-6-5     */
524#define <a class="link" href="packed-yuv.html#V4L2-PIX-FMT-YUV32">V4L2_PIX_FMT_YUV32</a>   v4l2_fourcc('Y', 'U', 'V', '4') /* 32  YUV-8-8-8-8   */
525#define <a class="link" href="re28.html#V4L2-PIX-FMT-YUV410">V4L2_PIX_FMT_YUV410</a>  v4l2_fourcc('Y', 'U', 'V', '9') /*  9  YUV 4:1:0     */
526#define <a class="link" href="re25.html#V4L2-PIX-FMT-YUV420">V4L2_PIX_FMT_YUV420</a>  v4l2_fourcc('Y', 'U', '1', '2') /* 12  YUV 4:2:0     */
527#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-HI240">V4L2_PIX_FMT_HI240</a>   v4l2_fourcc('H', 'I', '2', '4') /*  8  8-bit color   */
528#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-HM12">V4L2_PIX_FMT_HM12</a>    v4l2_fourcc('H', 'M', '1', '2') /*  8  YUV 4:2:0 16x16 macroblocks */
529#define <a class="link" href="V4L2-PIX-FMT-M420.html" title="V4L2_PIX_FMT_M420 ('M420')">V4L2_PIX_FMT_M420</a>    v4l2_fourcc('M', '4', '2', '0') /* 12  YUV 4:2:0 2 lines y, 1 line uv interleaved */
530
531/* two planes -- one Y, one Cr + Cb interleaved  */
532#define <a class="link" href="re31.html#V4L2-PIX-FMT-NV12">V4L2_PIX_FMT_NV12</a>    v4l2_fourcc('N', 'V', '1', '2') /* 12  Y/CbCr 4:2:0  */
533#define <a class="link" href="re31.html#V4L2-PIX-FMT-NV21">V4L2_PIX_FMT_NV21</a>    v4l2_fourcc('N', 'V', '2', '1') /* 12  Y/CrCb 4:2:0  */
534#define <a class="link" href="re34.html#V4L2-PIX-FMT-NV16">V4L2_PIX_FMT_NV16</a>    v4l2_fourcc('N', 'V', '1', '6') /* 16  Y/CbCr 4:2:2  */
535#define <a class="link" href="re34.html#V4L2-PIX-FMT-NV61">V4L2_PIX_FMT_NV61</a>    v4l2_fourcc('N', 'V', '6', '1') /* 16  Y/CrCb 4:2:2  */
536#define <a class="link" href="re36.html#V4L2-PIX-FMT-NV24">V4L2_PIX_FMT_NV24</a>    v4l2_fourcc('N', 'V', '2', '4') /* 24  Y/CbCr 4:4:4  */
537#define <a class="link" href="re36.html#V4L2-PIX-FMT-NV42">V4L2_PIX_FMT_NV42</a>    v4l2_fourcc('N', 'V', '4', '2') /* 24  Y/CrCb 4:4:4  */
538
539/* two non contiguous planes - one Y, one Cr + Cb interleaved  */
540#define <a class="link" href="re32.html#V4L2-PIX-FMT-NV12M">V4L2_PIX_FMT_NV12M</a>   v4l2_fourcc('N', 'M', '1', '2') /* 12  Y/CbCr 4:2:0  */
541#define <a class="link" href="re32.html#V4L2-PIX-FMT-NV21M">V4L2_PIX_FMT_NV21M</a>   v4l2_fourcc('N', 'M', '2', '1') /* 21  Y/CrCb 4:2:0  */
542#define <a class="link" href="re35.html#V4L2-PIX-FMT-NV16M">V4L2_PIX_FMT_NV16M</a>   v4l2_fourcc('N', 'M', '1', '6') /* 16  Y/CbCr 4:2:2  */
543#define <a class="link" href="re35.html#V4L2-PIX-FMT-NV61M">V4L2_PIX_FMT_NV61M</a>   v4l2_fourcc('N', 'M', '6', '1') /* 16  Y/CrCb 4:2:2  */
544#define <a class="link" href="re33.html#V4L2-PIX-FMT-NV12MT">V4L2_PIX_FMT_NV12MT</a>  v4l2_fourcc('T', 'M', '1', '2') /* 12  Y/CbCr 4:2:0 64x32 macroblocks */
545#define <a class="link" href="re32.html#V4L2-PIX-FMT-NV12MT-16X16">V4L2_PIX_FMT_NV12MT_16X16</a> v4l2_fourcc('V', 'M', '1', '2') /* 12  Y/CbCr 4:2:0 16x16 macroblocks */
546
547/* three non contiguous planes - Y, Cb, Cr */
548#define <a class="link" href="V4L2-PIX-FMT-YUV420M.html" title="V4L2_PIX_FMT_YUV420M ('YM12')">V4L2_PIX_FMT_YUV420M</a> v4l2_fourcc('Y', 'M', '1', '2') /* 12  YUV420 planar */
549#define <a class="link" href="V4L2-PIX-FMT-YVU420M.html" title="V4L2_PIX_FMT_YVU420M ('YM21')">V4L2_PIX_FMT_YVU420M</a> v4l2_fourcc('Y', 'M', '2', '1') /* 12  YVU420 planar */
550
551/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */
552#define <a class="link" href="V4L2-PIX-FMT-SBGGR8.html" title="V4L2_PIX_FMT_SBGGR8 ('BA81')">V4L2_PIX_FMT_SBGGR8</a>  v4l2_fourcc('B', 'A', '8', '1') /*  8  BGBG.. GRGR.. */
553#define <a class="link" href="V4L2-PIX-FMT-SGBRG8.html" title="V4L2_PIX_FMT_SGBRG8 ('GBRG')">V4L2_PIX_FMT_SGBRG8</a>  v4l2_fourcc('G', 'B', 'R', 'G') /*  8  GBGB.. RGRG.. */
554#define <a class="link" href="V4L2-PIX-FMT-SGRBG8.html" title="V4L2_PIX_FMT_SGRBG8 ('GRBG')">V4L2_PIX_FMT_SGRBG8</a>  v4l2_fourcc('G', 'R', 'B', 'G') /*  8  GRGR.. BGBG.. */
555#define <a class="link" href="V4L2-PIX-FMT-SRGGB8.html" title="V4L2_PIX_FMT_SRGGB8 ('RGGB')">V4L2_PIX_FMT_SRGGB8</a>  v4l2_fourcc('R', 'G', 'G', 'B') /*  8  RGRG.. GBGB.. */
556#define <a class="link" href="pixfmt-srggb10.html#V4L2-PIX-FMT-SBGGR10">V4L2_PIX_FMT_SBGGR10</a> v4l2_fourcc('B', 'G', '1', '0') /* 10  BGBG.. GRGR.. */
557#define <a class="link" href="pixfmt-srggb10.html#V4L2-PIX-FMT-SGBRG10">V4L2_PIX_FMT_SGBRG10</a> v4l2_fourcc('G', 'B', '1', '0') /* 10  GBGB.. RGRG.. */
558#define <a class="link" href="pixfmt-srggb10.html#V4L2-PIX-FMT-SGRBG10">V4L2_PIX_FMT_SGRBG10</a> v4l2_fourcc('B', 'A', '1', '0') /* 10  GRGR.. BGBG.. */
559#define <a class="link" href="pixfmt-srggb10.html#V4L2-PIX-FMT-SRGGB10">V4L2_PIX_FMT_SRGGB10</a> v4l2_fourcc('R', 'G', '1', '0') /* 10  RGRG.. GBGB.. */
560        /* 10bit raw bayer packed, 5 bytes for every 4 pixels */
561#define <a class="link" href="pixfmt-srggb10p.html#V4L2-PIX-FMT-SBGGR10P">V4L2_PIX_FMT_SBGGR10P</a> v4l2_fourcc('p', 'B', 'A', 'A')
562#define <a class="link" href="pixfmt-srggb10p.html#V4L2-PIX-FMT-SGBRG10P">V4L2_PIX_FMT_SGBRG10P</a> v4l2_fourcc('p', 'G', 'A', 'A')
563#define <a class="link" href="pixfmt-srggb10p.html#V4L2-PIX-FMT-SGRBG10P">V4L2_PIX_FMT_SGRBG10P</a> v4l2_fourcc('p', 'g', 'A', 'A')
564#define <a class="link" href="pixfmt-srggb10p.html#V4L2-PIX-FMT-SRGGB10P">V4L2_PIX_FMT_SRGGB10P</a> v4l2_fourcc('p', 'R', 'A', 'A')
565        /* 10bit raw bayer a-law compressed to 8 bits */
566#define <a class="link" href="re09.html#V4L2-PIX-FMT-SBGGR10ALAW8">V4L2_PIX_FMT_SBGGR10ALAW8</a> v4l2_fourcc('a', 'B', 'A', '8')
567#define <a class="link" href="re09.html#V4L2-PIX-FMT-SGBRG10ALAW8">V4L2_PIX_FMT_SGBRG10ALAW8</a> v4l2_fourcc('a', 'G', 'A', '8')
568#define <a class="link" href="re09.html#V4L2-PIX-FMT-SGRBG10ALAW8">V4L2_PIX_FMT_SGRBG10ALAW8</a> v4l2_fourcc('a', 'g', 'A', '8')
569#define <a class="link" href="re09.html#V4L2-PIX-FMT-SRGGB10ALAW8">V4L2_PIX_FMT_SRGGB10ALAW8</a> v4l2_fourcc('a', 'R', 'A', '8')
570        /* 10bit raw bayer DPCM compressed to 8 bits */
571#define <a class="link" href="pixfmt-srggb10dpcm8.html#V4L2-PIX-FMT-SBGGR10DPCM8">V4L2_PIX_FMT_SBGGR10DPCM8</a> v4l2_fourcc('b', 'B', 'A', '8')
572#define <a class="link" href="pixfmt-srggb10dpcm8.html#V4L2-PIX-FMT-SGBRG10DPCM8">V4L2_PIX_FMT_SGBRG10DPCM8</a> v4l2_fourcc('b', 'G', 'A', '8')
573#define <a class="link" href="pixfmt-srggb10dpcm8.html#V4L2-PIX-FMT-SGRBG10DPCM8">V4L2_PIX_FMT_SGRBG10DPCM8</a> v4l2_fourcc('B', 'D', '1', '0')
574#define <a class="link" href="pixfmt-srggb10dpcm8.html#V4L2-PIX-FMT-SRGGB10DPCM8">V4L2_PIX_FMT_SRGGB10DPCM8</a> v4l2_fourcc('b', 'R', 'A', '8')
575#define <a class="link" href="re11.html#V4L2-PIX-FMT-SBGGR12">V4L2_PIX_FMT_SBGGR12</a> v4l2_fourcc('B', 'G', '1', '2') /* 12  BGBG.. GRGR.. */
576#define <a class="link" href="re11.html#V4L2-PIX-FMT-SGBRG12">V4L2_PIX_FMT_SGBRG12</a> v4l2_fourcc('G', 'B', '1', '2') /* 12  GBGB.. RGRG.. */
577#define <a class="link" href="re11.html#V4L2-PIX-FMT-SGRBG12">V4L2_PIX_FMT_SGRBG12</a> v4l2_fourcc('B', 'A', '1', '2') /* 12  GRGR.. BGBG.. */
578#define <a class="link" href="re11.html#V4L2-PIX-FMT-SRGGB12">V4L2_PIX_FMT_SRGGB12</a> v4l2_fourcc('R', 'G', '1', '2') /* 12  RGRG.. GBGB.. */
579#define <a class="link" href="V4L2-PIX-FMT-SBGGR16.html" title="V4L2_PIX_FMT_SBGGR16 ('BYR2')">V4L2_PIX_FMT_SBGGR16</a> v4l2_fourcc('B', 'Y', 'R', '2') /* 16  BGBG.. GRGR.. */
580
581/* compressed formats */
582#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-MJPEG">V4L2_PIX_FMT_MJPEG</a>    v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG   */
583#define <a class="link" href="ch02s11.html#V4L2-PIX-FMT-JPEG">V4L2_PIX_FMT_JPEG</a>     v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG     */
584#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-DV">V4L2_PIX_FMT_DV</a>       v4l2_fourcc('d', 'v', 's', 'd') /* 1394          */
585#define <a class="link" href="ch02s11.html#V4L2-PIX-FMT-MPEG">V4L2_PIX_FMT_MPEG</a>     v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 Multiplexed */
586#define <a class="link" href="ch02s11.html#V4L2-PIX-FMT-H264">V4L2_PIX_FMT_H264</a>     v4l2_fourcc('H', '2', '6', '4') /* H264 with start codes */
587#define <a class="link" href="ch02s11.html#V4L2-PIX-FMT-H264-NO-SC">V4L2_PIX_FMT_H264_NO_SC</a> v4l2_fourcc('A', 'V', 'C', '1') /* H264 without start codes */
588#define <a class="link" href="ch02s11.html#V4L2-PIX-FMT-H264-MVC">V4L2_PIX_FMT_H264_MVC</a> v4l2_fourcc('M', '2', '6', '4') /* H264 MVC */
589#define <a class="link" href="ch02s11.html#V4L2-PIX-FMT-H263">V4L2_PIX_FMT_H263</a>     v4l2_fourcc('H', '2', '6', '3') /* H263          */
590#define <a class="link" href="ch02s11.html#V4L2-PIX-FMT-MPEG1">V4L2_PIX_FMT_MPEG1</a>    v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES     */
591#define <a class="link" href="ch02s11.html#V4L2-PIX-FMT-MPEG2">V4L2_PIX_FMT_MPEG2</a>    v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES     */
592#define <a class="link" href="ch02s11.html#V4L2-PIX-FMT-MPEG4">V4L2_PIX_FMT_MPEG4</a>    v4l2_fourcc('M', 'P', 'G', '4') /* MPEG-4 part 2 ES */
593#define <a class="link" href="ch02s11.html#V4L2-PIX-FMT-XVID">V4L2_PIX_FMT_XVID</a>     v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid           */
594#define <a class="link" href="ch02s11.html#V4L2-PIX-FMT-VC1-ANNEX-G">V4L2_PIX_FMT_VC1_ANNEX_G</a> v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */
595#define <a class="link" href="ch02s11.html#V4L2-PIX-FMT-VC1-ANNEX-L">V4L2_PIX_FMT_VC1_ANNEX_L</a> v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M Annex L compliant stream */
596#define <a class="link" href="ch02s11.html#V4L2-PIX-FMT-VP8">V4L2_PIX_FMT_VP8</a>      v4l2_fourcc('V', 'P', '8', '0') /* VP8 */
597
598/*  Vendor-specific formats   */
599#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-CPIA1">V4L2_PIX_FMT_CPIA1</a>    v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
600#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-WNVA">V4L2_PIX_FMT_WNVA</a>     v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */
601#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-SN9C10X">V4L2_PIX_FMT_SN9C10X</a>  v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */
602#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-SN9C20X-I420">V4L2_PIX_FMT_SN9C20X_I420</a> v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */
603#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-PWC1">V4L2_PIX_FMT_PWC1</a>     v4l2_fourcc('P', 'W', 'C', '1') /* pwc older webcam */
604#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-PWC2">V4L2_PIX_FMT_PWC2</a>     v4l2_fourcc('P', 'W', 'C', '2') /* pwc newer webcam */
605#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-ET61X251">V4L2_PIX_FMT_ET61X251</a> v4l2_fourcc('E', '6', '2', '5') /* ET61X251 compression */
606#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-SPCA501">V4L2_PIX_FMT_SPCA501</a>  v4l2_fourcc('S', '5', '0', '1') /* YUYV per line */
607#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-SPCA505">V4L2_PIX_FMT_SPCA505</a>  v4l2_fourcc('S', '5', '0', '5') /* YYUV per line */
608#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-SPCA508">V4L2_PIX_FMT_SPCA508</a>  v4l2_fourcc('S', '5', '0', '8') /* YUVY per line */
609#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-SPCA561">V4L2_PIX_FMT_SPCA561</a>  v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */
610#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-PAC207">V4L2_PIX_FMT_PAC207</a>   v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */
611#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-MR97310A">V4L2_PIX_FMT_MR97310A</a> v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */
612#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-JL2005BCD">V4L2_PIX_FMT_JL2005BCD</a> v4l2_fourcc('J', 'L', '2', '0') /* compressed RGGB bayer */
613#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-SN9C2028">V4L2_PIX_FMT_SN9C2028</a> v4l2_fourcc('S', 'O', 'N', 'X') /* compressed GBRG bayer */
614#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-SQ905C">V4L2_PIX_FMT_SQ905C</a>   v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */
615#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-PJPG">V4L2_PIX_FMT_PJPG</a>     v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */
616#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-OV511">V4L2_PIX_FMT_OV511</a>    v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */
617#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-OV518">V4L2_PIX_FMT_OV518</a>    v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */
618#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-STV0680">V4L2_PIX_FMT_STV0680</a>  v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */
619#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-TM6000">V4L2_PIX_FMT_TM6000</a>   v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */
620#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-CIT-YYVYUY">V4L2_PIX_FMT_CIT_YYVYUY</a> v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */
621#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-KONICA420">V4L2_PIX_FMT_KONICA420</a>  v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */
622#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-JPGL">V4L2_PIX_FMT_JPGL</a>       v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */
623#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-SE401">V4L2_PIX_FMT_SE401</a>      v4l2_fourcc('S', '4', '0', '1') /* se401 janggu compressed rgb */
624#define <a class="link" href="pixfmt-reserved.html#V4L2-PIX-FMT-S5C-UYVY-JPG">V4L2_PIX_FMT_S5C_UYVY_JPG</a> v4l2_fourcc('S', '5', 'C', 'I') /* S5C73M3 interleaved UYVY/JPEG */
625
626/* SDR formats - used only for Software Defined Radio devices */
627#define V4L2_SDR_FMT_CU8          v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */
628#define V4L2_SDR_FMT_CU16LE       v4l2_fourcc('C', 'U', '1', '6') /* IQ u16le */
629#define V4L2_SDR_FMT_CS8          v4l2_fourcc('C', 'S', '0', '8') /* complex s8 */
630#define V4L2_SDR_FMT_CS14LE       v4l2_fourcc('C', 'S', '1', '4') /* complex s14le */
631#define V4L2_SDR_FMT_RU12LE       v4l2_fourcc('R', 'U', '1', '2') /* real u12le */
632
633/* priv field value to indicates that subsequent fields are valid. */
634#define V4L2_PIX_FMT_PRIV_MAGIC         0xfeedcafe
635
636/* Flags */
637#define V4L2_PIX_FMT_FLAG_PREMUL_ALPHA  0x00000001
638
639/*
640 *      F O R M A T   E N U M E R A T I O N
641 */
642struct <a class="link" href="vidioc-enum-fmt.html#v4l2-fmtdesc" title="Table A.28. struct v4l2_fmtdesc">v4l2_fmtdesc</a> {
643        __u32               index;             /* Format number      */
644        __u32               type;              /* enum <a class="link" href="buffer.html#v4l2-buf-type" title="Table 3.3. enum v4l2_buf_type">v4l2_buf_type</a> */
645        __u32               flags;
646        __u8                description[32];   /* Description string */
647        __u32               pixelformat;       /* Format fourcc      */
648        __u32               reserved[4];
649};
650
651#define V4L2_FMT_FLAG_COMPRESSED 0x0001
652#define V4L2_FMT_FLAG_EMULATED   0x0002
653
654#if 1
655        /* Experimental Frame Size and frame rate enumeration */
656/*
657 *      F R A M E   S I Z E   E N U M E R A T I O N
658 */
659enum <a class="link" href="vidioc-enum-framesizes.html#v4l2-frmsizetypes" title="Table A.33. enum v4l2_frmsizetypes">v4l2_frmsizetypes</a> {
660        V4L2_FRMSIZE_TYPE_DISCRETE      = 1,
661        V4L2_FRMSIZE_TYPE_CONTINUOUS    = 2,
662        V4L2_FRMSIZE_TYPE_STEPWISE      = 3,
663};
664
665struct <a class="link" href="vidioc-enum-framesizes.html#v4l2-frmsize-discrete" title="Table A.30. struct v4l2_frmsize_discrete">v4l2_frmsize_discrete</a> {
666        __u32                   width;          /* Frame width [pixel] */
667        __u32                   height;         /* Frame height [pixel] */
668};
669
670struct <a class="link" href="vidioc-enum-framesizes.html#v4l2-frmsize-stepwise" title="Table A.31. struct v4l2_frmsize_stepwise">v4l2_frmsize_stepwise</a> {
671        __u32                   min_width;      /* Minimum frame width [pixel] */
672        __u32                   max_width;      /* Maximum frame width [pixel] */
673        __u32                   step_width;     /* Frame width step size [pixel] */
674        __u32                   min_height;     /* Minimum frame height [pixel] */
675        __u32                   max_height;     /* Maximum frame height [pixel] */
676        __u32                   step_height;    /* Frame height step size [pixel] */
677};
678
679struct <a class="link" href="vidioc-enum-framesizes.html#v4l2-frmsizeenum" title="Table A.32. struct v4l2_frmsizeenum">v4l2_frmsizeenum</a> {
680        __u32                   index;          /* Frame size number */
681        __u32                   pixel_format;   /* Pixel format */
682        __u32                   type;           /* Frame size type the device supports. */
683
684        union {                                 /* Frame size */
685                struct <a class="link" href="vidioc-enum-framesizes.html#v4l2-frmsize-discrete" title="Table A.30. struct v4l2_frmsize_discrete">v4l2_frmsize_discrete</a>    discrete;
686                struct <a class="link" href="vidioc-enum-framesizes.html#v4l2-frmsize-stepwise" title="Table A.31. struct v4l2_frmsize_stepwise">v4l2_frmsize_stepwise</a>    stepwise;
687        };
688
689        __u32   reserved[2];                    /* Reserved space for future use */
690};
691
692/*
693 *      F R A M E   R A T E   E N U M E R A T I O N
694 */
695enum <a class="link" href="vidioc-enum-frameintervals.html#v4l2-frmivaltypes" title="Table A.36. enum v4l2_frmivaltypes">v4l2_frmivaltypes</a> {
696        V4L2_FRMIVAL_TYPE_DISCRETE      = 1,
697        V4L2_FRMIVAL_TYPE_CONTINUOUS    = 2,
698        V4L2_FRMIVAL_TYPE_STEPWISE      = 3,
699};
700
701struct <a class="link" href="vidioc-enum-frameintervals.html#v4l2-frmival-stepwise" title="Table A.34. struct v4l2_frmival_stepwise">v4l2_frmival_stepwise</a> {
702        struct <a class="link" href="vidioc-enumstd.html#v4l2-fract" title="Table A.47. struct v4l2_fract">v4l2_fract</a>       min;            /* Minimum frame interval [s] */
703        struct <a class="link" href="vidioc-enumstd.html#v4l2-fract" title="Table A.47. struct v4l2_fract">v4l2_fract</a>       max;            /* Maximum frame interval [s] */
704        struct <a class="link" href="vidioc-enumstd.html#v4l2-fract" title="Table A.47. struct v4l2_fract">v4l2_fract</a>       step;           /* Frame interval step size [s] */
705};
706
707struct <a class="link" href="vidioc-enum-frameintervals.html#v4l2-frmivalenum" title="Table A.35. struct v4l2_frmivalenum">v4l2_frmivalenum</a> {
708        __u32                   index;          /* Frame format index */
709        __u32                   pixel_format;   /* Pixel format */
710        __u32                   width;          /* Frame width */
711        __u32                   height;         /* Frame height */
712        __u32                   type;           /* Frame interval type the device supports. */
713
714        union {                                 /* Frame interval */
715                struct <a class="link" href="vidioc-enumstd.html#v4l2-fract" title="Table A.47. struct v4l2_fract">v4l2_fract</a>               discrete;
716                struct <a class="link" href="vidioc-enum-frameintervals.html#v4l2-frmival-stepwise" title="Table A.34. struct v4l2_frmival_stepwise">v4l2_frmival_stepwise</a>    stepwise;
717        };
718
719        __u32   reserved[2];                    /* Reserved space for future use */
720};
721#endif
722
723/*
724 *      T I M E C O D E
725 */
726struct <a class="link" href="buffer.html#v4l2-timecode" title="Table 3.6. struct v4l2_timecode">v4l2_timecode</a> {
727        __u32   type;
728        __u32   flags;
729        __u8    frames;
730        __u8    seconds;
731        __u8    minutes;
732        __u8    hours;
733        __u8    userbits[4];
734};
735
736/*  Type  */
737#define V4L2_TC_TYPE_24FPS              1
738#define V4L2_TC_TYPE_25FPS              2
739#define V4L2_TC_TYPE_30FPS              3
740#define V4L2_TC_TYPE_50FPS              4
741#define V4L2_TC_TYPE_60FPS              5
742
743/*  Flags  */
744#define V4L2_TC_FLAG_DROPFRAME          0x0001 /* "drop-frame" mode */
745#define V4L2_TC_FLAG_COLORFRAME         0x0002
746#define V4L2_TC_USERBITS_field          0x000C
747#define V4L2_TC_USERBITS_USERDEFINED    0x0000
748#define V4L2_TC_USERBITS_8BITCHARS      0x0008
749/* The above is based on SMPTE timecodes */
750
751struct <a class="link" href="vidioc-g-jpegcomp.html#v4l2-jpegcompression" title="Table A.74. struct v4l2_jpegcompression">v4l2_jpegcompression</a> {
752        int quality;
753
754        int  APPn;              /* Number of APP segment to be written,
755                                 * must be 0..15 */
756        int  APP_len;           /* Length of data in JPEG APPn segment */
757        char APP_data[60];      /* Data in the JPEG APPn segment. */
758
759        int  COM_len;           /* Length of data in JPEG COM segment */
760        char COM_data[60];      /* Data in JPEG COM segment */
761
762        __u32 jpeg_markers;     /* Which markers should go into the JPEG
763                                 * output. Unless you exactly know what
764                                 * you do, leave them untouched.
765                                 * Including less markers will make the
766                                 * resulting code smaller, but there will
767                                 * be fewer applications which can read it.
768                                 * The presence of the APP and COM marker
769                                 * is influenced by APP_len and COM_len
770                                 * ONLY, not by this property! */
771
772#define V4L2_JPEG_MARKER_DHT (1&lt;&lt;3)    /* Define Huffman Tables */
773#define V4L2_JPEG_MARKER_DQT (1&lt;&lt;4)    /* Define Quantization Tables */
774#define V4L2_JPEG_MARKER_DRI (1&lt;&lt;5)    /* Define Restart Interval */
775#define V4L2_JPEG_MARKER_COM (1&lt;&lt;6)    /* Comment segment */
776#define V4L2_JPEG_MARKER_APP (1&lt;&lt;7)    /* App segment, driver will
777                                        * always use APP0 */
778};
779
780/*
781 *      M E M O R Y - M A P P I N G   B U F F E R S
782 */
783struct <a class="link" href="vidioc-reqbufs.html#v4l2-requestbuffers" title="Table A.100. struct v4l2_requestbuffers">v4l2_requestbuffers</a> {
784        __u32                   count;
785        __u32                   type;           /* enum <a class="link" href="buffer.html#v4l2-buf-type" title="Table 3.3. enum v4l2_buf_type">v4l2_buf_type</a> */
786        __u32                   memory;         /* enum <a class="link" href="buffer.html#v4l2-memory" title="Table 3.5. enum v4l2_memory">v4l2_memory</a> */
787        __u32                   reserved[2];
788};
789
790/**
791 * struct <a class="link" href="buffer.html#v4l2-plane" title="Table 3.2. struct v4l2_plane">v4l2_plane</a> - plane info for multi-planar buffers
792 * @bytesused:          number of bytes occupied by data in the plane (payload)
793 * @length:             size of this plane (NOT the payload) in bytes
794 * @mem_offset:         when memory in the associated struct <a class="link" href="buffer.html#v4l2-buffer" title="Table 3.1. struct v4l2_buffer">v4l2_buffer</a> is
795 *                      V4L2_MEMORY_MMAP, equals the offset from the start of
796 *                      the device memory for this plane (or is a "cookie" that
797 *                      should be passed to mmap() called on the video node)
798 * @userptr:            when memory is V4L2_MEMORY_USERPTR, a userspace pointer
799 *                      pointing to this plane
800 * @fd:                 when memory is V4L2_MEMORY_DMABUF, a userspace file
801 *                      descriptor associated with this plane
802 * @data_offset:        offset in the plane to the start of data; usually 0,
803 *                      unless there is a header in front of the data
804 *
805 * Multi-planar buffers consist of one or more planes, e.g. an YCbCr buffer
806 * with two planes can have one plane for Y, and another for interleaved CbCr
807 * components. Each plane can reside in a separate memory buffer, or even in
808 * a completely separate memory node (e.g. in embedded devices).
809 */
810struct <a class="link" href="buffer.html#v4l2-plane" title="Table 3.2. struct v4l2_plane">v4l2_plane</a> {
811        __u32                   bytesused;
812        __u32                   length;
813        union {
814                __u32           mem_offset;
815                unsigned long   userptr;
816                __s32           fd;
817        } m;
818        __u32                   data_offset;
819        __u32                   reserved[11];
820};
821
822/**
823 * struct <a class="link" href="buffer.html#v4l2-buffer" title="Table 3.1. struct v4l2_buffer">v4l2_buffer</a> - video buffer info
824 * @index:      id number of the buffer
825 * @type:       enum <a class="link" href="buffer.html#v4l2-buf-type" title="Table 3.3. enum v4l2_buf_type">v4l2_buf_type</a>; buffer type (type == *_MPLANE for
826 *              multiplanar buffers);
827 * @bytesused:  number of bytes occupied by data in the buffer (payload);
828 *              unused (set to 0) for multiplanar buffers
829 * @flags:      buffer informational flags
830 * @field:      enum <a class="link" href="field-order.html#v4l2-field" title="Table 3.9. enum v4l2_field">v4l2_field</a>; field order of the image in the buffer
831 * @timestamp:  frame timestamp
832 * @timecode:   frame timecode
833 * @sequence:   sequence count of this frame
834 * @memory:     enum <a class="link" href="buffer.html#v4l2-memory" title="Table 3.5. enum v4l2_memory">v4l2_memory</a>; the method, in which the actual video data is
835 *              passed
836 * @offset:     for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;
837 *              offset from the start of the device memory for this plane,
838 *              (or a "cookie" that should be passed to mmap() as offset)
839 * @userptr:    for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;
840 *              a userspace pointer pointing to this buffer
841 * @fd:         for non-multiplanar buffers with memory == V4L2_MEMORY_DMABUF;
842 *              a userspace file descriptor associated with this buffer
843 * @planes:     for multiplanar buffers; userspace pointer to the array of plane
844 *              info structs for this buffer
845 * @length:     size in bytes of the buffer (NOT its payload) for single-plane
846 *              buffers (when type != *_MPLANE); number of elements in the
847 *              planes array for multi-plane buffers
848 *
849 * Contains data exchanged by application and driver using one of the Streaming
850 * I/O methods.
851 */
852struct <a class="link" href="buffer.html#v4l2-buffer" title="Table 3.1. struct v4l2_buffer">v4l2_buffer</a> {
853        __u32                   index;
854        __u32                   type;
855        __u32                   bytesused;
856        __u32                   flags;
857        __u32                   field;
858        struct timeval          timestamp;
859        struct <a class="link" href="buffer.html#v4l2-timecode" title="Table 3.6. struct v4l2_timecode">v4l2_timecode</a>    timecode;
860        __u32                   sequence;
861
862        /* memory location */
863        __u32                   memory;
864        union {
865                __u32           offset;
866                unsigned long   userptr;
867                struct <a class="link" href="buffer.html#v4l2-plane" title="Table 3.2. struct v4l2_plane">v4l2_plane</a> *planes;
868                __s32           fd;
869        } m;
870        __u32                   length;
871        __u32                   reserved2;
872        __u32                   reserved;
873};
874
875/*  Flags for 'flags' field */
876/* Buffer is mapped (flag) */
877#define V4L2_BUF_FLAG_MAPPED                    0x00000001
878/* Buffer is queued for processing */
879#define V4L2_BUF_FLAG_QUEUED                    0x00000002
880/* Buffer is ready */
881#define V4L2_BUF_FLAG_DONE                      0x00000004
882/* Image is a keyframe (I-frame) */
883#define V4L2_BUF_FLAG_KEYFRAME                  0x00000008
884/* Image is a P-frame */
885#define V4L2_BUF_FLAG_PFRAME                    0x00000010
886/* Image is a B-frame */
887#define V4L2_BUF_FLAG_BFRAME                    0x00000020
888/* Buffer is ready, but the data contained within is corrupted. */
889#define V4L2_BUF_FLAG_ERROR                     0x00000040
890/* timecode field is valid */
891#define V4L2_BUF_FLAG_TIMECODE                  0x00000100
892/* Buffer is prepared for queuing */
893#define V4L2_BUF_FLAG_PREPARED                  0x00000400
894/* Cache handling flags */
895#define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE       0x00000800
896#define V4L2_BUF_FLAG_NO_CACHE_CLEAN            0x00001000
897/* Timestamp type */
898#define V4L2_BUF_FLAG_TIMESTAMP_MASK            0x0000e000
899#define V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN         0x00000000
900#define V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC       0x00002000
901#define V4L2_BUF_FLAG_TIMESTAMP_COPY            0x00004000
902/* Timestamp sources. */
903#define V4L2_BUF_FLAG_TSTAMP_SRC_MASK           0x00070000
904#define V4L2_BUF_FLAG_TSTAMP_SRC_EOF            0x00000000
905#define V4L2_BUF_FLAG_TSTAMP_SRC_SOE            0x00010000
906/* mem2mem encoder/decoder */
907#define V4L2_BUF_FLAG_LAST                      0x00100000
908
909/**
910 * struct <a class="link" href="vidioc-expbuf.html#v4l2-exportbuffer" title="Table A.50. struct v4l2_exportbuffer">v4l2_exportbuffer</a> - export of video buffer as DMABUF file descriptor
911 *
912 * @index:      id number of the buffer
913 * @type:       enum <a class="link" href="buffer.html#v4l2-buf-type" title="Table 3.3. enum v4l2_buf_type">v4l2_buf_type</a>; buffer type (type == *_MPLANE for
914 *              multiplanar buffers);
915 * @plane:      index of the plane to be exported, 0 for single plane queues
916 * @flags:      flags for newly created file, currently only O_CLOEXEC is
917 *              supported, refer to manual of open syscall for more details
918 * @fd:         file descriptor associated with DMABUF (set by driver)
919 *
920 * Contains data used for exporting a video buffer as DMABUF file descriptor.
921 * The buffer is identified by a 'cookie' returned by VIDIOC_QUERYBUF
922 * (identical to the cookie used to mmap() the buffer to userspace). All
923 * reserved fields must be set to zero. The field reserved0 is expected to
924 * become a structure 'type' allowing an alternative layout of the structure
925 * content. Therefore this field should not be used for any other extensions.
926 */
927struct <a class="link" href="vidioc-expbuf.html#v4l2-exportbuffer" title="Table A.50. struct v4l2_exportbuffer">v4l2_exportbuffer</a> {
928        __u32           type; /* enum <a class="link" href="buffer.html#v4l2-buf-type" title="Table 3.3. enum v4l2_buf_type">v4l2_buf_type</a> */
929        __u32           index;
930        __u32           plane;
931        __u32           flags;
932        __s32           fd;
933        __u32           reserved[11];
934};
935
936/*
937 *      O V E R L A Y   P R E V I E W
938 */
939struct <a class="link" href="vidioc-g-fbuf.html#v4l2-framebuffer" title="Table A.69. struct v4l2_framebuffer">v4l2_framebuffer</a> {
940        __u32                   capability;
941        __u32                   flags;
942/* FIXME: in theory we should pass something like PCI device + memory
943 * region + offset instead of some physical address */
944        void                    *base;
945        struct {
946                __u32           width;
947                __u32           height;
948                __u32           pixelformat;
949                __u32           field;          /* enum <a class="link" href="field-order.html#v4l2-field" title="Table 3.9. enum v4l2_field">v4l2_field</a> */
950                __u32           bytesperline;   /* for padding, zero if unused */
951                __u32           sizeimage;
952                __u32           colorspace;     /* enum <a class="link" href="ch02s05.html#v4l2-colorspace" title="Table 2.4. V4L2 Colorspaces">v4l2_colorspace</a> */
953                __u32           priv;           /* reserved field, set to 0 */
954        } fmt;
955};
956/*  Flags for the 'capability' field. Read only */
957#define V4L2_FBUF_CAP_EXTERNOVERLAY     0x0001
958#define V4L2_FBUF_CAP_CHROMAKEY         0x0002
959#define V4L2_FBUF_CAP_LIST_CLIPPING     0x0004
960#define V4L2_FBUF_CAP_BITMAP_CLIPPING   0x0008
961#define V4L2_FBUF_CAP_LOCAL_ALPHA       0x0010
962#define V4L2_FBUF_CAP_GLOBAL_ALPHA      0x0020
963#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA   0x0040
964#define V4L2_FBUF_CAP_SRC_CHROMAKEY     0x0080
965/*  Flags for the 'flags' field. */
966#define V4L2_FBUF_FLAG_PRIMARY          0x0001
967#define V4L2_FBUF_FLAG_OVERLAY          0x0002
968#define V4L2_FBUF_FLAG_CHROMAKEY        0x0004
969#define V4L2_FBUF_FLAG_LOCAL_ALPHA      0x0008
970#define V4L2_FBUF_FLAG_GLOBAL_ALPHA     0x0010
971#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA  0x0020
972#define V4L2_FBUF_FLAG_SRC_CHROMAKEY    0x0040
973
974struct <a class="link" href="overlay.html#v4l2-clip" title="Table 4.2. struct v4l2_clip">v4l2_clip</a> {
975        struct <a class="link" href="overlay.html#v4l2-rect" title="Table 4.3. struct v4l2_rect">v4l2_rect</a>        c;
976        struct <a class="link" href="overlay.html#v4l2-clip" title="Table 4.2. struct v4l2_clip">v4l2_clip</a>        __user *next;
977};
978
979struct <a class="link" href="overlay.html#v4l2-window" title="Table 4.1. struct v4l2_window">v4l2_window</a> {
980        struct <a class="link" href="overlay.html#v4l2-rect" title="Table 4.3. struct v4l2_rect">v4l2_rect</a>        w;
981        __u32                   field;   /* enum <a class="link" href="field-order.html#v4l2-field" title="Table 3.9. enum v4l2_field">v4l2_field</a> */
982        __u32                   chromakey;
983        struct <a class="link" href="overlay.html#v4l2-clip" title="Table 4.2. struct v4l2_clip">v4l2_clip</a>        __user *clips;
984        __u32                   clipcount;
985        void                    __user *bitmap;
986        __u8                    global_alpha;
987};
988
989/*
990 *      C A P T U R E   P A R A M E T E R S
991 */
992struct <a class="link" href="vidioc-g-parm.html#v4l2-captureparm" title="Table A.79. struct v4l2_captureparm">v4l2_captureparm</a> {
993        __u32              capability;    /*  Supported modes */
994        __u32              capturemode;   /*  Current mode */
995        struct <a class="link" href="vidioc-enumstd.html#v4l2-fract" title="Table A.47. struct v4l2_fract">v4l2_fract</a>  timeperframe;  /*  Time per frame in seconds */
996        __u32              extendedmode;  /*  Driver-specific extensions */
997        __u32              readbuffers;   /*  # of buffers for read */
998        __u32              reserved[4];
999};
1000
1001/*  Flags for 'capability' and 'capturemode' fields */
1002#define V4L2_MODE_HIGHQUALITY   0x0001  /*  High quality imaging mode */
1003#define V4L2_CAP_TIMEPERFRAME   0x1000  /*  timeperframe field is supported */
1004
1005struct <a class="link" href="vidioc-g-parm.html#v4l2-outputparm" title="Table A.80. struct v4l2_outputparm">v4l2_outputparm</a> {
1006        __u32              capability;   /*  Supported modes */
1007        __u32              outputmode;   /*  Current mode */
1008        struct <a class="link" href="vidioc-enumstd.html#v4l2-fract" title="Table A.47. struct v4l2_fract">v4l2_fract</a>  timeperframe; /*  Time per frame in seconds */
1009        __u32              extendedmode; /*  Driver-specific extensions */
1010        __u32              writebuffers; /*  # of buffers for write */
1011        __u32              reserved[4];
1012};
1013
1014/*
1015 *      I N P U T   I M A G E   C R O P P I N G
1016 */
1017struct <a class="link" href="vidioc-cropcap.html#v4l2-cropcap" title="Table A.2. struct v4l2_cropcap">v4l2_cropcap</a> {
1018        __u32                   type;   /* enum <a class="link" href="buffer.html#v4l2-buf-type" title="Table 3.3. enum v4l2_buf_type">v4l2_buf_type</a> */
1019        struct <a class="link" href="overlay.html#v4l2-rect" title="Table 4.3. struct v4l2_rect">v4l2_rect</a>        bounds;
1020        struct <a class="link" href="overlay.html#v4l2-rect" title="Table 4.3. struct v4l2_rect">v4l2_rect</a>        defrect;
1021        struct <a class="link" href="vidioc-enumstd.html#v4l2-fract" title="Table A.47. struct v4l2_fract">v4l2_fract</a>       pixelaspect;
1022};
1023
1024struct <a class="link" href="vidioc-g-crop.html#v4l2-crop" title="Table A.55. struct v4l2_crop">v4l2_crop</a> {
1025        __u32                   type;   /* enum <a class="link" href="buffer.html#v4l2-buf-type" title="Table 3.3. enum v4l2_buf_type">v4l2_buf_type</a> */
1026        struct <a class="link" href="overlay.html#v4l2-rect" title="Table 4.3. struct v4l2_rect">v4l2_rect</a>        c;
1027};
1028
1029/**
1030 * struct <a class="link" href="vidioc-g-selection.html#v4l2-selection" title="Table A.84. struct v4l2_selection">v4l2_selection</a> - selection info
1031 * @type:       buffer type (do not use *_MPLANE types)
1032 * @target:     Selection target, used to choose one of possible rectangles;
1033 *              defined in v4l2-common.h; V4L2_SEL_TGT_* .
1034 * @flags:      constraints flags, defined in v4l2-common.h; V4L2_SEL_FLAG_*.
1035 * @r:          coordinates of selection window
1036 * @reserved:   for future use, rounds structure size to 64 bytes, set to zero
1037 *
1038 * Hardware may use multiple helper windows to process a video stream.
1039 * The structure is used to exchange this selection areas between
1040 * an application and a driver.
1041 */
1042struct <a class="link" href="vidioc-g-selection.html#v4l2-selection" title="Table A.84. struct v4l2_selection">v4l2_selection</a> {
1043        __u32                   type;
1044        __u32                   target;
1045        __u32                   flags;
1046        struct <a class="link" href="overlay.html#v4l2-rect" title="Table 4.3. struct v4l2_rect">v4l2_rect</a>        r;
1047        __u32                   reserved[9];
1048};
1049
1050
1051/*
1052 *      A N A L O G   V I D E O   S T A N D A R D
1053 */
1054
1055typedef __u64 v4l2_std_id;
1056
1057/* one bit for each */
1058#define V4L2_STD_PAL_B          ((v4l2_std_id)0x00000001)
1059#define V4L2_STD_PAL_B1         ((v4l2_std_id)0x00000002)
1060#define V4L2_STD_PAL_G          ((v4l2_std_id)0x00000004)
1061#define V4L2_STD_PAL_H          ((v4l2_std_id)0x00000008)
1062#define V4L2_STD_PAL_I          ((v4l2_std_id)0x00000010)
1063#define V4L2_STD_PAL_D          ((v4l2_std_id)0x00000020)
1064#define V4L2_STD_PAL_D1         ((v4l2_std_id)0x00000040)
1065#define V4L2_STD_PAL_K          ((v4l2_std_id)0x00000080)
1066
1067#define V4L2_STD_PAL_M          ((v4l2_std_id)0x00000100)
1068#define V4L2_STD_PAL_N          ((v4l2_std_id)0x00000200)
1069#define V4L2_STD_PAL_Nc         ((v4l2_std_id)0x00000400)
1070#define V4L2_STD_PAL_60         ((v4l2_std_id)0x00000800)
1071
1072#define V4L2_STD_NTSC_M         ((v4l2_std_id)0x00001000)       /* BTSC */
1073#define V4L2_STD_NTSC_M_JP      ((v4l2_std_id)0x00002000)       /* EIA-J */
1074#define V4L2_STD_NTSC_443       ((v4l2_std_id)0x00004000)
1075#define V4L2_STD_NTSC_M_KR      ((v4l2_std_id)0x00008000)       /* FM A2 */
1076
1077#define V4L2_STD_SECAM_B        ((v4l2_std_id)0x00010000)
1078#define V4L2_STD_SECAM_D        ((v4l2_std_id)0x00020000)
1079#define V4L2_STD_SECAM_G        ((v4l2_std_id)0x00040000)
1080#define V4L2_STD_SECAM_H        ((v4l2_std_id)0x00080000)
1081#define V4L2_STD_SECAM_K        ((v4l2_std_id)0x00100000)
1082#define V4L2_STD_SECAM_K1       ((v4l2_std_id)0x00200000)
1083#define V4L2_STD_SECAM_L        ((v4l2_std_id)0x00400000)
1084#define V4L2_STD_SECAM_LC       ((v4l2_std_id)0x00800000)
1085
1086/* ATSC/HDTV */
1087#define V4L2_STD_ATSC_8_VSB     ((v4l2_std_id)0x01000000)
1088#define V4L2_STD_ATSC_16_VSB    ((v4l2_std_id)0x02000000)
1089
1090/* FIXME:
1091   Although std_id is 64 bits, there is an issue on PPC32 architecture that
1092   makes switch(__u64) to break. So, there's a hack on v4l2-common.c rounding
1093   this value to 32 bits.
1094   As, currently, the max value is for V4L2_STD_ATSC_16_VSB (30 bits wide),
1095   it should work fine. However, if needed to add more than two standards,
1096   v4l2-common.c should be fixed.
1097 */
1098
1099/*
1100 * Some macros to merge video standards in order to make live easier for the
1101 * drivers and V4L2 applications
1102 */
1103
1104/*
1105 * "Common" NTSC/M - It should be noticed that V4L2_STD_NTSC_443 is
1106 * Missing here.
1107 */
1108#define V4L2_STD_NTSC           (V4L2_STD_NTSC_M        |\
1109                                 V4L2_STD_NTSC_M_JP     |\
1110                                 V4L2_STD_NTSC_M_KR)
1111/* Secam macros */
1112#define V4L2_STD_SECAM_DK       (V4L2_STD_SECAM_D       |\
1113                                 V4L2_STD_SECAM_K       |\
1114                                 V4L2_STD_SECAM_K1)
1115/* All Secam Standards */
1116#define V4L2_STD_SECAM          (V4L2_STD_SECAM_B       |\
1117                                 V4L2_STD_SECAM_G       |\
1118                                 V4L2_STD_SECAM_H       |\
1119                                 V4L2_STD_SECAM_DK      |\
1120                                 V4L2_STD_SECAM_L       |\
1121                                 V4L2_STD_SECAM_LC)
1122/* PAL macros */
1123#define V4L2_STD_PAL_BG         (V4L2_STD_PAL_B         |\
1124                                 V4L2_STD_PAL_B1        |\
1125                                 V4L2_STD_PAL_G)
1126#define V4L2_STD_PAL_DK         (V4L2_STD_PAL_D         |\
1127                                 V4L2_STD_PAL_D1        |\
1128                                 V4L2_STD_PAL_K)
1129/*
1130 * "Common" PAL - This macro is there to be compatible with the old
1131 * V4L1 concept of "PAL": /BGDKHI.
1132 * Several PAL standards are missing here: /M, /N and /Nc
1133 */
1134#define V4L2_STD_PAL            (V4L2_STD_PAL_BG        |\
1135                                 V4L2_STD_PAL_DK        |\
1136                                 V4L2_STD_PAL_H         |\
1137                                 V4L2_STD_PAL_I)
1138/* Chroma "agnostic" standards */
1139#define V4L2_STD_B              (V4L2_STD_PAL_B         |\
1140                                 V4L2_STD_PAL_B1        |\
1141                                 V4L2_STD_SECAM_B)
1142#define V4L2_STD_G              (V4L2_STD_PAL_G         |\
1143                                 V4L2_STD_SECAM_G)
1144#define V4L2_STD_H              (V4L2_STD_PAL_H         |\
1145                                 V4L2_STD_SECAM_H)
1146#define V4L2_STD_L              (V4L2_STD_SECAM_L       |\
1147                                 V4L2_STD_SECAM_LC)
1148#define V4L2_STD_GH             (V4L2_STD_G             |\
1149                                 V4L2_STD_H)
1150#define V4L2_STD_DK             (V4L2_STD_PAL_DK        |\
1151                                 V4L2_STD_SECAM_DK)
1152#define V4L2_STD_BG             (V4L2_STD_B             |\
1153                                 V4L2_STD_G)
1154#define V4L2_STD_MN             (V4L2_STD_PAL_M         |\
1155                                 V4L2_STD_PAL_N         |\
1156                                 V4L2_STD_PAL_Nc        |\
1157                                 V4L2_STD_NTSC)
1158
1159/* Standards where MTS/BTSC stereo could be found */
1160#define V4L2_STD_MTS            (V4L2_STD_NTSC_M        |\
1161                                 V4L2_STD_PAL_M         |\
1162                                 V4L2_STD_PAL_N         |\
1163                                 V4L2_STD_PAL_Nc)
1164
1165/* Standards for Countries with 60Hz Line frequency */
1166#define V4L2_STD_525_60         (V4L2_STD_PAL_M         |\
1167                                 V4L2_STD_PAL_60        |\
1168                                 V4L2_STD_NTSC          |\
1169                                 V4L2_STD_NTSC_443)
1170/* Standards for Countries with 50Hz Line frequency */
1171#define V4L2_STD_625_50         (V4L2_STD_PAL           |\
1172                                 V4L2_STD_PAL_N         |\
1173                                 V4L2_STD_PAL_Nc        |\
1174                                 V4L2_STD_SECAM)
1175
1176#define V4L2_STD_ATSC           (V4L2_STD_ATSC_8_VSB    |\
1177                                 V4L2_STD_ATSC_16_VSB)
1178/* Macros with none and all analog standards */
1179#define V4L2_STD_UNKNOWN        0
1180#define V4L2_STD_ALL            (V4L2_STD_525_60        |\
1181                                 V4L2_STD_625_50)
1182
1183struct <a class="link" href="vidioc-enumstd.html#v4l2-standard" title="Table A.46. struct v4l2_standard">v4l2_standard</a> {
1184        __u32                index;
1185        v4l2_std_id          id;
1186        __u8                 name[24];
1187        struct <a class="link" href="vidioc-enumstd.html#v4l2-fract" title="Table A.47. struct v4l2_fract">v4l2_fract</a>    frameperiod; /* Frames, not fields */
1188        __u32                framelines;
1189        __u32                reserved[4];
1190};
1191
1192/*
1193 *      D V     B T     T I M I N G S
1194 */
1195
1196/** struct <a class="link" href="vidioc-g-dv-timings.html#v4l2-bt-timings" title="Table A.57. struct v4l2_bt_timings">v4l2_bt_timings</a> - BT.656/BT.1120 timing data
1197 * @width:      total width of the active video in pixels
1198 * @height:     total height of the active video in lines
1199 * @interlaced: Interlaced or progressive
1200 * @polarities: Positive or negative polarities
1201 * @pixelclock: Pixel clock in HZ. Ex. 74.25MHz-&gt;74250000
1202 * @hfrontporch:Horizontal front porch in pixels
1203 * @hsync:      Horizontal Sync length in pixels
1204 * @hbackporch: Horizontal back porch in pixels
1205 * @vfrontporch:Vertical front porch in lines
1206 * @vsync:      Vertical Sync length in lines
1207 * @vbackporch: Vertical back porch in lines
1208 * @il_vfrontporch:Vertical front porch for the even field
1209 *              (aka field 2) of interlaced field formats
1210 * @il_vsync:   Vertical Sync length for the even field
1211 *              (aka field 2) of interlaced field formats
1212 * @il_vbackporch:Vertical back porch for the even field
1213 *              (aka field 2) of interlaced field formats
1214 * @standards:  Standards the timing belongs to
1215 * @flags:      Flags
1216 * @reserved:   Reserved fields, must be zeroed.
1217 *
1218 * A note regarding vertical interlaced timings: height refers to the total
1219 * height of the active video frame (= two fields). The blanking timings refer
1220 * to the blanking of each field. So the height of the total frame is
1221 * calculated as follows:
1222 *
1223 * tot_height = height + vfrontporch + vsync + vbackporch +
1224 *                       il_vfrontporch + il_vsync + il_vbackporch
1225 *
1226 * The active height of each field is height / 2.
1227 */
1228struct <a class="link" href="vidioc-g-dv-timings.html#v4l2-bt-timings" title="Table A.57. struct v4l2_bt_timings">v4l2_bt_timings</a> {
1229        __u32   width;
1230        __u32   height;
1231        __u32   interlaced;
1232        __u32   polarities;
1233        __u64   pixelclock;
1234        __u32   hfrontporch;
1235        __u32   hsync;
1236        __u32   hbackporch;
1237        __u32   vfrontporch;
1238        __u32   vsync;
1239        __u32   vbackporch;
1240        __u32   il_vfrontporch;
1241        __u32   il_vsync;
1242        __u32   il_vbackporch;
1243        __u32   standards;
1244        __u32   flags;
1245        __u32   reserved[14];
1246} __attribute__ ((packed));
1247
1248/* Interlaced or progressive format */
1249#define V4L2_DV_PROGRESSIVE     0
1250#define V4L2_DV_INTERLACED      1
1251
1252/* Polarities. If bit is not set, it is assumed to be negative polarity */
1253#define V4L2_DV_VSYNC_POS_POL   0x00000001
1254#define V4L2_DV_HSYNC_POS_POL   0x00000002
1255
1256/* Timings standards */
1257#define V4L2_DV_BT_STD_CEA861   (1 &lt;&lt; 0)  /* CEA-861 Digital TV Profile */
1258#define V4L2_DV_BT_STD_DMT      (1 &lt;&lt; 1)  /* VESA Discrete Monitor Timings */
1259#define V4L2_DV_BT_STD_CVT      (1 &lt;&lt; 2)  /* VESA Coordinated Video Timings */
1260#define V4L2_DV_BT_STD_GTF      (1 &lt;&lt; 3)  /* VESA Generalized Timings Formula */
1261
1262/* Flags */
1263
1264/* CVT/GTF specific: timing uses reduced blanking (CVT) or the 'Secondary
1265   GTF' curve (GTF). In both cases the horizontal and/or vertical blanking
1266   intervals are reduced, allowing a higher resolution over the same
1267   bandwidth. This is a read-only flag. */
1268#define V4L2_DV_FL_REDUCED_BLANKING             (1 &lt;&lt; 0)
1269/* CEA-861 specific: set for CEA-861 formats with a framerate of a multiple
1270   of six. These formats can be optionally played at 1 / 1.001 speed.
1271   This is a read-only flag. */
1272#define V4L2_DV_FL_CAN_REDUCE_FPS               (1 &lt;&lt; 1)
1273/* CEA-861 specific: only valid for video transmitters, the flag is cleared
1274   by receivers.
1275   If the framerate of the format is a multiple of six, then the pixelclock
1276   used to set up the transmitter is divided by 1.001 to make it compatible
1277   with 60 Hz based standards such as NTSC and PAL-M that use a framerate of
1278   29.97 Hz. Otherwise this flag is cleared. If the transmitter can't generate
1279   such frequencies, then the flag will also be cleared. */
1280#define V4L2_DV_FL_REDUCED_FPS                  (1 &lt;&lt; 2)
1281/* Specific to interlaced formats: if set, then field 1 is really one half-line
1282   longer and field 2 is really one half-line shorter, so each field has
1283   exactly the same number of half-lines. Whether half-lines can be detected
1284   or used depends on the hardware. */
1285#define V4L2_DV_FL_HALF_LINE                    (1 &lt;&lt; 3)
1286/* If set, then this is a Consumer Electronics (CE) video format. Such formats
1287 * differ from other formats (commonly called IT formats) in that if RGB
1288 * encoding is used then by default the RGB values use limited range (i.e.ie;
1289 * use the range 16-235) as opposed to 0-255. All formats defined in CEA-861
1290 * except for the 640x480 format are CE formats. */
1291#define V4L2_DV_FL_IS_CE_VIDEO                  (1 &lt;&lt; 4)
1292
1293/* A few useful defines to calculate the total blanking and frame sizes */
1294#define V4L2_DV_BT_BLANKING_WIDTH(bt) \
1295        ((bt)-&gt;hfrontporch + (bt)-&gt;hsync + (bt)-&gt;hbackporch)
1296#define V4L2_DV_BT_FRAME_WIDTH(bt) \
1297        ((bt)-&gt;width + V4L2_DV_BT_BLANKING_WIDTH(bt))
1298#define V4L2_DV_BT_BLANKING_HEIGHT(bt) \
1299        ((bt)-&gt;vfrontporch + (bt)-&gt;vsync + (bt)-&gt;vbackporch + \
1300         (bt)-&gt;il_vfrontporch + (bt)-&gt;il_vsync + (bt)-&gt;il_vbackporch)
1301#define V4L2_DV_BT_FRAME_HEIGHT(bt) \
1302        ((bt)-&gt;height + V4L2_DV_BT_BLANKING_HEIGHT(bt))
1303
1304/** struct <a class="link" href="vidioc-g-dv-timings.html#v4l2-dv-timings" title="Table A.58. struct v4l2_dv_timings">v4l2_dv_timings</a> - DV timings
1305 * @type:       the type of the timings
1306 * @bt: BT656/1120 timings
1307 */
1308struct <a class="link" href="vidioc-g-dv-timings.html#v4l2-dv-timings" title="Table A.58. struct v4l2_dv_timings">v4l2_dv_timings</a> {
1309        __u32 type;
1310        union {
1311                struct <a class="link" href="vidioc-g-dv-timings.html#v4l2-bt-timings" title="Table A.57. struct v4l2_bt_timings">v4l2_bt_timings</a>  bt;
1312                __u32   reserved[32];
1313        };
1314} __attribute__ ((packed));
1315
1316/* Values for the type field */
1317#define V4L2_DV_BT_656_1120     0       /* BT.656/1120 timing type */
1318
1319
1320/** struct <a class="link" href="vidioc-enum-dv-timings.html#v4l2-enum-dv-timings" title="Table A.27. struct v4l2_enum_dv_timings">v4l2_enum_dv_timings</a> - DV timings enumeration
1321 * @index:      enumeration index
1322 * @pad:        the pad number for which to enumerate timings (used with
1323 *              v4l-subdev nodes only)
1324 * @reserved:   must be zeroed
1325 * @timings:    the timings for the given index
1326 */
1327struct <a class="link" href="vidioc-enum-dv-timings.html#v4l2-enum-dv-timings" title="Table A.27. struct v4l2_enum_dv_timings">v4l2_enum_dv_timings</a> {
1328        __u32 index;
1329        __u32 pad;
1330        __u32 reserved[2];
1331        struct <a class="link" href="vidioc-g-dv-timings.html#v4l2-dv-timings" title="Table A.58. struct v4l2_dv_timings">v4l2_dv_timings</a> timings;
1332};
1333
1334/** struct <a class="link" href="vidioc-dv-timings-cap.html#v4l2-bt-timings-cap" title="Table A.21. struct v4l2_bt_timings_cap">v4l2_bt_timings_cap</a> - BT.656/BT.1120 timing capabilities
1335 * @min_width:          width in pixels
1336 * @max_width:          width in pixels
1337 * @min_height:         height in lines
1338 * @max_height:         height in lines
1339 * @min_pixelclock:     Pixel clock in HZ. Ex. 74.25MHz-&gt;74250000
1340 * @max_pixelclock:     Pixel clock in HZ. Ex. 74.25MHz-&gt;74250000
1341 * @standards:          Supported standards
1342 * @capabilities:       Supported capabilities
1343 * @reserved:           Must be zeroed
1344 */
1345struct <a class="link" href="vidioc-dv-timings-cap.html#v4l2-bt-timings-cap" title="Table A.21. struct v4l2_bt_timings_cap">v4l2_bt_timings_cap</a> {
1346        __u32   min_width;
1347        __u32   max_width;
1348        __u32   min_height;
1349        __u32   max_height;
1350        __u64   min_pixelclock;
1351        __u64   max_pixelclock;
1352        __u32   standards;
1353        __u32   capabilities;
1354        __u32   reserved[16];
1355} __attribute__ ((packed));
1356
1357/* Supports interlaced formats */
1358#define V4L2_DV_BT_CAP_INTERLACED       (1 &lt;&lt; 0)
1359/* Supports progressive formats */
1360#define V4L2_DV_BT_CAP_PROGRESSIVE      (1 &lt;&lt; 1)
1361/* Supports CVT/GTF reduced blanking */
1362#define V4L2_DV_BT_CAP_REDUCED_BLANKING (1 &lt;&lt; 2)
1363/* Supports custom formats */
1364#define V4L2_DV_BT_CAP_CUSTOM           (1 &lt;&lt; 3)
1365
1366/** struct <a class="link" href="vidioc-dv-timings-cap.html#v4l2-dv-timings-cap" title="Table A.22. struct v4l2_dv_timings_cap">v4l2_dv_timings_cap</a> - DV timings capabilities
1367 * @type:       the type of the timings (same as in struct <a class="link" href="vidioc-g-dv-timings.html#v4l2-dv-timings" title="Table A.58. struct v4l2_dv_timings">v4l2_dv_timings</a>)
1368 * @pad:        the pad number for which to query capabilities (used with
1369 *              v4l-subdev nodes only)
1370 * @bt:         the BT656/1120 timings capabilities
1371 */
1372struct <a class="link" href="vidioc-dv-timings-cap.html#v4l2-dv-timings-cap" title="Table A.22. struct v4l2_dv_timings_cap">v4l2_dv_timings_cap</a> {
1373        __u32 type;
1374        __u32 pad;
1375        __u32 reserved[2];
1376        union {
1377                struct <a class="link" href="vidioc-dv-timings-cap.html#v4l2-bt-timings-cap" title="Table A.21. struct v4l2_bt_timings_cap">v4l2_bt_timings_cap</a> bt;
1378                __u32 raw_data[32];
1379        };
1380};
1381
1382
1383/*
1384 *      V I D E O   I N P U T S
1385 */
1386struct <a class="link" href="vidioc-enuminput.html#v4l2-input" title="Table A.39. struct v4l2_input">v4l2_input</a> {
1387        __u32        index;             /*  Which input */
1388        __u8         name[32];          /*  Label */
1389        __u32        type;              /*  Type of input */
1390        __u32        audioset;          /*  Associated audios (bitfield) */
1391        __u32        tuner;             /*  enum <a class="link" href="vidioc-g-tuner.html#v4l2-tuner-type" title="Table A.88. enum v4l2_tuner_type">v4l2_tuner_type</a> */
1392        v4l2_std_id  std;
1393        __u32        status;
1394        __u32        capabilities;
1395        __u32        reserved[3];
1396};
1397
1398/*  Values for the 'type' field */
1399#define V4L2_INPUT_TYPE_TUNER           1
1400#define V4L2_INPUT_TYPE_CAMERA          2
1401
1402/* field 'status' - general */
1403#define V4L2_IN_ST_NO_POWER    0x00000001  /* Attached device is off */
1404#define V4L2_IN_ST_NO_SIGNAL   0x00000002
1405#define V4L2_IN_ST_NO_COLOR    0x00000004
1406
1407/* field 'status' - sensor orientation */
1408/* If sensor is mounted upside down set both bits */
1409#define V4L2_IN_ST_HFLIP       0x00000010 /* Frames are flipped horizontally */
1410#define V4L2_IN_ST_VFLIP       0x00000020 /* Frames are flipped vertically */
1411
1412/* field 'status' - analog */
1413#define V4L2_IN_ST_NO_H_LOCK   0x00000100  /* No horizontal sync lock */
1414#define V4L2_IN_ST_COLOR_KILL  0x00000200  /* Color killer is active */
1415
1416/* field 'status' - digital */
1417#define V4L2_IN_ST_NO_SYNC     0x00010000  /* No synchronization lock */
1418#define V4L2_IN_ST_NO_EQU      0x00020000  /* No equalizer lock */
1419#define V4L2_IN_ST_NO_CARRIER  0x00040000  /* Carrier recovery failed */
1420
1421/* field 'status' - VCR and set-top box */
1422#define V4L2_IN_ST_MACROVISION 0x01000000  /* Macrovision detected */
1423#define V4L2_IN_ST_NO_ACCESS   0x02000000  /* Conditional access denied */
1424#define V4L2_IN_ST_VTR         0x04000000  /* VTR time constant */
1425
1426/* capabilities flags */
1427#define V4L2_IN_CAP_DV_TIMINGS          0x00000002 /* Supports S_DV_TIMINGS */
1428#define V4L2_IN_CAP_CUSTOM_TIMINGS      V4L2_IN_CAP_DV_TIMINGS /* For compatibility */
1429#define V4L2_IN_CAP_STD                 0x00000004 /* Supports S_STD */
1430#define V4L2_IN_CAP_NATIVE_SIZE         0x00000008 /* Supports setting native size */
1431
1432/*
1433 *      V I D E O   O U T P U T S
1434 */
1435struct <a class="link" href="vidioc-enumoutput.html#v4l2-output" title="Table A.43. struct v4l2_output">v4l2_output</a> {
1436        __u32        index;             /*  Which output */
1437        __u8         name[32];          /*  Label */
1438        __u32        type;              /*  Type of output */
1439        __u32        audioset;          /*  Associated audios (bitfield) */
1440        __u32        modulator;         /*  Associated modulator */
1441        v4l2_std_id  std;
1442        __u32        capabilities;
1443        __u32        reserved[3];
1444};
1445/*  Values for the 'type' field */
1446#define V4L2_OUTPUT_TYPE_MODULATOR              1
1447#define V4L2_OUTPUT_TYPE_ANALOG                 2
1448#define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY       3
1449
1450/* capabilities flags */
1451#define V4L2_OUT_CAP_DV_TIMINGS         0x00000002 /* Supports S_DV_TIMINGS */
1452#define V4L2_OUT_CAP_CUSTOM_TIMINGS     V4L2_OUT_CAP_DV_TIMINGS /* For compatibility */
1453#define V4L2_OUT_CAP_STD                0x00000004 /* Supports S_STD */
1454#define V4L2_OUT_CAP_NATIVE_SIZE        0x00000008 /* Supports setting native size */
1455
1456/*
1457 *      C O N T R O L S
1458 */
1459struct <a class="link" href="vidioc-g-ctrl.html#v4l2-control" title="Table A.56. struct v4l2_control">v4l2_control</a> {
1460        __u32                id;
1461        __s32                value;
1462};
1463
1464struct <a class="link" href="vidioc-g-ext-ctrls.html#v4l2-ext-control" title="Table A.66. struct v4l2_ext_control">v4l2_ext_control</a> {
1465        __u32 id;
1466        __u32 size;
1467        __u32 reserved2[1];
1468        union {
1469                __s32 value;
1470                __s64 value64;
1471                char __user *string;
1472                __u8 __user *p_u8;
1473                __u16 __user *p_u16;
1474                __u32 __user *p_u32;
1475                void __user *ptr;
1476        };
1477} __attribute__ ((packed));
1478
1479struct <a class="link" href="vidioc-g-ext-ctrls.html#v4l2-ext-controls" title="Table A.67. struct v4l2_ext_controls">v4l2_ext_controls</a> {
1480        __u32 ctrl_class;
1481        __u32 count;
1482        __u32 error_idx;
1483        __u32 reserved[2];
1484        struct <a class="link" href="vidioc-g-ext-ctrls.html#v4l2-ext-control" title="Table A.66. struct v4l2_ext_control">v4l2_ext_control</a> *controls;
1485};
1486
1487#define V4L2_CTRL_ID_MASK         (0x0fffffff)
1488#define V4L2_CTRL_ID2CLASS(id)    ((id) &amp; 0x0fff0000UL)
1489#define V4L2_CTRL_DRIVER_PRIV(id) (((id) &amp; 0xffff) &gt;= 0x1000)
1490#define V4L2_CTRL_MAX_DIMS        (4)
1491
1492enum <a class="link" href="vidioc-queryctrl.html#v4l2-ctrl-type" title="Table A.98. enum v4l2_ctrl_type">v4l2_ctrl_type</a> {
1493        V4L2_CTRL_TYPE_INTEGER       = 1,
1494        V4L2_CTRL_TYPE_BOOLEAN       = 2,
1495        V4L2_CTRL_TYPE_MENU          = 3,
1496        V4L2_CTRL_TYPE_BUTTON        = 4,
1497        V4L2_CTRL_TYPE_INTEGER64     = 5,
1498        V4L2_CTRL_TYPE_CTRL_CLASS    = 6,
1499        V4L2_CTRL_TYPE_STRING        = 7,
1500        V4L2_CTRL_TYPE_BITMASK       = 8,
1501        V4L2_CTRL_TYPE_INTEGER_MENU  = 9,
1502
1503        /* Compound types are &gt;= 0x0100 */
1504        V4L2_CTRL_COMPOUND_TYPES     = 0x0100,
1505        V4L2_CTRL_TYPE_U8            = 0x0100,
1506        V4L2_CTRL_TYPE_U16           = 0x0101,
1507        V4L2_CTRL_TYPE_U32           = 0x0102,
1508};
1509
1510/*  Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
1511struct <a class="link" href="vidioc-queryctrl.html#v4l2-queryctrl" title="Table A.95. struct v4l2_queryctrl">v4l2_queryctrl</a> {
1512        __u32                id;
1513        __u32                type;      /* enum <a class="link" href="vidioc-queryctrl.html#v4l2-ctrl-type" title="Table A.98. enum v4l2_ctrl_type">v4l2_ctrl_type</a> */
1514        __u8                 name[32];  /* Whatever */
1515        __s32                minimum;   /* Note signedness */
1516        __s32                maximum;
1517        __s32                step;
1518        __s32                default_value;
1519        __u32                flags;
1520        __u32                reserved[2];
1521};
1522
1523/*  Used in the VIDIOC_QUERY_EXT_CTRL ioctl for querying extended controls */
1524struct <a class="link" href="vidioc-queryctrl.html#v4l2-query-ext-ctrl" title="Table A.96. struct v4l2_query_ext_ctrl">v4l2_query_ext_ctrl</a> {
1525        __u32                id;
1526        __u32                type;
1527        char                 name[32];
1528        __s64                minimum;
1529        __s64                maximum;
1530        __u64                step;
1531        __s64                default_value;
1532        __u32                flags;
1533        __u32                elem_size;
1534        __u32                elems;
1535        __u32                nr_of_dims;
1536        __u32                dims[V4L2_CTRL_MAX_DIMS];
1537        __u32                reserved[32];
1538};
1539
1540/*  Used in the VIDIOC_QUERYMENU ioctl for querying menu items */
1541struct <a class="link" href="vidioc-queryctrl.html#v4l2-querymenu" title="Table A.97. struct v4l2_querymenu">v4l2_querymenu</a> {
1542        __u32           id;
1543        __u32           index;
1544        union {
1545                __u8    name[32];       /* Whatever */
1546                __s64   value;
1547        };
1548        __u32           reserved;
1549} __attribute__ ((packed));
1550
1551/*  Control flags  */
1552#define V4L2_CTRL_FLAG_DISABLED         0x0001
1553#define V4L2_CTRL_FLAG_GRABBED          0x0002
1554#define V4L2_CTRL_FLAG_READ_ONLY        0x0004
1555#define V4L2_CTRL_FLAG_UPDATE           0x0008
1556#define V4L2_CTRL_FLAG_INACTIVE         0x0010
1557#define V4L2_CTRL_FLAG_SLIDER           0x0020
1558#define V4L2_CTRL_FLAG_WRITE_ONLY       0x0040
1559#define V4L2_CTRL_FLAG_VOLATILE         0x0080
1560#define V4L2_CTRL_FLAG_HAS_PAYLOAD      0x0100
1561#define V4L2_CTRL_FLAG_EXECUTE_ON_WRITE 0x0200
1562
1563/*  Query flags, to be ORed with the control ID */
1564#define V4L2_CTRL_FLAG_NEXT_CTRL        0x80000000
1565#define V4L2_CTRL_FLAG_NEXT_COMPOUND    0x40000000
1566
1567/*  User-class control IDs defined by V4L2 */
1568#define V4L2_CID_MAX_CTRLS              1024
1569/*  IDs reserved for driver specific controls */
1570#define V4L2_CID_PRIVATE_BASE           0x08000000
1571
1572
1573/*
1574 *      T U N I N G
1575 */
1576struct <a class="link" href="vidioc-g-tuner.html#v4l2-tuner" title="Table A.87. struct v4l2_tuner">v4l2_tuner</a> {
1577        __u32                   index;
1578        __u8                    name[32];
1579        __u32                   type;   /* enum <a class="link" href="vidioc-g-tuner.html#v4l2-tuner-type" title="Table A.88. enum v4l2_tuner_type">v4l2_tuner_type</a> */
1580        __u32                   capability;
1581        __u32                   rangelow;
1582        __u32                   rangehigh;
1583        __u32                   rxsubchans;
1584        __u32                   audmode;
1585        __s32                   signal;
1586        __s32                   afc;
1587        __u32                   reserved[4];
1588};
1589
1590struct <a class="link" href="vidioc-g-modulator.html#v4l2-modulator" title="Table A.76. struct v4l2_modulator">v4l2_modulator</a> {
1591        __u32                   index;
1592        __u8                    name[32];
1593        __u32                   capability;
1594        __u32                   rangelow;
1595        __u32                   rangehigh;
1596        __u32                   txsubchans;
1597        __u32                   type;   /* enum <a class="link" href="vidioc-g-tuner.html#v4l2-tuner-type" title="Table A.88. enum v4l2_tuner_type">v4l2_tuner_type</a> */
1598        __u32                   reserved[3];
1599};
1600
1601/*  Flags for the 'capability' field */
1602#define V4L2_TUNER_CAP_LOW              0x0001
1603#define V4L2_TUNER_CAP_NORM             0x0002
1604#define V4L2_TUNER_CAP_HWSEEK_BOUNDED   0x0004
1605#define V4L2_TUNER_CAP_HWSEEK_WRAP      0x0008
1606#define V4L2_TUNER_CAP_STEREO           0x0010
1607#define V4L2_TUNER_CAP_LANG2            0x0020
1608#define V4L2_TUNER_CAP_SAP              0x0020
1609#define V4L2_TUNER_CAP_LANG1            0x0040
1610#define V4L2_TUNER_CAP_RDS              0x0080
1611#define V4L2_TUNER_CAP_RDS_BLOCK_IO     0x0100
1612#define V4L2_TUNER_CAP_RDS_CONTROLS     0x0200
1613#define V4L2_TUNER_CAP_FREQ_BANDS       0x0400
1614#define V4L2_TUNER_CAP_HWSEEK_PROG_LIM  0x0800
1615#define V4L2_TUNER_CAP_1HZ              0x1000
1616
1617/*  Flags for the 'rxsubchans' field */
1618#define V4L2_TUNER_SUB_MONO             0x0001
1619#define V4L2_TUNER_SUB_STEREO           0x0002
1620#define V4L2_TUNER_SUB_LANG2            0x0004
1621#define V4L2_TUNER_SUB_SAP              0x0004
1622#define V4L2_TUNER_SUB_LANG1            0x0008
1623#define V4L2_TUNER_SUB_RDS              0x0010
1624
1625/*  Values for the 'audmode' field */
1626#define V4L2_TUNER_MODE_MONO            0x0000
1627#define V4L2_TUNER_MODE_STEREO          0x0001
1628#define V4L2_TUNER_MODE_LANG2           0x0002
1629#define V4L2_TUNER_MODE_SAP             0x0002
1630#define V4L2_TUNER_MODE_LANG1           0x0003
1631#define V4L2_TUNER_MODE_LANG1_LANG2     0x0004
1632
1633struct <a class="link" href="vidioc-g-frequency.html#v4l2-frequency" title="Table A.73. struct v4l2_frequency">v4l2_frequency</a> {
1634        __u32   tuner;
1635        __u32   type;   /* enum <a class="link" href="vidioc-g-tuner.html#v4l2-tuner-type" title="Table A.88. enum v4l2_tuner_type">v4l2_tuner_type</a> */
1636        __u32   frequency;
1637        __u32   reserved[8];
1638};
1639
1640#define V4L2_BAND_MODULATION_VSB        (1 &lt;&lt; 1)
1641#define V4L2_BAND_MODULATION_FM         (1 &lt;&lt; 2)
1642#define V4L2_BAND_MODULATION_AM         (1 &lt;&lt; 3)
1643
1644struct <a class="link" href="vidioc-enum-freq-bands.html#v4l2-frequency-band" title="Table A.37. struct v4l2_frequency_band">v4l2_frequency_band</a> {
1645        __u32   tuner;
1646        __u32   type;   /* enum <a class="link" href="vidioc-g-tuner.html#v4l2-tuner-type" title="Table A.88. enum v4l2_tuner_type">v4l2_tuner_type</a> */
1647        __u32   index;
1648        __u32   capability;
1649        __u32   rangelow;
1650        __u32   rangehigh;
1651        __u32   modulation;
1652        __u32   reserved[9];
1653};
1654
1655struct <a class="link" href="vidioc-s-hw-freq-seek.html#v4l2-hw-freq-seek" title="Table A.101. struct v4l2_hw_freq_seek">v4l2_hw_freq_seek</a> {
1656        __u32   tuner;
1657        __u32   type;   /* enum <a class="link" href="vidioc-g-tuner.html#v4l2-tuner-type" title="Table A.88. enum v4l2_tuner_type">v4l2_tuner_type</a> */
1658        __u32   seek_upward;
1659        __u32   wrap_around;
1660        __u32   spacing;
1661        __u32   rangelow;
1662        __u32   rangehigh;
1663        __u32   reserved[5];
1664};
1665
1666/*
1667 *      R D S
1668 */
1669
1670struct <a class="link" href="rds.html#v4l2-rds-data" title="Table 4.15. struct v4l2_rds_data">v4l2_rds_data</a> {
1671        __u8    lsb;
1672        __u8    msb;
1673        __u8    block;
1674} __attribute__ ((packed));
1675
1676#define V4L2_RDS_BLOCK_MSK       0x7
1677#define V4L2_RDS_BLOCK_A         0
1678#define V4L2_RDS_BLOCK_B         1
1679#define V4L2_RDS_BLOCK_C         2
1680#define V4L2_RDS_BLOCK_D         3
1681#define V4L2_RDS_BLOCK_C_ALT     4
1682#define V4L2_RDS_BLOCK_INVALID   7
1683
1684#define V4L2_RDS_BLOCK_CORRECTED 0x40
1685#define V4L2_RDS_BLOCK_ERROR     0x80
1686
1687/*
1688 *      A U D I O
1689 */
1690struct <a class="link" href="vidioc-g-audio.html#v4l2-audio" title="Table A.51. struct v4l2_audio">v4l2_audio</a> {
1691        __u32   index;
1692        __u8    name[32];
1693        __u32   capability;
1694        __u32   mode;
1695        __u32   reserved[2];
1696};
1697
1698/*  Flags for the 'capability' field */
1699#define V4L2_AUDCAP_STEREO              0x00001
1700#define V4L2_AUDCAP_AVL                 0x00002
1701
1702/*  Flags for the 'mode' field */
1703#define V4L2_AUDMODE_AVL                0x00001
1704
1705struct <a class="link" href="vidioc-g-audioout.html#v4l2-audioout" title="Table A.54. struct v4l2_audioout">v4l2_audioout</a> {
1706        __u32   index;
1707        __u8    name[32];
1708        __u32   capability;
1709        __u32   mode;
1710        __u32   reserved[2];
1711};
1712
1713/*
1714 *      M P E G   S E R V I C E S
1715 *
1716 *      NOTE: EXPERIMENTAL API
1717 */
1718#if 1
1719#define V4L2_ENC_IDX_FRAME_I    (0)
1720#define V4L2_ENC_IDX_FRAME_P    (1)
1721#define V4L2_ENC_IDX_FRAME_B    (2)
1722#define V4L2_ENC_IDX_FRAME_MASK (0xf)
1723
1724struct <a class="link" href="vidioc-g-enc-index.html#v4l2-enc-idx-entry" title="Table A.64. struct v4l2_enc_idx_entry">v4l2_enc_idx_entry</a> {
1725        __u64 offset;
1726        __u64 pts;
1727        __u32 length;
1728        __u32 flags;
1729        __u32 reserved[2];
1730};
1731
1732#define V4L2_ENC_IDX_ENTRIES (64)
1733struct <a class="link" href="vidioc-g-enc-index.html#v4l2-enc-idx" title="Table A.63. struct v4l2_enc_idx">v4l2_enc_idx</a> {
1734        __u32 entries;
1735        __u32 entries_cap;
1736        __u32 reserved[4];
1737        struct <a class="link" href="vidioc-g-enc-index.html#v4l2-enc-idx-entry" title="Table A.64. struct v4l2_enc_idx_entry">v4l2_enc_idx_entry</a> entry[V4L2_ENC_IDX_ENTRIES];
1738};
1739
1740
1741#define V4L2_ENC_CMD_START      (0)
1742#define V4L2_ENC_CMD_STOP       (1)
1743#define V4L2_ENC_CMD_PAUSE      (2)
1744#define V4L2_ENC_CMD_RESUME     (3)
1745
1746/* Flags for V4L2_ENC_CMD_STOP */
1747#define V4L2_ENC_CMD_STOP_AT_GOP_END    (1 &lt;&lt; 0)
1748
1749struct <a class="link" href="vidioc-encoder-cmd.html#v4l2-encoder-cmd" title="Table A.24. struct v4l2_encoder_cmd">v4l2_encoder_cmd</a> {
1750        __u32 cmd;
1751        __u32 flags;
1752        union {
1753                struct {
1754                        __u32 data[8];
1755                } raw;
1756        };
1757};
1758
1759/* Decoder commands */
1760#define V4L2_DEC_CMD_START       (0)
1761#define V4L2_DEC_CMD_STOP        (1)
1762#define V4L2_DEC_CMD_PAUSE       (2)
1763#define V4L2_DEC_CMD_RESUME      (3)
1764
1765/* Flags for V4L2_DEC_CMD_START */
1766#define V4L2_DEC_CMD_START_MUTE_AUDIO   (1 &lt;&lt; 0)
1767
1768/* Flags for V4L2_DEC_CMD_PAUSE */
1769#define V4L2_DEC_CMD_PAUSE_TO_BLACK     (1 &lt;&lt; 0)
1770
1771/* Flags for V4L2_DEC_CMD_STOP */
1772#define V4L2_DEC_CMD_STOP_TO_BLACK      (1 &lt;&lt; 0)
1773#define V4L2_DEC_CMD_STOP_IMMEDIATELY   (1 &lt;&lt; 1)
1774
1775/* Play format requirements (returned by the driver): */
1776
1777/* The decoder has no special format requirements */
1778#define V4L2_DEC_START_FMT_NONE         (0)
1779/* The decoder requires full GOPs */
1780#define V4L2_DEC_START_FMT_GOP          (1)
1781
1782/* The structure must be zeroed before use by the application
1783   This ensures it can be extended safely in the future. */
1784struct <a class="link" href="vidioc-decoder-cmd.html#v4l2-decoder-cmd" title="Table A.10. struct v4l2_decoder_cmd">v4l2_decoder_cmd</a> {
1785        __u32 cmd;
1786        __u32 flags;
1787        union {
1788                struct {
1789                        __u64 pts;
1790                } stop;
1791
1792                struct {
1793                        /* 0 or 1000 specifies normal speed,
1794                           1 specifies forward single stepping,
1795                           -1 specifies backward single stepping,
1796                           &gt;1: playback at speed/1000 of the normal speed,
1797                           &lt;-1: reverse playback at (-speed/1000) of the normal speed. */
1798                        __s32 speed;
1799                        __u32 format;
1800                } start;
1801
1802                struct {
1803                        __u32 data[16];
1804                } raw;
1805        };
1806};
1807#endif
1808
1809
1810/*
1811 *      D A T A   S E R V I C E S   ( V B I )
1812 *
1813 *      Data services API by Michael Schimek
1814 */
1815
1816/* Raw VBI */
1817struct <a class="link" href="raw-vbi.html#v4l2-vbi-format" title="Table 4.4. struct v4l2_vbi_format">v4l2_vbi_format</a> {
1818        __u32   sampling_rate;          /* in 1 Hz */
1819        __u32   offset;
1820        __u32   samples_per_line;
1821        __u32   sample_format;          /* V4L2_PIX_FMT_* */
1822        __s32   start[2];
1823        __u32   count[2];
1824        __u32   flags;                  /* V4L2_VBI_* */
1825        __u32   reserved[2];            /* must be zero */
1826};
1827
1828/*  VBI flags  */
1829#define V4L2_VBI_UNSYNC         (1 &lt;&lt; 0)
1830#define V4L2_VBI_INTERLACED     (1 &lt;&lt; 1)
1831
1832/* ITU-R start lines for each field */
1833#define V4L2_VBI_ITU_525_F1_START (1)
1834#define V4L2_VBI_ITU_525_F2_START (264)
1835#define V4L2_VBI_ITU_625_F1_START (1)
1836#define V4L2_VBI_ITU_625_F2_START (314)
1837
1838/* Sliced VBI
1839 *
1840 *    This implements is a proposal V4L2 API to allow SLICED VBI
1841 * required for some hardware encoders. It should change without
1842 * notice in the definitive implementation.
1843 */
1844
1845struct <a class="link" href="sliced.html#v4l2-sliced-vbi-format" title="Table 4.6. struct v4l2_sliced_vbi_format">v4l2_sliced_vbi_format</a> {
1846        __u16   service_set;
1847        /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
1848           service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
1849                                 (equals frame lines 313-336 for 625 line video
1850                                  standards, 263-286 for 525 line standards) */
1851        __u16   service_lines[2][24];
1852        __u32   io_size;
1853        __u32   reserved[2];            /* must be zero */
1854};
1855
1856/* Teletext World System Teletext
1857   (WST), defined on ITU-R BT.653-2 */
1858#define V4L2_SLICED_TELETEXT_B          (0x0001)
1859/* Video Program System, defined on ETS 300 231*/
1860#define V4L2_SLICED_VPS                 (0x0400)
1861/* Closed Caption, defined on EIA-608 */
1862#define V4L2_SLICED_CAPTION_525         (0x1000)
1863/* Wide Screen System, defined on ITU-R BT1119.1 */
1864#define V4L2_SLICED_WSS_625             (0x4000)
1865
1866#define V4L2_SLICED_VBI_525             (V4L2_SLICED_CAPTION_525)
1867#define V4L2_SLICED_VBI_625             (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625)
1868
1869struct <a class="link" href="vidioc-g-sliced-vbi-cap.html#v4l2-sliced-vbi-cap" title="Table A.85. struct v4l2_sliced_vbi_cap">v4l2_sliced_vbi_cap</a> {
1870        __u16   service_set;
1871        /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
1872           service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
1873                                 (equals frame lines 313-336 for 625 line video
1874                                  standards, 263-286 for 525 line standards) */
1875        __u16   service_lines[2][24];
1876        __u32   type;           /* enum <a class="link" href="buffer.html#v4l2-buf-type" title="Table 3.3. enum v4l2_buf_type">v4l2_buf_type</a> */
1877        __u32   reserved[3];    /* must be 0 */
1878};
1879
1880struct <a class="link" href="sliced.html#v4l2-sliced-vbi-data" title="Table 4.8. struct v4l2_sliced_vbi_data">v4l2_sliced_vbi_data</a> {
1881        __u32   id;
1882        __u32   field;          /* 0: first field, 1: second field */
1883        __u32   line;           /* 1-23 */
1884        __u32   reserved;       /* must be 0 */
1885        __u8    data[48];
1886};
1887
1888/*
1889 * Sliced VBI data inserted into MPEG Streams
1890 */
1891
1892/*
1893 * V4L2_MPEG_STREAM_VBI_FMT_IVTV:
1894 *
1895 * Structure of payload contained in an MPEG 2 Private Stream 1 PES Packet in an
1896 * MPEG-2 Program Pack that contains V4L2_MPEG_STREAM_VBI_FMT_IVTV Sliced VBI
1897 * data
1898 *
1899 * Note, the MPEG-2 Program Pack and Private Stream 1 PES packet header
1900 * definitions are not included here.  See the MPEG-2 specifications for details
1901 * on these headers.
1902 */
1903
1904/* Line type IDs */
1905#define V4L2_MPEG_VBI_IVTV_TELETEXT_B     (1)
1906#define V4L2_MPEG_VBI_IVTV_CAPTION_525    (4)
1907#define V4L2_MPEG_VBI_IVTV_WSS_625        (5)
1908#define V4L2_MPEG_VBI_IVTV_VPS            (7)
1909
1910struct <a class="link" href="sliced.html#v4l2-mpeg-vbi-itv0-line" title="Table 4.13. struct v4l2_mpeg_vbi_itv0_line">v4l2_mpeg_vbi_itv0_line</a> {
1911        __u8 id;        /* One of V4L2_MPEG_VBI_IVTV_* above */
1912        __u8 data[42];  /* Sliced VBI data for the line */
1913} __attribute__ ((packed));
1914
1915struct <a class="link" href="sliced.html#v4l2-mpeg-vbi-itv0" title="Table 4.11. struct v4l2_mpeg_vbi_itv0">v4l2_mpeg_vbi_itv0</a> {
1916        __le32 linemask[2]; /* Bitmasks of VBI service lines present */
1917        struct <a class="link" href="sliced.html#v4l2-mpeg-vbi-itv0-line" title="Table 4.13. struct v4l2_mpeg_vbi_itv0_line">v4l2_mpeg_vbi_itv0_line</a> line[35];
1918} __attribute__ ((packed));
1919
1920struct <a class="link" href="sliced.html#v4l2-mpeg-vbi-itv0-1" title="Table 4.12. struct v4l2_mpeg_vbi_ITV0">v4l2_mpeg_vbi_ITV0</a> {
1921        struct <a class="link" href="sliced.html#v4l2-mpeg-vbi-itv0-line" title="Table 4.13. struct v4l2_mpeg_vbi_itv0_line">v4l2_mpeg_vbi_itv0_line</a> line[36];
1922} __attribute__ ((packed));
1923
1924#define V4L2_MPEG_VBI_IVTV_MAGIC0       "itv0"
1925#define V4L2_MPEG_VBI_IVTV_MAGIC1       "ITV0"
1926
1927struct <a class="link" href="sliced.html#v4l2-mpeg-vbi-fmt-ivtv" title="Table 4.9. struct v4l2_mpeg_vbi_fmt_ivtv">v4l2_mpeg_vbi_fmt_ivtv</a> {
1928        __u8 magic[4];
1929        union {
1930                struct <a class="link" href="sliced.html#v4l2-mpeg-vbi-itv0" title="Table 4.11. struct v4l2_mpeg_vbi_itv0">v4l2_mpeg_vbi_itv0</a> itv0;
1931                struct <a class="link" href="sliced.html#v4l2-mpeg-vbi-itv0-1" title="Table 4.12. struct v4l2_mpeg_vbi_ITV0">v4l2_mpeg_vbi_ITV0</a> ITV0;
1932        };
1933} __attribute__ ((packed));
1934
1935/*
1936 *      A G G R E G A T E   S T R U C T U R E S
1937 */
1938
1939/**
1940 * struct <a class="link" href="ch02s02.html#v4l2-plane-pix-format" title="Table 2.2. struct v4l2_plane_pix_format">v4l2_plane_pix_format</a> - additional, per-plane format definition
1941 * @sizeimage:          maximum size in bytes required for data, for which
1942 *                      this plane will be used
1943 * @bytesperline:       distance in bytes between the leftmost pixels in two
1944 *                      adjacent lines
1945 */
1946struct <a class="link" href="ch02s02.html#v4l2-plane-pix-format" title="Table 2.2. struct v4l2_plane_pix_format">v4l2_plane_pix_format</a> {
1947        __u32           sizeimage;
1948        __u32           bytesperline;
1949        __u16           reserved[6];
1950} __attribute__ ((packed));
1951
1952/**
1953 * struct <a class="link" href="ch02s02.html#v4l2-pix-format-mplane" title="Table 2.3. struct v4l2_pix_format_mplane">v4l2_pix_format_mplane</a> - multiplanar format definition
1954 * @width:              image width in pixels
1955 * @height:             image height in pixels
1956 * @pixelformat:        little endian four character code (fourcc)
1957 * @field:              enum <a class="link" href="field-order.html#v4l2-field" title="Table 3.9. enum v4l2_field">v4l2_field</a>; field order (for interlaced video)
1958 * @colorspace:         enum <a class="link" href="ch02s05.html#v4l2-colorspace" title="Table 2.4. V4L2 Colorspaces">v4l2_colorspace</a>; supplemental to pixelformat
1959 * @plane_fmt:          per-plane information
1960 * @num_planes:         number of planes for this format
1961 * @flags:              format flags (V4L2_PIX_FMT_FLAG_*)
1962 * @ycbcr_enc:          enum <a class="link" href="ch02s05.html#v4l2-ycbcr-encoding" title="Table 2.6. V4L2 Y'CbCr Encodings">v4l2_ycbcr_encoding</a>, Y'CbCr encoding
1963 * @quantization:       enum <a class="link" href="ch02s05.html#v4l2-quantization" title="Table 2.7. V4L2 Quantization Methods">v4l2_quantization</a>, colorspace quantization
1964 * @xfer_func:          enum <a class="link" href="ch02s05.html#v4l2-xfer-func" title="Table 2.5. V4L2 Transfer Function">v4l2_xfer_func</a>, colorspace transfer function
1965 */
1966struct <a class="link" href="ch02s02.html#v4l2-pix-format-mplane" title="Table 2.3. struct v4l2_pix_format_mplane">v4l2_pix_format_mplane</a> {
1967        __u32                           width;
1968        __u32                           height;
1969        __u32                           pixelformat;
1970        __u32                           field;
1971        __u32                           colorspace;
1972
1973        struct <a class="link" href="ch02s02.html#v4l2-plane-pix-format" title="Table 2.2. struct v4l2_plane_pix_format">v4l2_plane_pix_format</a>    plane_fmt[VIDEO_MAX_PLANES];
1974        __u8                            num_planes;
1975        __u8                            flags;
1976        __u8                            ycbcr_enc;
1977        __u8                            quantization;
1978        __u8                            xfer_func;
1979        __u8                            reserved[7];
1980} __attribute__ ((packed));
1981
1982/**
1983 * struct <a class="link" href="sdr.html#v4l2-sdr-format" title="Table 4.18. struct v4l2_sdr_format">v4l2_sdr_format</a> - SDR format definition
1984 * @pixelformat:        little endian four character code (fourcc)
1985 * @buffersize:         maximum size in bytes required for data
1986 */
1987struct <a class="link" href="sdr.html#v4l2-sdr-format" title="Table 4.18. struct v4l2_sdr_format">v4l2_sdr_format</a> {
1988        __u32                           pixelformat;
1989        __u32                           buffersize;
1990        __u8                            reserved[24];
1991} __attribute__ ((packed));
1992
1993/**
1994 * struct <a class="link" href="vidioc-g-fmt.html#v4l2-format" title="Table A.72. struct v4l2_format">v4l2_format</a> - stream data format
1995 * @type:       enum <a class="link" href="buffer.html#v4l2-buf-type" title="Table 3.3. enum v4l2_buf_type">v4l2_buf_type</a>; type of the data stream
1996 * @pix:        definition of an image format
1997 * @pix_mp:     definition of a multiplanar image format
1998 * @win:        definition of an overlaid image
1999 * @vbi:        raw VBI capture or output parameters
2000 * @sliced:     sliced VBI capture or output parameters
2001 * @raw_data:   placeholder for future extensions and custom formats
2002 */
2003struct <a class="link" href="vidioc-g-fmt.html#v4l2-format" title="Table A.72. struct v4l2_format">v4l2_format</a> {
2004        __u32    type;
2005        union {
2006                struct <a class="link" href="pixfmt.html#v4l2-pix-format" title="Table 2.1. struct v4l2_pix_format">v4l2_pix_format</a>          pix;     /* V4L2_BUF_TYPE_VIDEO_CAPTURE */
2007                struct <a class="link" href="ch02s02.html#v4l2-pix-format-mplane" title="Table 2.3. struct v4l2_pix_format_mplane">v4l2_pix_format_mplane</a>   pix_mp;  /* V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE */
2008                struct <a class="link" href="overlay.html#v4l2-window" title="Table 4.1. struct v4l2_window">v4l2_window</a>              win;     /* V4L2_BUF_TYPE_VIDEO_OVERLAY */
2009                struct <a class="link" href="raw-vbi.html#v4l2-vbi-format" title="Table 4.4. struct v4l2_vbi_format">v4l2_vbi_format</a>          vbi;     /* V4L2_BUF_TYPE_VBI_CAPTURE */
2010                struct <a class="link" href="sliced.html#v4l2-sliced-vbi-format" title="Table 4.6. struct v4l2_sliced_vbi_format">v4l2_sliced_vbi_format</a>   sliced;  /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */
2011                struct <a class="link" href="sdr.html#v4l2-sdr-format" title="Table 4.18. struct v4l2_sdr_format">v4l2_sdr_format</a>          sdr;     /* V4L2_BUF_TYPE_SDR_CAPTURE */
2012                __u8    raw_data[200];                   /* user-defined */
2013        } fmt;
2014};
2015
2016/*      Stream type-dependent parameters
2017 */
2018struct <a class="link" href="vidioc-g-parm.html#v4l2-streamparm" title="Table A.78. struct v4l2_streamparm">v4l2_streamparm</a> {
2019        __u32    type;                  /* enum <a class="link" href="buffer.html#v4l2-buf-type" title="Table 3.3. enum v4l2_buf_type">v4l2_buf_type</a> */
2020        union {
2021                struct <a class="link" href="vidioc-g-parm.html#v4l2-captureparm" title="Table A.79. struct v4l2_captureparm">v4l2_captureparm</a> capture;
2022                struct <a class="link" href="vidioc-g-parm.html#v4l2-outputparm" title="Table A.80. struct v4l2_outputparm">v4l2_outputparm</a>  output;
2023                __u8    raw_data[200];  /* user-defined */
2024        } parm;
2025};
2026
2027/*
2028 *      E V E N T S
2029 */
2030
2031#define V4L2_EVENT_ALL                          0
2032#define V4L2_EVENT_VSYNC                        1
2033#define V4L2_EVENT_EOS                          2
2034#define V4L2_EVENT_CTRL                         3
2035#define V4L2_EVENT_FRAME_SYNC                   4
2036#define V4L2_EVENT_SOURCE_CHANGE                5
2037#define V4L2_EVENT_MOTION_DET                   6
2038#define V4L2_EVENT_PRIVATE_START                0x08000000
2039
2040/* Payload for V4L2_EVENT_VSYNC */
2041struct <a class="link" href="vidioc-dqevent.html#v4l2-event-vsync" title="Table A.14. struct v4l2_event_vsync">v4l2_event_vsync</a> {
2042        /* Can be V4L2_FIELD_ANY, _NONE, _TOP or _BOTTOM */
2043        __u8 field;
2044} __attribute__ ((packed));
2045
2046/* Payload for V4L2_EVENT_CTRL */
2047#define V4L2_EVENT_CTRL_CH_VALUE                (1 &lt;&lt; 0)
2048#define V4L2_EVENT_CTRL_CH_FLAGS                (1 &lt;&lt; 1)
2049#define V4L2_EVENT_CTRL_CH_RANGE                (1 &lt;&lt; 2)
2050
2051struct <a class="link" href="vidioc-dqevent.html#v4l2-event-ctrl" title="Table A.15. struct v4l2_event_ctrl">v4l2_event_ctrl</a> {
2052        __u32 changes;
2053        __u32 type;
2054        union {
2055                __s32 value;
2056                __s64 value64;
2057        };
2058        __u32 flags;
2059        __s32 minimum;
2060        __s32 maximum;
2061        __s32 step;
2062        __s32 default_value;
2063};
2064
2065struct <a class="link" href="vidioc-dqevent.html#v4l2-event-frame-sync" title="Table A.16. struct v4l2_event_frame_sync">v4l2_event_frame_sync</a> {
2066        __u32 frame_sequence;
2067};
2068
2069#define V4L2_EVENT_SRC_CH_RESOLUTION            (1 &lt;&lt; 0)
2070
2071struct <a class="link" href="vidioc-dqevent.html#v4l2-event-src-change" title="Table A.17. struct v4l2_event_src_change">v4l2_event_src_change</a> {
2072        __u32 changes;
2073};
2074
2075#define V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ (1 &lt;&lt; 0)
2076
2077/**
2078 * struct <a class="link" href="vidioc-dqevent.html#v4l2-event-motion-det" title="Table A.18. struct v4l2_event_motion_det">v4l2_event_motion_det</a> - motion detection event
2079 * @flags:             if V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ is set, then the
2080 *                     frame_sequence field is valid.
2081 * @frame_sequence:    the frame sequence number associated with this event.
2082 * @region_mask:       which regions detected motion.
2083 */
2084struct <a class="link" href="vidioc-dqevent.html#v4l2-event-motion-det" title="Table A.18. struct v4l2_event_motion_det">v4l2_event_motion_det</a> {
2085        __u32 flags;
2086        __u32 frame_sequence;
2087        __u32 region_mask;
2088};
2089
2090struct <a class="link" href="vidioc-dqevent.html#v4l2-event" title="Table A.12. struct v4l2_event">v4l2_event</a> {
2091        __u32                           type;
2092        union {
2093                struct <a class="link" href="vidioc-dqevent.html#v4l2-event-vsync" title="Table A.14. struct v4l2_event_vsync">v4l2_event_vsync</a>         vsync;
2094                struct <a class="link" href="vidioc-dqevent.html#v4l2-event-ctrl" title="Table A.15. struct v4l2_event_ctrl">v4l2_event_ctrl</a>          ctrl;
2095                struct <a class="link" href="vidioc-dqevent.html#v4l2-event-frame-sync" title="Table A.16. struct v4l2_event_frame_sync">v4l2_event_frame_sync</a>    frame_sync;
2096                struct <a class="link" href="vidioc-dqevent.html#v4l2-event-src-change" title="Table A.17. struct v4l2_event_src_change">v4l2_event_src_change</a>    src_change;
2097                struct <a class="link" href="vidioc-dqevent.html#v4l2-event-motion-det" title="Table A.18. struct v4l2_event_motion_det">v4l2_event_motion_det</a>    motion_det;
2098                __u8                            data[64];
2099        } u;
2100        __u32                           pending;
2101        __u32                           sequence;
2102        struct timespec                 timestamp;
2103        __u32                           id;
2104        __u32                           reserved[8];
2105};
2106
2107#define V4L2_EVENT_SUB_FL_SEND_INITIAL          (1 &lt;&lt; 0)
2108#define V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK        (1 &lt;&lt; 1)
2109
2110struct <a class="link" href="vidioc-subscribe-event.html#v4l2-event-subscription" title="Table A.110. struct v4l2_event_subscription">v4l2_event_subscription</a> {
2111        __u32                           type;
2112        __u32                           id;
2113        __u32                           flags;
2114        __u32                           reserved[5];
2115};
2116
2117/*
2118 *      A D V A N C E D   D E B U G G I N G
2119 *
2120 *      NOTE: EXPERIMENTAL API, NEVER RELY ON THIS IN APPLICATIONS!
2121 *      FOR DEBUGGING, TESTING AND INTERNAL USE ONLY!
2122 */
2123
2124/* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */
2125
2126#define V4L2_CHIP_MATCH_BRIDGE      0  /* Match against chip ID on the bridge (0 for the bridge) */
2127#define V4L2_CHIP_MATCH_SUBDEV      4  /* Match against subdev index */
2128
2129/* The following four defines are no longer in use */
2130#define V4L2_CHIP_MATCH_HOST V4L2_CHIP_MATCH_BRIDGE
2131#define V4L2_CHIP_MATCH_I2C_DRIVER  1  /* Match against I2C driver name */
2132#define V4L2_CHIP_MATCH_I2C_ADDR    2  /* Match against I2C 7-bit address */
2133#define V4L2_CHIP_MATCH_AC97        3  /* Match against ancillary AC97 chip */
2134
2135struct <a class="link" href="vidioc-dbg-g-register.html#v4l2-dbg-match" title="Table A.7. struct v4l2_dbg_match">v4l2_dbg_match</a> {
2136        __u32 type; /* Match type */
2137        union {     /* Match this chip, meaning determined by type */
2138                __u32 addr;
2139                char name[32];
2140        };
2141} __attribute__ ((packed));
2142
2143struct <a class="link" href="vidioc-dbg-g-register.html#v4l2-dbg-register" title="Table A.8. struct v4l2_dbg_register">v4l2_dbg_register</a> {
2144        struct <a class="link" href="vidioc-dbg-g-register.html#v4l2-dbg-match" title="Table A.7. struct v4l2_dbg_match">v4l2_dbg_match</a> match;
2145        __u32 size;     /* register size in bytes */
2146        __u64 reg;
2147        __u64 val;
2148} __attribute__ ((packed));
2149
2150#define V4L2_CHIP_FL_READABLE (1 &lt;&lt; 0)
2151#define V4L2_CHIP_FL_WRITABLE (1 &lt;&lt; 1)
2152
2153/* VIDIOC_DBG_G_CHIP_INFO */
2154struct <a class="link" href="vidioc-dbg-g-chip-info.html#v4l2-dbg-chip-info" title="Table A.5. struct v4l2_dbg_chip_info">v4l2_dbg_chip_info</a> {
2155        struct <a class="link" href="vidioc-dbg-g-register.html#v4l2-dbg-match" title="Table A.7. struct v4l2_dbg_match">v4l2_dbg_match</a> match;
2156        char name[32];
2157        __u32 flags;
2158        __u32 reserved[32];
2159} __attribute__ ((packed));
2160
2161/**
2162 * struct <a class="link" href="vidioc-create-bufs.html#v4l2-create-buffers" title="Table A.1. struct v4l2_create_buffers">v4l2_create_buffers</a> - VIDIOC_CREATE_BUFS argument
2163 * @index:      on return, index of the first created buffer
2164 * @count:      entry: number of requested buffers,
2165 *              return: number of created buffers
2166 * @memory:     enum <a class="link" href="buffer.html#v4l2-memory" title="Table 3.5. enum v4l2_memory">v4l2_memory</a>; buffer memory type
2167 * @format:     frame format, for which buffers are requested
2168 * @reserved:   future extensions
2169 */
2170struct <a class="link" href="vidioc-create-bufs.html#v4l2-create-buffers" title="Table A.1. struct v4l2_create_buffers">v4l2_create_buffers</a> {
2171        __u32                   index;
2172        __u32                   count;
2173        __u32                   memory;
2174        struct <a class="link" href="vidioc-g-fmt.html#v4l2-format" title="Table A.72. struct v4l2_format">v4l2_format</a>      format;
2175        __u32                   reserved[8];
2176};
2177
2178/*
2179 *      I O C T L   C O D E S   F O R   V I D E O   D E V I C E S
2180 *
2181 */
2182#define VIDIOC_QUERYCAP          _IOR('V',  0, struct <a class="link" href="vidioc-querycap.html#v4l2-capability" title="Table A.93. struct v4l2_capability">v4l2_capability</a>)
2183#define VIDIOC_RESERVED           _IO('V',  1)
2184#define VIDIOC_ENUM_FMT         _IOWR('V',  2, struct <a class="link" href="vidioc-enum-fmt.html#v4l2-fmtdesc" title="Table A.28. struct v4l2_fmtdesc">v4l2_fmtdesc</a>)
2185#define VIDIOC_G_FMT            _IOWR('V',  4, struct <a class="link" href="vidioc-g-fmt.html#v4l2-format" title="Table A.72. struct v4l2_format">v4l2_format</a>)
2186#define VIDIOC_S_FMT            _IOWR('V',  5, struct <a class="link" href="vidioc-g-fmt.html#v4l2-format" title="Table A.72. struct v4l2_format">v4l2_format</a>)
2187#define VIDIOC_REQBUFS          _IOWR('V',  8, struct <a class="link" href="vidioc-reqbufs.html#v4l2-requestbuffers" title="Table A.100. struct v4l2_requestbuffers">v4l2_requestbuffers</a>)
2188#define VIDIOC_QUERYBUF         _IOWR('V',  9, struct <a class="link" href="buffer.html#v4l2-buffer" title="Table 3.1. struct v4l2_buffer">v4l2_buffer</a>)
2189#define VIDIOC_G_FBUF            _IOR('V', 10, struct <a class="link" href="vidioc-g-fbuf.html#v4l2-framebuffer" title="Table A.69. struct v4l2_framebuffer">v4l2_framebuffer</a>)
2190#define VIDIOC_S_FBUF            _IOW('V', 11, struct <a class="link" href="vidioc-g-fbuf.html#v4l2-framebuffer" title="Table A.69. struct v4l2_framebuffer">v4l2_framebuffer</a>)
2191#define VIDIOC_OVERLAY           _IOW('V', 14, int)
2192#define VIDIOC_QBUF             _IOWR('V', 15, struct <a class="link" href="buffer.html#v4l2-buffer" title="Table 3.1. struct v4l2_buffer">v4l2_buffer</a>)
2193#define VIDIOC_EXPBUF           _IOWR('V', 16, struct <a class="link" href="vidioc-expbuf.html#v4l2-exportbuffer" title="Table A.50. struct v4l2_exportbuffer">v4l2_exportbuffer</a>)
2194#define VIDIOC_DQBUF            _IOWR('V', 17, struct <a class="link" href="buffer.html#v4l2-buffer" title="Table 3.1. struct v4l2_buffer">v4l2_buffer</a>)
2195#define VIDIOC_STREAMON          _IOW('V', 18, int)
2196#define VIDIOC_STREAMOFF         _IOW('V', 19, int)
2197#define VIDIOC_G_PARM           _IOWR('V', 21, struct <a class="link" href="vidioc-g-parm.html#v4l2-streamparm" title="Table A.78. struct v4l2_streamparm">v4l2_streamparm</a>)
2198#define VIDIOC_S_PARM           _IOWR('V', 22, struct <a class="link" href="vidioc-g-parm.html#v4l2-streamparm" title="Table A.78. struct v4l2_streamparm">v4l2_streamparm</a>)
2199#define VIDIOC_G_STD             _IOR('V', 23, v4l2_std_id)
2200#define VIDIOC_S_STD             _IOW('V', 24, v4l2_std_id)
2201#define VIDIOC_ENUMSTD          _IOWR('V', 25, struct <a class="link" href="vidioc-enumstd.html#v4l2-standard" title="Table A.46. struct v4l2_standard">v4l2_standard</a>)
2202#define VIDIOC_ENUMINPUT        _IOWR('V', 26, struct <a class="link" href="vidioc-enuminput.html#v4l2-input" title="Table A.39. struct v4l2_input">v4l2_input</a>)
2203#define VIDIOC_G_CTRL           _IOWR('V', 27, struct <a class="link" href="vidioc-g-ctrl.html#v4l2-control" title="Table A.56. struct v4l2_control">v4l2_control</a>)
2204#define VIDIOC_S_CTRL           _IOWR('V', 28, struct <a class="link" href="vidioc-g-ctrl.html#v4l2-control" title="Table A.56. struct v4l2_control">v4l2_control</a>)
2205#define VIDIOC_G_TUNER          _IOWR('V', 29, struct <a class="link" href="vidioc-g-tuner.html#v4l2-tuner" title="Table A.87. struct v4l2_tuner">v4l2_tuner</a>)
2206#define VIDIOC_S_TUNER           _IOW('V', 30, struct <a class="link" href="vidioc-g-tuner.html#v4l2-tuner" title="Table A.87. struct v4l2_tuner">v4l2_tuner</a>)
2207#define VIDIOC_G_AUDIO           _IOR('V', 33, struct <a class="link" href="vidioc-g-audio.html#v4l2-audio" title="Table A.51. struct v4l2_audio">v4l2_audio</a>)
2208#define VIDIOC_S_AUDIO           _IOW('V', 34, struct <a class="link" href="vidioc-g-audio.html#v4l2-audio" title="Table A.51. struct v4l2_audio">v4l2_audio</a>)
2209#define VIDIOC_QUERYCTRL        _IOWR('V', 36, struct <a class="link" href="vidioc-queryctrl.html#v4l2-queryctrl" title="Table A.95. struct v4l2_queryctrl">v4l2_queryctrl</a>)
2210#define VIDIOC_QUERYMENU        _IOWR('V', 37, struct <a class="link" href="vidioc-queryctrl.html#v4l2-querymenu" title="Table A.97. struct v4l2_querymenu">v4l2_querymenu</a>)
2211#define VIDIOC_G_INPUT           _IOR('V', 38, int)
2212#define VIDIOC_S_INPUT          _IOWR('V', 39, int)
2213#define VIDIOC_G_EDID           _IOWR('V', 40, struct <a class="link" href="vidioc-g-edid.html#v4l2-edid" title="Table A.62. struct v4l2_edid">v4l2_edid</a>)
2214#define VIDIOC_S_EDID           _IOWR('V', 41, struct <a class="link" href="vidioc-g-edid.html#v4l2-edid" title="Table A.62. struct v4l2_edid">v4l2_edid</a>)
2215#define VIDIOC_G_OUTPUT          _IOR('V', 46, int)
2216#define VIDIOC_S_OUTPUT         _IOWR('V', 47, int)
2217#define VIDIOC_ENUMOUTPUT       _IOWR('V', 48, struct <a class="link" href="vidioc-enumoutput.html#v4l2-output" title="Table A.43. struct v4l2_output">v4l2_output</a>)
2218#define VIDIOC_G_AUDOUT          _IOR('V', 49, struct <a class="link" href="vidioc-g-audioout.html#v4l2-audioout" title="Table A.54. struct v4l2_audioout">v4l2_audioout</a>)
2219#define VIDIOC_S_AUDOUT          _IOW('V', 50, struct <a class="link" href="vidioc-g-audioout.html#v4l2-audioout" title="Table A.54. struct v4l2_audioout">v4l2_audioout</a>)
2220#define VIDIOC_G_MODULATOR      _IOWR('V', 54, struct <a class="link" href="vidioc-g-modulator.html#v4l2-modulator" title="Table A.76. struct v4l2_modulator">v4l2_modulator</a>)
2221#define VIDIOC_S_MODULATOR       _IOW('V', 55, struct <a class="link" href="vidioc-g-modulator.html#v4l2-modulator" title="Table A.76. struct v4l2_modulator">v4l2_modulator</a>)
2222#define VIDIOC_G_FREQUENCY      _IOWR('V', 56, struct <a class="link" href="vidioc-g-frequency.html#v4l2-frequency" title="Table A.73. struct v4l2_frequency">v4l2_frequency</a>)
2223#define VIDIOC_S_FREQUENCY       _IOW('V', 57, struct <a class="link" href="vidioc-g-frequency.html#v4l2-frequency" title="Table A.73. struct v4l2_frequency">v4l2_frequency</a>)
2224#define VIDIOC_CROPCAP          _IOWR('V', 58, struct <a class="link" href="vidioc-cropcap.html#v4l2-cropcap" title="Table A.2. struct v4l2_cropcap">v4l2_cropcap</a>)
2225#define VIDIOC_G_CROP           _IOWR('V', 59, struct <a class="link" href="vidioc-g-crop.html#v4l2-crop" title="Table A.55. struct v4l2_crop">v4l2_crop</a>)
2226#define VIDIOC_S_CROP            _IOW('V', 60, struct <a class="link" href="vidioc-g-crop.html#v4l2-crop" title="Table A.55. struct v4l2_crop">v4l2_crop</a>)
2227#define VIDIOC_G_JPEGCOMP        _IOR('V', 61, struct <a class="link" href="vidioc-g-jpegcomp.html#v4l2-jpegcompression" title="Table A.74. struct v4l2_jpegcompression">v4l2_jpegcompression</a>)
2228#define VIDIOC_S_JPEGCOMP        _IOW('V', 62, struct <a class="link" href="vidioc-g-jpegcomp.html#v4l2-jpegcompression" title="Table A.74. struct v4l2_jpegcompression">v4l2_jpegcompression</a>)
2229#define VIDIOC_QUERYSTD          _IOR('V', 63, v4l2_std_id)
2230#define VIDIOC_TRY_FMT          _IOWR('V', 64, struct <a class="link" href="vidioc-g-fmt.html#v4l2-format" title="Table A.72. struct v4l2_format">v4l2_format</a>)
2231#define VIDIOC_ENUMAUDIO        _IOWR('V', 65, struct <a class="link" href="vidioc-g-audio.html#v4l2-audio" title="Table A.51. struct v4l2_audio">v4l2_audio</a>)
2232#define VIDIOC_ENUMAUDOUT       _IOWR('V', 66, struct <a class="link" href="vidioc-g-audioout.html#v4l2-audioout" title="Table A.54. struct v4l2_audioout">v4l2_audioout</a>)
2233#define VIDIOC_G_PRIORITY        _IOR('V', 67, __u32) /* enum <a class="link" href="vidioc-g-priority.html#v4l2-priority" title="Table A.83. enum v4l2_priority">v4l2_priority</a> */
2234#define VIDIOC_S_PRIORITY        _IOW('V', 68, __u32) /* enum <a class="link" href="vidioc-g-priority.html#v4l2-priority" title="Table A.83. enum v4l2_priority">v4l2_priority</a> */
2235#define VIDIOC_G_SLICED_VBI_CAP _IOWR('V', 69, struct <a class="link" href="vidioc-g-sliced-vbi-cap.html#v4l2-sliced-vbi-cap" title="Table A.85. struct v4l2_sliced_vbi_cap">v4l2_sliced_vbi_cap</a>)
2236#define VIDIOC_LOG_STATUS         _IO('V', 70)
2237#define VIDIOC_G_EXT_CTRLS      _IOWR('V', 71, struct <a class="link" href="vidioc-g-ext-ctrls.html#v4l2-ext-controls" title="Table A.67. struct v4l2_ext_controls">v4l2_ext_controls</a>)
2238#define VIDIOC_S_EXT_CTRLS      _IOWR('V', 72, struct <a class="link" href="vidioc-g-ext-ctrls.html#v4l2-ext-controls" title="Table A.67. struct v4l2_ext_controls">v4l2_ext_controls</a>)
2239#define VIDIOC_TRY_EXT_CTRLS    _IOWR('V', 73, struct <a class="link" href="vidioc-g-ext-ctrls.html#v4l2-ext-controls" title="Table A.67. struct v4l2_ext_controls">v4l2_ext_controls</a>)
2240#define VIDIOC_ENUM_FRAMESIZES  _IOWR('V', 74, struct <a class="link" href="vidioc-enum-framesizes.html#v4l2-frmsizeenum" title="Table A.32. struct v4l2_frmsizeenum">v4l2_frmsizeenum</a>)
2241#define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct <a class="link" href="vidioc-enum-frameintervals.html#v4l2-frmivalenum" title="Table A.35. struct v4l2_frmivalenum">v4l2_frmivalenum</a>)
2242#define VIDIOC_G_ENC_INDEX       _IOR('V', 76, struct <a class="link" href="vidioc-g-enc-index.html#v4l2-enc-idx" title="Table A.63. struct v4l2_enc_idx">v4l2_enc_idx</a>)
2243#define VIDIOC_ENCODER_CMD      _IOWR('V', 77, struct <a class="link" href="vidioc-encoder-cmd.html#v4l2-encoder-cmd" title="Table A.24. struct v4l2_encoder_cmd">v4l2_encoder_cmd</a>)
2244#define VIDIOC_TRY_ENCODER_CMD  _IOWR('V', 78, struct <a class="link" href="vidioc-encoder-cmd.html#v4l2-encoder-cmd" title="Table A.24. struct v4l2_encoder_cmd">v4l2_encoder_cmd</a>)
2245
2246/* Experimental, meant for debugging, testing and internal use.
2247   Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined.
2248   You must be root to use these ioctls. Never use these in applications! */
2249#define VIDIOC_DBG_S_REGISTER    _IOW('V', 79, struct <a class="link" href="vidioc-dbg-g-register.html#v4l2-dbg-register" title="Table A.8. struct v4l2_dbg_register">v4l2_dbg_register</a>)
2250#define VIDIOC_DBG_G_REGISTER   _IOWR('V', 80, struct <a class="link" href="vidioc-dbg-g-register.html#v4l2-dbg-register" title="Table A.8. struct v4l2_dbg_register">v4l2_dbg_register</a>)
2251
2252#define VIDIOC_S_HW_FREQ_SEEK    _IOW('V', 82, struct <a class="link" href="vidioc-s-hw-freq-seek.html#v4l2-hw-freq-seek" title="Table A.101. struct v4l2_hw_freq_seek">v4l2_hw_freq_seek</a>)
2253
2254#define VIDIOC_S_DV_TIMINGS     _IOWR('V', 87, struct <a class="link" href="vidioc-g-dv-timings.html#v4l2-dv-timings" title="Table A.58. struct v4l2_dv_timings">v4l2_dv_timings</a>)
2255#define VIDIOC_G_DV_TIMINGS     _IOWR('V', 88, struct <a class="link" href="vidioc-g-dv-timings.html#v4l2-dv-timings" title="Table A.58. struct v4l2_dv_timings">v4l2_dv_timings</a>)
2256#define VIDIOC_DQEVENT           _IOR('V', 89, struct <a class="link" href="vidioc-dqevent.html#v4l2-event" title="Table A.12. struct v4l2_event">v4l2_event</a>)
2257#define VIDIOC_SUBSCRIBE_EVENT   _IOW('V', 90, struct <a class="link" href="vidioc-subscribe-event.html#v4l2-event-subscription" title="Table A.110. struct v4l2_event_subscription">v4l2_event_subscription</a>)
2258#define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct <a class="link" href="vidioc-subscribe-event.html#v4l2-event-subscription" title="Table A.110. struct v4l2_event_subscription">v4l2_event_subscription</a>)
2259
2260/* Experimental, the below two ioctls may change over the next couple of kernel
2261   versions */
2262#define VIDIOC_CREATE_BUFS      _IOWR('V', 92, struct <a class="link" href="vidioc-create-bufs.html#v4l2-create-buffers" title="Table A.1. struct v4l2_create_buffers">v4l2_create_buffers</a>)
2263#define VIDIOC_PREPARE_BUF      _IOWR('V', 93, struct <a class="link" href="buffer.html#v4l2-buffer" title="Table 3.1. struct v4l2_buffer">v4l2_buffer</a>)
2264
2265/* Experimental selection API */
2266#define VIDIOC_G_SELECTION      _IOWR('V', 94, struct <a class="link" href="vidioc-g-selection.html#v4l2-selection" title="Table A.84. struct v4l2_selection">v4l2_selection</a>)
2267#define VIDIOC_S_SELECTION      _IOWR('V', 95, struct <a class="link" href="vidioc-g-selection.html#v4l2-selection" title="Table A.84. struct v4l2_selection">v4l2_selection</a>)
2268
2269/* Experimental, these two ioctls may change over the next couple of kernel
2270   versions. */
2271#define VIDIOC_DECODER_CMD      _IOWR('V', 96, struct <a class="link" href="vidioc-decoder-cmd.html#v4l2-decoder-cmd" title="Table A.10. struct v4l2_decoder_cmd">v4l2_decoder_cmd</a>)
2272#define VIDIOC_TRY_DECODER_CMD  _IOWR('V', 97, struct <a class="link" href="vidioc-decoder-cmd.html#v4l2-decoder-cmd" title="Table A.10. struct v4l2_decoder_cmd">v4l2_decoder_cmd</a>)
2273
2274/* Experimental, these three ioctls may change over the next couple of kernel
2275   versions. */
2276#define VIDIOC_ENUM_DV_TIMINGS  _IOWR('V', 98, struct <a class="link" href="vidioc-enum-dv-timings.html#v4l2-enum-dv-timings" title="Table A.27. struct v4l2_enum_dv_timings">v4l2_enum_dv_timings</a>)
2277#define VIDIOC_QUERY_DV_TIMINGS  _IOR('V', 99, struct <a class="link" href="vidioc-g-dv-timings.html#v4l2-dv-timings" title="Table A.58. struct v4l2_dv_timings">v4l2_dv_timings</a>)
2278#define VIDIOC_DV_TIMINGS_CAP   _IOWR('V', 100, struct <a class="link" href="vidioc-dv-timings-cap.html#v4l2-dv-timings-cap" title="Table A.22. struct v4l2_dv_timings_cap">v4l2_dv_timings_cap</a>)
2279
2280/* Experimental, this ioctl may change over the next couple of kernel
2281   versions. */
2282#define VIDIOC_ENUM_FREQ_BANDS  _IOWR('V', 101, struct <a class="link" href="vidioc-enum-freq-bands.html#v4l2-frequency-band" title="Table A.37. struct v4l2_frequency_band">v4l2_frequency_band</a>)
2283
2284/* Experimental, meant for debugging, testing and internal use.
2285   Never use these in applications! */
2286#define VIDIOC_DBG_G_CHIP_INFO  _IOWR('V', 102, struct <a class="link" href="vidioc-dbg-g-chip-info.html#v4l2-dbg-chip-info" title="Table A.5. struct v4l2_dbg_chip_info">v4l2_dbg_chip_info</a>)
2287
2288#define VIDIOC_QUERY_EXT_CTRL   _IOWR('V', 103, struct <a class="link" href="vidioc-queryctrl.html#v4l2-query-ext-ctrl" title="Table A.96. struct v4l2_query_ext_ctrl">v4l2_query_ext_ctrl</a>)
2289
2290/* Reminder: when adding new ioctls please add support for them to
2291   drivers/media/v4l2-core/v4l2-compat-ioctl32.c as well! */
2292
2293#define BASE_VIDIOC_PRIVATE     192             /* 192-255 are private */
2294
2295#endif /* _UAPI__LINUX_VIDEODEV2_H */
2296</pre></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="apb.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="v4l2spec.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="capture-example.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix B. Common definitions for V4L2 and V4L2 subdev interfaces </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Appendix D. Video Capture Example</td></tr></table></div></body></html>
2297