Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[wrt350n-kernel.git] / include / linux / videodev.h
blob23957f5409476d2c9a6f495d94004825617f1ced
1 /*
2 * Video for Linux version 1 - OBSOLETE
4 * Header file for v4l1 drivers and applications, for
5 * Linux kernels 2.2.x or 2.4.x.
7 * Provides header for legacy drivers and applications
9 * See http://linuxtv.org for more info
12 #ifndef __LINUX_VIDEODEV_H
13 #define __LINUX_VIDEODEV_H
15 <<<<<<< HEAD:include/linux/videodev.h
16 =======
17 #include <linux/ioctl.h>
18 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a:include/linux/videodev.h
19 #include <linux/videodev2.h>
21 #if defined(CONFIG_VIDEO_V4L1_COMPAT) || !defined (__KERNEL__)
23 struct video_capability
25 char name[32];
26 int type;
27 int channels; /* Num channels */
28 int audios; /* Num audio devices */
29 int maxwidth; /* Supported width */
30 int maxheight; /* And height */
31 int minwidth; /* Supported width */
32 int minheight; /* And height */
36 struct video_channel
38 int channel;
39 char name[32];
40 int tuners;
41 __u32 flags;
42 #define VIDEO_VC_TUNER 1 /* Channel has a tuner */
43 #define VIDEO_VC_AUDIO 2 /* Channel has audio */
44 __u16 type;
45 #define VIDEO_TYPE_TV 1
46 #define VIDEO_TYPE_CAMERA 2
47 __u16 norm; /* Norm set by channel */
50 struct video_tuner
52 int tuner;
53 char name[32];
54 unsigned long rangelow, rangehigh; /* Tuner range */
55 __u32 flags;
56 #define VIDEO_TUNER_PAL 1
57 #define VIDEO_TUNER_NTSC 2
58 #define VIDEO_TUNER_SECAM 4
59 #define VIDEO_TUNER_LOW 8 /* Uses KHz not MHz */
60 #define VIDEO_TUNER_NORM 16 /* Tuner can set norm */
61 #define VIDEO_TUNER_STEREO_ON 128 /* Tuner is seeing stereo */
62 #define VIDEO_TUNER_RDS_ON 256 /* Tuner is seeing an RDS datastream */
63 #define VIDEO_TUNER_MBS_ON 512 /* Tuner is seeing an MBS datastream */
64 __u16 mode; /* PAL/NTSC/SECAM/OTHER */
65 #define VIDEO_MODE_PAL 0
66 #define VIDEO_MODE_NTSC 1
67 #define VIDEO_MODE_SECAM 2
68 #define VIDEO_MODE_AUTO 3
69 __u16 signal; /* Signal strength 16bit scale */
72 struct video_picture
74 __u16 brightness;
75 __u16 hue;
76 __u16 colour;
77 __u16 contrast;
78 __u16 whiteness; /* Black and white only */
79 __u16 depth; /* Capture depth */
80 __u16 palette; /* Palette in use */
81 #define VIDEO_PALETTE_GREY 1 /* Linear greyscale */
82 #define VIDEO_PALETTE_HI240 2 /* High 240 cube (BT848) */
83 #define VIDEO_PALETTE_RGB565 3 /* 565 16 bit RGB */
84 #define VIDEO_PALETTE_RGB24 4 /* 24bit RGB */
85 #define VIDEO_PALETTE_RGB32 5 /* 32bit RGB */
86 #define VIDEO_PALETTE_RGB555 6 /* 555 15bit RGB */
87 #define VIDEO_PALETTE_YUV422 7 /* YUV422 capture */
88 #define VIDEO_PALETTE_YUYV 8
89 #define VIDEO_PALETTE_UYVY 9 /* The great thing about standards is ... */
90 #define VIDEO_PALETTE_YUV420 10
91 #define VIDEO_PALETTE_YUV411 11 /* YUV411 capture */
92 #define VIDEO_PALETTE_RAW 12 /* RAW capture (BT848) */
93 #define VIDEO_PALETTE_YUV422P 13 /* YUV 4:2:2 Planar */
94 #define VIDEO_PALETTE_YUV411P 14 /* YUV 4:1:1 Planar */
95 #define VIDEO_PALETTE_YUV420P 15 /* YUV 4:2:0 Planar */
96 #define VIDEO_PALETTE_YUV410P 16 /* YUV 4:1:0 Planar */
97 #define VIDEO_PALETTE_PLANAR 13 /* start of planar entries */
98 #define VIDEO_PALETTE_COMPONENT 7 /* start of component entries */
101 struct video_audio
103 int audio; /* Audio channel */
104 __u16 volume; /* If settable */
105 __u16 bass, treble;
106 __u32 flags;
107 #define VIDEO_AUDIO_MUTE 1
108 #define VIDEO_AUDIO_MUTABLE 2
109 #define VIDEO_AUDIO_VOLUME 4
110 #define VIDEO_AUDIO_BASS 8
111 #define VIDEO_AUDIO_TREBLE 16
112 #define VIDEO_AUDIO_BALANCE 32
113 char name[16];
114 #define VIDEO_SOUND_MONO 1
115 #define VIDEO_SOUND_STEREO 2
116 #define VIDEO_SOUND_LANG1 4
117 #define VIDEO_SOUND_LANG2 8
118 __u16 mode;
119 __u16 balance; /* Stereo balance */
120 __u16 step; /* Step actual volume uses */
123 struct video_clip
125 __s32 x,y;
126 __s32 width, height;
127 struct video_clip *next; /* For user use/driver use only */
130 struct video_window
132 __u32 x,y; /* Position of window */
133 __u32 width,height; /* Its size */
134 __u32 chromakey;
135 __u32 flags;
136 struct video_clip __user *clips; /* Set only */
137 int clipcount;
138 #define VIDEO_WINDOW_INTERLACE 1
139 #define VIDEO_WINDOW_CHROMAKEY 16 /* Overlay by chromakey */
140 #define VIDEO_CLIP_BITMAP -1
141 /* bitmap is 1024x625, a '1' bit represents a clipped pixel */
142 #define VIDEO_CLIPMAP_SIZE (128 * 625)
145 struct video_capture
147 __u32 x,y; /* Offsets into image */
148 __u32 width, height; /* Area to capture */
149 __u16 decimation; /* Decimation divider */
150 __u16 flags; /* Flags for capture */
151 #define VIDEO_CAPTURE_ODD 0 /* Temporal */
152 #define VIDEO_CAPTURE_EVEN 1
155 struct video_buffer
157 void *base;
158 int height,width;
159 int depth;
160 int bytesperline;
163 struct video_mmap
165 unsigned int frame; /* Frame (0 - n) for double buffer */
166 int height,width;
167 unsigned int format; /* should be VIDEO_PALETTE_* */
170 struct video_key
172 __u8 key[8];
173 __u32 flags;
176 struct video_mbuf
178 int size; /* Total memory to map */
179 int frames; /* Frames */
180 int offsets[VIDEO_MAX_FRAME];
183 #define VIDEO_NO_UNIT (-1)
185 struct video_unit
187 int video; /* Video minor */
188 int vbi; /* VBI minor */
189 int radio; /* Radio minor */
190 int audio; /* Audio minor */
191 int teletext; /* Teletext minor */
194 struct vbi_format {
195 __u32 sampling_rate; /* in Hz */
196 __u32 samples_per_line;
197 __u32 sample_format; /* VIDEO_PALETTE_RAW only (1 byte) */
198 __s32 start[2]; /* starting line for each frame */
199 __u32 count[2]; /* count of lines for each frame */
200 __u32 flags;
201 #define VBI_UNSYNC 1 /* can distingues between top/bottom field */
202 #define VBI_INTERLACED 2 /* lines are interlaced */
205 /* video_info is biased towards hardware mpeg encode/decode */
206 /* but it could apply generically to any hardware compressor/decompressor */
207 struct video_info
209 __u32 frame_count; /* frames output since decode/encode began */
210 __u32 h_size; /* current unscaled horizontal size */
211 __u32 v_size; /* current unscaled veritcal size */
212 __u32 smpte_timecode; /* current SMPTE timecode (for current GOP) */
213 __u32 picture_type; /* current picture type */
214 __u32 temporal_reference; /* current temporal reference */
215 __u8 user_data[256]; /* user data last found in compressed stream */
216 /* user_data[0] contains user data flags, user_data[1] has count */
219 /* generic structure for setting playback modes */
220 struct video_play_mode
222 int mode;
223 int p1;
224 int p2;
227 /* for loading microcode / fpga programming */
228 struct video_code
230 char loadwhat[16]; /* name or tag of file being passed */
231 int datasize;
232 __u8 *data;
235 #define VIDIOCGCAP _IOR('v',1,struct video_capability) /* Get capabilities */
236 #define VIDIOCGCHAN _IOWR('v',2,struct video_channel) /* Get channel info (sources) */
237 #define VIDIOCSCHAN _IOW('v',3,struct video_channel) /* Set channel */
238 #define VIDIOCGTUNER _IOWR('v',4,struct video_tuner) /* Get tuner abilities */
239 #define VIDIOCSTUNER _IOW('v',5,struct video_tuner) /* Tune the tuner for the current channel */
240 #define VIDIOCGPICT _IOR('v',6,struct video_picture) /* Get picture properties */
241 #define VIDIOCSPICT _IOW('v',7,struct video_picture) /* Set picture properties */
242 #define VIDIOCCAPTURE _IOW('v',8,int) /* Start, end capture */
243 #define VIDIOCGWIN _IOR('v',9, struct video_window) /* Get the video overlay window */
244 #define VIDIOCSWIN _IOW('v',10, struct video_window) /* Set the video overlay window - passes clip list for hardware smarts , chromakey etc */
245 #define VIDIOCGFBUF _IOR('v',11, struct video_buffer) /* Get frame buffer */
246 #define VIDIOCSFBUF _IOW('v',12, struct video_buffer) /* Set frame buffer - root only */
247 #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) */
248 #define VIDIOCGFREQ _IOR('v',14, unsigned long) /* Set tuner */
249 #define VIDIOCSFREQ _IOW('v',15, unsigned long) /* Set tuner */
250 #define VIDIOCGAUDIO _IOR('v',16, struct video_audio) /* Get audio info */
251 #define VIDIOCSAUDIO _IOW('v',17, struct video_audio) /* Audio source, mute etc */
252 #define VIDIOCSYNC _IOW('v',18, int) /* Sync with mmap grabbing */
253 #define VIDIOCMCAPTURE _IOW('v',19, struct video_mmap) /* Grab frames */
254 #define VIDIOCGMBUF _IOR('v',20, struct video_mbuf) /* Memory map buffer info */
255 #define VIDIOCGUNIT _IOR('v',21, struct video_unit) /* Get attached units */
256 #define VIDIOCGCAPTURE _IOR('v',22, struct video_capture) /* Get subcapture */
257 #define VIDIOCSCAPTURE _IOW('v',23, struct video_capture) /* Set subcapture */
258 #define VIDIOCSPLAYMODE _IOW('v',24, struct video_play_mode) /* Set output video mode/feature */
259 #define VIDIOCSWRITEMODE _IOW('v',25, int) /* Set write mode */
260 #define VIDIOCGPLAYINFO _IOR('v',26, struct video_info) /* Get current playback info from hardware */
261 #define VIDIOCSMICROCODE _IOW('v',27, struct video_code) /* Load microcode into hardware */
262 #define VIDIOCGVBIFMT _IOR('v',28, struct vbi_format) /* Get VBI information */
263 #define VIDIOCSVBIFMT _IOW('v',29, struct vbi_format) /* Set VBI information */
266 #define BASE_VIDIOCPRIVATE 192 /* 192-255 are private */
268 /* VIDIOCSWRITEMODE */
269 #define VID_WRITE_MPEG_AUD 0
270 #define VID_WRITE_MPEG_VID 1
271 #define VID_WRITE_OSD 2
272 #define VID_WRITE_TTX 3
273 #define VID_WRITE_CC 4
274 #define VID_WRITE_MJPEG 5
276 /* VIDIOCSPLAYMODE */
277 #define VID_PLAY_VID_OUT_MODE 0
278 /* p1: = VIDEO_MODE_PAL, VIDEO_MODE_NTSC, etc ... */
279 #define VID_PLAY_GENLOCK 1
280 /* p1: 0 = OFF, 1 = ON */
281 /* p2: GENLOCK FINE DELAY value */
282 #define VID_PLAY_NORMAL 2
283 #define VID_PLAY_PAUSE 3
284 #define VID_PLAY_SINGLE_FRAME 4
285 #define VID_PLAY_FAST_FORWARD 5
286 #define VID_PLAY_SLOW_MOTION 6
287 #define VID_PLAY_IMMEDIATE_NORMAL 7
288 #define VID_PLAY_SWITCH_CHANNELS 8
289 #define VID_PLAY_FREEZE_FRAME 9
290 #define VID_PLAY_STILL_MODE 10
291 #define VID_PLAY_MASTER_MODE 11
292 /* p1: see below */
293 #define VID_PLAY_MASTER_NONE 1
294 #define VID_PLAY_MASTER_VIDEO 2
295 #define VID_PLAY_MASTER_AUDIO 3
296 #define VID_PLAY_ACTIVE_SCANLINES 12
297 /* p1 = first active; p2 = last active */
298 #define VID_PLAY_RESET 13
299 #define VID_PLAY_END_MARK 14
301 #endif /* CONFIG_VIDEO_V4L1_COMPAT */
303 #endif /* __LINUX_VIDEODEV_H */
306 * Local variables:
307 * c-basic-offset: 8
308 * End: