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/types.h>
16
#include <linux/ioctl.h>
17
#include <linux/videodev2.h>
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 */
34
struct video_capability
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 */
53
#define VIDEO_VC_TUNER 1 /* Channel has a tuner */
54
#define VIDEO_VC_AUDIO 2 /* Channel has audio */
56
#define VIDEO_TYPE_TV 1
57
#define VIDEO_TYPE_CAMERA 2
58
__u16 norm; /* Norm set by channel */
65
unsigned long rangelow, rangehigh; /* Tuner range */
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 */
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 */
114
int audio; /* Audio channel */
115
__u16 volume; /* If settable */
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
125
#define VIDEO_SOUND_MONO 1
126
#define VIDEO_SOUND_STEREO 2
127
#define VIDEO_SOUND_LANG1 4
128
#define VIDEO_SOUND_LANG2 8
130
__u16 balance; /* Stereo balance */
131
__u16 step; /* Step actual volume uses */
138
struct video_clip *next; /* For user use/driver use only */
143
__u32 x,y; /* Position of window */
144
__u32 width,height; /* Its size */
147
struct video_clip __user *clips; /* Set only */
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)
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
176
unsigned int frame; /* Frame (0 - n) for double buffer */
178
unsigned int format; /* should be VIDEO_PALETTE_* */
189
int size; /* Total memory to map */
190
int frames; /* Frames */
191
int offsets[VIDEO_MAX_FRAME];
194
#define VIDEO_NO_UNIT (-1)
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 */
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 */
212
#define VBI_UNSYNC 1 /* can distingues between top/bottom field */
213
#define VBI_INTERLACED 2 /* lines are interlaced */
216
/* video_info is biased towards hardware mpeg encode/decode */
217
/* but it could apply generically to any hardware compressor/decompressor */
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 */
230
/* generic structure for setting playback modes */
231
struct video_play_mode
238
/* for loading microcode / fpga programming */
241
char loadwhat[16]; /* name or tag of file being passed */
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 */
277
#define BASE_VIDIOCPRIVATE 192 /* 192-255 are private */
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
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
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
312
#endif /* __LINUX_VIDEODEV_H */