/linux/include/linux/videodev.h

来源:互联网 发布:sails.js 开发api 编辑:程序博客网 时间:2024/06/10 16:07
 1 /*  2  *      Video for Linux version 1 - OBSOLETE  3  *  4  *      Header file for v4l1 drivers and applications, for  5  *      Linux kernels 2.2.x or 2.4.x.  6  *  7  *      Provides header for legacy drivers and applications  8  *  9  *      See http://linuxtv.org for more info 10  * 11  */ 12 #ifndef __LINUX_VIDEODEV_H 13 #define __LINUX_VIDEODEV_H 14  15 #include <linux/types.h> 16 #include <linux/ioctl.h> 17 #include <linux/videodev2.h> 18  19 #if defined(__MIN_V4L1) && defined (__KERNEL__) 20  21 /* 22  * Used by those V4L2 core functions that need a minimum V4L1 support, 23  * in order to allow V4L1 Compatibilty code compilation. 24  */ 25  26 struct video_mbuf 27 { 28         int     size;           /* Total memory to map */ 29         int     frames;         /* Frames */ 30         int     offsets[VIDEO_MAX_FRAME]; 31 }; 32  33 #define VIDIOCGMBUF             _IOR('v',20, struct video_mbuf)         /* Memory map buffer info */ 34  35 #else 36 #if defined(CONFIG_VIDEO_V4L1_COMPAT) || !defined (__KERNEL__) 37  38 #define VID_TYPE_CAPTURE        1       /* Can capture */ 39 #define VID_TYPE_TUNER          2       /* Can tune */ 40 #define VID_TYPE_TELETEXT       4       /* Does teletext */ 41 #define VID_TYPE_OVERLAY        8       /* Overlay onto frame buffer */ 42 #define VID_TYPE_CHROMAKEY      16      /* Overlay by chromakey */ 43 #define VID_TYPE_CLIPPING       32      /* Can clip */ 44 #define VID_TYPE_FRAMERAM       64      /* Uses the frame buffer memory */ 45 #define VID_TYPE_SCALES         128     /* Scalable */ 46 #define VID_TYPE_MONOCHROME     256     /* Monochrome only */ 47 #define VID_TYPE_SUBCAPTURE     512     /* Can capture subareas of the image */ 48 #define VID_TYPE_MPEG_DECODER   1024    /* Can decode MPEG streams */ 49 #define VID_TYPE_MPEG_ENCODER   2048    /* Can encode MPEG streams */ 50 #define VID_TYPE_MJPEG_DECODER  4096    /* Can decode MJPEG streams */ 51 #define VID_TYPE_MJPEG_ENCODER  8192    /* Can encode MJPEG streams */ 52  53 struct video_capability 54 { 55         char name[32]; 56         int type; 57         int channels;   /* Num channels */ 58         int audios;     /* Num audio devices */ 59         int maxwidth;   /* Supported width */ 60         int maxheight;  /* And height */ 61         int minwidth;   /* Supported width */ 62         int minheight;  /* And height */ 63 }; 64  65  66 struct video_channel 67 { 68         int channel; 69         char name[32]; 70         int tuners; 71         __u32  flags; 72 #define VIDEO_VC_TUNER          1       /* Channel has a tuner */ 73 #define VIDEO_VC_AUDIO          2       /* Channel has audio */ 74         __u16  type; 75 #define VIDEO_TYPE_TV           1 76 #define VIDEO_TYPE_CAMERA       2 77         __u16 norm;                     /* Norm set by channel */ 78 }; 79  80 struct video_tuner 81 { 82         int tuner; 83         char name[32]; 84         unsigned long rangelow, rangehigh;      /* Tuner range */ 85         __u32 flags; 86 #define VIDEO_TUNER_PAL         1 87 #define VIDEO_TUNER_NTSC        2 88 #define VIDEO_TUNER_SECAM       4 89 #define VIDEO_TUNER_LOW         8       /* Uses KHz not MHz */ 90 #define VIDEO_TUNER_NORM        16      /* Tuner can set norm */ 91 #define VIDEO_TUNER_STEREO_ON   128     /* Tuner is seeing stereo */ 92 #define VIDEO_TUNER_RDS_ON      256     /* Tuner is seeing an RDS datastream */ 93 #define VIDEO_TUNER_MBS_ON      512     /* Tuner is seeing an MBS datastream */ 94         __u16 mode;                     /* PAL/NTSC/SECAM/OTHER */ 95 #define VIDEO_MODE_PAL          0 96 #define VIDEO_MODE_NTSC         1 97 #define VIDEO_MODE_SECAM        2 98 #define VIDEO_MODE_AUTO         3 99         __u16 signal;                   /* Signal strength 16bit scale */100 };101 102 struct video_picture103 {104         __u16   brightness;105         __u16   hue;106         __u16   colour;107         __u16   contrast;108         __u16   whiteness;      /* Black and white only */109         __u16   depth;          /* Capture depth */110         __u16   palette;        /* Palette in use */111 #define VIDEO_PALETTE_GREY      1       /* Linear greyscale */112 #define VIDEO_PALETTE_HI240     2       /* High 240 cube (BT848) */113 #define VIDEO_PALETTE_RGB565    3       /* 565 16 bit RGB */114 #define VIDEO_PALETTE_RGB24     4       /* 24bit RGB */115 #define VIDEO_PALETTE_RGB32     5       /* 32bit RGB */116 #define VIDEO_PALETTE_RGB555    6       /* 555 15bit RGB */117 #define VIDEO_PALETTE_YUV422    7       /* YUV422 capture */118 #define VIDEO_PALETTE_YUYV      8119 #define VIDEO_PALETTE_UYVY      9       /* The great thing about standards is ... */120 #define VIDEO_PALETTE_YUV420    10121 #define VIDEO_PALETTE_YUV411    11      /* YUV411 capture */122 #define VIDEO_PALETTE_RAW       12      /* RAW capture (BT848) */123 #define VIDEO_PALETTE_YUV422P   13      /* YUV 4:2:2 Planar */124 #define VIDEO_PALETTE_YUV411P   14      /* YUV 4:1:1 Planar */125 #define VIDEO_PALETTE_YUV420P   15      /* YUV 4:2:0 Planar */126 #define VIDEO_PALETTE_YUV410P   16      /* YUV 4:1:0 Planar */127 #define VIDEO_PALETTE_PLANAR    13      /* start of planar entries */128 #define VIDEO_PALETTE_COMPONENT 7       /* start of component entries */129 };130 131 struct video_audio132 {133         int     audio;          /* Audio channel */134         __u16   volume;         /* If settable */135         __u16   bass, treble;136         __u32   flags;137 #define VIDEO_AUDIO_MUTE        1138 #define VIDEO_AUDIO_MUTABLE     2139 #define VIDEO_AUDIO_VOLUME      4140 #define VIDEO_AUDIO_BASS        8141 #define VIDEO_AUDIO_TREBLE      16142 #define VIDEO_AUDIO_BALANCE     32143         char    name[16];144 #define VIDEO_SOUND_MONO        1145 #define VIDEO_SOUND_STEREO      2146 #define VIDEO_SOUND_LANG1       4147 #define VIDEO_SOUND_LANG2       8148         __u16   mode;149         __u16   balance;        /* Stereo balance */150         __u16   step;           /* Step actual volume uses */151 };152 153 struct video_clip154 {155         __s32   x,y;156         __s32   width, height;157         struct  video_clip *next;       /* For user use/driver use only */158 };159 160 struct video_window161 {162         __u32   x,y;                    /* Position of window */163         __u32   width,height;           /* Its size */164         __u32   chromakey;165         __u32   flags;166         struct  video_clip__user *clips;       /* Set only */167         int     clipcount;168 #define VIDEO_WINDOW_INTERLACE  1169 #define VIDEO_WINDOW_CHROMAKEY  16      /* Overlay by chromakey */170 #define VIDEO_CLIP_BITMAP       -1171 /* bitmap is 1024x625, a '1' bit represents a clipped pixel */172 #define VIDEO_CLIPMAP_SIZE      (128 * 625)173 };174 175 struct video_capture176 {177         __u32   x,y;                    /* Offsets into image */178         __u32   width, height;          /* Area to capture */179         __u16   decimation;             /* Decimation divider */180         __u16   flags;                  /* Flags for capture */181 #define VIDEO_CAPTURE_ODD               0       /* Temporal */182 #define VIDEO_CAPTURE_EVEN              1183 };184 185 struct video_buffer186 {187         void    *base;188         int     height,width;189         int     depth;190         int     bytesperline;191 };192 193 struct video_mmap194 {195         unsigned        int frame;              /* Frame (0 - n) for double buffer */196         int             height,width;197         unsigned        int format;             /* should be VIDEO_PALETTE_* */198 };199 200 struct video_key201 {202         __u8    key[8];203         __u32   flags;204 };205 206 struct video_mbuf207 {208         int     size;           /* Total memory to map */209         int     frames;         /* Frames */210         int     offsets[VIDEO_MAX_FRAME];211 };212 213 #define         VIDEO_NO_UNIT   (-1)214 215 struct video_unit216 {217         int     video;          /* Video minor */218         int     vbi;            /* VBI minor */219         int     radio;          /* Radio minor */220         int     audio;          /* Audio minor */221         int     teletext;       /* Teletext minor */222 };223 224 struct vbi_format {225         __u32   sampling_rate;  /* in Hz */226         __u32   samples_per_line;227         __u32   sample_format;  /* VIDEO_PALETTE_RAW only (1 byte) */228         __s32   start[2];       /* starting line for each frame */229         __u32   count[2];       /* count of lines for each frame */230         __u32   flags;231 #define VBI_UNSYNC      1       /* can distingues between top/bottom field */232 #define VBI_INTERLACED  2       /* lines are interlaced */233 };234 235 /* video_info is biased towards hardware mpeg encode/decode */236 /* but it could apply generically to any hardware compressor/decompressor */237 struct video_info238 {239         __u32   frame_count;    /* frames output since decode/encode began */240         __u32   h_size;         /* current unscaled horizontal size */241         __u32   v_size;         /* current unscaled veritcal size */242         __u32   smpte_timecode; /* current SMPTE timecode (for current GOP) */243         __u32   picture_type;   /* current picture type */244         __u32   temporal_reference;     /* current temporal reference */245         __u8    user_data[256]; /* user data last found in compressed stream */246         /* user_data[0] contains user data flags, user_data[1] has count */247 };248 249 /* generic structure for setting playback modes */250 struct video_play_mode251 {252         int     mode;253         int     p1;254         int     p2;255 };256 257 /* for loading microcode / fpga programming */258 struct video_code259 {260         char    loadwhat[16];   /* name or tag of file being passed */261         int     datasize;262         __u8    *data;263 };264 265 #define VIDIOCGCAP              _IOR('v',1,struct video_capability)     /* Get capabilities */266 #define VIDIOCGCHAN             _IOWR('v',2,struct video_channel)       /* Get channel info (sources) */267 #define VIDIOCSCHAN             _IOW('v',3,struct video_channel)        /* Set channel  */268 #define VIDIOCGTUNER            _IOWR('v',4,struct video_tuner)         /* Get tuner abilities */269 #define VIDIOCSTUNER            _IOW('v',5,struct video_tuner)          /* Tune the tuner for the current channel */270 #define VIDIOCGPICT             _IOR('v',6,struct video_picture)        /* Get picture properties */271 #define VIDIOCSPICT             _IOW('v',7,struct video_picture)        /* Set picture properties */272 #define VIDIOCCAPTURE           _IOW('v',8,int)                         /* Start, end capture */273 #define VIDIOCGWIN              _IOR('v',9, struct video_window)        /* Get the video overlay window */274 #define VIDIOCSWIN              _IOW('v',10, struct video_window)       /* Set the video overlay window - passes clip list for hardware smarts , chromakey etc */275 #define VIDIOCGFBUF             _IOR('v',11, struct video_buffer)       /* Get frame buffer */276 #define VIDIOCSFBUF             _IOW('v',12, struct video_buffer)       /* Set frame buffer - root only */277 #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) */278 #define VIDIOCGFREQ             _IOR('v',14, unsigned long)             /* Set tuner */279 #define VIDIOCSFREQ             _IOW('v',15, unsigned long)             /* Set tuner */280 #define VIDIOCGAUDIO            _IOR('v',16, struct video_audio)        /* Get audio info */281 #define VIDIOCSAUDIO            _IOW('v',17, struct video_audio)        /* Audio source, mute etc */282 #define VIDIOCSYNC              _IOW('v',18, int)                       /* Sync with mmap grabbing */283 #define VIDIOCMCAPTURE          _IOW('v',19, struct video_mmap)         /* Grab frames */284 #define VIDIOCGMBUF             _IOR('v',20, struct video_mbuf)         /* Memory map buffer info */285 #define VIDIOCGUNIT             _IOR('v',21, struct video_unit)         /* Get attached units */286 #define VIDIOCGCAPTURE          _IOR('v',22, struct video_capture)      /* Get subcapture */287 #define VIDIOCSCAPTURE          _IOW('v',23, struct video_capture)      /* Set subcapture */288 #define VIDIOCSPLAYMODE         _IOW('v',24, struct video_play_mode)    /* Set output video mode/feature */289 #define VIDIOCSWRITEMODE        _IOW('v',25, int)                       /* Set write mode */290 #define VIDIOCGPLAYINFO         _IOR('v',26, struct video_info)         /* Get current playback info from hardware */291 #define VIDIOCSMICROCODE        _IOW('v',27, struct video_code)         /* Load microcode into hardware */292 #define VIDIOCGVBIFMT           _IOR('v',28, struct vbi_format)         /* Get VBI information */293 #define VIDIOCSVBIFMT           _IOW('v',29, struct vbi_format)         /* Set VBI information */294 295 296 #define BASE_VIDIOCPRIVATE      192             /* 192-255 are private */297 298 /* VIDIOCSWRITEMODE */299 #define VID_WRITE_MPEG_AUD              0300 #define VID_WRITE_MPEG_VID              1301 #define VID_WRITE_OSD                   2302 #define VID_WRITE_TTX                   3303 #define VID_WRITE_CC                    4304 #define VID_WRITE_MJPEG                 5305 306 /* VIDIOCSPLAYMODE */307 #define VID_PLAY_VID_OUT_MODE           0308         /* p1: = VIDEO_MODE_PAL, VIDEO_MODE_NTSC, etc ... */309 #define VID_PLAY_GENLOCK                1310         /* p1: 0 = OFF, 1 = ON */311         /* p2: GENLOCK FINE DELAY value */312 #define VID_PLAY_NORMAL                 2313 #define VID_PLAY_PAUSE                  3314 #define VID_PLAY_SINGLE_FRAME           4315 #define VID_PLAY_FAST_FORWARD           5316 #define VID_PLAY_SLOW_MOTION            6317 #define VID_PLAY_IMMEDIATE_NORMAL       7318 #define VID_PLAY_SWITCH_CHANNELS        8319 #define VID_PLAY_FREEZE_FRAME           9320 #define VID_PLAY_STILL_MODE             10321 #define VID_PLAY_MASTER_MODE            11322         /* p1: see below */323 #define         VID_PLAY_MASTER_NONE    1324 #define         VID_PLAY_MASTER_VIDEO   2325 #define         VID_PLAY_MASTER_AUDIO   3326 #define VID_PLAY_ACTIVE_SCANLINES       12327         /* p1 = first active; p2 = last active */328 #define VID_PLAY_RESET                  13329 #define VID_PLAY_END_MARK               14330 331 #endif /* CONFIG_VIDEO_V4L1_COMPAT */332 #endif /* __MIN_V4L1 */333 334 #endif /* __LINUX_VIDEODEV_H */335 336 /*337  * Local variables:338  * c-basic-offset: 8339  * End:340  */341