Mercurial > mplayer.hg
annotate vidix/vidix.h @ 4313:1dbffed555a6
Added buffering of output data
author | anders |
---|---|
date | Wed, 23 Jan 2002 12:28:36 +0000 |
parents | 03879e356f6d |
children | 693e4cfd2b84 |
rev | line source |
---|---|
3991 | 1 /* |
2 * vidix.h | |
3 * VIDIX - VIDeo Interface for *niX | |
4 * This interface is introduced as universal one to MPEG decoder, | |
5 * BES == Back End Scaler and YUV2RGB hw accelerators. | |
6 * In the future it may be expanded up to capturing and audio things. | |
7 * Main goal of this this interface imlpementation is providing DGA | |
8 * everywhere where it's possible (unlike X11 and other). | |
9 * Copyright 2002 Nick Kurshev | |
10 * Licence: GPL | |
11 * This interface is based on v4l2, fbvid.h, mga_vid.h projects | |
12 * and personally my ideas. | |
13 * NOTE: This interface is introduces as driver interface. | |
14 * Don't use it for APP. | |
15 */ | |
16 #ifndef VIDIX_H | |
17 #define VIDIX_H | |
18 | |
19 #ifdef __cplusplus | |
20 extern "C" { | |
21 #endif | |
22 | |
23 #define VIDIX_VERSION 100 | |
24 | |
25 /* returns driver version */ | |
26 extern unsigned vixGetVersion( void ); | |
27 | |
4191 | 28 #define PROBE_NORMAL 0 /* normal probing */ |
29 #define PROBE_FORCE 1 /* ignore device_id but recognize device if it's known */ | |
30 /* Probes video hw. | |
31 verbose - specifies verbose level. | |
32 force - specifies force mode - driver should ignore | |
33 device_id (danger but useful for new devices) | |
34 Returns 0 if ok else errno */ | |
35 extern int vixProbe( int verbose, int force ); | |
3991 | 36 /* Initializes driver. Returns 0 if ok else errno */ |
37 extern int vixInit( void ); | |
38 /* Destroys driver */ | |
39 extern void vixDestroy( void ); | |
40 | |
41 typedef struct vidix_capability_s | |
42 { | |
43 char name[32]; /* Driver name */ | |
4191 | 44 #define TYPE_OUTPUT 0x00000000 /* Is a video playback device */ |
45 #define TYPE_CAPTURE 0x00000001 /* Is a capture device */ | |
46 #define TYPE_CODEC 0x00000002 /* Device supports hw (de)coding */ | |
3991 | 47 #define TYPE_FX 0x00000004 /* Is a video effects device */ |
48 int type; /* Device type, see below */ | |
4191 | 49 unsigned reserved0[4]; |
3991 | 50 int maxwidth; |
51 int maxheight; | |
52 int minwidth; | |
53 int minheight; | |
54 int maxframerate; /* -1 if unlimited */ | |
55 #define FLAG_NONE 0x00000000 /* No flags defined */ | |
56 #define FLAG_DMA 0x00000001 /* Card can use DMA */ | |
4191 | 57 #define FLAG_EQ_DMA 0x00000002 /* Card can use DMA only if src pitch == dest pitch */ |
3991 | 58 #define FLAG_UPSCALER 0x00000010 /* Card supports hw upscaling */ |
59 #define FLAG_DOWNSCALER 0x00000020 /* Card supports hw downscaling */ | |
60 #define FLAG_SUBPIC 0x00001000 /* Card supports DVD subpictures */ | |
4263 | 61 #define FLAG_EQUALIZER 0x00002000 /* Card supports equalizer */ |
4191 | 62 unsigned flags; /* Feature flags, see above */ |
3991 | 63 unsigned short vendor_id; |
64 unsigned short device_id; | |
65 unsigned reserved[4]; | |
66 }vidix_capability_t; | |
67 | |
68 /* Should fill at least type before init. | |
69 Returns 0 if ok else errno */ | |
70 extern int vixGetCapability(vidix_capability_t *); | |
71 | |
72 typedef struct vidix_fourcc_s | |
73 { | |
74 unsigned fourcc; | |
75 #define VID_DEPTH_NONE 0x0000 | |
76 #define VID_DEPTH_1BPP 0x0001 | |
77 #define VID_DEPTH_2BPP 0x0002 | |
78 #define VID_DEPTH_4BPP 0x0004 | |
79 #define VID_DEPTH_8BPP 0x0008 | |
80 #define VID_DEPTH_12BPP 0x0010 | |
81 #define VID_DEPTH_15BPP 0x0020 | |
82 #define VID_DEPTH_16BPP 0x0040 | |
83 #define VID_DEPTH_24BPP 0x0080 | |
84 #define VID_DEPTH_32BPP 0x0100 | |
85 unsigned depth; | |
86 #define VID_CAP_NONE 0x0000 | |
87 #define VID_CAP_EXPAND 0x0001 /* if overlay can be bigger than source */ | |
88 #define VID_CAP_SHRINK 0x0002 /* if overlay can be smaller than source */ | |
89 #define VID_CAP_BLEND 0x0004 /* if overlay can be blended with framebuffer */ | |
90 #define VID_CAP_COLORKEY 0x0008 /* if overlay can be restricted to a colorkey */ | |
91 #define VID_CAP_ALPHAKEY 0x0010 /* if overlay can be restricted to an alpha channel */ | |
92 #define VID_CAP_COLORKEY_ISRANGE 0x0020 /* if the colorkey can be a range */ | |
93 #define VID_CAP_ALPHAKEY_ISRANGE 0x0040 /* if the alphakey can be a range */ | |
94 #define VID_CAP_COLORKEY_ISMAIN 0x0080 /* colorkey is checked against framebuffer */ | |
95 #define VID_CAP_COLORKEY_ISOVERLAY 0x0100 /* colorkey is checked against overlay */ | |
96 #define VID_CAP_ALPHAKEY_ISMAIN 0x0200 /* alphakey is checked against framebuffer */ | |
97 #define VID_CAP_ALPHAKEY_ISOVERLAY 0x0400 /* alphakey is checked against overlay */ | |
98 unsigned flags; | |
99 }vidix_fourcc_t; | |
100 | |
101 /* Returns 0 if ok else errno */ | |
102 extern int vixQueryFourcc(vidix_fourcc_t *); | |
103 | |
104 typedef struct vidix_yuv_s | |
105 { | |
106 unsigned y,u,v; | |
107 }vidix_yuv_t; | |
108 | |
109 typedef struct vidix_rect_s | |
110 { | |
111 unsigned x,y,w,h; /* in pixels */ | |
4008 | 112 vidix_yuv_t pitch; /* line-align in bytes */ |
3991 | 113 }vidix_rect_t; |
114 | |
115 typedef struct vidix_color_key_s | |
116 { | |
117 #define CKEY_FALSE 0 | |
118 #define CKEY_TRUE 1 | |
119 #define CKEY_EQ 2 | |
120 #define CKEY_NEQ 3 | |
121 unsigned op; /* defines logical operation */ | |
122 unsigned char red; | |
123 unsigned char green; | |
124 unsigned char blue; | |
125 unsigned char reserved; | |
126 }vidix_ckey_t; | |
127 | |
128 typedef struct vidix_video_key_s | |
129 { | |
130 #define VKEY_FALSE 0 | |
131 #define VKEY_TRUE 1 | |
132 #define VKEY_EQ 2 | |
133 #define VKEY_NEQ 3 | |
134 unsigned op; /* defines logical operation */ | |
135 unsigned char key[8]; | |
136 }vidix_vkey_t; | |
137 | |
138 typedef struct vidix_playback_s | |
139 { | |
140 unsigned fourcc; /* app -> driver: movies's fourcc */ | |
141 unsigned capability; /* app -> driver: what capability to use */ | |
142 unsigned blend_factor; /* app -> driver: blenfing factor */ | |
143 vidix_rect_t src; /* app -> driver: original movie size */ | |
144 vidix_rect_t dest; /* app -> driver: destinition movie size. driver->app dest_pitch */ | |
3995 | 145 /* memory model */ |
4008 | 146 unsigned frame_size; /* driver -> app; destinition frame size */ |
4191 | 147 unsigned num_frames; /* app -> driver: after call: driver -> app */ |
3991 | 148 #define LVO_MAXFRAMES 32 |
149 unsigned offsets[LVO_MAXFRAMES]; /* driver -> app */ | |
150 vidix_yuv_t offset; /* driver -> app: relative offsets within frame for yuv planes */ | |
151 void* dga_addr; /* driver -> app: linear address */ | |
3995 | 152 }vidix_playback_t; |
3991 | 153 |
154 /* Returns 0 if ok else errno */ | |
3995 | 155 extern int vixConfigPlayback(vidix_playback_t *); |
3991 | 156 |
157 /* Returns 0 if ok else errno */ | |
158 extern int vixPlaybackOn( void ); | |
159 | |
160 /* Returns 0 if ok else errno */ | |
161 extern int vixPlaybackOff( void ); | |
162 | |
163 /* Returns 0 if ok else errno */ | |
164 extern int vixPlaybackFrameSelect( unsigned frame_idx ); | |
165 | |
4070
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
166 typedef struct vidix_grkey_s |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
167 { |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
168 vidix_ckey_t ckey; /* app -> driver: color key */ |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
169 vidix_vkey_t vkey; /* app -> driver: video key */ |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
170 #define KEYS_PUT 0 |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
171 #define KEYS_AND 1 |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
172 #define KEYS_OR 2 |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
173 #define KEYS_XOR 3 |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
174 unsigned key_op; /* app -> driver: keys operations */ |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
175 }vidix_grkey_t; |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
176 |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
177 /* Returns 0 if ok else errno */ |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
178 extern int vixGetGrKeys( vidix_grkey_t * ); |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
179 |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
180 /* Returns 0 if ok else errno */ |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
181 extern int vixSetGrKeys( const vidix_grkey_t * ); |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
182 |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
183 |
3991 | 184 typedef struct vidix_video_eq_s |
185 { | |
186 /* end-user app can have presets like: cold-normal-hot picture and so on */ | |
187 int brightness; /* -1000 : +1000 */ | |
188 int contrast; /* -1000 : +1000 */ | |
189 int saturation; /* -1000 : +1000 */ | |
190 int hue; /* -1000 : +1000 */ | |
191 int red_intense; /* -1000 : +1000 */ | |
192 int green_intense; /* -1000 : +1000 */ | |
193 int blue_intense; /* -1000 : +1000 */ | |
4191 | 194 #define VEQ_FLG_ITU_R_BT_601 0x00000000 /* ITU-R BT.601 colour space (default) */ |
195 #define VEQ_FLG_ITU_R_BT_709 0x00000001 /* ITU-R BT.709 colour space */ | |
196 #define VEQ_FLG_ITU_MASK 0x0000000f | |
197 int flags; /* currently specifies ITU YCrCb color space to use */ | |
3991 | 198 }vidix_video_eq_t; |
199 | |
200 /* Returns 0 if ok else errno */ | |
201 extern int vixPlaybackGetEq( vidix_video_eq_t * ); | |
202 | |
203 /* Returns 0 if ok else errno */ | |
204 extern int vixPlaybackSetEq( const vidix_video_eq_t * ); | |
205 | |
4191 | 206 typedef struct vidix_deinterlace_s |
207 { | |
208 #define CFG_NON_INTERLACED 0x00000000 /* stream is not interlaced */ | |
209 #define CFG_INTERLACED 0x00000001 /* stream is interlaced */ | |
210 #define CFG_EVEN_ODD_INTERLACING 0x00000002 /* first frame contains even fields but second - odd */ | |
211 #define CFG_ODD_EVEN_INTERLACING 0x00000004 /* first frame contains odd fields but second - even */ | |
212 #define CFG_UNIQUE_INTERLACING 0x00000008 /* field deinterlace_pattern is valid */ | |
213 #define CFG_UNKNOWN_INTERLACING 0x0000000f /* unknown deinterlacing - use adaptive if it's possible */ | |
214 unsigned flags; | |
215 unsigned deinterlace_pattern; /* app -> driver: deinterlace pattern if flag CFG_UNIQUE_INTERLACING is set */ | |
216 }vidix_deinterlace_t; | |
217 | |
218 /* Returns 0 if ok else errno */ | |
219 extern int vixPlaybackGetDeint( vidix_deinterlace_t * ); | |
220 | |
221 /* Returns 0 if ok else errno */ | |
222 extern int vixPlaybackSetDeint( const vidix_deinterlace_t * ); | |
223 | |
3991 | 224 typedef struct vidix_slice_s |
225 { | |
226 void* address; /* app -> driver */ | |
227 unsigned size; /* app -> driver */ | |
228 vidix_rect_t slice; /* app -> driver */ | |
229 }vidix_slice_t; | |
230 | |
231 typedef struct vidix_dma_s | |
232 { | |
233 vidix_slice_t src; /* app -> driver */ | |
234 vidix_slice_t dest; /* app -> driver */ | |
235 #define LVO_DMA_NOSYNC 0 | |
236 #define LVO_DMA_SYNC 1 /* means: wait vsync or hsync */ | |
237 unsigned flags; /* app -> driver */ | |
238 }vidix_dma_t; | |
239 | |
240 /* Returns 0 if ok else errno */ | |
241 extern int vixPlaybackCopyFrame( const vidix_dma_t * ); | |
242 | |
4191 | 243 /* |
244 This structure is introdused to support OEM effects like: | |
245 - sharpness | |
246 - exposure | |
247 - (auto)gain | |
248 - H(V)flip | |
249 - black level | |
250 - white balance | |
251 and many other | |
252 */ | |
253 typedef struct vidix_oem_fx_s | |
254 { | |
255 #define FX_TYPE_BOOLEAN 0x00000000 | |
256 #define FX_TYPE_INTEGER 0x00000001 | |
257 int type; /* type of effects */ | |
258 int num; /* app -> driver: effect number. From 0 to max number of effects */ | |
259 int minvalue; /* min value of effect. 0 - for boolean */ | |
260 int maxvalue; /* max value of effect. 1 - for boolean */ | |
261 int value; /* current value of effect on 'get'; required on set */ | |
262 char * name[80]; /* effect name to display */ | |
263 }vidix_oem_fx_t; | |
264 | |
265 /* Returns 0 if ok else errno */ | |
266 extern int vixQueryNumOemEffects( unsigned * number ); | |
267 | |
268 /* Returns 0 if ok else errno */ | |
269 extern int vixGetOemEffect( vidix_oem_fx_t * ); | |
270 | |
271 /* Returns 0 if ok else errno */ | |
272 extern int vixSetOemEffect( const vidix_oem_fx_t * ); | |
273 | |
3991 | 274 #ifdef __cplusplus |
275 } | |
276 #endif | |
277 | |
278 #endif |