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