Mercurial > mplayer.hg
annotate vidix/vidix.h @ 22865:441582f3ed87
simplified function prototypes to avoid casts but keep external API compatibility
author | ben |
---|---|
date | Sun, 01 Apr 2007 12:39:06 +0000 |
parents | efe51e2b81c3 |
children | d74001dbe2a6 |
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 | |
22860
efe51e2b81c3
removed references to no longer used internal drivers functions
ben
parents:
22859
diff
changeset
|
25 #define PROBE_NORMAL 0 /* normal probing */ |
efe51e2b81c3
removed references to no longer used internal drivers functions
ben
parents:
22859
diff
changeset
|
26 #define PROBE_FORCE 1 /* ignore device_id but recognize device if it's known */ |
efe51e2b81c3
removed references to no longer used internal drivers functions
ben
parents:
22859
diff
changeset
|
27 |
22859 | 28 typedef enum vidix_dev_type { |
29 TYPE_OUTPUT = 0x00000000, /* Is a video playback device */ | |
30 TYPE_CAPTURE = 0x00000001, /* Is a capture device */ | |
31 TYPE_CODEC = 0x00000002, /* Device supports hw (de)coding */ | |
32 TYPE_FX = 0x00000004, /* Is a video effects device */ | |
33 } vidix_dev_type_t; | |
34 | |
35 typedef enum vidix_dev_flag { | |
36 FLAG_NONE = 0x00000000, /* No flags defined */ | |
37 FLAG_DMA = 0x00000001, /* Card can use DMA */ | |
38 /* Card can use DMA only if src pitch == dest pitch */ | |
39 FLAG_EQ_DMA = 0x00000002, | |
40 /* Possible to wait for DMA to finish. See BM_DMA_SYNC and BM_DMA_BLOCK */ | |
41 FLAG_SYNC_DMA = 0x00000004, | |
42 FLAG_UPSCALER = 0x00000010, /* Card supports hw upscaling */ | |
43 FLAG_DOWNSCALER = 0x00000020, /* Card supports hw downscaling */ | |
44 FLAG_SUBPIC = 0x00001000, /* Card supports DVD subpictures */ | |
45 FLAG_EQUALIZER = 0x00002000, /* Card supports equalizer */ | |
46 } vidix_dev_flag_t; | |
47 | |
3991 | 48 typedef struct vidix_capability_s |
49 { | |
22859 | 50 char name[64]; /* Driver name */ |
51 char author[64]; /* Author name */ | |
52 vidix_dev_type_t type; | |
53 unsigned reserved0[4]; | |
54 int maxwidth; | |
55 int maxheight; | |
56 int minwidth; | |
57 int minheight; | |
58 int maxframerate; /* -1 if unlimited */ | |
59 vidix_dev_flag_t flags; | |
60 unsigned short vendor_id; | |
61 unsigned short device_id; | |
62 unsigned reserved1[4]; | |
63 } vidix_capability_t; | |
64 | |
65 typedef enum vidix_depth { | |
66 VID_DEPTH_NONE = 0x0000, | |
67 VID_DEPTH_1BPP = 0x0001, | |
68 VID_DEPTH_2BPP = 0x0002, | |
69 VID_DEPTH_4BPP = 0x0004, | |
70 VID_DEPTH_8BPP = 0x0008, | |
71 VID_DEPTH_12BPP = 0x0010, | |
72 VID_DEPTH_15BPP = 0x0020, | |
73 VID_DEPTH_16BPP = 0x0040, | |
74 VID_DEPTH_24BPP = 0x0080, | |
75 VID_DEPTH_32BPP = 0x0100, | |
76 VID_DEPTH_ALL = VID_DEPTH_1BPP | VID_DEPTH_2BPP | \ | |
77 VID_DEPTH_4BPP | VID_DEPTH_8BPP | \ | |
78 VID_DEPTH_12BPP | VID_DEPTH_15BPP | \ | |
79 VID_DEPTH_16BPP | VID_DEPTH_24BPP | \ | |
80 VID_DEPTH_32BPP, | |
81 } vidix_depth_t; | |
82 | |
83 typedef enum vidix_cap { | |
84 VID_CAP_NONE = 0x0000, | |
85 /* if overlay can be bigger than source */ | |
86 VID_CAP_EXPAND = 0x0001, | |
87 /* if overlay can be smaller than source */ | |
88 VID_CAP_SHRINK = 0x0002, | |
89 /* if overlay can be blended with framebuffer */ | |
90 VID_CAP_BLEND = 0x0004, | |
91 /* if overlay can be restricted to a colorkey */ | |
92 VID_CAP_COLORKEY = 0x0008, | |
93 /* if overlay can be restricted to an alpha channel */ | |
94 VID_CAP_ALPHAKEY = 0x0010, | |
95 /* if the colorkey can be a range */ | |
96 VID_CAP_COLORKEY_ISRANGE = 0x0020, | |
97 /* if the alphakey can be a range */ | |
98 VID_CAP_ALPHAKEY_ISRANGE = 0x0040, | |
99 /* colorkey is checked against framebuffer */ | |
100 VID_CAP_COLORKEY_ISMAIN = 0x0080, | |
101 /* colorkey is checked against overlay */ | |
102 VID_CAP_COLORKEY_ISOVERLAY = 0x0100, | |
103 /* alphakey is checked against framebuffer */ | |
104 VID_CAP_ALPHAKEY_ISMAIN = 0x0200, | |
105 /* alphakey is checked against overlay */ | |
106 VID_CAP_ALPHAKEY_ISOVERLAY = 0x0400, | |
107 } vidix_cap_t; | |
3991 | 108 |
109 typedef struct vidix_fourcc_s | |
110 { | |
22859 | 111 unsigned fourcc; /* input: requested fourcc */ |
112 vidix_depth_t depth; /* output: screen depth for given fourcc */ | |
113 vidix_cap_t flags; /* output: capability */ | |
114 } vidix_fourcc_t; | |
3991 | 115 |
116 typedef struct vidix_yuv_s | |
117 { | |
22859 | 118 unsigned y,u,v; |
119 } vidix_yuv_t; | |
3991 | 120 |
121 typedef struct vidix_rect_s | |
122 { | |
22859 | 123 unsigned x,y,w,h; /* in pixels */ |
124 vidix_yuv_t pitch; /* line-align in bytes */ | |
125 } vidix_rect_t; | |
126 | |
127 typedef enum vidix_color_key_op { | |
128 CKEY_FALSE = 0, | |
129 CKEY_TRUE = 1, | |
130 CKEY_EQ = 2, | |
131 CKEY_NEQ = 3, | |
132 } vidix_color_key_op_t; | |
3991 | 133 |
134 typedef struct vidix_color_key_s | |
135 { | |
22859 | 136 vidix_color_key_op_t op; /* defines logical operation */ |
137 unsigned char red; | |
138 unsigned char green; | |
139 unsigned char blue; | |
140 unsigned char reserved; | |
3991 | 141 }vidix_ckey_t; |
142 | |
22859 | 143 typedef enum vidix_video_key_op { |
144 VKEY_FALSE = 0, | |
145 VKEY_TRUE = 1, | |
146 VKEY_EQ = 2, | |
147 VKEY_NEQ = 3, | |
148 } vidix_video_key_op_t; | |
149 | |
150 typedef struct vidix_video_key_s { | |
151 vidix_video_key_op_t op; /* defines logical operation */ | |
152 unsigned char key[8]; | |
153 } vidix_vkey_t; | |
154 | |
155 typedef enum vidix_interleave { | |
156 VID_PLAY_INTERLEAVED_UV = 0x00000001, | |
157 /* UVUVUVUVUV used by Matrox G200 */ | |
158 INTERLEAVING_UV = 0x00001000, | |
159 /* VUVUVUVUVU */ | |
160 INTERLEAVING_VU = 0x00001001, | |
161 } vidix_interleave_t; | |
162 | |
163 #define VID_PLAY_MAXFRAMES 64 /* unreal limitation */ | |
3991 | 164 |
165 typedef struct vidix_playback_s | |
166 { | |
22859 | 167 unsigned fourcc; /* app -> driver: movies's fourcc */ |
168 unsigned capability; /* app -> driver: what capability to use */ | |
169 unsigned blend_factor; /* app -> driver: blending factor */ | |
170 vidix_rect_t src; /* app -> driver: original movie size */ | |
171 vidix_rect_t dest; /* app -> driver: destinition movie size. | |
172 driver->app dest_pitch */ | |
173 vidix_interleave_t flags; /* driver -> app: interleaved UV planes */ | |
174 /* memory model */ | |
175 unsigned frame_size; /* driver -> app: destinition frame size */ | |
176 unsigned num_frames; /* app -> driver: after call: driver -> app */ | |
177 unsigned offsets[VID_PLAY_MAXFRAMES]; /* driver -> app */ | |
178 vidix_yuv_t offset; /* driver -> app: relative offsets | |
179 within frame for yuv planes */ | |
180 void *dga_addr; /* driver -> app: linear address */ | |
181 } vidix_playback_t; | |
3991 | 182 |
22859 | 183 typedef enum vidix_key_op { |
184 KEYS_PUT = 0, | |
185 KEYS_AND = 1, | |
186 KEYS_OR = 2, | |
187 KEYS_XOR = 3, | |
188 } vidix_key_op_t; | |
3991 | 189 |
4070
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
190 typedef struct vidix_grkey_s |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
191 { |
22859 | 192 vidix_ckey_t ckey; /* app -> driver: color key */ |
193 vidix_vkey_t vkey; /* app -> driver: video key */ | |
194 vidix_key_op_t key_op; /* app -> driver: keys operations */ | |
195 } vidix_grkey_t; | |
196 | |
197 typedef enum vidix_veq_cap { | |
198 VEQ_CAP_NONE = 0x00000000UL, | |
199 VEQ_CAP_BRIGHTNESS = 0x00000001UL, | |
200 VEQ_CAP_CONTRAST = 0x00000002UL, | |
201 VEQ_CAP_SATURATION = 0x00000004UL, | |
202 VEQ_CAP_HUE = 0x00000008UL, | |
203 VEQ_CAP_RGB_INTENSITY = 0x00000010UL, | |
204 } vidix_veq_cap_t; | |
4070
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
205 |
22859 | 206 typedef enum vidix_veq_flag { |
207 VEQ_FLG_ITU_R_BT_601 = 0x00000000, /* ITU-R BT.601 colour space (default) */ | |
208 VEQ_FLG_ITU_R_BT_709 = 0x00000001, /* ITU-R BT.709 colour space */ | |
209 VEQ_FLG_ITU_MASK = 0x0000000f, | |
210 } vidix_veq_flag_t; | |
4070
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
211 |
22859 | 212 typedef struct vidix_video_eq_s { |
213 vidix_veq_cap_t cap; /* on get_eq should contain capability of | |
214 equalizer on set_eq should contain using fields */ | |
215 /* end-user app can have presets like: cold-normal-hot picture and so on */ | |
216 int brightness; /* -1000 : +1000 */ | |
217 int contrast; /* -1000 : +1000 */ | |
218 int saturation; /* -1000 : +1000 */ | |
219 int hue; /* -1000 : +1000 */ | |
220 int red_intensity; /* -1000 : +1000 */ | |
221 int green_intensity; /* -1000 : +1000 */ | |
222 int blue_intensity; /* -1000 : +1000 */ | |
223 vidix_veq_flag_t flags; /* currently specifies ITU YCrCb color | |
224 space to use */ | |
225 } vidix_video_eq_t; | |
4070
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
226 |
22859 | 227 typedef enum vidix_interlace_flag { |
228 /* stream is not interlaced */ | |
229 CFG_NON_INTERLACED = 0x00000000, | |
230 /* stream is interlaced */ | |
231 CFG_INTERLACED = 0x00000001, | |
232 /* first frame contains even fields but second - odd */ | |
233 CFG_EVEN_ODD_INTERLACING = 0x00000002, | |
234 /* first frame contains odd fields but second - even */ | |
235 CFG_ODD_EVEN_INTERLACING = 0x00000004, | |
236 /* field deinterlace_pattern is valid */ | |
237 CFG_UNIQUE_INTERLACING = 0x00000008, | |
238 /* unknown deinterlacing - use adaptive if it's possible */ | |
239 CFG_UNKNOWN_INTERLACING = 0x0000000f, | |
240 } vidix_interlace_flag_t; | |
3991 | 241 |
22859 | 242 typedef struct vidix_deinterlace_s { |
243 vidix_interlace_flag_t flags; | |
244 unsigned deinterlace_pattern; /* app -> driver: deinterlace pattern if | |
245 flag CFG_UNIQUE_INTERLACING is set */ | |
246 } vidix_deinterlace_t; | |
247 | |
248 typedef struct vidix_slice_s { | |
249 void *address; /* app -> driver */ | |
250 unsigned size; /* app -> driver */ | |
251 vidix_rect_t slice; /* app -> driver */ | |
252 } vidix_slice_t; | |
4191 | 253 |
22859 | 254 typedef enum vidix_bm_flag { |
255 LVO_DMA_NOSYNC = 0, | |
256 /* waits for vsync or hsync */ | |
257 LVO_DMA_SYNC = 1, | |
258 } vidix_dma_flag_t; | |
3991 | 259 |
260 typedef struct vidix_dma_s | |
261 { | |
22859 | 262 vidix_slice_t src; /* app -> driver */ |
263 vidix_slice_t dest; /* app -> driver */ | |
264 vidix_dma_flag_t flags; /* app -> driver */ | |
265 } vidix_dma_t; | |
266 | |
267 typedef enum vidix_fx_type { | |
268 FX_TYPE_BOOLEAN = 0x00000000, | |
269 FX_TYPE_INTEGER = 0x00000001, | |
270 } vidix_fx_type_t; | |
3991 | 271 |
4191 | 272 /* |
273 This structure is introdused to support OEM effects like: | |
274 - sharpness | |
275 - exposure | |
276 - (auto)gain | |
277 - H(V)flip | |
278 - black level | |
279 - white balance | |
280 and many other | |
281 */ | |
282 typedef struct vidix_oem_fx_s | |
283 { | |
22859 | 284 vidix_fx_type_t type; /* type of effects */ |
285 int num; /* app -> driver: effect number. | |
286 From 0 to max number of effects */ | |
287 int minvalue; /* min value of effect. 0 - for boolean */ | |
288 int maxvalue; /* max value of effect. 1 - for boolean */ | |
289 int value; /* current value of effect on get; required on set */ | |
290 char *name[80]; /* effect name to display */ | |
291 } vidix_oem_fx_t; | |
4191 | 292 |
3991 | 293 #ifdef __cplusplus |
294 } | |
295 #endif | |
296 | |
297 #endif |