Import 2.1.81
[davej-history.git] / include / linux / videodev.h
blob064ee9d064fd1bbc5fcf5bc9de31f8045b602030
1 #ifndef __LINUX_VIDEODEV_H
2 #define __LINUX_VIDEODEV_H
4 #ifdef __KERNEL__
6 struct video_device
8 char name[32];
9 int type;
10 int hardware;
12 int (*open)(struct video_device *, int mode);
13 void (*close)(struct video_device *);
14 long (*read)(struct video_device *, char *, unsigned long, int noblock);
15 /* Do we need a write method ? */
16 long (*write)(struct video_device *, const char *, unsigned long, int noblock);
17 int (*ioctl)(struct video_device *, unsigned int , void *);
18 int (*mmap)(struct video_device *, const char *, unsigned long);
19 int (*initialize)(struct video_device *);
20 void *private;
21 int busy;
22 int minor;
25 extern int videodev_init(void);
26 #define VIDEO_MAJOR 81
27 extern int video_register_device(struct video_device *);
28 extern void video_unregister_device(struct video_device *);
29 #endif
32 #define VID_TYPE_CAPTURE 1 /* Can capture */
33 #define VID_TYPE_TUNER 2 /* Can tune */
34 #define VID_TYPE_TELETEXT 4 /* Does teletext */
35 #define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */
36 #define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */
37 #define VID_TYPE_CLIPPING 32 /* Can clip */
38 #define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */
39 #define VID_TYPE_SCALES 128 /* Scalable */
40 #define VID_TYPE_MONOCHROME 256 /* Monochrome only */
43 struct video_capability
45 char name[32];
46 int type;
47 int channels; /* Num channels */
48 int audios; /* Num audio devices */
49 int maxwidth; /* Supported width */
50 int maxheight; /* And height */
51 int minwidth; /* Supported width */
52 int minheight; /* And height */
56 struct video_channel
58 int channel;
59 char name[32];
60 int tuners;
61 __u32 flags;
62 #define VIDEO_VC_TUNER 1 /* Channel has a tuner */
63 #define VIDEO_VC_AUDIO 2 /* Channel has audio */
64 __u16 type;
65 #define VIDEO_TYPE_TV 1
66 #define VIDEO_TYPE_CAMERA 2
69 struct video_tuner
71 int tuner;
72 char name[32];
73 ulong rangelow, rangehigh; /* Tuner range */
74 __u32 flags;
75 #define VIDEO_TUNER_PAL 1
76 #define VIDEO_TUNER_NTSC 2
77 #define VIDEO_TUNER_SECAM 4
78 __u16 mode; /* PAL/NTSC/SECAM/OTHER */
79 #define VIDEO_MODE_PAL 0
80 #define VIDEO_MODE_NTSC 1
81 #define VIDEO_MODE_SECAM 2
82 #define VIDEO_MODE_AUTO 3
85 struct video_picture
87 __u16 brightness;
88 __u16 hue;
89 __u16 colour;
90 __u16 contrast;
91 __u16 whiteness; /* Black and white only */
92 __u16 depth; /* Capture depth */
93 __u16 palette; /* Palette in use */
94 #define VIDEO_PALETTE_GREY 1 /* Linear greyscale */
95 #define VIDEO_PALETTE_HI240 2 /* High 240 cube (BT848) */
96 #define VIDEO_PALETTE_RGB565 3 /* 565 16 bit RGB */
97 #define VIDEO_PALETTE_RGB24 4 /* 24bit RGB */
98 #define VIDEO_PALETTE_RGB32 5 /* 32bit RGB */
99 #define VIDEO_PALETTE_RGB555 6 /* 555 15bit RGB */
102 struct video_audio
104 int audio; /* Audio channel */
105 __u16 volume; /* If settable */
106 __u16 bass, treble;
107 __u32 flags;
108 #define VIDEO_AUDIO_MUTE 1
109 #define VIDEO_AUDIO_MUTABLE 2
110 #define VIDEO_AUDIO_VOLUME 4
111 #define VIDEO_AUDIO_BASS 8
112 #define VIDEO_AUDIO_TREBLE 16
113 char name[16];
116 struct video_clip
118 __s32 x,y;
119 __s32 width, height;
120 struct video_clip *next; /* For user use/driver use only */
123 struct video_window
125 __u32 x,y;
126 __u32 width,height;
127 __u32 chromakey;
128 __u32 flags;
129 struct video_clip *clips; /* Set only */
130 int clipcount;
131 #define VIDEO_WINDOW_INTERLACE 1
134 struct video_buffer
136 void *base;
137 int height,width;
138 int depth;
139 int bytesperline;
143 struct video_key
145 __u8 key[8];
146 __u32 flags;
149 #define VIDIOCGCAP _IOR('v',1,struct video_capability) /* Get capabilities */
150 #define VIDIOCGCHAN _IOWR('v',2,struct video_channel) /* Get channel info (sources) */
151 #define VIDIOCSCHAN _IOW('v',3,int) /* Set channel */
152 #define VIDIOCGTUNER _IOWR('v',4,struct video_tuner) /* Get tuner abilities */
153 #define VIDIOCSTUNER _IOW('v',5,struct video_tuner) /* Tune the tuner for the current channel */
154 #define VIDIOCGPICT _IOR('v',6,struct video_picture) /* Get picture properties */
155 #define VIDIOCSPICT _IOW('v',7,struct video_picture) /* Set picture properties */
156 #define VIDIOCCAPTURE _IOW('v',8,int) /* Start, end capture */
157 #define VIDIOCGWIN _IOR('v',9, struct video_window) /* Set the video overlay window */
158 #define VIDIOCSWIN _IOW('v',10, struct video_window) /* Set the video overlay window - passes clip list for hardware smarts , chromakey etc */
159 #define VIDIOCGFBUF _IOR('v',11, struct video_buffer) /* Get frame buffer */
160 #define VIDIOCSFBUF _IOW('v',12, struct video_buffer) /* Set frame buffer - root only */
161 #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) */
162 #define VIDIOCGFREQ _IOR('v',14, unsigned long) /* Set tuner */
163 #define VIDIOCSFREQ _IOW('v',15, unsigned long) /* Set tuner */
164 #define VIDIOCGAUDIO _IOR('v',16, struct video_audio) /* Get audio info */
165 #define VIDIOCSAUDIO _IOW('v',17, struct video_audio) /* Audio source, mute etc */
168 #define BASE_VIDIOCPRIVATE 192 /* 192-255 are private */
171 #define VID_HARDWARE_BT848 1
172 #define VID_HARDWARE_QCAM_BW 2
173 #define VID_HARDWARE_PMS 3
174 #define VID_HARDWARE_QCAM_C 4
177 * Initialiser list
180 struct video_init
182 char *name;
183 int (*init)(struct video_init *);
186 #endif