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