Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

videodev2.h

Go to the documentation of this file.
00001 /*
00002  *      Video for Linux Two
00003  *
00004  *      Header file for V4L2 drivers and applications.
00005  *
00006  *      Author: Bill Dirks <bdirks@pacbell.net>
00007  */
00008 
00009 #ifndef __LINUX_VIDEODEV_H
00010 #define __LINUX_VIDEODEV_H
00011 
00012 
00013 #define V4L2_MAJOR_VERSION      0
00014 #define V4L2_MINOR_VERSION      20
00015 #include "videodevfix.h"
00016 
00017 /*
00018  *      M I S C E L L A N E O U S
00019  */
00020 
00021 /*  Four-character-code (int32_tCC) */
00022 #define fourcc(a,b,c,d)\
00023         (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))
00024 
00025 /*  Open flag for non-capturing opens on capture devices  */
00026 #define O_NONCAP        O_TRUNC
00027 #define O_NOIO          O_TRUNC
00028 
00029 /*  Timestamp data type, 64-bit signed integer  */
00030 /*  Should be removed from here when UST is added to kernel  */
00031 #ifndef STAMP_T
00032 #define STAMP_T
00033 typedef __s64 stamp_t;
00034 #endif
00035 
00036 /*
00037  *      D R I V E R   C A P A B I L I T I E S
00038  */
00039 struct v4l2_capability
00040 {
00041         char    name[32];       /* Descriptive, and unique */
00042         int     type;           /* Device type, see below */
00043         int     inputs;         /* Num video inputs */
00044         int     outputs;        /* Num video outputs */
00045         int     audios;         /* Num audio devices */
00046         int     maxwidth;
00047         int     maxheight;
00048         int     minwidth;
00049         int     minheight;
00050         int     maxframerate;
00051         __u32   flags;          /* Feature flags, see below */
00052         __u32   reserved[4];
00053 };
00054 /* Values for 'type' field */
00055 #define V4L2_TYPE_CAPTURE       0       /* Is a video capture device */
00056 #define V4L2_TYPE_CODEC         1       /* Is a CODEC device */
00057 #define V4L2_TYPE_OUTPUT        2       /* Is a video output device */
00058 #define V4L2_TYPE_FX            3       /* Is a video effects device */
00059 #define V4L2_TYPE_VBI           4       /* Is a VBI capture device */
00060 #define V4L2_TYPE_VTR           5       /* Is a tape recorder controller */
00061 #define V4L2_TYPE_VTX           6       /* Is a teletext device */
00062 #define V4L2_TYPE_RADIO         7       /* Is a radio device */
00063 #define V4L2_TYPE_PRIVATE       1000    /* Start of driver private types */
00064 /* Flags for 'flags' field */
00065 #define V4L2_FLAG_READ          0x00001 /* Can capture via read() call */
00066 #define V4L2_FLAG_WRITE         0x00002 /* Can accept data via write() */
00067 #define V4L2_FLAG_STREAMING     0x00004 /* Can capture streaming video */
00068 #define V4L2_FLAG_PREVIEW       0x00008 /* Can do automatic preview */
00069 #define V4L2_FLAG_SELECT        0x00010 /* Supports the select() call */
00070 #define V4L2_FLAG_TUNER         0x00020 /* Can tune */
00071 #define V4L2_FLAG_MONOCHROME    0x00040 /* Monochrome only */
00072 #define V4L2_FLAG_DATA_SERVICE  0x00080 /* Has a related data service dev. */
00073 
00074 
00075 /*
00076  *      V I D E O   I M A G E   F O R M A T
00077  */
00078 struct v4l2_pix_format
00079 {
00080         __u32   width;
00081         __u32   height;
00082         __u32   depth;
00083         __u32   pixelformat;
00084         __u32   flags;
00085         __u32   bytesperline;   /* only used when there are pad bytes */
00086         __u32   sizeimage;
00087         __u32   priv;           /* private data, depends on pixelformat */
00088 };
00089 /*           Pixel format    int32_tCC                  depth  Description   */
00090 #define V4L2_PIX_FMT_RGB332  fourcc('R','G','B','1') /*  8  RGB-3-3-2     */
00091 #define V4L2_PIX_FMT_RGB555  fourcc('R','G','B','O') /* 16  RGB-5-5-5     */
00092 #define V4L2_PIX_FMT_RGB565  fourcc('R','G','B','P') /* 16  RGB-5-6-5     */
00093 #define V4L2_PIX_FMT_BGR24   fourcc('B','G','R','3') /* 24  BGR-8-8-8     */
00094 #define V4L2_PIX_FMT_RGB24   fourcc('R','G','B','3') /* 24  RGB-8-8-8     */
00095 #define V4L2_PIX_FMT_BGR32   fourcc('B','G','R','4') /* 32  BGR-8-8-8-8   */
00096 #define V4L2_PIX_FMT_RGB32   fourcc('R','G','B','4') /* 32  RGB-8-8-8-8   */
00097 #define V4L2_PIX_FMT_GREY    fourcc('G','R','E','Y') /*  8  Greyscale     */
00098 #define V4L2_PIX_FMT_YVU410  fourcc('Y','V','U','9') /*  9  YVU 4:1:0     */
00099 #define V4L2_PIX_FMT_YVU420  fourcc('Y','V','1','2') /* 12  YVU 4:2:0     */
00100 #define V4L2_PIX_FMT_YUYV    fourcc('Y','U','Y','V') /* 16  YUV 4:2:2     */
00101 #define V4L2_PIX_FMT_UYVY    fourcc('U','Y','V','Y') /* 16  YUV 4:2:2     */
00102 #define V4L2_PIX_FMT_YVU422P fourcc('4','2','2','P') /* 16  YVU422 planar */
00103 #define V4L2_PIX_FMT_YVU411P fourcc('4','1','1','P') /* 16  YVU411 planar */
00104 
00105 /*  The following formats are not defined in the V4L2 specification */
00106 #define V4L2_PIX_FMT_YUV410  fourcc('Y','U','V','9') /*  9  YUV 4:1:0     */
00107 #define V4L2_PIX_FMT_YUV420  fourcc('Y','U','1','2') /* 12  YUV 4:2:0     */
00108 #define V4L2_PIX_FMT_YYUV    fourcc('Y','Y','U','V') /* 16  YUV 4:2:2     */
00109 #define V4L2_PIX_FMT_HI240   fourcc('H','I','2','4') /*  8  8-bit color   */
00110 
00111 
00112 /*  Flags */
00113 #define V4L2_FMT_FLAG_COMPRESSED        0x0001  /* Compressed format */
00114 #define V4L2_FMT_FLAG_BYTESPERLINE      0x0002  /* bytesperline field valid */
00115 #define V4L2_FMT_FLAG_INTERLACED        0x0004  /* Image is interlaced */
00116 #define V4L2_FMT_FLAG_TOPFIELD          0x0008  /* is a top field only */
00117 #define V4L2_FMT_FLAG_BOTFIELD          0x0010  /* is a bottom field only */
00118 #define V4L2_FMT_FLAG_ODDFIELD          V4L2_FMT_FLAG_TOPFIELD
00119 #define V4L2_FMT_FLAG_EVENFIELD         V4L2_FMT_FLAG_BOTFIELD
00120 #define V4L2_FMT_FLAG_COMBINED          V4L2_FMT_FLAG_INTERLACED
00121 #define V4L2_FMT_CS_field               0xF000  /* Color space field mask */
00122 #define V4L2_FMT_CS_601YUV              0x1000  /* ITU YCrCb color space */
00123 #define V4L2_FMT_FLAG_SWCONVERSION      0x0800  /* used only in format enum. */
00124 /*  SWCONVERSION indicates the format is not natively supported by the  */
00125 /*  driver and the driver uses software conversion to support it  */
00126 
00127 
00128 /*
00129  *      F O R M A T   E N U M E R A T I O N
00130  */
00131 struct v4l2_fmtdesc
00132 {
00133         int     index;                  /* Format number */
00134         char    description[32];        /* Description string */
00135         __u32   pixelformat;            /* Format fourcc */
00136         __u32   flags;                  /* Format flags */
00137         __u32   depth;                  /* Bits per pixel */
00138         __u32   reserved[2];
00139 };
00140 
00141 struct v4l2_cvtdesc
00142 {
00143         int     index;
00144         struct
00145         {
00146                 __u32   pixelformat;
00147                 __u32   flags;
00148                 __u32   depth;
00149                 __u32   reserved[2];
00150         }       in, out;
00151 };
00152 
00153 struct v4l2_fxdesc
00154 {
00155         int     index;
00156         char    name[32];
00157         __u32   flags;
00158         __u32   inputs;
00159         __u32   controls;
00160         __u32   reserved[2];
00161 };
00162 
00163 
00164 /*
00165  *      T I M E C O D E
00166  */
00167 struct v4l2_timecode
00168 {
00169         __u8    frames;
00170         __u8    seconds;
00171         __u8    minutes;
00172         __u8    hours;
00173         __u8    userbits[4];
00174         __u32   flags;
00175         __u32   type;
00176 };
00177 /*  Type  */
00178 #define V4L2_TC_TYPE_24FPS              1
00179 #define V4L2_TC_TYPE_25FPS              2
00180 #define V4L2_TC_TYPE_30FPS              3
00181 #define V4L2_TC_TYPE_50FPS              4
00182 #define V4L2_TC_TYPE_60FPS              5
00183 
00184 
00185 /*  Flags  */
00186 #define V4L2_TC_FLAG_DROPFRAME          0x0001 /* "drop-frame" mode */
00187 #define V4L2_TC_FLAG_COLORFRAME         0x0002
00188 #define V4L2_TC_USERBITS_field          0x000C
00189 #define V4L2_TC_USERBITS_USERDEFINED    0x0000
00190 #define V4L2_TC_USERBITS_8BITCHARS      0x0008
00191 /* The above is based on SMPTE timecodes */
00192 
00193 
00194 /*
00195  *      C O M P R E S S I O N   P A R A M E T E R S
00196  */
00197 struct v4l2_compression
00198 {
00199         int     quality;
00200         int     keyframerate;
00201         int     pframerate;
00202         __u32   reserved[5];
00203 };
00204 
00205 
00206 /*
00207  *      M E M O R Y - M A P P I N G   B U F F E R S
00208  */
00209 struct v4l2_requestbuffers
00210 {
00211         int     count;
00212         __u32   type;
00213         __u32   reserved[2];
00214 };
00215 struct v4l2_buffer
00216 {
00217         int                     index;
00218         __u32                   type;
00219         __u32                   offset;
00220         __u32                   length;
00221         __u32                   bytesused;
00222         __u32                   flags;
00223         stamp_t                 timestamp;
00224         struct v4l2_timecode    timecode;
00225         __u32                   sequence;
00226         __u32                   reserved[3];
00227 };
00228 /*  Buffer type codes and flags for 'type' field */
00229 #define V4L2_BUF_TYPE_field             0x00001FFF  /* Type field mask  */
00230 #define V4L2_BUF_TYPE_CAPTURE           0x00000001
00231 #define V4L2_BUF_TYPE_CODECIN           0x00000002
00232 #define V4L2_BUF_TYPE_CODECOUT          0x00000003
00233 #define V4L2_BUF_TYPE_EFFECTSIN         0x00000004
00234 #define V4L2_BUF_TYPE_EFFECTSIN2        0x00000005
00235 #define V4L2_BUF_TYPE_EFFECTSOUT        0x00000006
00236 #define V4L2_BUF_TYPE_VIDEOOUT          0x00000007
00237 #define V4L2_BUF_TYPE_FXCONTROL         0x00000008
00238 
00239 /*  Starting value of driver private buffer types  */
00240 #define V4L2_BUF_TYPE_PRIVATE           0x00001000
00241 
00242 #define V4L2_BUF_ATTR_DEVICEMEM 0x00010000  /* Buffer is on device (flag) */
00243 
00244 /*  Flags used only in VIDIOC_REQBUFS  */
00245 #define V4L2_BUF_REQ_field      0xF0000000
00246 #define V4L2_BUF_REQ_CONTIG     0x10000000  /* Map all buffers in one
00247                                                contiguous mmap(). This flag
00248                                                only used in VIDIOC_REQBUFS */
00249 
00250 /*  Flags for 'flags' field */
00251 #define V4L2_BUF_FLAG_MAPPED    0x0001  /* Buffer is mapped (flag) */
00252 #define V4L2_BUF_FLAG_QUEUED    0x0002  /* Buffer is queued for processing */
00253 #define V4L2_BUF_FLAG_DONE      0x0004  /* Buffer is ready */
00254 #define V4L2_BUF_FLAG_KEYFRAME  0x0008  /* Image is a keyframe (I-frame) */
00255 #define V4L2_BUF_FLAG_PFRAME    0x0010  /* Image is a P-frame */
00256 #define V4L2_BUF_FLAG_BFRAME    0x0020  /* Image is a B-frame */
00257 #define V4L2_BUF_FLAG_TOPFIELD  0x0040  /* Image is a top field only */
00258 #define V4L2_BUF_FLAG_BOTFIELD  0x0080  /* Image is a bottom field only */
00259 #define V4L2_BUF_FLAG_ODDFIELD  V4L2_BUF_FLAG_TOPFIELD
00260 #define V4L2_BUF_FLAG_EVENFIELD V4L2_BUF_FLAG_BOTFIELD
00261 #define V4L2_BUF_FLAG_TIMECODE  0x0100  /* timecode field is valid */
00262 
00263 /*
00264  *      O V E R L A Y   P R E V I E W
00265  */
00266 struct v4l2_framebuffer
00267 {
00268         __u32                   capability;
00269         __u32                   flags;
00270         void                    *base[3];
00271         struct v4l2_pix_format  fmt;
00272 };
00273 /*  Flags for the 'capability' field. Read only */
00274 #define V4L2_FBUF_CAP_EXTERNOVERLAY     0x0001
00275 #define V4L2_FBUF_CAP_CHROMAKEY         0x0002
00276 #define V4L2_FBUF_CAP_CLIPPING          0x0004
00277 #define V4L2_FBUF_CAP_SCALEUP           0x0008
00278 #define V4L2_FBUF_CAP_SCALEDOWN         0x0010
00279 #define V4L2_FBUF_CAP_BITMAP_CLIPPING   0x0020
00280 /*  Flags for the 'flags' field. */
00281 #define V4L2_FBUF_FLAG_PRIMARY          0x0001
00282 #define V4L2_FBUF_FLAG_OVERLAY          0x0002
00283 #define V4L2_FBUF_FLAG_CHROMAKEY        0x0004
00284 
00285 struct v4l2_clip
00286 {
00287         int                     x;
00288         int                     y;
00289         int                     width;
00290         int                     height;
00291         struct v4l2_clip        *next;
00292 };
00293 struct v4l2_window
00294 {
00295         int                     x;
00296         int                     y;
00297         int                     width;
00298         int                     height;
00299         __u32                   chromakey;
00300         struct v4l2_clip        *clips;
00301         int                     clipcount;
00302         void                    *bitmap;
00303 };
00304 
00305 
00306 /*
00307  *      D E V I C E   P E R F O R M A N C E
00308  */
00309 struct v4l2_performance
00310 {
00311         int     frames;
00312         int     framesdropped;
00313         __u64   bytesin;
00314         __u64   bytesout;
00315         __u32   reserved[4];
00316 };
00317 
00318 /*
00319  *      C A P T U R E   P A R A M E T E R S
00320  */
00321 struct v4l2_captureparm
00322 {
00323         __u32           capability;     /*  Supported modes */
00324         __u32           capturemode;    /*  Current mode */
00325         unsigned long   timeperframe;   /*  Time per frame in .1us units */
00326         __u32           extendedmode;   /*  Driver-specific extensions */
00327         __u32           reserved[4];
00328 };
00329 /*  Flags for 'capability' and 'capturemode' fields */
00330 #define V4L2_MODE_HIGHQUALITY   0x0001  /*  High quality imaging mode */
00331 //#define V4L2_MODE_VFLIP               0x0002  /*  Flip image vertically */
00332 //#define V4L2_MODE_HFLIP               0x0004  /*  Flip image horizontally */
00333 #define V4L2_CAP_TIMEPERFRAME   0x1000  /*  timeperframe field is supported */
00334 
00335 struct v4l2_outputparm
00336 {
00337         __u32           capability;     /*  Supported modes */
00338         __u32           outputmode;     /*  Current mode */
00339         unsigned long   timeperframe;   /*  Time per frame in .1us units */
00340         __u32           extendedmode;   /*  Driver-specific extensions */
00341         __u32           reserved[4];
00342 };
00343 
00344 /*
00345  *      I N P U T   I M A G E   C R O P P I N G
00346  */
00347 struct v4l2_cropcap
00348 {
00349         __u32   capability;
00350         int     min_x;
00351         int     min_y;
00352         int     max_x;
00353         int     max_y;
00354         int     default_left;
00355         int     default_top;
00356         int     default_right;
00357         int     default_bottom;
00358         __u32   reserved[2];
00359 };
00360 struct v4l2_crop
00361 {
00362         int     left;
00363         int     top;
00364         int     right;
00365         int     bottom;
00366         __u32   reserved;
00367 };
00368 
00369 /*
00370  *      D I G I T A L   Z O O M
00371  */
00372 struct v4l2_zoomcap
00373 {
00374         __u32   capability;
00375         __u32   maxwidth;
00376         __u32   maxheight;
00377         __u32   minwidth;
00378         __u32   minheight;
00379         __u32   reserved[2];
00380 };
00381 /*  Flags for the capability field  */
00382 #define V4L2_ZOOM_NONCAP                0x0001
00383 #define V4L2_ZOOM_WHILESTREAMING        0x0002
00384 
00385 struct v4l2_zoom
00386 {
00387         __u32   x;
00388         __u32   y;
00389         __u32   width;
00390         __u32   height;
00391         __u32   reserved;
00392 };
00393 
00394 
00395 /*
00396  *      A N A L O G   V I D E O   S T A N D A R D
00397  */
00398 struct v4l2_standard
00399 {
00400         __u8            name[24];
00401         struct {
00402                 __u32   numerator;
00403                 __u32   denominator;    /* >= 1 */
00404         } framerate;                    /* Frames, not fields */
00405         __u32           framelines;
00406         __u32           reserved1;
00407         __u32           colorstandard;
00408         union {                         
00409                 struct {
00410                         __u32           colorsubcarrier; /* Hz */
00411                 }               pal;
00412                 struct {                                        
00413                         __u32           colorsubcarrier; /* Hz */
00414                 }               ntsc;
00415                 struct {
00416                         __u32           f0b;    /* Hz (blue) */
00417                         __u32           f0r;    /* Hz (red)  */
00418                 }               secam;
00419                 __u8            reserved[12];
00420         } colorstandard_data;
00421         __u32           transmission;   /* Bit field. Must be zero for
00422                                            non-modulators/demodulators. */
00423         __u32           reserved2;      /* Must be set to zero */
00424 };
00425 
00426 /*  Values for the 'colorstandard' field  */
00427 #define V4L2_COLOR_STD_PAL              1
00428 #define V4L2_COLOR_STD_NTSC             2
00429 #define V4L2_COLOR_STD_SECAM            3
00430 
00431 /*  Values for the color subcarrier fields  */
00432 #define V4L2_COLOR_SUBC_PAL     4433619         /* PAL BGHI, NTSC-44 */
00433 #define V4L2_COLOR_SUBC_PAL_M   3575611         /* PAL M (Brazil) */
00434 #define V4L2_COLOR_SUBC_PAL_N   3582056         /* PAL N */
00435 #define V4L2_COLOR_SUBC_NTSC    3579545         /* NTSC M, NTSC-Japan */
00436 #define V4L2_COLOR_SUBC_SECAMB  4250000         /* SECAM B - Y carrier */
00437 #define V4L2_COLOR_SUBC_SECAMR  4406250         /* SECAM R - Y carrier */
00438 
00439 /*  Flags for the 'transmission' field  */
00440 #define V4L2_TRANSM_STD_B               (1<<1)
00441 #define V4L2_TRANSM_STD_D               (1<<3)
00442 #define V4L2_TRANSM_STD_G               (1<<6)
00443 #define V4L2_TRANSM_STD_H               (1<<7)
00444 #define V4L2_TRANSM_STD_I               (1<<8)
00445 #define V4L2_TRANSM_STD_K               (1<<10)
00446 #define V4L2_TRANSM_STD_K1              (1<<11)
00447 #define V4L2_TRANSM_STD_L               (1<<12)
00448 #define V4L2_TRANSM_STD_M               (1<<13)
00449 #define V4L2_TRANSM_STD_N               (1<<14)
00450 
00451 
00452 /*  Used in the VIDIOC_ENUMSTD ioctl for querying supported standards  */
00453 struct v4l2_enumstd
00454 {
00455         int                     index;
00456         struct v4l2_standard    std;
00457         __u32                   inputs;  /* set of inputs that */
00458                                          /* support this standard */
00459         __u32                   outputs; /* set of outputs that */
00460                                          /* support this standard */
00461         __u32                   reserved[2];
00462 };
00463 
00464 
00465 /*
00466  *      V I D E O   I N P U T S
00467  */
00468 struct v4l2_input
00469 {
00470         int     index;          /*  Which input */
00471         char    name[32];       /*  Label */
00472         int     type;           /*  Type of input */
00473         __u32   capability;     /*  Capability flags */
00474         int     assoc_audio;    /*  Associated audio input */
00475         __u32   reserved[4];
00476 };
00477 /*  Values for the 'type' field */
00478 #define V4L2_INPUT_TYPE_TUNER           1
00479 #define V4L2_INPUT_TYPE_CAMERA          2
00480 
00481 /*  Flags for the 'capability' field */
00482 #define V4L2_INPUT_CAP_AUDIO            0x0001  /* assoc_audio */
00483 
00484 
00485 /*
00486  *      V I D E O   O U T P U T S
00487  */
00488 struct v4l2_output
00489 {
00490         int     index;          /*  Which output */
00491         char    name[32];       /*  Label */
00492         int     type;           /*  Type of output */
00493         __u32   capability;     /*  Capability flags */
00494         int     assoc_audio;    /*  Associated audio */
00495         __u32   reserved[4];
00496 };
00497 /*  Values for the 'type' field */
00498 #define V4L2_OUTPUT_TYPE_MODULATOR              1
00499 #define V4L2_OUTPUT_TYPE_ANALOG                 2
00500 #define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY       3
00501 
00502 /*  Flags for the 'capability' field */
00503 #define V4L2_OUTPUT_CAP_AUDIO           0x0001  /* assoc_audio */
00504 
00505 
00506 /*
00507  *      C O N T R O L S
00508  */
00509 struct v4l2_control
00510 {
00511         __u32           id;
00512         int             value;
00513 };
00514 
00515 /*  Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
00516 struct v4l2_queryctrl
00517 {
00518         __u32           id;
00519         __u8            name[32];       /* Whatever */
00520         int             minimum;        /* Note signedness */
00521         int             maximum;
00522         unsigned int    step;
00523         int             default_value;
00524         __u32           type;
00525         __u32           flags;
00526         __u32           category;       /* Automatically filled in by V4L2 */
00527         __u8            group[32];      /*   for pre-defined controls      */
00528         __u32           reserved[2];
00529 };
00530 
00531 /*  Used in the VIDIOC_QUERYMENU ioctl for querying menu items */
00532 struct v4l2_querymenu
00533 {
00534         __u32           id;
00535         int             index;
00536         __u8            name[32];       /* Whatever */
00537         int             reserved;
00538 };
00539 
00540 /*  Used in V4L2_BUF_TYPE_FXCONTROL buffers  */
00541 struct v4l2_fxcontrol
00542 {
00543         __u32   id;
00544         __u32   value;
00545 };
00546 
00547 /*  Control types  */
00548 #define V4L2_CTRL_TYPE_INTEGER          0
00549 #define V4L2_CTRL_TYPE_BOOLEAN          1
00550 #define V4L2_CTRL_TYPE_MENU             2
00551 #define V4L2_CTRL_TYPE_BUTTON           3
00552 
00553 /*  Control flags  */
00554 #define V4L2_CTRL_FLAG_DISABLED         0x0001
00555 #define V4L2_CTRL_FLAG_GRABBED          0x0002
00556 
00557 /*  Control categories  */
00558 #define V4L2_CTRL_CAT_VIDEO             1  /*  "Video"   */
00559 #define V4L2_CTRL_CAT_AUDIO             2  /*  "Audio"   */
00560 #define V4L2_CTRL_CAT_EFFECT            3  /*  "Effect"  */
00561 
00562 /*  Control IDs defined by V4L2 */
00563 #define V4L2_CID_BASE                   0x00980900
00564 /*  IDs reserved for driver specific controls */
00565 #define V4L2_CID_PRIVATE_BASE           0x08000000
00566 /*  IDs reserved for effect-specific controls on effects devices  */
00567 #define V4L2_CID_EFFECT_BASE            0x0A00B000
00568 
00569 #define V4L2_CID_BRIGHTNESS             (V4L2_CID_BASE+0)
00570 #define V4L2_CID_CONTRAST               (V4L2_CID_BASE+1)
00571 #define V4L2_CID_SATURATION             (V4L2_CID_BASE+2)
00572 #define V4L2_CID_HUE                    (V4L2_CID_BASE+3)
00573 #define V4L2_CID_AUDIO_VOLUME           (V4L2_CID_BASE+5)
00574 #define V4L2_CID_AUDIO_BALANCE          (V4L2_CID_BASE+6)
00575 #define V4L2_CID_AUDIO_BASS             (V4L2_CID_BASE+7)
00576 #define V4L2_CID_AUDIO_TREBLE           (V4L2_CID_BASE+8)
00577 #define V4L2_CID_AUDIO_MUTE             (V4L2_CID_BASE+9)
00578 #define V4L2_CID_AUDIO_LOUDNESS         (V4L2_CID_BASE+10)
00579 #define V4L2_CID_BLACK_LEVEL            (V4L2_CID_BASE+11)
00580 #define V4l2_CID_AUTO_WHITE_BALANCE     (V4L2_CID_BASE+12)
00581 #define V4L2_CID_DO_WHITE_BALANCE       (V4L2_CID_BASE+13)
00582 #define V4L2_CID_RED_BALANCE            (V4L2_CID_BASE+14)
00583 #define V4L2_CID_BLUE_BALANCE           (V4L2_CID_BASE+15)
00584 #define V4L2_CID_GAMMA                  (V4L2_CID_BASE+16)
00585 #define V4L2_CID_WHITENESS              (V4L2_CID_GAMMA) /* ? Not sure */
00586 #define V4L2_CID_EXPOSURE               (V4L2_CID_BASE+17)
00587 #define V4L2_CID_AUTOGAIN               (V4L2_CID_BASE+18)
00588 #define V4L2_CID_GAIN                   (V4L2_CID_BASE+19)
00589 #define V4L2_CID_HFLIP                  (V4L2_CID_BASE+20)
00590 #define V4L2_CID_VFLIP                  (V4L2_CID_BASE+21)
00591 #define V4L2_CID_HCENTER                (V4L2_CID_BASE+22)
00592 #define V4L2_CID_VCENTER                (V4l2_CID_BASE+23)
00593 #define V4L2_CID_LASTP1                 (V4L2_CID_BASE+24) /* last CID + 1 */
00594 /*  Remember to change fill_ctrl_category() in videodev.c  */
00595 
00596 /*
00597  *      T U N I N G
00598  */
00599 struct v4l2_tuner
00600 {
00601         int                     input;
00602         char                    name[32];
00603         struct v4l2_standard    std;
00604         __u32                   capability;
00605         __u32                   rangelow;
00606         __u32                   rangehigh;
00607         __u32                   rxsubchans;
00608         __u32                   audmode;
00609         int                     signal;
00610         int                     afc;
00611         __u32                   reserved[4];
00612 };
00613 struct v4l2_modulator
00614 {
00615         int                     output;
00616         char                    name[32];
00617         struct v4l2_standard    std;
00618         __u32                   capability;
00619         __u32                   rangelow;
00620         __u32                   rangehigh;
00621         __u32                   txsubchans;
00622         __u32                   reserved[4];
00623 };
00624 /*  Flags for the 'capability' field */
00625 #define V4L2_TUNER_CAP_LOW              0x0001
00626 #define V4L2_TUNER_CAP_NORM             0x0002
00627 #define V4L2_TUNER_CAP_STEREO           0x0010
00628 #define V4L2_TUNER_CAP_LANG2            0x0020
00629 #define V4L2_TUNER_CAP_SAP              0x0020
00630 #define V4L2_TUNER_CAP_LANG1            0x0040
00631 
00632 /*  Flags for the 'rxsubchans' field */
00633 #define V4L2_TUNER_SUB_MONO             0x0001
00634 #define V4L2_TUNER_SUB_STEREO           0x0002
00635 #define V4L2_TUNER_SUB_LANG2            0x0004
00636 #define V4L2_TUNER_SUB_SAP              0x0004
00637 #define V4L2_TUNER_SUB_LANG1            0x0008
00638 
00639 /*  Values for the 'audmode' field */
00640 #define V4L2_TUNER_MODE_MONO            0x0000
00641 #define V4L2_TUNER_MODE_STEREO          0x0001
00642 #define V4L2_TUNER_MODE_LANG2           0x0002
00643 #define V4L2_TUNER_MODE_SAP             0x0002
00644 #define V4L2_TUNER_MODE_LANG1           0x0003
00645 
00646 struct v4l2_frequency
00647 {
00648         int     port;
00649         __u32   frequency;
00650         __u32   reserved[2];
00651 };
00652 
00653 /*
00654  *      A U D I O
00655  */
00656 struct v4l2_audio
00657 {
00658         int     audio;
00659         char    name[32];
00660         __u32   capability;
00661         __u32   mode;
00662         __u32   reserved[2];
00663 };
00664 /*  Flags for the 'capability' field */
00665 #define V4L2_AUDCAP_EFFECTS             0x0020
00666 #define V4L2_AUDCAP_LOUDNESS            0x0040
00667 #define V4L2_AUDCAP_AVL                 0x0080
00668 
00669 /*  Flags for the 'mode' field */
00670 #define V4L2_AUDMODE_LOUDNESS           0x00002
00671 #define V4L2_AUDMODE_AVL                0x00004
00672 #define V4L2_AUDMODE_STEREO_field       0x0FF00
00673 #define V4L2_AUDMODE_STEREO_LINEAR      0x00100
00674 #define V4L2_AUDMODE_STEREO_PSEUDO      0x00200
00675 #define V4L2_AUDMODE_STEREO_SPATIAL30   0x00300
00676 #define V4L2_AUDMODE_STEREO_SPATIAL50   0x00400
00677 
00678 struct v4l2_audioout
00679 {
00680         int     audio;
00681         char    name[32];
00682         __u32   capability;
00683         __u32   mode;
00684         __u32   reserved[2];
00685 };
00686 
00687 /*
00688  *      D A T A   S E R V I C E S   ( V B I )
00689  */
00690 
00691 struct v4l2_vbi_format
00692 {
00693         __u32   sampling_rate;          /* in 1 Hz */
00694         __u32   reserved1;              /* must be zero */
00695         __u32   samples_per_line;
00696         __u32   sample_format;          /* V4L2_VBI_SF_* */
00697         __s32   start[2];
00698         __u32   count[2];
00699         __u32   flags;                  /* V4L2_VBI_* */
00700         __u32   reserved2;              /* must be zero */
00701 };
00702 
00703 /*  VBI sampling formats */
00704 #define V4L2_VBI_SF_UBYTE       1
00705 
00706 /*  VBI flags  */
00707 #define V4L2_VBI_UNSYNC         (1<< 0)
00708 #define V4L2_VBI_INTERLACED     (1<< 1)
00709 
00710 
00711 /*
00712  *      A G G R E G A T E   S T R U C T U R E S
00713  */
00714 
00715 /*      Stream data format
00716  */
00717 struct v4l2_format
00718 {
00719         __u32   type;
00720         union
00721         {
00722                 struct v4l2_pix_format  pix;    /*  image format  */
00723                 struct v4l2_vbi_format  vbi;    /*  VBI data  */
00724                 /*  add more  */
00725                 __u8    raw_data[200];  /* user-defined */
00726         } fmt;
00727 };
00728 
00729 
00730 /*      Stream type-dependent parameters
00731  */
00732 struct v4l2_streamparm
00733 {
00734         __u32   type;
00735         union
00736         {
00737                 struct v4l2_captureparm capture;
00738                 struct v4l2_outputparm  output;
00739                 /*  add more  */
00740                 __u8    raw_data[200];  /* user-defined */
00741         } parm;
00742 };
00743 
00744 
00745 
00746 /*
00747  *      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
00748  *
00749  */
00750 #define VIDIOC_QUERYCAP         _IOR  ('V',  0, struct v4l2_capability)
00751 #define VIDIOC_RESERVED         _IO   ('V',  1)
00752 #define VIDIOC_ENUM_PIXFMT      _IOWR ('V',  2, struct v4l2_fmtdesc)
00753 #define VIDIOC_ENUM_FBUFFMT     _IOWR ('V',  3, struct v4l2_fmtdesc)
00754 #define VIDIOC_G_FMT            _IOWR ('V',  4, struct v4l2_format)
00755 #define VIDIOC_S_FMT            _IOWR ('V',  5, struct v4l2_format)
00756 #define VIDIOC_G_COMP           _IOR  ('V',  6, struct v4l2_compression)
00757 #define VIDIOC_S_COMP           _IOW  ('V',  7, struct v4l2_compression)
00758 #define VIDIOC_REQBUFS          _IOWR ('V',  8, struct v4l2_requestbuffers)
00759 #define VIDIOC_QUERYBUF         _IOWR ('V',  9, struct v4l2_buffer)
00760 #define VIDIOC_G_FBUF           _IOR  ('V', 10, struct v4l2_framebuffer)
00761 #define VIDIOC_S_FBUF           _IOW  ('V', 11, struct v4l2_framebuffer)
00762 #define VIDIOC_G_WIN            _IOR  ('V', 12, struct v4l2_window)
00763 #define VIDIOC_S_WIN            _IOW  ('V', 13, struct v4l2_window)
00764 #define VIDIOC_PREVIEW          _IOWR ('V', 14, int)
00765 #define VIDIOC_QBUF             _IOWR ('V', 15, struct v4l2_buffer)
00766 #define VIDIOC_DQBUF            _IOWR ('V', 17, struct v4l2_buffer)
00767 #define VIDIOC_STREAMON         _IOW  ('V', 18, int)
00768 #define VIDIOC_STREAMOFF        _IOW  ('V', 19, int)
00769 #define VIDIOC_G_PERF           _IOR  ('V', 20, struct v4l2_performance)
00770 #define VIDIOC_G_PARM           _IOWR ('V', 21, struct v4l2_streamparm)
00771 #define VIDIOC_S_PARM           _IOW  ('V', 22, struct v4l2_streamparm)
00772 #define VIDIOC_G_STD            _IOR  ('V', 23, struct v4l2_standard)
00773 #define VIDIOC_S_STD            _IOW  ('V', 24, struct v4l2_standard)
00774 #define VIDIOC_ENUMSTD          _IOWR ('V', 25, struct v4l2_enumstd)
00775 #define VIDIOC_ENUMINPUT        _IOWR ('V', 26, struct v4l2_input)
00776 #define VIDIOC_G_CTRL           _IOWR ('V', 27, struct v4l2_control)
00777 #define VIDIOC_S_CTRL           _IOW  ('V', 28, struct v4l2_control)
00778 #define VIDIOC_G_TUNER          _IOWR ('V', 29, struct v4l2_tuner)
00779 #define VIDIOC_S_TUNER          _IOW  ('V', 30, struct v4l2_tuner)
00780 #define VIDIOC_G_FREQ           _IOR  ('V', 31, int)
00781 #define VIDIOC_S_FREQ           _IOWR ('V', 32, int)
00782 #define VIDIOC_G_AUDIO          _IOWR ('V', 33, struct v4l2_audio)
00783 #define VIDIOC_S_AUDIO          _IOW  ('V', 34, struct v4l2_audio)
00784 #define VIDIOC_QUERYCTRL        _IOWR ('V', 36, struct v4l2_queryctrl)
00785 #define VIDIOC_QUERYMENU        _IOWR ('V', 37, struct v4l2_querymenu)
00786 #define VIDIOC_G_INPUT          _IOR  ('V', 38, int)
00787 #define VIDIOC_S_INPUT          _IOWR ('V', 39, int)
00788 #define VIDIOC_ENUMCVT          _IOWR ('V', 40, struct v4l2_cvtdesc)
00789 #define VIDIOC_G_OUTPUT         _IOR  ('V', 46, int)
00790 #define VIDIOC_S_OUTPUT         _IOWR ('V', 47, int)
00791 #define VIDIOC_ENUMOUTPUT       _IOWR ('V', 48, struct v4l2_output)
00792 #define VIDIOC_G_AUDOUT         _IOWR ('V', 49, struct v4l2_audioout)
00793 #define VIDIOC_S_AUDOUT         _IOW  ('V', 50, struct v4l2_audioout)
00794 #define VIDIOC_ENUMFX           _IOWR ('V', 51, struct v4l2_fxdesc)
00795 #define VIDIOC_G_EFFECT         _IOR  ('V', 52, int)
00796 #define VIDIOC_S_EFFECT         _IOWR ('V', 53, int)
00797 #define VIDIOC_G_MODULATOR      _IOWR ('V', 54, struct v4l2_modulator)
00798 #define VIDIOC_S_MODULATOR      _IOW  ('V', 55, struct v4l2_modulator)
00799 
00800 #define VIDIOC_ENUM_CAPFMT      VIDIOC_ENUM_PIXFMT
00801 #define VIDIOC_ENUM_OUTFMT      VIDIOC_ENUM_PIXFMT
00802 #define VIDIOC_ENUM_SRCFMT      VIDIOC_ENUM_PIXFMT
00803 #define VIDIOC_ENUMFMT          VIDIOC_ENUM_PIXFMT
00804 
00805 #define BASE_VIDIOC_PRIVATE     192             /* 192-255 are private */
00806 
00807 
00808 #ifdef __KERNEL__
00809 /*
00810  *      These things are used only by drivers.
00811  */
00812 
00813 extern int videodev_init(void);
00814 
00815 /*
00816  *
00817  *      V 4 L 2   D R I V E R   H E L P E R   A P I
00818  *
00819  *      Some commonly needed functions for drivers.
00820  */
00821 
00822 extern void v4l2_version(int *major, int *minor);
00823 extern int v4l2_major_number(void);
00824 
00825 /*  Memory management  */
00826 extern unsigned long v4l2_vmalloc_to_bus(void *virt);
00827 extern unsigned long v4l2_vmalloc_to_page(void *virt);
00828 
00829 /*  Simple queue management  */
00830 struct v4l2_q_node
00831 {
00832         struct v4l2_q_node      *forw, *back;
00833 };
00834 struct v4l2_queue
00835 {
00836         struct v4l2_q_node      *forw, *back;
00837         rwlock_t                qlock;
00838 };
00839 extern void  v4l2_q_init(struct v4l2_queue *q);
00840 extern void  v4l2_q_add_head(struct v4l2_queue *q, struct v4l2_q_node *node);
00841 extern void  v4l2_q_add_tail(struct v4l2_queue *q, struct v4l2_q_node *node);
00842 extern void *v4l2_q_del_head(struct v4l2_queue *q);
00843 extern void *v4l2_q_del_tail(struct v4l2_queue *q);
00844 extern void *v4l2_q_peek_head(struct v4l2_queue *q);
00845 extern void *v4l2_q_peek_tail(struct v4l2_queue *q);
00846 extern void *v4l2_q_yank_node(struct v4l2_queue *q, struct v4l2_q_node *node);
00847 
00848 /*  Math functions  */
00849 extern u32 v4l2_math_div6432(u64 a, u32 d, u32 *r);
00850 
00851 /*  Time functions  */
00852 extern unsigned long v4l2_timestamp_divide(stamp_t t,
00853                                            unsigned long p_100ns);
00854 extern unsigned long v4l2_timestamp_correct(stamp_t *t,
00855                                             unsigned long p_100ns);
00856 
00857 /*  Master Clock functions  */
00858 struct v4l2_clock
00859 {
00860         void    (*gettime)(stamp_t *);
00861 };
00862 extern int  v4l2_masterclock_register(struct v4l2_clock *clock);
00863 extern void v4l2_masterclock_unregister(struct v4l2_clock *clock);
00864 extern void v4l2_masterclock_gettime(stamp_t *curr);
00865 
00866 /*  Video standard functions  */
00867 extern unsigned int v4l2_video_std_fps(struct v4l2_standard *vs);
00868 extern unsigned long v4l2_video_std_tpf(struct v4l2_standard *vs);
00869 extern int v4l2_video_std_confirm(struct v4l2_standard *vs);
00870 extern int v4l2_video_std_construct(struct v4l2_standard *vs,
00871                                     int id, __u32 transmission);
00872 
00873 #define V4L2_STD_PAL            1       /* PAL B, G, H, I (...) */
00874 #define V4L2_STD_PAL_M          5       /* (Brazil) */
00875 #define V4L2_STD_PAL_N          6       /* (Argentina, Paraguay, Uruguay) */
00876 #define V4L2_STD_PAL_60         10      /* PAL/NTSC hybrid */
00877 #define V4L2_STD_NTSC           11      /* NTSC M (USA, ...) */
00878 #define V4L2_STD_NTSC_N         12      /* (Barbados, Bolivia, Colombia, 
00879                                            S. Korea) */
00880 #define V4L2_STD_NTSC_44        15      /* PAL/NTSC hybrid */
00881 #define V4L2_STD_SECAM          21      /* SECAM B, D, G, K, K1 (...) */
00882 //#define V4L2_STD_SECAM_H      27      /* (Greece, Iran, Morocco) */ 
00883 //#define V4L2_STD_SECAM_L      28      /* (France, Luxembourg, Monaco) */
00884 //#define V4L2_STD_SECAM_M      29      /* (Jamaica) */
00885 
00886 /*
00887  *      D E V I C E   D R I V E R   R E G I S T R A T I O N
00888  *
00889  */
00890 struct v4l2_device
00891 {
00892         char    name[32];
00893         int     type;
00894         int     minor;
00895 
00896         int     (*open)(struct v4l2_device *v,
00897                         int flags, void **idptr);
00898         void    (*close)(void *id);
00899         long    (*read)(void *id,
00900                         char *buf, unsigned long count, int noblock);
00901         long    (*write)(void *id,
00902                          const char *buf, unsigned long count, int noblock);
00903         int     (*ioctl)(void *id,
00904                          unsigned int cmd, void *arg);
00905         int     (*mmap)(void *id,
00906                         struct vm_area_struct *vma);
00907         int     (*poll)(void *id,
00908                         struct file *file, poll_table *table);
00909 
00910         int     (*initialize)(struct v4l2_device *v);
00911         void    *priv;  /*  may be used by the driver  */
00912 
00913         int     busy;           /*  open count maintained by videodev.c  */
00914         void    *v4l2_priv;             /*  for V4L2 use  */
00915         int     v4l2_reserved[4];       /*  for V4L2 use  */
00916 };
00917 
00918 /*  Size of kernel ioctl arg buffer used in ioctl handler  */
00919 #define V4L2_MAX_IOCTL_SIZE             256
00920 
00921 extern int v4l2_register_device(struct v4l2_device *);
00922 extern void v4l2_unregister_device(struct v4l2_device *);
00923 
00924 /*  V4L2 structures  */
00925 extern struct v4l2_device *v4l2_device_from_file(struct file *file);
00926 extern void *v4l2_openid_from_file(struct file *file);
00927 
00928 #endif/*ifdef __KERNEL__ */
00929 
00930 
00931 /*----------------------------------------------------------------------
00932        Old Video for Linux backward compatibility below this line. 
00933   ----------------------------------------------------------------------
00934 
00935   All new applications should use the new API calls.
00936 
00937   (These definitions taken from 2.2.1.)
00938 
00939  */
00940 
00941 
00942 #define VID_TYPE_CAPTURE        1       /* Can capture */
00943 #define VID_TYPE_TUNER          2       /* Can tune */
00944 #define VID_TYPE_TELETEXT       4       /* Does teletext */
00945 #define VID_TYPE_OVERLAY        8       /* Overlay onto frame buffer */
00946 #define VID_TYPE_CHROMAKEY      16      /* Overlay by chromakey */
00947 #define VID_TYPE_CLIPPING       32      /* Can clip */
00948 #define VID_TYPE_FRAMERAM       64      /* Uses the frame buffer memory */
00949 #define VID_TYPE_SCALES         128     /* Scalable */
00950 #define VID_TYPE_MONOCHROME     256     /* Monochrome only */
00951 #define VID_TYPE_SUBCAPTURE     512     /* Can capture subareas of the image */
00952 
00953 struct video_capability
00954 {
00955         char name[32];
00956         int type;
00957         int channels;   /* Num channels */
00958         int audios;     /* Num audio devices */
00959         int maxwidth;   /* Supported width */
00960         int maxheight;  /* And height */
00961         int minwidth;   /* Supported width */
00962         int minheight;  /* And height */
00963 };
00964 
00965 
00966 struct video_channel
00967 {
00968         int channel;
00969         char name[32];
00970         int tuners;
00971         __u32  flags;
00972 #define VIDEO_VC_TUNER          1       /* Channel has a tuner */
00973 #define VIDEO_VC_AUDIO          2       /* Channel has audio */
00974         __u16  type;
00975 #define VIDEO_TYPE_TV           1
00976 #define VIDEO_TYPE_CAMERA       2       
00977         __u16 norm;                     /* Norm set by channel */
00978 };
00979 
00980 struct video_tuner
00981 {
00982         int tuner;
00983         char name[32];
00984         ulong rangelow, rangehigh;      /* Tuner range */
00985         __u32 flags;
00986 #define VIDEO_TUNER_PAL         1
00987 #define VIDEO_TUNER_NTSC        2
00988 #define VIDEO_TUNER_SECAM       4
00989 #define VIDEO_TUNER_LOW         8       /* Uses KHz not MHz */
00990 #define VIDEO_TUNER_NORM        16      /* Tuner can set norm */
00991 #define VIDEO_TUNER_STEREO_ON   128     /* Tuner is seeing stereo */
00992 #define VIDEO_TUNER_RDS_ON      256     /* Tuner is seeing an RDS datastream */
00993 #define VIDEO_TUNER_MBS_ON      512     /* Tuner is seeing an MBS datastream */
00994         __u16 mode;                     /* PAL/NTSC/SECAM/OTHER */
00995 #define VIDEO_MODE_PAL          0
00996 #define VIDEO_MODE_NTSC         1
00997 #define VIDEO_MODE_SECAM        2
00998 #define VIDEO_MODE_AUTO         3
00999         __u16 signal;                   /* Signal strength 16bit scale */
01000 };
01001 
01002 struct video_picture
01003 {
01004         __u16   brightness;
01005         __u16   hue;
01006         __u16   colour;
01007         __u16   contrast;
01008         __u16   whiteness;      /* Black and white only */
01009         __u16   depth;          /* Capture depth */
01010         __u16   palette;        /* Palette in use */
01011 #define VIDEO_PALETTE_GREY      1       /* Linear greyscale */
01012 #define VIDEO_PALETTE_HI240     2       /* High 240 cube (BT848) */
01013 #define VIDEO_PALETTE_RGB565    3       /* 565 16 bit RGB */
01014 #define VIDEO_PALETTE_RGB24     4       /* 24bit RGB */
01015 #define VIDEO_PALETTE_RGB32     5       /* 32bit RGB */ 
01016 #define VIDEO_PALETTE_RGB555    6       /* 555 15bit RGB */
01017 #define VIDEO_PALETTE_YUV422    7       /* YUV422 capture */
01018 #define VIDEO_PALETTE_YUYV      8
01019 #define VIDEO_PALETTE_UYVY      9       /* The great thing about standards is ... */
01020 #define VIDEO_PALETTE_YUV420    10
01021 #define VIDEO_PALETTE_YUV411    11      /* YUV411 capture */
01022 #define VIDEO_PALETTE_RAW       12      /* RAW capture (BT848) */
01023 #define VIDEO_PALETTE_YUV422P   13      /* YUV 4:2:2 Planar */
01024 #define VIDEO_PALETTE_YUV411P   14      /* YUV 4:1:1 Planar */
01025 #define VIDEO_PALETTE_YUV420P   15      /* YUV 4:2:0 Planar */
01026 #define VIDEO_PALETTE_YUV410P   16      /* YUV 4:1:0 Planar */
01027 #define VIDEO_PALETTE_PLANAR    13      /* start of planar entries */
01028 #define VIDEO_PALETTE_COMPONENT 7       /* start of component entries */
01029 };
01030 
01031 struct video_audio
01032 {
01033         int     audio;          /* Audio channel */
01034         __u16   volume;         /* If settable */
01035         __u16   bass, treble;
01036         __u32   flags;
01037 #define VIDEO_AUDIO_MUTE        1
01038 #define VIDEO_AUDIO_MUTABLE     2
01039 #define VIDEO_AUDIO_VOLUME      4
01040 #define VIDEO_AUDIO_BASS        8
01041 #define VIDEO_AUDIO_TREBLE      16
01042 #define VIDEO_AUDIO_BALANCE     32
01043         char    name[16];
01044 #define VIDEO_SOUND_MONO        1
01045 #define VIDEO_SOUND_STEREO      2
01046 #define VIDEO_SOUND_LANG1       4
01047 #define VIDEO_SOUND_LANG2       8
01048         __u16   mode;
01049         __u16   balance;        /* Stereo balance */
01050         __u16   step;           /* Step actual volume uses */
01051 };
01052 
01053 struct video_clip
01054 {
01055         __s32   x,y;
01056         __s32   width, height;
01057         struct  video_clip *next;       /* For user use/driver use only */
01058 };
01059 
01060 struct video_window
01061 {
01062         __u32   x,y;                    /* Position of window */
01063         __u32   width,height;           /* Its size */
01064         __u32   chromakey;
01065         __u32   flags;
01066         struct  video_clip *clips;      /* Set only */
01067         int     clipcount;
01068 #define VIDEO_WINDOW_INTERLACE  1
01069 #define VIDEO_CLIP_BITMAP       -1
01070 /* bitmap is 1024x625, a '1' bit represents a clipped pixel */
01071 #define VIDEO_CLIPMAP_SIZE      (128 * 625)
01072 };
01073 
01074 struct video_capture
01075 {
01076         __u32   x,y;                    /* Offsets into image */
01077         __u32   width, height;          /* Area to capture */
01078         __u16   decimation;             /* Decimation divder */
01079         __u16   flags;                  /* Flags for capture */
01080 #define VIDEO_CAPTURE_ODD               0       /* Temporal */
01081 #define VIDEO_CAPTURE_EVEN              1
01082 };
01083 
01084 struct video_buffer
01085 {
01086         void    *base;
01087         int     height,width;
01088         int     depth;
01089         int     bytesperline;
01090 };
01091 
01092 struct video_mmap
01093 {
01094         unsigned        int frame;              /* Frame (0 - n) for double buffer */
01095         int             height,width;
01096         unsigned        int format;             /* should be VIDEO_PALETTE_* */
01097 };
01098 
01099 struct video_key
01100 {
01101         __u8    key[8];
01102         __u32   flags;
01103 };
01104 
01105 
01106 #define VIDEO_MAX_FRAME         32
01107 
01108 struct video_mbuf
01109 {
01110         int     size;           /* Total memory to map */
01111         int     frames;         /* Frames */
01112         int     offsets[VIDEO_MAX_FRAME];
01113 };
01114         
01115 
01116 #define         VIDEO_NO_UNIT   (-1)
01117 
01118         
01119 struct video_unit
01120 {
01121         int     video;          /* Video minor */
01122         int     vbi;            /* VBI minor */
01123         int     radio;          /* Radio minor */
01124         int     audio;          /* Audio minor */
01125         int     teletext;       /* Teletext minor */
01126 };
01127 
01128 #define VIDIOCGCAP              _IOR('v',1,struct video_capability)     /* Get capabilities */
01129 #define VIDIOCGCHAN             _IOWR('v',2,struct video_channel)       /* Get channel info (sources) */
01130 #define VIDIOCSCHAN             _IOW('v',3,struct video_channel)        /* Set channel  */
01131 #define VIDIOCGTUNER            _IOWR('v',4,struct video_tuner)         /* Get tuner abilities */
01132 #define VIDIOCSTUNER            _IOW('v',5,struct video_tuner)          /* Tune the tuner for the current channel */
01133 #define VIDIOCGPICT             _IOR('v',6,struct video_picture)        /* Get picture properties */
01134 #define VIDIOCSPICT             _IOW('v',7,struct video_picture)        /* Set picture properties */
01135 #define VIDIOCCAPTURE           _IOW('v',8,int)                         /* Start, end capture */
01136 #define VIDIOCGWIN              _IOR('v',9, struct video_window)        /* Set the video overlay window */
01137 #define VIDIOCSWIN              _IOW('v',10, struct video_window)       /* Set the video overlay window - passes clip list for hardware smarts , chromakey etc */
01138 #define VIDIOCGFBUF             _IOR('v',11, struct video_buffer)       /* Get frame buffer */
01139 #define VIDIOCSFBUF             _IOW('v',12, struct video_buffer)       /* Set frame buffer - root only */
01140 #define VIDIOCKEY               _IOR('v',13, struct video_key)          /* Video key event - to dev 255 is to all - cuts capture on all DMA windows with this key (0xFFFFFFFF == all) */
01141 #define VIDIOCGFREQ             _IOR('v',14, unsigned long)             /* Set tuner */
01142 #define VIDIOCSFREQ             _IOW('v',15, unsigned long)             /* Set tuner */
01143 #define VIDIOCGAUDIO            _IOR('v',16, struct video_audio)        /* Get audio info */
01144 #define VIDIOCSAUDIO            _IOW('v',17, struct video_audio)        /* Audio source, mute etc */
01145 #define VIDIOCSYNC              _IOW('v',18, int)                       /* Sync with mmap grabbing */
01146 #define VIDIOCMCAPTURE          _IOW('v',19, struct video_mmap)         /* Grab frames */
01147 #define VIDIOCGMBUF             _IOR('v', 20, struct video_mbuf)        /* Memory map buffer info */
01148 #define VIDIOCGUNIT             _IOR('v', 21, struct video_unit)        /* Get attached units */
01149 #define VIDIOCGCAPTURE          _IOR('v',22, struct video_capture)      /* Get frame buffer */
01150 #define VIDIOCSCAPTURE          _IOW('v',23, struct video_capture)      /* Set frame buffer - root only */
01151 #define BASE_VIDIOCPRIVATE      192             /* 192-255 are private */
01152 
01153 
01154 
01155 #endif/*ifndef __LINUX_VIDEODEV_H*/

Generated on Sun Jan 8 13:39:02 2006 for Cinelerra-svn by  doxygen 1.4.4