1
2
3
4
5
6
7
8
9
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#if defined(__MIN_V4L1) && defined (__KERNEL__)
20
21
22
23
24
25
26struct video_mbuf
27{
28 int size;
29 int frames;
30 int offsets[VIDEO_MAX_FRAME];
31};
32
33#define VIDIOCGMBUF _IOR('v',20, struct video_mbuf)
34
35#else
36#if defined(CONFIG_VIDEO_V4L1_COMPAT) || !defined (__KERNEL__)
37
38#define VID_TYPE_CAPTURE 1
39#define VID_TYPE_TUNER 2
40#define VID_TYPE_TELETEXT 4
41#define VID_TYPE_OVERLAY 8
42#define VID_TYPE_CHROMAKEY 16
43#define VID_TYPE_CLIPPING 32
44#define VID_TYPE_FRAMERAM 64
45#define VID_TYPE_SCALES 128
46#define VID_TYPE_MONOCHROME 256
47#define VID_TYPE_SUBCAPTURE 512
48#define VID_TYPE_MPEG_DECODER 1024
49#define VID_TYPE_MPEG_ENCODER 2048
50#define VID_TYPE_MJPEG_DECODER 4096
51#define VID_TYPE_MJPEG_ENCODER 8192
52
53struct video_capability
54{
55 char name[32];
56 int type;
57 int channels;
58 int audios;
59 int maxwidth;
60 int maxheight;
61 int minwidth;
62 int minheight;
63};
64
65
66struct video_channel
67{
68 int channel;
69 char name[32];
70 int tuners;
71 __u32 flags;
72#define VIDEO_VC_TUNER 1
73#define VIDEO_VC_AUDIO 2
74 __u16 type;
75#define VIDEO_TYPE_TV 1
76#define VIDEO_TYPE_CAMERA 2
77 __u16 norm;
78};
79
80struct video_tuner
81{
82 int tuner;
83 char name[32];
84 unsigned long rangelow, rangehigh;
85 __u32 flags;
86#define VIDEO_TUNER_PAL 1
87#define VIDEO_TUNER_NTSC 2
88#define VIDEO_TUNER_SECAM 4
89#define VIDEO_TUNER_LOW 8
90#define VIDEO_TUNER_NORM 16
91#define VIDEO_TUNER_STEREO_ON 128
92#define VIDEO_TUNER_RDS_ON 256
93#define VIDEO_TUNER_MBS_ON 512
94 __u16 mode;
95#define VIDEO_MODE_PAL 0
96#define VIDEO_MODE_NTSC 1
97#define VIDEO_MODE_SECAM 2
98#define VIDEO_MODE_AUTO 3
99 __u16 signal;
100};
101
102struct video_picture
103{
104 __u16 brightness;
105 __u16 hue;
106 __u16 colour;
107 __u16 contrast;
108 __u16 whiteness;
109 __u16 depth;
110 __u16 palette;
111#define VIDEO_PALETTE_GREY 1
112#define VIDEO_PALETTE_HI240 2
113#define VIDEO_PALETTE_RGB565 3
114#define VIDEO_PALETTE_RGB24 4
115#define VIDEO_PALETTE_RGB32 5
116#define VIDEO_PALETTE_RGB555 6
117#define VIDEO_PALETTE_YUV422 7
118#define VIDEO_PALETTE_YUYV 8
119#define VIDEO_PALETTE_UYVY 9
120#define VIDEO_PALETTE_YUV420 10
121#define VIDEO_PALETTE_YUV411 11
122#define VIDEO_PALETTE_RAW 12
123#define VIDEO_PALETTE_YUV422P 13
124#define VIDEO_PALETTE_YUV411P 14
125#define VIDEO_PALETTE_YUV420P 15
126#define VIDEO_PALETTE_YUV410P 16
127#define VIDEO_PALETTE_PLANAR 13
128#define VIDEO_PALETTE_COMPONENT 7
129};
130
131struct video_audio
132{
133 int audio;
134 __u16 volume;
135 __u16 bass, treble;
136 __u32 flags;
137#define VIDEO_AUDIO_MUTE 1
138#define VIDEO_AUDIO_MUTABLE 2
139#define VIDEO_AUDIO_VOLUME 4
140#define VIDEO_AUDIO_BASS 8
141#define VIDEO_AUDIO_TREBLE 16
142#define VIDEO_AUDIO_BALANCE 32
143 char name[16];
144#define VIDEO_SOUND_MONO 1
145#define VIDEO_SOUND_STEREO 2
146#define VIDEO_SOUND_LANG1 4
147#define VIDEO_SOUND_LANG2 8
148 __u16 mode;
149 __u16 balance;
150 __u16 step;
151};
152
153struct video_clip
154{
155 __s32 x,y;
156 __s32 width, height;
157 struct video_clip *next;
158};
159
160struct video_window
161{
162 __u32 x,y;
163 __u32 width,height;
164 __u32 chromakey;
165 __u32 flags;
166 struct video_clip __user *clips;
167 int clipcount;
168#define VIDEO_WINDOW_INTERLACE 1
169#define VIDEO_WINDOW_CHROMAKEY 16
170#define VIDEO_CLIP_BITMAP -1
171
172#define VIDEO_CLIPMAP_SIZE (128 * 625)
173};
174
175struct video_capture
176{
177 __u32 x,y;
178 __u32 width, height;
179 __u16 decimation;
180 __u16 flags;
181#define VIDEO_CAPTURE_ODD 0
182#define VIDEO_CAPTURE_EVEN 1
183};
184
185struct video_buffer
186{
187 void *base;
188 int height,width;
189 int depth;
190 int bytesperline;
191};
192
193struct video_mmap
194{
195 unsigned int frame;
196 int height,width;
197 unsigned int format;
198};
199
200struct video_key
201{
202 __u8 key[8];
203 __u32 flags;
204};
205
206struct video_mbuf
207{
208 int size;
209 int frames;
210 int offsets[VIDEO_MAX_FRAME];
211};
212
213#define VIDEO_NO_UNIT (-1)
214
215struct video_unit
216{
217 int video;
218 int vbi;
219 int radio;
220 int audio;
221 int teletext;
222};
223
224struct vbi_format {
225 __u32 sampling_rate;
226 __u32 samples_per_line;
227 __u32 sample_format;
228 __s32 start[2];
229 __u32 count[2];
230 __u32 flags;
231#define VBI_UNSYNC 1
232#define VBI_INTERLACED 2
233};
234
235
236
237struct video_info
238{
239 __u32 frame_count;
240 __u32 h_size;
241 __u32 v_size;
242 __u32 smpte_timecode;
243 __u32 picture_type;
244 __u32 temporal_reference;
245 __u8 user_data[256];
246
247};
248
249
250struct video_play_mode
251{
252 int mode;
253 int p1;
254 int p2;
255};
256
257
258struct video_code
259{
260 char loadwhat[16];
261 int datasize;
262 __u8 *data;
263};
264
265#define VIDIOCGCAP _IOR('v',1,struct video_capability)
266#define VIDIOCGCHAN _IOWR('v',2,struct video_channel)
267#define VIDIOCSCHAN _IOW('v',3,struct video_channel)
268#define VIDIOCGTUNER _IOWR('v',4,struct video_tuner)
269#define VIDIOCSTUNER _IOW('v',5,struct video_tuner)
270#define VIDIOCGPICT _IOR('v',6,struct video_picture)
271#define VIDIOCSPICT _IOW('v',7,struct video_picture)
272#define VIDIOCCAPTURE _IOW('v',8,int)
273#define VIDIOCGWIN _IOR('v',9, struct video_window)
274#define VIDIOCSWIN _IOW('v',10, struct video_window)
275#define VIDIOCGFBUF _IOR('v',11, struct video_buffer)
276#define VIDIOCSFBUF _IOW('v',12, struct video_buffer)
277#define VIDIOCKEY _IOR('v',13, struct video_key)
278#define VIDIOCGFREQ _IOR('v',14, unsigned long)
279#define VIDIOCSFREQ _IOW('v',15, unsigned long)
280#define VIDIOCGAUDIO _IOR('v',16, struct video_audio)
281#define VIDIOCSAUDIO _IOW('v',17, struct video_audio)
282#define VIDIOCSYNC _IOW('v',18, int)
283#define VIDIOCMCAPTURE _IOW('v',19, struct video_mmap)
284#define VIDIOCGMBUF _IOR('v',20, struct video_mbuf)
285#define VIDIOCGUNIT _IOR('v',21, struct video_unit)
286#define VIDIOCGCAPTURE _IOR('v',22, struct video_capture)
287#define VIDIOCSCAPTURE _IOW('v',23, struct video_capture)
288#define VIDIOCSPLAYMODE _IOW('v',24, struct video_play_mode)
289#define VIDIOCSWRITEMODE _IOW('v',25, int)
290#define VIDIOCGPLAYINFO _IOR('v',26, struct video_info)
291#define VIDIOCSMICROCODE _IOW('v',27, struct video_code)
292#define VIDIOCGVBIFMT _IOR('v',28, struct vbi_format)
293#define VIDIOCSVBIFMT _IOW('v',29, struct vbi_format)
294
295
296#define BASE_VIDIOCPRIVATE 192
297
298
299#define VID_WRITE_MPEG_AUD 0
300#define VID_WRITE_MPEG_VID 1
301#define VID_WRITE_OSD 2
302#define VID_WRITE_TTX 3
303#define VID_WRITE_CC 4
304#define VID_WRITE_MJPEG 5
305
306
307#define VID_PLAY_VID_OUT_MODE 0
308
309#define VID_PLAY_GENLOCK 1
310
311
312#define VID_PLAY_NORMAL 2
313#define VID_PLAY_PAUSE 3
314#define VID_PLAY_SINGLE_FRAME 4
315#define VID_PLAY_FAST_FORWARD 5
316#define VID_PLAY_SLOW_MOTION 6
317#define VID_PLAY_IMMEDIATE_NORMAL 7
318#define VID_PLAY_SWITCH_CHANNELS 8
319#define VID_PLAY_FREEZE_FRAME 9
320#define VID_PLAY_STILL_MODE 10
321#define VID_PLAY_MASTER_MODE 11
322
323#define VID_PLAY_MASTER_NONE 1
324#define VID_PLAY_MASTER_VIDEO 2
325#define VID_PLAY_MASTER_AUDIO 3
326#define VID_PLAY_ACTIVE_SCANLINES 12
327
328#define VID_PLAY_RESET 13
329#define VID_PLAY_END_MARK 14
330
331#endif
332#endif
333
334#endif
335
336
337
338
339
340
341