1 /* This header is extracted from linux/videodev.h, approximately
2 version 2.6.0. We can't use linux/videodev.h directly because
3 it indirectly defines struct timespec, which is also defined
4 by the standard C library headers. Argh. -blp */
7 #define FM_VIDEODEV_H 1
11 #define VID_TYPE_CAPTURE 1 /* Can capture */
12 #define VID_TYPE_TUNER 2 /* Can tune */
13 #define VID_TYPE_TELETEXT 4 /* Does teletext */
14 #define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */
15 #define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */
16 #define VID_TYPE_CLIPPING 32 /* Can clip */
17 #define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */
18 #define VID_TYPE_SCALES 128 /* Scalable */
19 #define VID_TYPE_MONOCHROME 256 /* Monochrome only */
20 #define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */
21 #define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */
22 #define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */
23 #define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */
24 #define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */
26 struct video_capability
30 int channels
; /* Num channels */
31 int audios
; /* Num audio devices */
32 int maxwidth
; /* Supported width */
33 int maxheight
; /* And height */
34 int minwidth
; /* Supported width */
35 int minheight
; /* And height */
45 #define VIDEO_VC_TUNER 1 /* Channel has a tuner */
46 #define VIDEO_VC_AUDIO 2 /* Channel has audio */
48 #define VIDEO_TYPE_TV 1
49 #define VIDEO_TYPE_CAMERA 2
50 uint16_t norm
; /* Norm set by channel */
57 unsigned long rangelow
, rangehigh
; /* Tuner range */
59 #define VIDEO_TUNER_PAL 1
60 #define VIDEO_TUNER_NTSC 2
61 #define VIDEO_TUNER_SECAM 4
62 #define VIDEO_TUNER_LOW 8 /* Uses KHz not MHz */
63 #define VIDEO_TUNER_NORM 16 /* Tuner can set norm */
64 #define VIDEO_TUNER_STEREO_ON 128 /* Tuner is seeing stereo */
65 #define VIDEO_TUNER_RDS_ON 256 /* Tuner is seeing an RDS datastream */
66 #define VIDEO_TUNER_MBS_ON 512 /* Tuner is seeing an MBS datastream */
67 uint16_t mode
; /* PAL/NTSC/SECAM/OTHER */
68 #define VIDEO_MODE_PAL 0
69 #define VIDEO_MODE_NTSC 1
70 #define VIDEO_MODE_SECAM 2
71 #define VIDEO_MODE_AUTO 3
72 uint16_t signal
; /* Signal strength 16bit scale */
81 uint16_t whiteness
; /* Black and white only */
82 uint16_t depth
; /* Capture depth */
83 uint16_t palette
; /* Palette in use */
84 #define VIDEO_PALETTE_GREY 1 /* Linear greyscale */
85 #define VIDEO_PALETTE_HI240 2 /* High 240 cube (BT848) */
86 #define VIDEO_PALETTE_RGB565 3 /* 565 16 bit RGB */
87 #define VIDEO_PALETTE_RGB24 4 /* 24bit RGB */
88 #define VIDEO_PALETTE_RGB32 5 /* 32bit RGB */
89 #define VIDEO_PALETTE_RGB555 6 /* 555 15bit RGB */
90 #define VIDEO_PALETTE_YUV422 7 /* YUV422 capture */
91 #define VIDEO_PALETTE_YUYV 8
92 #define VIDEO_PALETTE_UYVY 9 /* The great thing about standards is ... */
93 #define VIDEO_PALETTE_YUV420 10
94 #define VIDEO_PALETTE_YUV411 11 /* YUV411 capture */
95 #define VIDEO_PALETTE_RAW 12 /* RAW capture (BT848) */
96 #define VIDEO_PALETTE_YUV422P 13 /* YUV 4:2:2 Planar */
97 #define VIDEO_PALETTE_YUV411P 14 /* YUV 4:1:1 Planar */
98 #define VIDEO_PALETTE_YUV420P 15 /* YUV 4:2:0 Planar */
99 #define VIDEO_PALETTE_YUV410P 16 /* YUV 4:1:0 Planar */
100 #define VIDEO_PALETTE_PLANAR 13 /* start of planar entries */
101 #define VIDEO_PALETTE_COMPONENT 7 /* start of component entries */
106 int audio
; /* Audio channel */
107 uint16_t volume
; /* If settable */
108 uint16_t bass
, treble
;
110 #define VIDEO_AUDIO_MUTE 1
111 #define VIDEO_AUDIO_MUTABLE 2
112 #define VIDEO_AUDIO_VOLUME 4
113 #define VIDEO_AUDIO_BASS 8
114 #define VIDEO_AUDIO_TREBLE 16
115 #define VIDEO_AUDIO_BALANCE 32
117 #define VIDEO_SOUND_MONO 1
118 #define VIDEO_SOUND_STEREO 2
119 #define VIDEO_SOUND_LANG1 4
120 #define VIDEO_SOUND_LANG2 8
122 uint16_t balance
; /* Stereo balance */
123 uint16_t step
; /* Step actual volume uses */
129 int32_t width
, height
;
130 struct video_clip
*next
; /* For user use/driver use only */
135 uint32_t x
,y
; /* Position of window */
136 uint32_t width
,height
; /* Its size */
139 struct video_clip
*clips
; /* Set only */
141 #define VIDEO_WINDOW_INTERLACE 1
142 #define VIDEO_WINDOW_CHROMAKEY 16 /* Overlay by chromakey */
143 #define VIDEO_CLIP_BITMAP -1
144 /* bitmap is 1024x625, a '1' bit represents a clipped pixel */
145 #define VIDEO_CLIPMAP_SIZE (128 * 625)
150 uint32_t x
,y
; /* Offsets into image */
151 uint32_t width
, height
; /* Area to capture */
152 uint16_t decimation
; /* Decimation divider */
153 uint16_t flags
; /* Flags for capture */
154 #define VIDEO_CAPTURE_ODD 0 /* Temporal */
155 #define VIDEO_CAPTURE_EVEN 1
168 unsigned int frame
; /* Frame (0 - n) for double buffer */
170 unsigned int format
; /* should be VIDEO_PALETTE_* */
180 #define VIDEO_MAX_FRAME 32
184 int size
; /* Total memory to map */
185 int frames
; /* Frames */
186 int offsets
[VIDEO_MAX_FRAME
];
190 #define VIDEO_NO_UNIT (-1)
195 int video
; /* Video minor */
196 int vbi
; /* VBI minor */
197 int radio
; /* Radio minor */
198 int audio
; /* Audio minor */
199 int teletext
; /* Teletext minor */
203 uint32_t sampling_rate
; /* in Hz */
204 uint32_t samples_per_line
;
205 uint32_t sample_format
; /* VIDEO_PALETTE_RAW only (1 byte) */
206 int32_t start
[2]; /* starting line for each frame */
207 uint32_t count
[2]; /* count of lines for each frame */
209 #define VBI_UNSYNC 1 /* can distingues between top/bottom field */
210 #define VBI_INTERLACED 2 /* lines are interlaced */
213 /* video_info is biased towards hardware mpeg encode/decode */
214 /* but it could apply generically to any hardware compressor/decompressor */
217 uint32_t frame_count
; /* frames output since decode/encode began */
218 uint32_t h_size
; /* current unscaled horizontal size */
219 uint32_t v_size
; /* current unscaled veritcal size */
220 uint32_t smpte_timecode
; /* current SMPTE timecode (for current GOP) */
221 uint32_t picture_type
; /* current picture type */
222 uint32_t temporal_reference
; /* current temporal reference */
223 uint8_t user_data
[256]; /* user data last found in compressed stream */
224 /* user_data[0] contains user data flags, user_data[1] has count */
227 /* generic structure for setting playback modes */
228 struct video_play_mode
235 /* for loading microcode / fpga programming */
238 char loadwhat
[16]; /* name or tag of file being passed */
243 #define VIDIOCGCAP _IOR('v',1,struct video_capability) /* Get capabilities */
244 #define VIDIOCGCHAN _IOWR('v',2,struct video_channel) /* Get channel info (sources) */
245 #define VIDIOCSCHAN _IOW('v',3,struct video_channel) /* Set channel */
246 #define VIDIOCGTUNER _IOWR('v',4,struct video_tuner) /* Get tuner abilities */
247 #define VIDIOCSTUNER _IOW('v',5,struct video_tuner) /* Tune the tuner for the current channel */
248 #define VIDIOCGPICT _IOR('v',6,struct video_picture) /* Get picture properties */
249 #define VIDIOCSPICT _IOW('v',7,struct video_picture) /* Set picture properties */
250 #define VIDIOCCAPTURE _IOW('v',8,int) /* Start, end capture */
251 #define VIDIOCGWIN _IOR('v',9, struct video_window) /* Get the video overlay window */
252 #define VIDIOCSWIN _IOW('v',10, struct video_window) /* Set the video overlay window - passes clip list for hardware smarts , chromakey etc */
253 #define VIDIOCGFBUF _IOR('v',11, struct video_buffer) /* Get frame buffer */
254 #define VIDIOCSFBUF _IOW('v',12, struct video_buffer) /* Set frame buffer - root only */
255 #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) */
256 #define VIDIOCGFREQ _IOR('v',14, unsigned long) /* Set tuner */
257 #define VIDIOCSFREQ _IOW('v',15, unsigned long) /* Set tuner */
258 #define VIDIOCGAUDIO _IOR('v',16, struct video_audio) /* Get audio info */
259 #define VIDIOCSAUDIO _IOW('v',17, struct video_audio) /* Audio source, mute etc */
260 #define VIDIOCSYNC _IOW('v',18, int) /* Sync with mmap grabbing */
261 #define VIDIOCMCAPTURE _IOW('v',19, struct video_mmap) /* Grab frames */
262 #define VIDIOCGMBUF _IOR('v',20, struct video_mbuf) /* Memory map buffer info */
263 #define VIDIOCGUNIT _IOR('v',21, struct video_unit) /* Get attached units */
264 #define VIDIOCGCAPTURE _IOR('v',22, struct video_capture) /* Get subcapture */
265 #define VIDIOCSCAPTURE _IOW('v',23, struct video_capture) /* Set subcapture */
266 #define VIDIOCSPLAYMODE _IOW('v',24, struct video_play_mode) /* Set output video mode/feature */
267 #define VIDIOCSWRITEMODE _IOW('v',25, int) /* Set write mode */
268 #define VIDIOCGPLAYINFO _IOR('v',26, struct video_info) /* Get current playback info from hardware */
269 #define VIDIOCSMICROCODE _IOW('v',27, struct video_code) /* Load microcode into hardware */
270 #define VIDIOCGVBIFMT _IOR('v',28, struct vbi_format) /* Get VBI information */
271 #define VIDIOCSVBIFMT _IOW('v',29, struct vbi_format) /* Set VBI information */
274 #define BASE_VIDIOCPRIVATE 192 /* 192-255 are private */
276 /* VIDIOCSWRITEMODE */
277 #define VID_WRITE_MPEG_AUD 0
278 #define VID_WRITE_MPEG_VID 1
279 #define VID_WRITE_OSD 2
280 #define VID_WRITE_TTX 3
281 #define VID_WRITE_CC 4
282 #define VID_WRITE_MJPEG 5
284 /* VIDIOCSPLAYMODE */
285 #define VID_PLAY_VID_OUT_MODE 0
286 /* p1: = VIDEO_MODE_PAL, VIDEO_MODE_NTSC, etc ... */
287 #define VID_PLAY_GENLOCK 1
288 /* p1: 0 = OFF, 1 = ON */
289 /* p2: GENLOCK FINE DELAY value */
290 #define VID_PLAY_NORMAL 2
291 #define VID_PLAY_PAUSE 3
292 #define VID_PLAY_SINGLE_FRAME 4
293 #define VID_PLAY_FAST_FORWARD 5
294 #define VID_PLAY_SLOW_MOTION 6
295 #define VID_PLAY_IMMEDIATE_NORMAL 7
296 #define VID_PLAY_SWITCH_CHANNELS 8
297 #define VID_PLAY_FREEZE_FRAME 9
298 #define VID_PLAY_STILL_MODE 10
299 #define VID_PLAY_MASTER_MODE 11
301 #define VID_PLAY_MASTER_NONE 1
302 #define VID_PLAY_MASTER_VIDEO 2
303 #define VID_PLAY_MASTER_AUDIO 3
304 #define VID_PLAY_ACTIVE_SCANLINES 12
305 /* p1 = first active; p2 = last active */
306 #define VID_PLAY_RESET 13
307 #define VID_PLAY_END_MARK 14
311 #define VID_HARDWARE_BT848 1
312 #define VID_HARDWARE_QCAM_BW 2
313 #define VID_HARDWARE_PMS 3
314 #define VID_HARDWARE_QCAM_C 4
315 #define VID_HARDWARE_PSEUDO 5
316 #define VID_HARDWARE_SAA5249 6
317 #define VID_HARDWARE_AZTECH 7
318 #define VID_HARDWARE_SF16MI 8
319 #define VID_HARDWARE_RTRACK 9
320 #define VID_HARDWARE_ZOLTRIX 10
321 #define VID_HARDWARE_SAA7146 11
322 #define VID_HARDWARE_VIDEUM 12 /* Reserved for Winnov videum */
323 #define VID_HARDWARE_RTRACK2 13
324 #define VID_HARDWARE_PERMEDIA2 14 /* Reserved for Permedia2 */
325 #define VID_HARDWARE_RIVA128 15 /* Reserved for RIVA 128 */
326 #define VID_HARDWARE_PLANB 16 /* PowerMac motherboard video-in */
327 #define VID_HARDWARE_BROADWAY 17 /* Broadway project */
328 #define VID_HARDWARE_GEMTEK 18
329 #define VID_HARDWARE_TYPHOON 19
330 #define VID_HARDWARE_VINO 20 /* SGI Indy Vino */
331 #define VID_HARDWARE_CADET 21 /* Cadet radio */
332 #define VID_HARDWARE_TRUST 22 /* Trust FM Radio */
333 #define VID_HARDWARE_TERRATEC 23 /* TerraTec ActiveRadio */
334 #define VID_HARDWARE_CPIA 24
335 #define VID_HARDWARE_ZR36120 25 /* Zoran ZR36120/ZR36125 */
336 #define VID_HARDWARE_ZR36067 26 /* Zoran ZR36067/36060 */
337 #define VID_HARDWARE_OV511 27
338 #define VID_HARDWARE_ZR356700 28 /* Zoran 36700 series */
339 #define VID_HARDWARE_W9966 29
340 #define VID_HARDWARE_SE401 30 /* SE401 USB webcams */
341 #define VID_HARDWARE_PWC 31 /* Philips webcams */
342 #define VID_HARDWARE_MEYE 32 /* Sony Vaio MotionEye cameras */
343 #define VID_HARDWARE_CPIA2 33
344 #define VID_HARDWARE_VICAM 34
345 #define VID_HARDWARE_SF16FMR2 35
347 #endif /* videodev.h */