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