Mercurial > mplayer.hg
annotate vidix/vidix.h @ 24360:ba7da0656d80
warning fix:
libmpcodecs/vf_divtc.c:206: warning: 'cmp' defined but not used
author | diego |
---|---|
date | Sun, 09 Sep 2007 09:59:50 +0000 |
parents | 82216ef041e0 |
children | 3baf6a2283da |
rev | line source |
---|---|
3991 | 1 /* |
23046
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
2 * VIDIX - VIDeo Interface for *niX. |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
3 * Copyright (C) 2002 Nick Kurshev |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
4 * Copyright (C) 2007 Benjamin Zores <ben@geexbox.org> |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
5 * |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
6 * This file is part of MPlayer. |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
7 * |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
8 * MPlayer is free software; you can redistribute it and/or modify |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
9 * it under the terms of the GNU General Public License as published by |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
10 * the Free Software Foundation; either version 2 of the License, or |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
11 * (at your option) any later version. |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
12 * |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
13 * MPlayer is distributed in the hope that it will be useful, |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
16 * GNU General Public License for more details. |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
17 * |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
18 * You should have received a copy of the GNU General Public License |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
19 * along with MPlayer; if not, write to the Free Software |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
21 * |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
22 * This interface is introduced as universal one to MPEG decoder, |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
23 * Back End Scaler (BES) and YUV2RGB hw accelerators. |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
24 * |
3991 | 25 * In the future it may be expanded up to capturing and audio things. |
26 * Main goal of this this interface imlpementation is providing DGA | |
27 * everywhere where it's possible (unlike X11 and other). | |
23046
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
28 * |
3991 | 29 * This interface is based on v4l2, fbvid.h, mga_vid.h projects |
30 * and personally my ideas. | |
23046
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
31 * |
3991 | 32 * NOTE: This interface is introduces as driver interface. |
23046
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
33 */ |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
23039
diff
changeset
|
34 |
3991 | 35 #ifndef VIDIX_H |
36 #define VIDIX_H | |
37 | |
38 #ifdef __cplusplus | |
39 extern "C" { | |
40 #endif | |
41 | |
42 #define VIDIX_VERSION 100 | |
43 | |
22860
efe51e2b81c3
removed references to no longer used internal drivers functions
ben
parents:
22859
diff
changeset
|
44 #define PROBE_NORMAL 0 /* normal probing */ |
efe51e2b81c3
removed references to no longer used internal drivers functions
ben
parents:
22859
diff
changeset
|
45 #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
|
46 |
22859 | 47 typedef enum vidix_dev_type { |
48 TYPE_OUTPUT = 0x00000000, /* Is a video playback device */ | |
49 TYPE_CAPTURE = 0x00000001, /* Is a capture device */ | |
50 TYPE_CODEC = 0x00000002, /* Device supports hw (de)coding */ | |
51 TYPE_FX = 0x00000004, /* Is a video effects device */ | |
52 } vidix_dev_type_t; | |
53 | |
54 typedef enum vidix_dev_flag { | |
55 FLAG_NONE = 0x00000000, /* No flags defined */ | |
56 FLAG_DMA = 0x00000001, /* Card can use DMA */ | |
57 /* Card can use DMA only if src pitch == dest pitch */ | |
58 FLAG_EQ_DMA = 0x00000002, | |
59 /* Possible to wait for DMA to finish. See BM_DMA_SYNC and BM_DMA_BLOCK */ | |
60 FLAG_SYNC_DMA = 0x00000004, | |
61 FLAG_UPSCALER = 0x00000010, /* Card supports hw upscaling */ | |
62 FLAG_DOWNSCALER = 0x00000020, /* Card supports hw downscaling */ | |
63 FLAG_SUBPIC = 0x00001000, /* Card supports DVD subpictures */ | |
64 FLAG_EQUALIZER = 0x00002000, /* Card supports equalizer */ | |
65 } vidix_dev_flag_t; | |
66 | |
3991 | 67 typedef struct vidix_capability_s |
68 { | |
22859 | 69 char name[64]; /* Driver name */ |
70 char author[64]; /* Author name */ | |
71 vidix_dev_type_t type; | |
72 unsigned reserved0[4]; | |
73 int maxwidth; | |
74 int maxheight; | |
75 int minwidth; | |
76 int minheight; | |
77 int maxframerate; /* -1 if unlimited */ | |
78 vidix_dev_flag_t flags; | |
79 unsigned short vendor_id; | |
80 unsigned short device_id; | |
81 unsigned reserved1[4]; | |
82 } vidix_capability_t; | |
83 | |
84 typedef enum vidix_depth { | |
85 VID_DEPTH_NONE = 0x0000, | |
86 VID_DEPTH_1BPP = 0x0001, | |
87 VID_DEPTH_2BPP = 0x0002, | |
88 VID_DEPTH_4BPP = 0x0004, | |
89 VID_DEPTH_8BPP = 0x0008, | |
90 VID_DEPTH_12BPP = 0x0010, | |
91 VID_DEPTH_15BPP = 0x0020, | |
92 VID_DEPTH_16BPP = 0x0040, | |
93 VID_DEPTH_24BPP = 0x0080, | |
94 VID_DEPTH_32BPP = 0x0100, | |
95 VID_DEPTH_ALL = VID_DEPTH_1BPP | VID_DEPTH_2BPP | \ | |
96 VID_DEPTH_4BPP | VID_DEPTH_8BPP | \ | |
97 VID_DEPTH_12BPP | VID_DEPTH_15BPP | \ | |
98 VID_DEPTH_16BPP | VID_DEPTH_24BPP | \ | |
99 VID_DEPTH_32BPP, | |
100 } vidix_depth_t; | |
101 | |
102 typedef enum vidix_cap { | |
103 VID_CAP_NONE = 0x0000, | |
104 /* if overlay can be bigger than source */ | |
105 VID_CAP_EXPAND = 0x0001, | |
106 /* if overlay can be smaller than source */ | |
107 VID_CAP_SHRINK = 0x0002, | |
108 /* if overlay can be blended with framebuffer */ | |
109 VID_CAP_BLEND = 0x0004, | |
110 /* if overlay can be restricted to a colorkey */ | |
111 VID_CAP_COLORKEY = 0x0008, | |
112 /* if overlay can be restricted to an alpha channel */ | |
113 VID_CAP_ALPHAKEY = 0x0010, | |
114 /* if the colorkey can be a range */ | |
115 VID_CAP_COLORKEY_ISRANGE = 0x0020, | |
116 /* if the alphakey can be a range */ | |
117 VID_CAP_ALPHAKEY_ISRANGE = 0x0040, | |
118 /* colorkey is checked against framebuffer */ | |
119 VID_CAP_COLORKEY_ISMAIN = 0x0080, | |
120 /* colorkey is checked against overlay */ | |
121 VID_CAP_COLORKEY_ISOVERLAY = 0x0100, | |
122 /* alphakey is checked against framebuffer */ | |
123 VID_CAP_ALPHAKEY_ISMAIN = 0x0200, | |
124 /* alphakey is checked against overlay */ | |
125 VID_CAP_ALPHAKEY_ISOVERLAY = 0x0400, | |
126 } vidix_cap_t; | |
3991 | 127 |
128 typedef struct vidix_fourcc_s | |
129 { | |
22859 | 130 unsigned fourcc; /* input: requested fourcc */ |
131 vidix_depth_t depth; /* output: screen depth for given fourcc */ | |
132 vidix_cap_t flags; /* output: capability */ | |
133 } vidix_fourcc_t; | |
3991 | 134 |
135 typedef struct vidix_yuv_s | |
136 { | |
22859 | 137 unsigned y,u,v; |
138 } vidix_yuv_t; | |
3991 | 139 |
140 typedef struct vidix_rect_s | |
141 { | |
22859 | 142 unsigned x,y,w,h; /* in pixels */ |
143 vidix_yuv_t pitch; /* line-align in bytes */ | |
144 } vidix_rect_t; | |
145 | |
146 typedef enum vidix_color_key_op { | |
147 CKEY_FALSE = 0, | |
148 CKEY_TRUE = 1, | |
149 CKEY_EQ = 2, | |
150 CKEY_NEQ = 3, | |
23039
d5e23946d776
added a new value for alpha colorkey (will be needed by further ati vidix driver upgrade)
ben
parents:
22902
diff
changeset
|
151 CKEY_ALPHA = 4, |
22859 | 152 } vidix_color_key_op_t; |
3991 | 153 |
154 typedef struct vidix_color_key_s | |
155 { | |
22859 | 156 vidix_color_key_op_t op; /* defines logical operation */ |
157 unsigned char red; | |
158 unsigned char green; | |
159 unsigned char blue; | |
160 unsigned char reserved; | |
3991 | 161 }vidix_ckey_t; |
162 | |
22859 | 163 typedef enum vidix_video_key_op { |
164 VKEY_FALSE = 0, | |
165 VKEY_TRUE = 1, | |
166 VKEY_EQ = 2, | |
167 VKEY_NEQ = 3, | |
168 } vidix_video_key_op_t; | |
169 | |
170 typedef struct vidix_video_key_s { | |
171 vidix_video_key_op_t op; /* defines logical operation */ | |
172 unsigned char key[8]; | |
173 } vidix_vkey_t; | |
174 | |
175 typedef enum vidix_interleave { | |
176 VID_PLAY_INTERLEAVED_UV = 0x00000001, | |
177 /* UVUVUVUVUV used by Matrox G200 */ | |
178 INTERLEAVING_UV = 0x00001000, | |
179 /* VUVUVUVUVU */ | |
180 INTERLEAVING_VU = 0x00001001, | |
181 } vidix_interleave_t; | |
182 | |
183 #define VID_PLAY_MAXFRAMES 64 /* unreal limitation */ | |
3991 | 184 |
185 typedef struct vidix_playback_s | |
186 { | |
22859 | 187 unsigned fourcc; /* app -> driver: movies's fourcc */ |
188 unsigned capability; /* app -> driver: what capability to use */ | |
189 unsigned blend_factor; /* app -> driver: blending factor */ | |
190 vidix_rect_t src; /* app -> driver: original movie size */ | |
191 vidix_rect_t dest; /* app -> driver: destinition movie size. | |
192 driver->app dest_pitch */ | |
193 vidix_interleave_t flags; /* driver -> app: interleaved UV planes */ | |
194 /* memory model */ | |
195 unsigned frame_size; /* driver -> app: destinition frame size */ | |
196 unsigned num_frames; /* app -> driver: after call: driver -> app */ | |
197 unsigned offsets[VID_PLAY_MAXFRAMES]; /* driver -> app */ | |
198 vidix_yuv_t offset; /* driver -> app: relative offsets | |
199 within frame for yuv planes */ | |
200 void *dga_addr; /* driver -> app: linear address */ | |
201 } vidix_playback_t; | |
3991 | 202 |
22859 | 203 typedef enum vidix_key_op { |
204 KEYS_PUT = 0, | |
205 KEYS_AND = 1, | |
206 KEYS_OR = 2, | |
207 KEYS_XOR = 3, | |
208 } vidix_key_op_t; | |
3991 | 209 |
4070
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
210 typedef struct vidix_grkey_s |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
211 { |
22859 | 212 vidix_ckey_t ckey; /* app -> driver: color key */ |
213 vidix_vkey_t vkey; /* app -> driver: video key */ | |
214 vidix_key_op_t key_op; /* app -> driver: keys operations */ | |
215 } vidix_grkey_t; | |
216 | |
217 typedef enum vidix_veq_cap { | |
218 VEQ_CAP_NONE = 0x00000000UL, | |
219 VEQ_CAP_BRIGHTNESS = 0x00000001UL, | |
220 VEQ_CAP_CONTRAST = 0x00000002UL, | |
221 VEQ_CAP_SATURATION = 0x00000004UL, | |
222 VEQ_CAP_HUE = 0x00000008UL, | |
223 VEQ_CAP_RGB_INTENSITY = 0x00000010UL, | |
224 } vidix_veq_cap_t; | |
4070
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
225 |
22859 | 226 typedef enum vidix_veq_flag { |
227 VEQ_FLG_ITU_R_BT_601 = 0x00000000, /* ITU-R BT.601 colour space (default) */ | |
228 VEQ_FLG_ITU_R_BT_709 = 0x00000001, /* ITU-R BT.709 colour space */ | |
229 VEQ_FLG_ITU_MASK = 0x0000000f, | |
230 } vidix_veq_flag_t; | |
4070
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
231 |
22859 | 232 typedef struct vidix_video_eq_s { |
233 vidix_veq_cap_t cap; /* on get_eq should contain capability of | |
234 equalizer on set_eq should contain using fields */ | |
235 /* end-user app can have presets like: cold-normal-hot picture and so on */ | |
236 int brightness; /* -1000 : +1000 */ | |
237 int contrast; /* -1000 : +1000 */ | |
238 int saturation; /* -1000 : +1000 */ | |
239 int hue; /* -1000 : +1000 */ | |
240 int red_intensity; /* -1000 : +1000 */ | |
241 int green_intensity; /* -1000 : +1000 */ | |
242 int blue_intensity; /* -1000 : +1000 */ | |
243 vidix_veq_flag_t flags; /* currently specifies ITU YCrCb color | |
244 space to use */ | |
245 } vidix_video_eq_t; | |
4070
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
4008
diff
changeset
|
246 |
22859 | 247 typedef enum vidix_interlace_flag { |
248 /* stream is not interlaced */ | |
249 CFG_NON_INTERLACED = 0x00000000, | |
250 /* stream is interlaced */ | |
251 CFG_INTERLACED = 0x00000001, | |
252 /* first frame contains even fields but second - odd */ | |
253 CFG_EVEN_ODD_INTERLACING = 0x00000002, | |
254 /* first frame contains odd fields but second - even */ | |
255 CFG_ODD_EVEN_INTERLACING = 0x00000004, | |
256 /* field deinterlace_pattern is valid */ | |
257 CFG_UNIQUE_INTERLACING = 0x00000008, | |
258 /* unknown deinterlacing - use adaptive if it's possible */ | |
259 CFG_UNKNOWN_INTERLACING = 0x0000000f, | |
260 } vidix_interlace_flag_t; | |
3991 | 261 |
22859 | 262 typedef struct vidix_deinterlace_s { |
263 vidix_interlace_flag_t flags; | |
264 unsigned deinterlace_pattern; /* app -> driver: deinterlace pattern if | |
265 flag CFG_UNIQUE_INTERLACING is set */ | |
266 } vidix_deinterlace_t; | |
267 | |
268 typedef struct vidix_slice_s { | |
269 void *address; /* app -> driver */ | |
270 unsigned size; /* app -> driver */ | |
271 vidix_rect_t slice; /* app -> driver */ | |
272 } vidix_slice_t; | |
4191 | 273 |
22859 | 274 typedef enum vidix_bm_flag { |
275 LVO_DMA_NOSYNC = 0, | |
276 /* waits for vsync or hsync */ | |
277 LVO_DMA_SYNC = 1, | |
278 } vidix_dma_flag_t; | |
3991 | 279 |
280 typedef struct vidix_dma_s | |
281 { | |
22859 | 282 vidix_slice_t src; /* app -> driver */ |
283 vidix_slice_t dest; /* app -> driver */ | |
284 vidix_dma_flag_t flags; /* app -> driver */ | |
285 } vidix_dma_t; | |
286 | |
287 typedef enum vidix_fx_type { | |
288 FX_TYPE_BOOLEAN = 0x00000000, | |
289 FX_TYPE_INTEGER = 0x00000001, | |
290 } vidix_fx_type_t; | |
3991 | 291 |
4191 | 292 /* |
293 This structure is introdused to support OEM effects like: | |
294 - sharpness | |
295 - exposure | |
296 - (auto)gain | |
297 - H(V)flip | |
298 - black level | |
299 - white balance | |
300 and many other | |
301 */ | |
302 typedef struct vidix_oem_fx_s | |
303 { | |
22859 | 304 vidix_fx_type_t type; /* type of effects */ |
305 int num; /* app -> driver: effect number. | |
306 From 0 to max number of effects */ | |
307 int minvalue; /* min value of effect. 0 - for boolean */ | |
308 int maxvalue; /* max value of effect. 1 - for boolean */ | |
309 int value; /* current value of effect on get; required on set */ | |
310 char *name[80]; /* effect name to display */ | |
311 } vidix_oem_fx_t; | |
4191 | 312 |
3991 | 313 #ifdef __cplusplus |
314 } | |
315 #endif | |
316 | |
317 #endif |