[490] | 1 | /* |
---|
| 2 | Copyright 2006 Bill Dirks <bdirks@pacbell.net> |
---|
| 3 | Justin Schoeman |
---|
| 4 | et al. |
---|
| 5 | This program is free software; you can redistribute it and/or |
---|
| 6 | modify it under the terms of the GNU General Public License |
---|
| 7 | as published by the Free Software Foundation; either version 2 |
---|
| 8 | of the License, or (at your option) any later version. |
---|
| 9 | |
---|
| 10 | This program is distributed in the hope that it will be useful, |
---|
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 13 | GNU General Public License for more details. |
---|
| 14 | |
---|
| 15 | You should have received a copy of the GNU General Public License |
---|
| 16 | along with this program; if not, write to the Free Software |
---|
| 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
| 18 | */ |
---|
| 19 | |
---|
| 20 | #ifndef __LINUX_VIDEODEV_H |
---|
| 21 | #define __LINUX_VIDEODEV_H |
---|
| 22 | |
---|
| 23 | #define VID_TYPE_CAPTURE 1 /* Can capture */ |
---|
| 24 | #define VID_TYPE_TUNER 2 /* Can tune */ |
---|
| 25 | #define VID_TYPE_TELETEXT 4 /* Does teletext */ |
---|
| 26 | #define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */ |
---|
| 27 | #define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */ |
---|
| 28 | #define VID_TYPE_CLIPPING 32 /* Can clip */ |
---|
| 29 | #define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */ |
---|
| 30 | #define VID_TYPE_SCALES 128 /* Scalable */ |
---|
| 31 | #define VID_TYPE_MONOCHROME 256 /* Monochrome only */ |
---|
| 32 | #define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */ |
---|
| 33 | #define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */ |
---|
| 34 | #define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */ |
---|
| 35 | #define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ |
---|
| 36 | #define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ |
---|
| 37 | |
---|
| 38 | struct video_capability |
---|
| 39 | { |
---|
| 40 | char name[32]; |
---|
| 41 | int type; |
---|
| 42 | int channels; /* Num channels */ |
---|
| 43 | int audios; /* Num audio devices */ |
---|
| 44 | int maxwidth; /* Supported width */ |
---|
| 45 | int maxheight; /* And height */ |
---|
| 46 | int minwidth; /* Supported width */ |
---|
| 47 | int minheight; /* And height */ |
---|
| 48 | }; |
---|
| 49 | |
---|
| 50 | |
---|
| 51 | struct video_channel |
---|
| 52 | { |
---|
| 53 | int channel; |
---|
| 54 | char name[32]; |
---|
| 55 | int tuners; |
---|
| 56 | unsigned int flags; |
---|
| 57 | #define VIDEO_VC_TUNER 1 /* Channel has a tuner */ |
---|
| 58 | #define VIDEO_VC_AUDIO 2 /* Channel has audio */ |
---|
| 59 | unsigned short type; |
---|
| 60 | #define VIDEO_TYPE_TV 1 |
---|
| 61 | #define VIDEO_TYPE_CAMERA 2 |
---|
| 62 | unsigned short norm; /* Norm set by channel */ |
---|
| 63 | }; |
---|
| 64 | |
---|
| 65 | struct video_tuner |
---|
| 66 | { |
---|
| 67 | int tuner; |
---|
| 68 | char name[32]; |
---|
| 69 | unsigned long rangelow, rangehigh; /* Tuner range */ |
---|
| 70 | unsigned int flags; |
---|
| 71 | #define VIDEO_TUNER_PAL 1 |
---|
| 72 | #define VIDEO_TUNER_NTSC 2 |
---|
| 73 | #define VIDEO_TUNER_SECAM 4 |
---|
| 74 | #define VIDEO_TUNER_LOW 8 /* Uses KHz not MHz */ |
---|
| 75 | #define VIDEO_TUNER_NORM 16 /* Tuner can set norm */ |
---|
| 76 | #define VIDEO_TUNER_STEREO_ON 128 /* Tuner is seeing stereo */ |
---|
| 77 | #define VIDEO_TUNER_RDS_ON 256 /* Tuner is seeing an RDS datastream */ |
---|
| 78 | #define VIDEO_TUNER_MBS_ON 512 /* Tuner is seeing an MBS datastream */ |
---|
| 79 | unsigned short mode; /* PAL/NTSC/SECAM/OTHER */ |
---|
| 80 | #define VIDEO_MODE_PAL 0 |
---|
| 81 | #define VIDEO_MODE_NTSC 1 |
---|
| 82 | #define VIDEO_MODE_SECAM 2 |
---|
| 83 | #define VIDEO_MODE_AUTO 3 |
---|
| 84 | unsigned short signal; /* Signal strength 16bit scale */ |
---|
| 85 | }; |
---|
| 86 | |
---|
| 87 | struct video_picture |
---|
| 88 | { |
---|
| 89 | unsigned short brightness; |
---|
| 90 | unsigned short hue; |
---|
| 91 | unsigned short colour; |
---|
| 92 | unsigned short contrast; |
---|
| 93 | unsigned short whiteness; /* Black and white only */ |
---|
| 94 | unsigned short depth; /* Capture depth */ |
---|
| 95 | unsigned short palette; /* Palette in use */ |
---|
| 96 | #define VIDEO_PALETTE_GREY 1 /* Linear greyscale */ |
---|
| 97 | #define VIDEO_PALETTE_HI240 2 /* High 240 cube (BT848) */ |
---|
| 98 | #define VIDEO_PALETTE_RGB565 3 /* 565 16 bit RGB */ |
---|
| 99 | #define VIDEO_PALETTE_RGB24 4 /* 24bit RGB */ |
---|
| 100 | #define VIDEO_PALETTE_RGB32 5 /* 32bit RGB */ |
---|
| 101 | #define VIDEO_PALETTE_RGB555 6 /* 555 15bit RGB */ |
---|
| 102 | #define VIDEO_PALETTE_YUV422 7 /* YUV422 capture */ |
---|
| 103 | #define VIDEO_PALETTE_YUYV 8 |
---|
| 104 | #define VIDEO_PALETTE_UYVY 9 /* The great thing about standards is ... */ |
---|
| 105 | #define VIDEO_PALETTE_YUV420 10 |
---|
| 106 | #define VIDEO_PALETTE_YUV411 11 /* YUV411 capture */ |
---|
| 107 | #define VIDEO_PALETTE_RAW 12 /* RAW capture (BT848) */ |
---|
| 108 | #define VIDEO_PALETTE_YUV422P 13 /* YUV 4:2:2 Planar */ |
---|
| 109 | #define VIDEO_PALETTE_YUV411P 14 /* YUV 4:1:1 Planar */ |
---|
| 110 | #define VIDEO_PALETTE_YUV420P 15 /* YUV 4:2:0 Planar */ |
---|
| 111 | #define VIDEO_PALETTE_YUV410P 16 /* YUV 4:1:0 Planar */ |
---|
| 112 | #define VIDEO_PALETTE_PLANAR 13 /* start of planar entries */ |
---|
| 113 | #define VIDEO_PALETTE_COMPONENT 7 /* start of component entries */ |
---|
| 114 | }; |
---|
| 115 | |
---|
| 116 | struct video_audio |
---|
| 117 | { |
---|
| 118 | int audio; /* Audio channel */ |
---|
| 119 | unsigned short volume; /* If settable */ |
---|
| 120 | unsigned short bass, treble; |
---|
| 121 | unsigned int flags; |
---|
| 122 | #define VIDEO_AUDIO_MUTE 1 |
---|
| 123 | #define VIDEO_AUDIO_MUTABLE 2 |
---|
| 124 | #define VIDEO_AUDIO_VOLUME 4 |
---|
| 125 | #define VIDEO_AUDIO_BASS 8 |
---|
| 126 | #define VIDEO_AUDIO_TREBLE 16 |
---|
| 127 | #define VIDEO_AUDIO_BALANCE 32 |
---|
| 128 | char name[16]; |
---|
| 129 | #define VIDEO_SOUND_MONO 1 |
---|
| 130 | #define VIDEO_SOUND_STEREO 2 |
---|
| 131 | #define VIDEO_SOUND_LANG1 4 |
---|
| 132 | #define VIDEO_SOUND_LANG2 8 |
---|
| 133 | unsigned short mode; |
---|
| 134 | unsigned short balance; /* Stereo balance */ |
---|
| 135 | unsigned short step; /* Step actual volume uses */ |
---|
| 136 | }; |
---|
| 137 | |
---|
| 138 | struct video_clip |
---|
| 139 | { |
---|
| 140 | int x,y; |
---|
| 141 | int width, height; |
---|
| 142 | struct video_clip *next; /* For user use/driver use only */ |
---|
| 143 | }; |
---|
| 144 | |
---|
| 145 | struct video_window |
---|
| 146 | { |
---|
| 147 | unsigned int x,y; /* Position of window */ |
---|
| 148 | unsigned int width,height; /* Its size */ |
---|
| 149 | unsigned int chromakey; |
---|
| 150 | unsigned int flags; |
---|
| 151 | struct video_clip *clips; /* Set only */ |
---|
| 152 | int clipcount; |
---|
| 153 | #define VIDEO_WINDOW_INTERLACE 1 |
---|
| 154 | #define VIDEO_WINDOW_CHROMAKEY 16 /* Overlay by chromakey */ |
---|
| 155 | #define VIDEO_CLIP_BITMAP -1 |
---|
| 156 | /* bitmap is 1024x625, a '1' bit represents a clipped pixel */ |
---|
| 157 | #define VIDEO_CLIPMAP_SIZE (128 * 625) |
---|
| 158 | }; |
---|
| 159 | |
---|
| 160 | struct video_capture |
---|
| 161 | { |
---|
| 162 | unsigned int x,y; /* Offsets into image */ |
---|
| 163 | unsigned int width, height; /* Area to capture */ |
---|
| 164 | unsigned short decimation; /* Decimation divider */ |
---|
| 165 | unsigned short flags; /* Flags for capture */ |
---|
| 166 | #define VIDEO_CAPTURE_ODD 0 /* Temporal */ |
---|
| 167 | #define VIDEO_CAPTURE_EVEN 1 |
---|
| 168 | }; |
---|
| 169 | |
---|
| 170 | struct video_buffer |
---|
| 171 | { |
---|
| 172 | void *base; |
---|
| 173 | int height,width; |
---|
| 174 | int depth; |
---|
| 175 | int bytesperline; |
---|
| 176 | }; |
---|
| 177 | |
---|
| 178 | struct video_mmap |
---|
| 179 | { |
---|
| 180 | unsigned int frame; /* Frame (0 - n) for double buffer */ |
---|
| 181 | int height,width; |
---|
| 182 | unsigned int format; /* should be VIDEO_PALETTE_* */ |
---|
| 183 | }; |
---|
| 184 | |
---|
| 185 | struct video_key |
---|
| 186 | { |
---|
| 187 | unsigned char key[8]; |
---|
| 188 | unsigned int flags; |
---|
| 189 | }; |
---|
| 190 | |
---|
| 191 | |
---|
| 192 | #define VIDEO_MAX_FRAME 32 |
---|
| 193 | |
---|
| 194 | struct video_mbuf |
---|
| 195 | { |
---|
| 196 | int size; /* Total memory to map */ |
---|
| 197 | int frames; /* Frames */ |
---|
| 198 | int offsets[VIDEO_MAX_FRAME]; |
---|
| 199 | }; |
---|
| 200 | |
---|
| 201 | |
---|
| 202 | #define VIDEO_NO_UNIT (-1) |
---|
| 203 | |
---|
| 204 | |
---|
| 205 | struct video_unit |
---|
| 206 | { |
---|
| 207 | int video; /* Video minor */ |
---|
| 208 | int vbi; /* VBI minor */ |
---|
| 209 | int radio; /* Radio minor */ |
---|
| 210 | int audio; /* Audio minor */ |
---|
| 211 | int teletext; /* Teletext minor */ |
---|
| 212 | }; |
---|
| 213 | |
---|
| 214 | struct vbi_format { |
---|
| 215 | unsigned int sampling_rate; /* in Hz */ |
---|
| 216 | unsigned int samples_per_line; |
---|
| 217 | unsigned int sample_format; /* VIDEO_PALETTE_RAW only (1 byte) */ |
---|
| 218 | int start[2]; /* starting line for each frame */ |
---|
| 219 | unsigned int count[2]; /* count of lines for each frame */ |
---|
| 220 | unsigned int flags; |
---|
| 221 | #define VBI_UNSYNC 1 /* can distingues between top/bottom field */ |
---|
| 222 | #define VBI_INTERLACED 2 /* lines are interlaced */ |
---|
| 223 | }; |
---|
| 224 | |
---|
| 225 | /* video_info is biased towards hardware mpeg encode/decode */ |
---|
| 226 | /* but it could apply generically to any hardware compressor/decompressor */ |
---|
| 227 | struct video_info |
---|
| 228 | { |
---|
| 229 | unsigned int frame_count; /* frames output since decode/encode began */ |
---|
| 230 | unsigned int h_size; /* current unscaled horizontal size */ |
---|
| 231 | unsigned int v_size; /* current unscaled veritcal size */ |
---|
| 232 | unsigned int smpte_timecode; /* current SMPTE timecode (for current GOP) */ |
---|
| 233 | unsigned int picture_type; /* current picture type */ |
---|
| 234 | unsigned int temporal_reference; /* current temporal reference */ |
---|
| 235 | unsigned char user_data[256]; /* user data last found in compressed stream */ |
---|
| 236 | /* user_data[0] contains user data flags, user_data[1] has count */ |
---|
| 237 | }; |
---|
| 238 | |
---|
| 239 | /* generic structure for setting playback modes */ |
---|
| 240 | struct video_play_mode |
---|
| 241 | { |
---|
| 242 | int mode; |
---|
| 243 | int p1; |
---|
| 244 | int p2; |
---|
| 245 | }; |
---|
| 246 | |
---|
| 247 | /* for loading microcode / fpga programming */ |
---|
| 248 | struct video_code |
---|
| 249 | { |
---|
| 250 | char loadwhat[16]; /* name or tag of file being passed */ |
---|
| 251 | int datasize; |
---|
| 252 | unsigned char *data; |
---|
| 253 | }; |
---|
| 254 | |
---|
| 255 | #define VIDIOCGCAP _IOR('v',1,struct video_capability) /* Get capabilities */ |
---|
| 256 | #define VIDIOCGCHAN _IOWR('v',2,struct video_channel) /* Get channel info (sources) */ |
---|
| 257 | #define VIDIOCSCHAN _IOW('v',3,struct video_channel) /* Set channel */ |
---|
| 258 | #define VIDIOCGTUNER _IOWR('v',4,struct video_tuner) /* Get tuner abilities */ |
---|
| 259 | #define VIDIOCSTUNER _IOW('v',5,struct video_tuner) /* Tune the tuner for the current channel */ |
---|
| 260 | #define VIDIOCGPICT _IOR('v',6,struct video_picture) /* Get picture properties */ |
---|
| 261 | #define VIDIOCSPICT _IOW('v',7,struct video_picture) /* Set picture properties */ |
---|
| 262 | #define VIDIOCCAPTURE _IOW('v',8,int) /* Start, end capture */ |
---|
| 263 | #define VIDIOCGWIN _IOR('v',9, struct video_window) /* Get the video overlay window */ |
---|
| 264 | #define VIDIOCSWIN _IOW('v',10, struct video_window) /* Set the video overlay window - passes clip list for hardware smarts , chromakey etc */ |
---|
| 265 | #define VIDIOCGFBUF _IOR('v',11, struct video_buffer) /* Get frame buffer */ |
---|
| 266 | #define VIDIOCSFBUF _IOW('v',12, struct video_buffer) /* Set frame buffer - root only */ |
---|
| 267 | #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) */ |
---|
| 268 | #define VIDIOCGFREQ _IOR('v',14, unsigned long) /* Set tuner */ |
---|
| 269 | #define VIDIOCSFREQ _IOW('v',15, unsigned long) /* Set tuner */ |
---|
| 270 | #define VIDIOCGAUDIO _IOR('v',16, struct video_audio) /* Get audio info */ |
---|
| 271 | #define VIDIOCSAUDIO _IOW('v',17, struct video_audio) /* Audio source, mute etc */ |
---|
| 272 | #define VIDIOCSYNC _IOW('v',18, int) /* Sync with mmap grabbing */ |
---|
| 273 | #define VIDIOCMCAPTURE _IOW('v',19, struct video_mmap) /* Grab frames */ |
---|
| 274 | #define VIDIOCGMBUF _IOR('v',20, struct video_mbuf) /* Memory map buffer info */ |
---|
| 275 | #define VIDIOCGUNIT _IOR('v',21, struct video_unit) /* Get attached units */ |
---|
| 276 | #define VIDIOCGCAPTURE _IOR('v',22, struct video_capture) /* Get subcapture */ |
---|
| 277 | #define VIDIOCSCAPTURE _IOW('v',23, struct video_capture) /* Set subcapture */ |
---|
| 278 | #define VIDIOCSPLAYMODE _IOW('v',24, struct video_play_mode) /* Set output video mode/feature */ |
---|
| 279 | #define VIDIOCSWRITEMODE _IOW('v',25, int) /* Set write mode */ |
---|
| 280 | #define VIDIOCGPLAYINFO _IOR('v',26, struct video_info) /* Get current playback info from hardware */ |
---|
| 281 | #define VIDIOCSMICROCODE _IOW('v',27, struct video_code) /* Load microcode into hardware */ |
---|
| 282 | #define VIDIOCGVBIFMT _IOR('v',28, struct vbi_format) /* Get VBI information */ |
---|
| 283 | #define VIDIOCSVBIFMT _IOW('v',29, struct vbi_format) /* Set VBI information */ |
---|
| 284 | |
---|
| 285 | |
---|
| 286 | #define BASE_VIDIOCPRIVATE 192 /* 192-255 are private */ |
---|
| 287 | |
---|
| 288 | /* VIDIOCSWRITEMODE */ |
---|
| 289 | #define VID_WRITE_MPEG_AUD 0 |
---|
| 290 | #define VID_WRITE_MPEG_VID 1 |
---|
| 291 | #define VID_WRITE_OSD 2 |
---|
| 292 | #define VID_WRITE_TTX 3 |
---|
| 293 | #define VID_WRITE_CC 4 |
---|
| 294 | #define VID_WRITE_MJPEG 5 |
---|
| 295 | |
---|
| 296 | /* VIDIOCSPLAYMODE */ |
---|
| 297 | #define VID_PLAY_VID_OUT_MODE 0 |
---|
| 298 | /* p1: = VIDEO_MODE_PAL, VIDEO_MODE_NTSC, etc ... */ |
---|
| 299 | #define VID_PLAY_GENLOCK 1 |
---|
| 300 | /* p1: 0 = OFF, 1 = ON */ |
---|
| 301 | /* p2: GENLOCK FINE DELAY value */ |
---|
| 302 | #define VID_PLAY_NORMAL 2 |
---|
| 303 | #define VID_PLAY_PAUSE 3 |
---|
| 304 | #define VID_PLAY_SINGLE_FRAME 4 |
---|
| 305 | #define VID_PLAY_FAST_FORWARD 5 |
---|
| 306 | #define VID_PLAY_SLOW_MOTION 6 |
---|
| 307 | #define VID_PLAY_IMMEDIATE_NORMAL 7 |
---|
| 308 | #define VID_PLAY_SWITCH_CHANNELS 8 |
---|
| 309 | #define VID_PLAY_FREEZE_FRAME 9 |
---|
| 310 | #define VID_PLAY_STILL_MODE 10 |
---|
| 311 | #define VID_PLAY_MASTER_MODE 11 |
---|
| 312 | /* p1: see below */ |
---|
| 313 | #define VID_PLAY_MASTER_NONE 1 |
---|
| 314 | #define VID_PLAY_MASTER_VIDEO 2 |
---|
| 315 | #define VID_PLAY_MASTER_AUDIO 3 |
---|
| 316 | #define VID_PLAY_ACTIVE_SCANLINES 12 |
---|
| 317 | /* p1 = first active; p2 = last active */ |
---|
| 318 | #define VID_PLAY_RESET 13 |
---|
| 319 | #define VID_PLAY_END_MARK 14 |
---|
| 320 | |
---|
| 321 | |
---|
| 322 | |
---|
| 323 | #define VID_HARDWARE_BT848 1 |
---|
| 324 | #define VID_HARDWARE_QCAM_BW 2 |
---|
| 325 | #define VID_HARDWARE_PMS 3 |
---|
| 326 | #define VID_HARDWARE_QCAM_C 4 |
---|
| 327 | #define VID_HARDWARE_PSEUDO 5 |
---|
| 328 | #define VID_HARDWARE_SAA5249 6 |
---|
| 329 | #define VID_HARDWARE_AZTECH 7 |
---|
| 330 | #define VID_HARDWARE_SF16MI 8 |
---|
| 331 | #define VID_HARDWARE_RTRACK 9 |
---|
| 332 | #define VID_HARDWARE_ZOLTRIX 10 |
---|
| 333 | #define VID_HARDWARE_SAA7146 11 |
---|
| 334 | #define VID_HARDWARE_VIDEUM 12 /* Reserved for Winnov videum */ |
---|
| 335 | #define VID_HARDWARE_RTRACK2 13 |
---|
| 336 | #define VID_HARDWARE_PERMEDIA2 14 /* Reserved for Permedia2 */ |
---|
| 337 | #define VID_HARDWARE_RIVA128 15 /* Reserved for RIVA 128 */ |
---|
| 338 | #define VID_HARDWARE_PLANB 16 /* PowerMac motherboard video-in */ |
---|
| 339 | #define VID_HARDWARE_BROADWAY 17 /* Broadway project */ |
---|
| 340 | #define VID_HARDWARE_GEMTEK 18 |
---|
| 341 | #define VID_HARDWARE_TYPHOON 19 |
---|
| 342 | #define VID_HARDWARE_VINO 20 /* SGI Indy Vino */ |
---|
| 343 | #define VID_HARDWARE_CADET 21 /* Cadet radio */ |
---|
| 344 | #define VID_HARDWARE_TRUST 22 /* Trust FM Radio */ |
---|
| 345 | #define VID_HARDWARE_TERRATEC 23 /* TerraTec ActiveRadio */ |
---|
| 346 | #define VID_HARDWARE_CPIA 24 |
---|
| 347 | #define VID_HARDWARE_ZR36120 25 /* Zoran ZR36120/ZR36125 */ |
---|
| 348 | #define VID_HARDWARE_ZR36067 26 /* Zoran ZR36067/36060 */ |
---|
| 349 | #define VID_HARDWARE_OV511 27 |
---|
| 350 | #define VID_HARDWARE_ZR356700 28 /* Zoran 36700 series */ |
---|
| 351 | #define VID_HARDWARE_W9966 29 |
---|
| 352 | #define VID_HARDWARE_SE401 30 /* SE401 USB webcams */ |
---|
| 353 | #define VID_HARDWARE_PWC 31 /* Philips webcams */ |
---|
| 354 | #define VID_HARDWARE_MEYE 32 /* Sony Vaio MotionEye cameras */ |
---|
| 355 | #define VID_HARDWARE_CPIA2 33 |
---|
| 356 | #define VID_HARDWARE_VICAM 34 |
---|
| 357 | #define VID_HARDWARE_SF16FMR2 35 |
---|
| 358 | #define VID_HARDWARE_W9968CF 36 |
---|
| 359 | #endif /* __LINUX_VIDEODEV_H */ |
---|
| 360 | |
---|
| 361 | /* |
---|
| 362 | * Local variables: |
---|
| 363 | * c-basic-offset: 8 |
---|
| 364 | * End: |
---|
| 365 | */ |
---|