ps3fb: Update for firmware 2.10
[pv_ops_mirror.git] / include / linux / videodev.h
blob52e3d5fd5be45438193873ff938c5871b1890f39
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 #include <linux/videodev2.h>
17 #if defined(CONFIG_VIDEO_V4L1_COMPAT) || !defined (__KERNEL__)
19 struct video_capability
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 */
32 struct video_channel
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 */
46 struct video_tuner
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 */
68 struct video_picture
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 */
97 struct video_audio
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
114 __u16 mode;
115 __u16 balance; /* Stereo balance */
116 __u16 step; /* Step actual volume uses */
119 struct video_clip
121 __s32 x,y;
122 __s32 width, height;
123 struct video_clip *next; /* For user use/driver use only */
126 struct video_window
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)
141 struct video_capture
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
151 struct video_buffer
153 void *base;
154 int height,width;
155 int depth;
156 int bytesperline;
159 struct video_mmap
161 unsigned int frame; /* Frame (0 - n) for double buffer */
162 int height,width;
163 unsigned int format; /* should be VIDEO_PALETTE_* */
166 struct video_key
168 __u8 key[8];
169 __u32 flags;
172 struct video_mbuf
174 int size; /* Total memory to map */
175 int frames; /* Frames */
176 int offsets[VIDEO_MAX_FRAME];
179 #define VIDEO_NO_UNIT (-1)
181 struct video_unit
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 */
190 struct 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 */
201 /* video_info is biased towards hardware mpeg encode/decode */
202 /* but it could apply generically to any hardware compressor/decompressor */
203 struct video_info
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 */
215 /* generic structure for setting playback modes */
216 struct video_play_mode
218 int mode;
219 int p1;
220 int p2;
223 /* for loading microcode / fpga programming */
224 struct video_code
226 char loadwhat[16]; /* name or tag of file being passed */
227 int datasize;
228 __u8 *data;
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 */
262 #define BASE_VIDIOCPRIVATE 192 /* 192-255 are private */
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
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
297 #endif /* CONFIG_VIDEO_V4L1_COMPAT */
299 #endif /* __LINUX_VIDEODEV_H */
302 * Local variables:
303 * c-basic-offset: 8
304 * End: