Import 2.1.118
[davej-history.git] / include / linux / videodev.h
blobe089d607ef5f26244a9e76a3ec56dad751bf22bf
1 #ifndef __LINUX_VIDEODEV_H
2 #define __LINUX_VIDEODEV_H
4 #ifdef __KERNEL__
6 #include <linux/poll.h>
8 struct video_device
10 char name[32];
11 int type;
12 int hardware;
14 int (*open)(struct video_device *, int mode);
15 void (*close)(struct video_device *);
16 long (*read)(struct video_device *, char *, unsigned long, int noblock);
17 /* Do we need a write method ? */
18 long (*write)(struct video_device *, const char *, unsigned long, int noblock);
19 unsigned int (*poll)(struct video_device *, struct file *, poll_table *);
20 int (*ioctl)(struct video_device *, unsigned int , void *);
21 int (*mmap)(struct video_device *, const char *, unsigned long);
22 int (*initialize)(struct video_device *);
23 void *priv; /* Used to be 'private' but that upsets C++ */
24 int busy;
25 int minor;
28 extern int videodev_init(void);
29 #define VIDEO_MAJOR 81
30 extern int video_register_device(struct video_device *, int type);
32 #define VFL_TYPE_GRABBER 0
33 #define VFL_TYPE_VBI 1
34 #define VFL_TYPE_RADIO 2
35 #define VFL_TYPE_VTX 3
37 extern void video_unregister_device(struct video_device *);
38 #endif
41 #define VID_TYPE_CAPTURE 1 /* Can capture */
42 #define VID_TYPE_TUNER 2 /* Can tune */
43 #define VID_TYPE_TELETEXT 4 /* Does teletext */
44 #define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */
45 #define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */
46 #define VID_TYPE_CLIPPING 32 /* Can clip */
47 #define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */
48 #define VID_TYPE_SCALES 128 /* Scalable */
49 #define VID_TYPE_MONOCHROME 256 /* Monochrome only */
50 #define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */
52 struct video_capability
54 char name[32];
55 int type;
56 int channels; /* Num channels */
57 int audios; /* Num audio devices */
58 int maxwidth; /* Supported width */
59 int maxheight; /* And height */
60 int minwidth; /* Supported width */
61 int minheight; /* And height */
65 struct video_channel
67 int channel;
68 char name[32];
69 int tuners;
70 __u32 flags;
71 #define VIDEO_VC_TUNER 1 /* Channel has a tuner */
72 #define VIDEO_VC_AUDIO 2 /* Channel has audio */
73 __u16 type;
74 #define VIDEO_TYPE_TV 1
75 #define VIDEO_TYPE_CAMERA 2
76 __u16 norm; /* Norm set by channel */
79 struct video_tuner
81 int tuner;
82 char name[32];
83 ulong rangelow, rangehigh; /* Tuner range */
84 __u32 flags;
85 #define VIDEO_TUNER_PAL 1
86 #define VIDEO_TUNER_NTSC 2
87 #define VIDEO_TUNER_SECAM 4
88 #define VIDEO_TUNER_LOW 8 /* Uses KHz not MHz */
89 #define VIDEO_TUNER_NORM 16 /* Tuner can set norm */
90 #define VIDEO_TUNER_STEREO_ON 128 /* Tuner is seeing stereo */
91 __u16 mode; /* PAL/NTSC/SECAM/OTHER */
92 #define VIDEO_MODE_PAL 0
93 #define VIDEO_MODE_NTSC 1
94 #define VIDEO_MODE_SECAM 2
95 #define VIDEO_MODE_AUTO 3
96 __u16 signal; /* Signal strength 16bit scale */
99 struct video_picture
101 __u16 brightness;
102 __u16 hue;
103 __u16 colour;
104 __u16 contrast;
105 __u16 whiteness; /* Black and white only */
106 __u16 depth; /* Capture depth */
107 __u16 palette; /* Palette in use */
108 #define VIDEO_PALETTE_GREY 1 /* Linear greyscale */
109 #define VIDEO_PALETTE_HI240 2 /* High 240 cube (BT848) */
110 #define VIDEO_PALETTE_RGB565 3 /* 565 16 bit RGB */
111 #define VIDEO_PALETTE_RGB24 4 /* 24bit RGB */
112 #define VIDEO_PALETTE_RGB32 5 /* 32bit RGB */
113 #define VIDEO_PALETTE_RGB555 6 /* 555 15bit RGB */
114 #define VIDEO_PALETTE_YUV422 7 /* YUV422 capture */
115 #define VIDEO_PALETTE_YUYV 8
116 #define VIDEO_PALETTE_UYVY 9 /* The great thing about standards is ... */
117 #define VIDEO_PALETTE_YUV420 10
118 #define VIDEO_PALETTE_YUV411 11 /* YUV411 capture */
119 #define VIDEO_PALETTE_RAW 12 /* RAW capture (BT848) */
120 #define VIDEO_PALETTE_YUV422P 13 /* YUV 4:2:2 Planar */
121 #define VIDEO_PALETTE_YUV411P 14 /* YUV 4:1:1 Planar */
124 struct video_audio
126 int audio; /* Audio channel */
127 __u16 volume; /* If settable */
128 __u16 bass, treble;
129 __u32 flags;
130 #define VIDEO_AUDIO_MUTE 1
131 #define VIDEO_AUDIO_MUTABLE 2
132 #define VIDEO_AUDIO_VOLUME 4
133 #define VIDEO_AUDIO_BASS 8
134 #define VIDEO_AUDIO_TREBLE 16
135 char name[16];
136 #define VIDEO_SOUND_MONO 1
137 #define VIDEO_SOUND_STEREO 2
138 #define VIDEO_SOUND_LANG1 3
139 #define VIDEO_SOUND_LANG2 4
140 __u16 mode;
141 __u16 balance; /* Stereo balance */
142 __u16 step; /* Step actual volume uses */
145 struct video_clip
147 __s32 x,y;
148 __s32 width, height;
149 struct video_clip *next; /* For user use/driver use only */
152 struct video_window
154 __u32 x,y; /* Position of window */
155 __u32 width,height; /* Its size */
156 __u32 chromakey;
157 __u32 flags;
158 struct video_clip *clips; /* Set only */
159 int clipcount;
160 #define VIDEO_WINDOW_INTERLACE 1
163 struct video_capture
165 __u32 x,y; /* Offsets into image */
166 __u32 width, height; /* Area to capture */
167 __u16 decimation; /* Decimation divder */
168 __u16 flags; /* Flags for capture */
169 #define VIDEO_CAPTURE_ODD 0 /* Temporal */
170 #define VIDEO_CAPTURE_EVEN 1
173 struct video_buffer
175 void *base;
176 int height,width;
177 int depth;
178 int bytesperline;
181 struct video_mmap
183 unsigned int frame; /* Frame (0 - n) for double buffer */
184 int height,width;
185 unsigned int format; /* should be VIDEO_PALETTE_* */
188 struct video_key
190 __u8 key[8];
191 __u32 flags;
195 #define VIDEO_MAX_FRAME 32
197 struct video_mbuf
199 int size; /* Total memory to map */
200 int frames; /* Frames */
201 int offsets[VIDEO_MAX_FRAME];
205 #define VIDEO_NO_UNIT (-1)
208 struct video_unit
210 int video; /* Video minor */
211 int vbi; /* VBI minor */
212 int radio; /* Radio minor */
213 int audio; /* Audio minor */
214 int teletext; /* Teletext minor */
217 #define VIDIOCGCAP _IOR('v',1,struct video_capability) /* Get capabilities */
218 #define VIDIOCGCHAN _IOWR('v',2,struct video_channel) /* Get channel info (sources) */
219 #define VIDIOCSCHAN _IOW('v',3,struct video_channel) /* Set channel */
220 #define VIDIOCGTUNER _IOWR('v',4,struct video_tuner) /* Get tuner abilities */
221 #define VIDIOCSTUNER _IOW('v',5,struct video_tuner) /* Tune the tuner for the current channel */
222 #define VIDIOCGPICT _IOR('v',6,struct video_picture) /* Get picture properties */
223 #define VIDIOCSPICT _IOW('v',7,struct video_picture) /* Set picture properties */
224 #define VIDIOCCAPTURE _IOW('v',8,int) /* Start, end capture */
225 #define VIDIOCGWIN _IOR('v',9, struct video_window) /* Set the video overlay window */
226 #define VIDIOCSWIN _IOW('v',10, struct video_window) /* Set the video overlay window - passes clip list for hardware smarts , chromakey etc */
227 #define VIDIOCGFBUF _IOR('v',11, struct video_buffer) /* Get frame buffer */
228 #define VIDIOCSFBUF _IOW('v',12, struct video_buffer) /* Set frame buffer - root only */
229 #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) */
230 #define VIDIOCGFREQ _IOR('v',14, unsigned long) /* Set tuner */
231 #define VIDIOCSFREQ _IOW('v',15, unsigned long) /* Set tuner */
232 #define VIDIOCGAUDIO _IOR('v',16, struct video_audio) /* Get audio info */
233 #define VIDIOCSAUDIO _IOW('v',17, struct video_audio) /* Audio source, mute etc */
234 #define VIDIOCSYNC _IOW('v',18, int) /* Sync with mmap grabbing */
235 #define VIDIOCMCAPTURE _IOW('v',19, struct video_mmap) /* Grab frames */
236 #define VIDIOCGMBUF _IOR('v', 20, struct video_mbuf) /* Memory map buffer info */
237 #define VIDIOCGUNIT _IOR('v', 21, struct video_unit) /* Get attached units */
238 #define VIDIOCGCAPTURE _IOR('v',22, struct video_capture) /* Get frame buffer */
239 #define VIDIOCSCAPTURE _IOW('v',23, struct video_capture) /* Set frame buffer - root only */
241 #define BASE_VIDIOCPRIVATE 192 /* 192-255 are private */
244 #define VID_HARDWARE_BT848 1
245 #define VID_HARDWARE_QCAM_BW 2
246 #define VID_HARDWARE_PMS 3
247 #define VID_HARDWARE_QCAM_C 4
248 #define VID_HARDWARE_PSEUDO 5
249 #define VID_HARDWARE_SAA5249 6
250 #define VID_HARDWARE_AZTECH 7
251 #define VID_HARDWARE_SF16MI 8
252 #define VID_HARDWARE_RTRACK 9
253 #define VID_HARDWARE_ZOLTRIX 10
254 #define VID_HARDWARE_SAA7146 11
255 #define VID_HARDWARE_VIDEUM 12 /* Reserved for Winnov videum */
256 #define VID_HARDWARE_RTRACK2 13
257 #define VID_HARDWARE_PERMEDIA2 14 /* Reserved for Permedia2 */
258 #define VID_HARDWARE_RIVA128 15 /* Reserved for RIVA 128 */
261 * Initialiser list
264 struct video_init
266 char *name;
267 int (*init)(struct video_init *);
270 #endif