Warning: That file was not part of the compilation database. It may have many parsing errors.
1 | /* |
---|---|
2 | * Copyright (C) 2000-2013 the xine project |
3 | * |
4 | * This file is part of xine, a free video player. |
5 | * |
6 | * xine is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by |
8 | * the Free Software Foundation; either version 2 of the License, or |
9 | * (at your option) any later version. |
10 | * |
11 | * xine is distributed in the hope that it will be useful, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | * GNU General Public License for more details. |
15 | * |
16 | * You should have received a copy of the GNU General Public License |
17 | * along with this program; if not, write to the Free Software |
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA |
19 | * |
20 | * public xine-lib (libxine) interface and documentation |
21 | * |
22 | * |
23 | * some programming guidelines about this api: |
24 | * ------------------------------------------- |
25 | * |
26 | * (1) libxine has (per stream instance) a fairly static memory |
27 | * model |
28 | * (2) as a rule of thumb, never free() or realloc() any pointers |
29 | * returned by the xine engine (unless stated otherwise) |
30 | * or, in other words: |
31 | * do not free() stuff you have not malloc()ed |
32 | * (3) xine is multi-threaded, make sure your programming environment |
33 | * can handle this. |
34 | * for x11-related stuff this means that you either have to properly |
35 | * use xlockdisplay() or use two seperate connections to the x-server |
36 | * |
37 | */ |
38 | /*_x_ Lines formatted like this one are xine-lib developer comments. */ |
39 | /*_x_ They will be removed from the installed version of this header. */ |
40 | |
41 | #ifndef HAVE_XINE_H |
42 | #define HAVE_XINE_H |
43 | |
44 | #ifdef __cplusplus |
45 | extern "C"{ |
46 | #endif |
47 | |
48 | #include <sys/types.h> |
49 | #include <sys/time.h> |
50 | #include <time.h> |
51 | #include <stdarg.h> |
52 | |
53 | #ifdef WIN32 |
54 | #include <windows.h> |
55 | #include <windowsx.h> |
56 | #endif |
57 | |
58 | #include <xine/os_types.h> |
59 | #include <xine/attributes.h> |
60 | #include <xine/version.h> |
61 | |
62 | /* This enables some experimental features. These are not part of the |
63 | * official libxine API, so use them only, if you absolutely need them. |
64 | * Although we make efforts to keep even this part of the API as stable |
65 | * as possible, this is not guaranteed. Incompatible changes can occur. |
66 | */ |
67 | /* #define XINE_ENABLE_EXPERIMENTAL_FEATURES */ |
68 | |
69 | /* This disables some deprecated features. These are still part of the |
70 | * official libxine API and you may still use them. During the current |
71 | * major release series, these will always be available and will stay |
72 | * compatible. However, removal is likely to occur as soon as possible. |
73 | */ |
74 | /* #define XINE_DISABLE_DEPRECATED_FEATURES */ |
75 | |
76 | |
77 | /********************************************************************* |
78 | * xine opaque data types * |
79 | *********************************************************************/ |
80 | |
81 | typedef struct xine_s xine_t; |
82 | typedef struct xine_stream_s xine_stream_t; |
83 | typedef struct xine_audio_port_s xine_audio_port_t; |
84 | typedef struct xine_video_port_s xine_video_port_t; |
85 | |
86 | /********************************************************************* |
87 | * global engine handling * |
88 | *********************************************************************/ |
89 | |
90 | /* |
91 | * version information |
92 | */ |
93 | |
94 | /* dynamic info from actually linked libxine */ |
95 | const char *xine_get_version_string (void) XINE_PROTECTED; |
96 | void xine_get_version (int *major, int *minor, int *sub) XINE_PROTECTED; |
97 | |
98 | /* compare given version to libxine version, |
99 | return 1 if compatible, 0 otherwise */ |
100 | int xine_check_version (int major, int minor, int sub) XINE_PROTECTED; |
101 | |
102 | /* |
103 | * pre-init the xine engine |
104 | * |
105 | * will first malloc and init a xine_t, create an empty config |
106 | * system, then scan through all installed plugins and add them |
107 | * to an internal list for later use. |
108 | * |
109 | * to fully init the xine engine, you have to load config values |
110 | * (either using your own storage method and calling |
111 | * xine_config_register_entry, or by using the xine_load_config |
112 | * utility function - see below) and then call xine_init |
113 | * |
114 | * the only proper way to shut down the xine engine is to |
115 | * call xine_exit() - do not try to free() the xine pointer |
116 | * yourself and do not try to access any internal data structures |
117 | */ |
118 | xine_t *xine_new (void) XINE_PROTECTED; |
119 | |
120 | /* allow the setting of some flags before xine_init |
121 | * FIXME-ABI: this is currently GLOBAL |
122 | */ |
123 | void xine_set_flags (xine_t *, int) XINE_PROTECTED XINE_WEAK; |
124 | #define XINE_FLAG_NO_WRITE_CACHE 1 |
125 | |
126 | /* |
127 | * post_init the xine engine |
128 | */ |
129 | void xine_init (xine_t *self) XINE_PROTECTED; |
130 | |
131 | /* |
132 | * helper functions to find and init audio/video drivers |
133 | * from xine's plugin collection |
134 | * |
135 | * id : identifier of the driver, may be NULL for auto-detection |
136 | * data : special data struct for ui/driver communications, depends |
137 | * on driver |
138 | * visual: video driver flavor selector, constants see below |
139 | * |
140 | * both functions may return NULL if driver failed to load, was not |
141 | * found ... |
142 | * |
143 | * use xine_close_audio/video_driver() to close loaded drivers |
144 | * and free resources allocated by them |
145 | */ |
146 | xine_audio_port_t *xine_open_audio_driver (xine_t *self, const char *id, |
147 | void *data) XINE_PROTECTED; |
148 | xine_video_port_t *xine_open_video_driver (xine_t *self, const char *id, |
149 | int visual, void *data) XINE_PROTECTED; |
150 | |
151 | void xine_close_audio_driver (xine_t *self, xine_audio_port_t *driver) XINE_PROTECTED; |
152 | void xine_close_video_driver (xine_t *self, xine_video_port_t *driver) XINE_PROTECTED; |
153 | |
154 | /* valid visual types */ |
155 | #define XINE_VISUAL_TYPE_NONE 0 |
156 | #define XINE_VISUAL_TYPE_X11 1 |
157 | #define XINE_VISUAL_TYPE_X11_2 10 |
158 | #define XINE_VISUAL_TYPE_AA 2 |
159 | #define XINE_VISUAL_TYPE_FB 3 |
160 | #define XINE_VISUAL_TYPE_GTK 4 |
161 | #define XINE_VISUAL_TYPE_DFB 5 |
162 | #define XINE_VISUAL_TYPE_PM 6 /* used by the OS/2 port */ |
163 | #define XINE_VISUAL_TYPE_DIRECTX 7 /* used by the win32/msvc port */ |
164 | #define XINE_VISUAL_TYPE_CACA 8 |
165 | #define XINE_VISUAL_TYPE_MACOSX 9 |
166 | #define XINE_VISUAL_TYPE_XCB 11 |
167 | #define XINE_VISUAL_TYPE_RAW 12 |
168 | |
169 | /* |
170 | * free all resources, close all plugins, close engine. |
171 | * self pointer is no longer valid after this call. |
172 | */ |
173 | void xine_exit (xine_t *self) XINE_PROTECTED; |
174 | |
175 | |
176 | /********************************************************************* |
177 | * stream handling * |
178 | *********************************************************************/ |
179 | |
180 | /* |
181 | * create a new stream for media playback/access |
182 | * |
183 | * returns xine_stream_t* if OK, |
184 | * NULL on error (use xine_get_error for details) |
185 | * |
186 | * the only proper way to free the stream pointer returned by this |
187 | * function is to call xine_dispose() on it. do not try to access any |
188 | * fields in xine_stream_t, they're all private and subject to change |
189 | * without further notice. |
190 | */ |
191 | xine_stream_t *xine_stream_new (xine_t *self, |
192 | xine_audio_port_t *ao, xine_video_port_t *vo) XINE_PROTECTED; |
193 | |
194 | /* |
195 | * Make one stream the slave of another. |
196 | * This establishes a binary master slave relation on streams, where |
197 | * certain operations (specified by parameter "affection") on the master |
198 | * stream are also applied to the slave stream. |
199 | * If you want more than one stream to react to one master, you have to |
200 | * apply the calls in a top down way: |
201 | * xine_stream_master_slave(stream1, stream2, 3); |
202 | * xine_stream_master_slave(stream2, stream3, 3); |
203 | * This will make stream1 affect stream2 and stream2 affect stream3, so |
204 | * effectively, operations on stream1 propagate to stream2 and 3. |
205 | * |
206 | * Please note that subsequent master_slave calls on the same streams |
207 | * will overwrite their previous master/slave setting. |
208 | * Be sure to not mess around. |
209 | * |
210 | * returns 1 on success, 0 on failure |
211 | */ |
212 | int xine_stream_master_slave(xine_stream_t *master, xine_stream_t *slave, |
213 | int affection) XINE_PROTECTED; |
214 | |
215 | /* affection is some of the following ORed together: */ |
216 | /* playing the master plays the slave */ |
217 | #define XINE_MASTER_SLAVE_PLAY (1<<0) |
218 | /* slave stops on master stop */ |
219 | #define XINE_MASTER_SLAVE_STOP (1<<1) |
220 | /* slave is synced to master's speed */ |
221 | #define XINE_MASTER_SLAVE_SPEED (1<<2) |
222 | |
223 | /* |
224 | * open a stream |
225 | * |
226 | * look for input / demux / decoder plugins, find out about the format |
227 | * see if it is supported, set up internal buffers and threads |
228 | * |
229 | * returns 1 if OK, 0 on error (use xine_get_error for details) |
230 | */ |
231 | int xine_open (xine_stream_t *stream, const char *mrl) XINE_PROTECTED; |
232 | |
233 | /* |
234 | * play a stream from a given position |
235 | * |
236 | * start_pos: 0..65535 |
237 | * start_time: milliseconds |
238 | * if both start position parameters are != 0 start_pos will be used |
239 | * for non-seekable streams both values will be ignored |
240 | * |
241 | * returns 1 if OK, 0 on error (use xine_get_error for details) |
242 | */ |
243 | int xine_play (xine_stream_t *stream, int start_pos, int start_time) XINE_PROTECTED; |
244 | |
245 | /* |
246 | * stop stream playback |
247 | * xine_stream_t stays valid for new xine_open or xine_play |
248 | */ |
249 | void xine_stop (xine_stream_t *stream) XINE_PROTECTED; |
250 | |
251 | /* |
252 | * stop stream playback, free all stream-related resources |
253 | * xine_stream_t stays valid for new xine_open |
254 | */ |
255 | void xine_close (xine_stream_t *stream) XINE_PROTECTED; |
256 | |
257 | /* |
258 | * ask current/recent input plugin to eject media - may or may not work, |
259 | * depending on input plugin capabilities |
260 | */ |
261 | int xine_eject (xine_stream_t *stream) XINE_PROTECTED; |
262 | |
263 | /* |
264 | * stop playback, dispose all stream-related resources |
265 | * xine_stream_t no longer valid when after this |
266 | */ |
267 | void xine_dispose (xine_stream_t *stream) XINE_PROTECTED; |
268 | |
269 | /* |
270 | * set/get engine parameters. |
271 | */ |
272 | void xine_engine_set_param(xine_t *self, int param, int value) XINE_PROTECTED; |
273 | int xine_engine_get_param(xine_t *self, int param) XINE_PROTECTED; |
274 | |
275 | #define XINE_ENGINE_PARAM_VERBOSITY 1 |
276 | |
277 | /* |
278 | * set/get xine stream parameters |
279 | * e.g. playback speed, constants see below |
280 | */ |
281 | void xine_set_param (xine_stream_t *stream, int param, int value) XINE_PROTECTED; |
282 | int xine_get_param (xine_stream_t *stream, int param) XINE_PROTECTED; |
283 | |
284 | /* |
285 | * xine stream parameters |
286 | */ |
287 | #define XINE_PARAM_SPEED 1 /* see below */ |
288 | #define XINE_PARAM_AV_OFFSET 2 /* unit: 1/90000 sec */ |
289 | #define XINE_PARAM_AUDIO_CHANNEL_LOGICAL 3 /* -1 => auto, -2 => off */ |
290 | #define XINE_PARAM_SPU_CHANNEL 4 |
291 | #define XINE_PARAM_VIDEO_CHANNEL 5 |
292 | #define XINE_PARAM_AUDIO_VOLUME 6 /* 0..100 */ |
293 | #define XINE_PARAM_AUDIO_MUTE 7 /* 1=>mute, 0=>unmute */ |
294 | #define XINE_PARAM_AUDIO_COMPR_LEVEL 8 /* <100=>off, % compress otherw*/ |
295 | #define XINE_PARAM_AUDIO_AMP_LEVEL 9 /* 0..200, 100=>100% (default) */ |
296 | #define XINE_PARAM_AUDIO_REPORT_LEVEL 10 /* 1=>send events, 0=> don't */ |
297 | #define XINE_PARAM_VERBOSITY 11 /* control console output */ |
298 | #define XINE_PARAM_SPU_OFFSET 12 /* unit: 1/90000 sec */ |
299 | #define XINE_PARAM_IGNORE_VIDEO 13 /* disable video decoding */ |
300 | #define XINE_PARAM_IGNORE_AUDIO 14 /* disable audio decoding */ |
301 | #define XINE_PARAM_IGNORE_SPU 15 /* disable spu decoding */ |
302 | #define XINE_PARAM_BROADCASTER_PORT 16 /* 0: disable, x: server port */ |
303 | #define XINE_PARAM_METRONOM_PREBUFFER 17 /* unit: 1/90000 sec */ |
304 | #define XINE_PARAM_EQ_30HZ 18 /* equalizer gains -100..100 */ |
305 | #define XINE_PARAM_EQ_60HZ 19 /* equalizer gains -100..100 */ |
306 | #define XINE_PARAM_EQ_125HZ 20 /* equalizer gains -100..100 */ |
307 | #define XINE_PARAM_EQ_250HZ 21 /* equalizer gains -100..100 */ |
308 | #define XINE_PARAM_EQ_500HZ 22 /* equalizer gains -100..100 */ |
309 | #define XINE_PARAM_EQ_1000HZ 23 /* equalizer gains -100..100 */ |
310 | #define XINE_PARAM_EQ_2000HZ 24 /* equalizer gains -100..100 */ |
311 | #define XINE_PARAM_EQ_4000HZ 25 /* equalizer gains -100..100 */ |
312 | #define XINE_PARAM_EQ_8000HZ 26 /* equalizer gains -100..100 */ |
313 | #define XINE_PARAM_EQ_16000HZ 27 /* equalizer gains -100..100 */ |
314 | #define XINE_PARAM_AUDIO_CLOSE_DEVICE 28 /* force closing audio device */ |
315 | #define XINE_PARAM_AUDIO_AMP_MUTE 29 /* 1=>mute, 0=>unmute */ |
316 | #define XINE_PARAM_FINE_SPEED 30 /* 1.000.000 => normal speed */ |
317 | #define XINE_PARAM_EARLY_FINISHED_EVENT 31 /* send event when demux finish*/ |
318 | #define XINE_PARAM_GAPLESS_SWITCH 32 /* next stream only gapless swi*/ |
319 | #define XINE_PARAM_DELAY_FINISHED_EVENT 33 /* 1/10sec,0=>disable,-1=>forev*/ |
320 | |
321 | /* |
322 | * speed values for XINE_PARAM_SPEED parameter. |
323 | * |
324 | * alternatively, one may use XINE_PARAM_FINE_SPEED for greater |
325 | * control of the speed value, where: |
326 | * XINE_PARAM_SPEED / 4 <-> XINE_PARAM_FINE_SPEED / 1000000 |
327 | */ |
328 | #define XINE_SPEED_PAUSE 0 |
329 | #define XINE_SPEED_SLOW_4 1 |
330 | #define XINE_SPEED_SLOW_2 2 |
331 | #define XINE_SPEED_NORMAL 4 |
332 | #define XINE_SPEED_FAST_2 8 |
333 | #define XINE_SPEED_FAST_4 16 |
334 | |
335 | /* normal speed value for XINE_PARAM_FINE_SPEED parameter */ |
336 | #define XINE_FINE_SPEED_NORMAL 1000000 |
337 | |
338 | /* video parameters */ |
339 | #define XINE_PARAM_VO_DEINTERLACE 0x01000000 /* bool */ |
340 | #define XINE_PARAM_VO_ASPECT_RATIO 0x01000001 /* see below */ |
341 | #define XINE_PARAM_VO_HUE 0x01000002 /* 0..65535 */ |
342 | #define XINE_PARAM_VO_SATURATION 0x01000003 /* 0..65535 */ |
343 | #define XINE_PARAM_VO_CONTRAST 0x01000004 /* 0..65535 */ |
344 | #define XINE_PARAM_VO_BRIGHTNESS 0x01000005 /* 0..65535 */ |
345 | #define XINE_PARAM_VO_GAMMA 0x0100000c /* 0..65535 */ |
346 | #define XINE_PARAM_VO_ZOOM_X 0x01000008 /* percent */ |
347 | #define XINE_PARAM_VO_ZOOM_Y 0x0100000d /* percent */ |
348 | #define XINE_PARAM_VO_PAN_SCAN 0x01000009 /* bool */ |
349 | #define XINE_PARAM_VO_TVMODE 0x0100000a /* ??? */ |
350 | #define XINE_PARAM_VO_WINDOW_WIDTH 0x0100000f /* readonly */ |
351 | #define XINE_PARAM_VO_WINDOW_HEIGHT 0x01000010 /* readonly */ |
352 | #define XINE_PARAM_VO_SHARPNESS 0x01000018 /* 0..65535 */ |
353 | #define XINE_PARAM_VO_NOISE_REDUCTION 0x01000019 /* 0..65535 */ |
354 | #define XINE_PARAM_VO_CROP_LEFT 0x01000020 /* crop frame pixels */ |
355 | #define XINE_PARAM_VO_CROP_RIGHT 0x01000021 /* crop frame pixels */ |
356 | #define XINE_PARAM_VO_CROP_TOP 0x01000022 /* crop frame pixels */ |
357 | #define XINE_PARAM_VO_CROP_BOTTOM 0x01000023 /* crop frame pixels */ |
358 | |
359 | #define XINE_VO_ZOOM_STEP 100 |
360 | #define XINE_VO_ZOOM_MAX 400 |
361 | #define XINE_VO_ZOOM_MIN -85 |
362 | |
363 | /* possible ratios for XINE_PARAM_VO_ASPECT_RATIO */ |
364 | #define XINE_VO_ASPECT_AUTO 0 |
365 | #define XINE_VO_ASPECT_SQUARE 1 /* 1:1 */ |
366 | #define XINE_VO_ASPECT_4_3 2 /* 4:3 */ |
367 | #define XINE_VO_ASPECT_ANAMORPHIC 3 /* 16:9 */ |
368 | #define XINE_VO_ASPECT_DVB 4 /* 2.11:1 */ |
369 | #define XINE_VO_ASPECT_NUM_RATIOS 5 |
370 | #ifndef XINE_DISABLE_DEPRECATED_FEATURES |
371 | #define XINE_VO_ASPECT_PAN_SCAN 41 |
372 | #define XINE_VO_ASPECT_DONT_TOUCH 42 |
373 | #endif |
374 | |
375 | /* stream format detection strategies */ |
376 | |
377 | /* recognize stream type first by content then by extension. */ |
378 | #define XINE_DEMUX_DEFAULT_STRATEGY 0 |
379 | /* recognize stream type first by extension then by content. */ |
380 | #define XINE_DEMUX_REVERT_STRATEGY 1 |
381 | /* recognize stream type by content only. */ |
382 | #define XINE_DEMUX_CONTENT_STRATEGY 2 |
383 | /* recognize stream type by extension only. */ |
384 | #define XINE_DEMUX_EXTENSION_STRATEGY 3 |
385 | |
386 | /* verbosity settings */ |
387 | #define XINE_VERBOSITY_NONE 0 |
388 | #define XINE_VERBOSITY_LOG 1 |
389 | #define XINE_VERBOSITY_DEBUG 2 |
390 | |
391 | /* |
392 | * snapshot function |
393 | * |
394 | * image format can be YUV 4:2:0 or 4:2:2 |
395 | * will copy the image data into memory that <img> points to |
396 | * (interleaved for yuv 4:2:2 or planary for 4:2:0) |
397 | * |
398 | * xine_get_current_frame() requires that <img> must be able |
399 | * to hold the image data. Use a NULL pointer to retrieve the |
400 | * necessary parameters for calculating the buffer size. Be |
401 | * aware that the image can change between two successive calls |
402 | * so you better pause the stream. |
403 | * |
404 | * xine_get_current_frame_s() requires to specify the buffer |
405 | * size and it returns the needed / used size. It won't copy |
406 | * image data into a too small buffer. |
407 | * |
408 | * xine_get_current_frame_alloc() takes care of allocating |
409 | * a buffer on its own, so image data can be retrieved by |
410 | * a single call without the need to pause the stream. |
411 | * |
412 | * xine_get_current_frame_data() passes the parameters of the |
413 | * previously mentioned functions plus further information in |
414 | * a structure and can work like the _s or _alloc function |
415 | * respectively depending on the passed flags. |
416 | * |
417 | * all functions return 1 on success, 0 failure. |
418 | */ |
419 | int xine_get_current_frame (xine_stream_t *stream, |
420 | int *width, int *height, |
421 | int *ratio_code, int *format, |
422 | uint8_t *img) XINE_PROTECTED; |
423 | |
424 | int xine_get_current_frame_s (xine_stream_t *stream, |
425 | int *width, int *height, |
426 | int *ratio_code, int *format, |
427 | uint8_t *img, int *img_size) XINE_PROTECTED; |
428 | |
429 | int xine_get_current_frame_alloc (xine_stream_t *stream, |
430 | int *width, int *height, |
431 | int *ratio_code, int *format, |
432 | uint8_t **img, int *img_size) XINE_PROTECTED; |
433 | |
434 | typedef struct { |
435 | |
436 | int width; |
437 | int height; |
438 | int crop_left; |
439 | int crop_right; |
440 | int crop_top; |
441 | int crop_bottom; |
442 | int ratio_code; |
443 | int interlaced; |
444 | int format; |
445 | int img_size; |
446 | uint8_t *img; |
447 | } xine_current_frame_data_t; |
448 | |
449 | #define XINE_FRAME_DATA_ALLOCATE_IMG (1<<0) |
450 | |
451 | int xine_get_current_frame_data (xine_stream_t *stream, |
452 | xine_current_frame_data_t *data, |
453 | int flags) XINE_PROTECTED; |
454 | |
455 | /* xine image formats */ |
456 | #define XINE_IMGFMT_YV12 (('2'<<24)|('1'<<16)|('V'<<8)|'Y') |
457 | #define XINE_IMGFMT_YUY2 (('2'<<24)|('Y'<<16)|('U'<<8)|'Y') |
458 | #define XINE_IMGFMT_XVMC (('C'<<24)|('M'<<16)|('v'<<8)|'X') |
459 | #define XINE_IMGFMT_XXMC (('C'<<24)|('M'<<16)|('x'<<8)|'X') |
460 | #define XINE_IMGFMT_VDPAU (('A'<<24)|('P'<<16)|('D'<<8)|'V') |
461 | #define XINE_IMGFMT_VAAPI (('P'<<24)|('A'<<16)|('A'<<8)|'V') |
462 | |
463 | /* get current xine's virtual presentation timestamp (1/90000 sec) |
464 | * note: this is mostly internal data. |
465 | * one can use vpts with xine_osd_show() and xine_osd_hide(). |
466 | */ |
467 | int64_t xine_get_current_vpts(xine_stream_t *stream) XINE_PROTECTED; |
468 | |
469 | |
470 | /* |
471 | * Continuous video frame grabbing feature. |
472 | * |
473 | * In opposite to the 'xine_get_current_frame' based snapshot function this grabbing |
474 | * feature allow continuous grabbing of last or next displayed video frame. |
475 | * Grabbed video frames are returned in simple three byte RGB format. |
476 | * |
477 | * Depending on the capabilities of the used video output driver video image data is |
478 | * taken as close as possible at the end of the video processing chain. Thus a returned |
479 | * video image could contain the blended OSD data, is deinterlaced, cropped and scaled |
480 | * and video properties like hue, sat could be applied. |
481 | * If a video output driver does not have a decent grabbing implementation then there |
482 | * is a generic fallback feature that grabs the video frame as they are taken from the video |
483 | * display queue (like the xine_get_current_frame' function). |
484 | * In this case color correct conversation to a RGB image incorporating source cropping |
485 | * and scaling to the requested grab size is also supported. |
486 | * |
487 | * The caller must first request a new video grab frame using the public 'xine_new_grab_video_frame' |
488 | * function. Then the caller should populate the frame with the wanted source cropping, grab image |
489 | * size and control flags. After that grab requests could be done by calling the supplied grab() feature |
490 | * of the frame. At the end a call to the supplied dispose() feature of the frame releases all needed |
491 | * resources. |
492 | * The caller should have acquired a port ticket while calling these features. |
493 | * |
494 | */ |
495 | #define HAVE_XINE_GRAB_VIDEO_FRAME 1 |
496 | |
497 | /* |
498 | * frame structure used for grabbing video frames of format RGB. |
499 | */ |
500 | typedef struct xine_grab_video_frame_s xine_grab_video_frame_t; |
501 | struct xine_grab_video_frame_s { |
502 | /* |
503 | * grab last/next displayed image. |
504 | * returns 0 if grab is successful, 1 on timeout and -1 on error |
505 | */ |
506 | int (*grab) (xine_grab_video_frame_t *self); |
507 | |
508 | /* |
509 | * free all resources. |
510 | */ |
511 | void (*dispose) (xine_grab_video_frame_t *self); |
512 | |
513 | /* |
514 | * Cropping of source image. Has to be specified by caller. |
515 | */ |
516 | int crop_left; |
517 | int crop_right; |
518 | int crop_top; |
519 | int crop_bottom; |
520 | |
521 | /* |
522 | * Parameters of returned RGB image. |
523 | * Caller can specify wanted frame size giving width and/or height a value > 0. |
524 | * In this case the grabbed image is scaled to the requested size. |
525 | * Otherwise the grab function returns the actual size of the grabbed image |
526 | * in width/height without scaling the image. |
527 | */ |
528 | int width, height; /* requested/returned size of image */ |
529 | uint8_t *img; /* returned RGB image data taking three bytes per pixel */ |
530 | int64_t vpts; /* virtual presentation timestamp (1/90000 sec) of returned frame */ |
531 | |
532 | int timeout; /* Max. time to wait for next displayed frame in milliseconds */ |
533 | int flags; /* Controlling flags. See XINE_GRAB_VIDEO_FRAME_FLAGS_* definitions */ |
534 | }; |
535 | |
536 | #define XINE_GRAB_VIDEO_FRAME_FLAGS_CONTINUOUS 0x01 /* optimize resource allocation for continuous frame grabbing */ |
537 | #define XINE_GRAB_VIDEO_FRAME_FLAGS_WAIT_NEXT 0x02 /* wait for next display frame instead of using last displayed frame */ |
538 | |
539 | #define XINE_GRAB_VIDEO_FRAME_DEFAULT_TIMEOUT 500 |
540 | |
541 | /* |
542 | * Allocate new grab video frame. Returns NULL on error. |
543 | */ |
544 | xine_grab_video_frame_t* xine_new_grab_video_frame (xine_stream_t *stream) XINE_PROTECTED; |
545 | |
546 | |
547 | /********************************************************************* |
548 | * media processing * |
549 | *********************************************************************/ |
550 | |
551 | #ifdef XINE_ENABLE_EXPERIMENTAL_FEATURES |
552 | |
553 | /* |
554 | * access to decoded audio and video frames from a stream |
555 | * these functions are intended to provide the basis for |
556 | * re-encoding and other video processing applications |
557 | * |
558 | * note that the xine playback engine will block when |
559 | * rendering to a framegrab port: to unblock the stream, |
560 | * you must fetch the frames manually with the |
561 | * xine_get_next_* functions. this ensures that a |
562 | * framegrab port is guaranteed to never miss a frame. |
563 | * |
564 | */ |
565 | |
566 | xine_video_port_t *xine_new_framegrab_video_port (xine_t *self) XINE_PROTECTED; |
567 | |
568 | typedef struct { |
569 | |
570 | int64_t vpts; /* timestamp 1/90000 sec for a/v sync */ |
571 | int64_t duration; |
572 | double aspect_ratio; |
573 | int width, height; |
574 | int colorspace; /* XINE_IMGFMT_* */ |
575 | |
576 | int pos_stream; /* bytes from stream start */ |
577 | int pos_time; /* milliseconds */ |
578 | |
579 | int frame_number; /* frame number (may be unknown) */ |
580 | |
581 | uint8_t *data; |
582 | void *xine_frame; /* used internally by xine engine */ |
583 | } xine_video_frame_t; |
584 | |
585 | int xine_get_next_video_frame (xine_video_port_t *port, |
586 | xine_video_frame_t *frame) XINE_PROTECTED; |
587 | |
588 | void xine_free_video_frame (xine_video_port_t *port, xine_video_frame_t *frame) XINE_PROTECTED; |
589 | |
590 | xine_audio_port_t *xine_new_framegrab_audio_port (xine_t *self) XINE_PROTECTED; |
591 | |
592 | typedef struct { |
593 | |
594 | int64_t vpts; /* timestamp 1/90000 sec for a/v sync */ |
595 | int num_samples; |
596 | int sample_rate; |
597 | int num_channels; |
598 | int bits_per_sample; /* per channel */ |
599 | |
600 | uint8_t *data; |
601 | void *xine_frame; /* used internally by xine engine */ |
602 | |
603 | off_t pos_stream; /* bytes from stream start */ |
604 | int pos_time; /* milliseconds */ |
605 | } xine_audio_frame_t; |
606 | |
607 | int xine_get_next_audio_frame (xine_audio_port_t *port, |
608 | xine_audio_frame_t *frame) XINE_PROTECTED; |
609 | |
610 | void xine_free_audio_frame (xine_audio_port_t *port, xine_audio_frame_t *frame) XINE_PROTECTED; |
611 | |
612 | #endif |
613 | |
614 | |
615 | /********************************************************************* |
616 | * post plugin handling * |
617 | *********************************************************************/ |
618 | |
619 | /* |
620 | * post effect plugin functions |
621 | * |
622 | * after the data leaves the decoder it can pass an arbitrary tree |
623 | * of post plugins allowing for effects to be applied to the video |
624 | * frames/audio buffers before they reach the output stage |
625 | */ |
626 | |
627 | typedef struct xine_post_s xine_post_t; |
628 | |
629 | struct xine_post_s { |
630 | |
631 | /* a NULL-terminated array of audio input ports this post plugin |
632 | * provides; you can hand these to other post plugin's outputs or |
633 | * pass them to the initialization of streams |
634 | */ |
635 | xine_audio_port_t **audio_input; |
636 | |
637 | /* a NULL-terminated array of video input ports this post plugin |
638 | * provides; you can hand these to other post plugin's outputs or |
639 | * pass them to the initialization of streams |
640 | */ |
641 | xine_video_port_t **video_input; |
642 | |
643 | /* the type of the post plugin |
644 | * one of XINE_POST_TYPE_* can be used here |
645 | */ |
646 | int type; |
647 | |
648 | }; |
649 | |
650 | /* |
651 | * initialize a post plugin |
652 | * |
653 | * returns xine_post_t* on success, NULL on failure |
654 | * |
655 | * Initializes the post plugin with the given name and connects its |
656 | * outputs to the NULL-terminated arrays of audio and video ports. |
657 | * Some plugins also care about the number of inputs you request |
658 | * (e.g. mixer plugins), others simply ignore this number. |
659 | */ |
660 | xine_post_t *xine_post_init(xine_t *xine, const char *name, |
661 | int inputs, |
662 | xine_audio_port_t **audio_target, |
663 | xine_video_port_t **video_target) XINE_PROTECTED; |
664 | |
665 | /* get a list of all available post plugins */ |
666 | const char *const *xine_list_post_plugins(xine_t *xine) XINE_PROTECTED; |
667 | |
668 | /* get a list of all post plugins of one type */ |
669 | const char *const *xine_list_post_plugins_typed(xine_t *xine, uint32_t type) XINE_PROTECTED; |
670 | |
671 | /* |
672 | * post plugin input/output |
673 | * |
674 | * These structures encapsulate inputs/outputs for post plugins |
675 | * to transfer arbitrary data. Frontends can also provide inputs |
676 | * and outputs and connect them to post plugins to exchange data |
677 | * with them. |
678 | */ |
679 | |
680 | typedef struct xine_post_in_s xine_post_in_t; |
681 | typedef struct xine_post_out_s xine_post_out_t; |
682 | |
683 | struct xine_post_in_s { |
684 | |
685 | /* the name identifying this input */ |
686 | const char *name; |
687 | |
688 | /* the data pointer; input is directed to this memory location, |
689 | * so you simply access the pointer to access the input data */ |
690 | void *data; |
691 | |
692 | /* the datatype of this input, use one of XINE_POST_DATA_* here */ |
693 | int type; |
694 | |
695 | }; |
696 | |
697 | struct xine_post_out_s { |
698 | |
699 | /* the name identifying this output */ |
700 | const char *name; |
701 | |
702 | /* the data pointer; output should be directed to this memory location, |
703 | * so in the easy case you simply write through the pointer */ |
704 | void *data; |
705 | |
706 | /* this function is called, when the output should be redirected |
707 | * to another input, you sould set the data pointer to direct |
708 | * any output to this new input; |
709 | * a special situation is, when this function is called with a NULL |
710 | * argument: in this case you should disconnect the data pointer |
711 | * from any output and if necessary to avoid writing to some stray |
712 | * memory you should make it point to some dummy location, |
713 | * returns 1 on success, 0 on failure; |
714 | * if you do not implement rewiring, set this to NULL */ |
715 | int (*rewire) (xine_post_out_t *self, void *data); |
716 | |
717 | /* the datatype of this output, use one of XINE_POST_DATA_* here */ |
718 | int type; |
719 | |
720 | }; |
721 | |
722 | /* get a list of all inputs of a post plugin */ |
723 | const char *const *xine_post_list_inputs(xine_post_t *self) XINE_PROTECTED; |
724 | |
725 | /* get a list of all outputs of a post plugin */ |
726 | const char *const *xine_post_list_outputs(xine_post_t *self) XINE_PROTECTED; |
727 | |
728 | /* retrieve one specific input of a post plugin */ |
729 | xine_post_in_t *xine_post_input(xine_post_t *self, const char *name) XINE_PROTECTED; |
730 | |
731 | /* retrieve one specific output of a post plugin */ |
732 | xine_post_out_t *xine_post_output(xine_post_t *self, const char *name) XINE_PROTECTED; |
733 | |
734 | /* |
735 | * wire an input to an output |
736 | * returns 1 on success, 0 on failure |
737 | */ |
738 | int xine_post_wire(xine_post_out_t *source, xine_post_in_t *target) XINE_PROTECTED; |
739 | |
740 | /* |
741 | * wire a video port to a video output |
742 | * This can be used to rewire different post plugins to the video output |
743 | * plugin layer. The ports you hand in at xine_post_init() will already |
744 | * be wired with the post plugin, so you need this function for |
745 | * _re_connecting only. |
746 | * |
747 | * returns 1 on success, 0 on failure |
748 | */ |
749 | int xine_post_wire_video_port(xine_post_out_t *source, xine_video_port_t *vo) XINE_PROTECTED; |
750 | |
751 | /* |
752 | * wire an audio port to an audio output |
753 | * This can be used to rewire different post plugins to the audio output |
754 | * plugin layer. The ports you hand in at xine_post_init() will already |
755 | * be wired with the post plugin, so you need this function for |
756 | * _re_connecting only. |
757 | * |
758 | * returns 1 on success, 0 on failure |
759 | */ |
760 | int xine_post_wire_audio_port(xine_post_out_t *source, xine_audio_port_t *ao) XINE_PROTECTED; |
761 | |
762 | /* |
763 | * Extracts an output for a stream. Use this to rewire the outputs of streams. |
764 | */ |
765 | xine_post_out_t * xine_get_video_source(xine_stream_t *stream) XINE_PROTECTED; |
766 | xine_post_out_t * xine_get_audio_source(xine_stream_t *stream) XINE_PROTECTED; |
767 | |
768 | /* |
769 | * disposes the post plugin |
770 | * please make sure that no other post plugin and no stream is |
771 | * connected to any of this plugin's inputs |
772 | */ |
773 | void xine_post_dispose(xine_t *xine, xine_post_t *self) XINE_PROTECTED; |
774 | |
775 | |
776 | /* post plugin types */ |
777 | #define XINE_POST_TYPE_VIDEO_FILTER 0x010000 |
778 | #define XINE_POST_TYPE_VIDEO_VISUALIZATION 0x010001 |
779 | #define XINE_POST_TYPE_VIDEO_COMPOSE 0x010002 |
780 | #define XINE_POST_TYPE_AUDIO_FILTER 0x020000 |
781 | #define XINE_POST_TYPE_AUDIO_VISUALIZATION 0x020001 |
782 | |
783 | |
784 | /* post plugin data types */ |
785 | |
786 | /* video port data |
787 | * input->data is a xine_video_port_t* |
788 | * output->data usually is a xine_video_port_t** |
789 | */ |
790 | #define XINE_POST_DATA_VIDEO 0 |
791 | |
792 | /* audio port data |
793 | * input->data is a xine_audio_port_t* |
794 | * output->data usually is a xine_audio_port_t** |
795 | */ |
796 | #define XINE_POST_DATA_AUDIO 1 |
797 | |
798 | /* integer data |
799 | * input->data is a int* |
800 | * output->data usually is a int* |
801 | */ |
802 | #define XINE_POST_DATA_INT 3 |
803 | |
804 | /* double precision floating point data |
805 | * input->data is a double* |
806 | * output->data usually is a double* |
807 | */ |
808 | #define XINE_POST_DATA_DOUBLE 4 |
809 | |
810 | /* parameters api (used by frontends) |
811 | * input->data is xine_post_api_t* (see below) |
812 | */ |
813 | #define XINE_POST_DATA_PARAMETERS 5 |
814 | |
815 | /* defines a single parameter entry. */ |
816 | typedef struct { |
817 | int type; /* POST_PARAM_TYPE_xxx */ |
818 | const char *name; /* name of this parameter */ |
819 | int size; /* sizeof(parameter) */ |
820 | int offset; /* offset in bytes from struct ptr */ |
821 | char **enum_values; /* enumeration (first=0) or NULL */ |
822 | double range_min; /* minimum value */ |
823 | double range_max; /* maximum value */ |
824 | int readonly; /* 0 = read/write, 1=read-only */ |
825 | const char *description; /* user-friendly description */ |
826 | } xine_post_api_parameter_t; |
827 | |
828 | /* description of parameters struct (params). */ |
829 | typedef struct { |
830 | int struct_size; /* sizeof(params) */ |
831 | xine_post_api_parameter_t *parameter; /* list of parameters */ |
832 | } xine_post_api_descr_t; |
833 | |
834 | typedef struct { |
835 | /* |
836 | * method to set all the read/write parameters. |
837 | * params is a struct * defined by xine_post_api_descr_t |
838 | */ |
839 | int (*set_parameters) (xine_post_t *self, void *params); |
840 | |
841 | /* |
842 | * method to get all parameters. |
843 | */ |
844 | int (*get_parameters) (xine_post_t *self, void *params); |
845 | |
846 | /* |
847 | * method to get params struct definition |
848 | */ |
849 | xine_post_api_descr_t * (*get_param_descr) (void); |
850 | |
851 | /* |
852 | * method to get plugin and parameters help (UTF-8) |
853 | * the help string must be word wrapped by the frontend. |
854 | * it might contain \n to mark paragraph breaks. |
855 | */ |
856 | char * (*get_help) (void); |
857 | } xine_post_api_t; |
858 | |
859 | /* post parameter types */ |
860 | #define POST_PARAM_TYPE_LAST 0 /* terminator of parameter list */ |
861 | #define POST_PARAM_TYPE_INT 1 /* integer (or vector of integers) */ |
862 | #define POST_PARAM_TYPE_DOUBLE 2 /* double (or vector of doubles) */ |
863 | #define POST_PARAM_TYPE_CHAR 3 /* char (or vector of chars = string) */ |
864 | #define POST_PARAM_TYPE_STRING 4 /* (char *), ASCIIZ */ |
865 | #define POST_PARAM_TYPE_STRINGLIST 5 /* (char **) list, NULL terminated */ |
866 | #define POST_PARAM_TYPE_BOOL 6 /* integer (0 or 1) */ |
867 | |
868 | |
869 | /********************************************************************* |
870 | * information retrieval * |
871 | *********************************************************************/ |
872 | |
873 | /* |
874 | * xine log functions |
875 | * |
876 | * frontends can display xine log output using these functions |
877 | */ |
878 | int xine_get_log_section_count(xine_t *self) XINE_PROTECTED; |
879 | |
880 | /* return a NULL terminated array of log sections names */ |
881 | const char *const *xine_get_log_names(xine_t *self) XINE_PROTECTED; |
882 | |
883 | /* print some log information to <buf> section */ |
884 | void xine_log (xine_t *self, int buf, |
885 | const char *format, ...) XINE_FORMAT_PRINTF(3, 4) XINE_PROTECTED; |
886 | void xine_vlog(xine_t *self, int buf, |
887 | const char *format, va_list args) XINE_FORMAT_PRINTF(3, 0) XINE_PROTECTED; |
888 | |
889 | /* get log messages of specified section */ |
890 | char *const *xine_get_log (xine_t *self, int buf) XINE_PROTECTED; |
891 | |
892 | /* log callback will be called whenever something is logged */ |
893 | typedef void (*xine_log_cb_t) (void *user_data, int section); |
894 | void xine_register_log_cb (xine_t *self, xine_log_cb_t cb, |
895 | void *user_data) XINE_PROTECTED; |
896 | |
897 | /* |
898 | * error handling / engine status |
899 | */ |
900 | |
901 | /* return last error */ |
902 | int xine_get_error (xine_stream_t *stream) XINE_PROTECTED; |
903 | |
904 | /* get current xine engine status (constants see below) */ |
905 | int xine_get_status (xine_stream_t *stream) XINE_PROTECTED; |
906 | |
907 | /* |
908 | * engine status codes |
909 | */ |
910 | #define XINE_STATUS_IDLE 0 /* no mrl assigned */ |
911 | #define XINE_STATUS_STOP 1 |
912 | #define XINE_STATUS_PLAY 2 |
913 | #define XINE_STATUS_QUIT 3 |
914 | |
915 | /* |
916 | * xine error codes |
917 | */ |
918 | #define XINE_ERROR_NONE 0 |
919 | #define XINE_ERROR_NO_INPUT_PLUGIN 1 |
920 | #define XINE_ERROR_NO_DEMUX_PLUGIN 2 |
921 | #define XINE_ERROR_DEMUX_FAILED 3 |
922 | #define XINE_ERROR_MALFORMED_MRL 4 |
923 | #define XINE_ERROR_INPUT_FAILED 5 |
924 | |
925 | /* |
926 | * try to find out audio/spu language of given channel |
927 | * (use -1 for current channel) |
928 | * |
929 | * lang must point to a buffer of at least XINE_LANG_MAX bytes |
930 | * |
931 | * returns 1 on success, 0 on failure |
932 | */ |
933 | int xine_get_audio_lang (xine_stream_t *stream, int channel, |
934 | char *lang) XINE_PROTECTED; |
935 | int xine_get_spu_lang (xine_stream_t *stream, int channel, |
936 | char *lang) XINE_PROTECTED; |
937 | /*_x_ increasing this number means an incompatible ABI breakage! */ |
938 | #define XINE_LANG_MAX 32 |
939 | |
940 | /* |
941 | * get position / length information |
942 | * |
943 | * depending of the nature and system layer of the stream, |
944 | * some or all of this information may be unavailable or incorrect |
945 | * (e.g. live network streams may not have a valid length) |
946 | * |
947 | * returns 1 on success, 0 on failure (data was not updated, |
948 | * probably because it's not known yet... try again later) |
949 | */ |
950 | int xine_get_pos_length (xine_stream_t *stream, |
951 | int *pos_stream, /* 0..65535 */ |
952 | int *pos_time, /* milliseconds */ |
953 | int *length_time) /* milliseconds */ |
954 | XINE_PROTECTED; |
955 | |
956 | /* |
957 | * get information about the stream such as |
958 | * video width/height, codecs, audio format, title, author... |
959 | * strings are UTF-8 encoded. |
960 | * |
961 | * constants see below |
962 | */ |
963 | uint32_t xine_get_stream_info (xine_stream_t *stream, int info) XINE_PROTECTED; |
964 | const char *xine_get_meta_info (xine_stream_t *stream, int info) XINE_PROTECTED; |
965 | |
966 | /* xine_get_stream_info */ |
967 | #define XINE_STREAM_INFO_BITRATE 0 |
968 | #define XINE_STREAM_INFO_SEEKABLE 1 |
969 | #define XINE_STREAM_INFO_VIDEO_WIDTH 2 |
970 | #define XINE_STREAM_INFO_VIDEO_HEIGHT 3 |
971 | #define XINE_STREAM_INFO_VIDEO_RATIO 4 /* *10000 */ |
972 | #define XINE_STREAM_INFO_VIDEO_CHANNELS 5 |
973 | #define XINE_STREAM_INFO_VIDEO_STREAMS 6 |
974 | #define XINE_STREAM_INFO_VIDEO_BITRATE 7 |
975 | #define XINE_STREAM_INFO_VIDEO_FOURCC 8 |
976 | #define XINE_STREAM_INFO_VIDEO_HANDLED 9 /* codec available? */ |
977 | #define XINE_STREAM_INFO_FRAME_DURATION 10 /* 1/90000 sec */ |
978 | #define XINE_STREAM_INFO_AUDIO_CHANNELS 11 |
979 | #define XINE_STREAM_INFO_AUDIO_BITS 12 |
980 | #define XINE_STREAM_INFO_AUDIO_SAMPLERATE 13 |
981 | #define XINE_STREAM_INFO_AUDIO_BITRATE 14 |
982 | #define XINE_STREAM_INFO_AUDIO_FOURCC 15 |
983 | #define XINE_STREAM_INFO_AUDIO_HANDLED 16 /* codec available? */ |
984 | #define XINE_STREAM_INFO_HAS_CHAPTERS 17 |
985 | #define XINE_STREAM_INFO_HAS_VIDEO 18 |
986 | #define XINE_STREAM_INFO_HAS_AUDIO 19 |
987 | #define XINE_STREAM_INFO_IGNORE_VIDEO 20 |
988 | #define XINE_STREAM_INFO_IGNORE_AUDIO 21 |
989 | #define XINE_STREAM_INFO_IGNORE_SPU 22 |
990 | #define XINE_STREAM_INFO_VIDEO_HAS_STILL 23 |
991 | #define XINE_STREAM_INFO_MAX_AUDIO_CHANNEL 24 |
992 | #define XINE_STREAM_INFO_MAX_SPU_CHANNEL 25 |
993 | #define XINE_STREAM_INFO_AUDIO_MODE 26 |
994 | #define XINE_STREAM_INFO_SKIPPED_FRAMES 27 /* for 1000 frames delivered */ |
995 | #define XINE_STREAM_INFO_DISCARDED_FRAMES 28 /* for 1000 frames delivered */ |
996 | #define XINE_STREAM_INFO_VIDEO_AFD 29 |
997 | #define XINE_STREAM_INFO_DVD_TITLE_NUMBER 30 |
998 | #define XINE_STREAM_INFO_DVD_TITLE_COUNT 31 |
999 | #define XINE_STREAM_INFO_DVD_CHAPTER_NUMBER 32 |
1000 | #define XINE_STREAM_INFO_DVD_CHAPTER_COUNT 33 |
1001 | #define XINE_STREAM_INFO_DVD_ANGLE_NUMBER 34 |
1002 | #define XINE_STREAM_INFO_DVD_ANGLE_COUNT 35 |
1003 | |
1004 | /* possible values for XINE_STREAM_INFO_VIDEO_AFD */ |
1005 | #define XINE_VIDEO_AFD_NOT_PRESENT -1 |
1006 | #define XINE_VIDEO_AFD_RESERVED_0 0 |
1007 | #define XINE_VIDEO_AFD_RESERVED_1 1 |
1008 | #define XINE_VIDEO_AFD_BOX_16_9_TOP 2 |
1009 | #define XINE_VIDEO_AFD_BOX_14_9_TOP 3 |
1010 | #define XINE_VIDEO_AFD_BOX_GT_16_9_CENTRE 4 |
1011 | #define XINE_VIDEO_AFD_RESERVED_5 5 |
1012 | #define XINE_VIDEO_AFD_RESERVED_6 6 |
1013 | #define XINE_VIDEO_AFD_RESERVED_7 7 |
1014 | #define XINE_VIDEO_AFD_SAME_AS_FRAME 8 |
1015 | #define XINE_VIDEO_AFD_4_3_CENTRE 9 |
1016 | #define XINE_VIDEO_AFD_16_9_CENTRE 10 |
1017 | #define XINE_VIDEO_AFD_14_9_CENTRE 11 |
1018 | #define XINE_VIDEO_AFD_RESERVED_12 12 |
1019 | #define XINE_VIDEO_AFD_4_3_PROTECT_14_9 13 |
1020 | #define XINE_VIDEO_AFD_16_9_PROTECT_14_9 14 |
1021 | #define XINE_VIDEO_AFD_16_9_PROTECT_4_3 15 |
1022 | |
1023 | /* xine_get_meta_info */ |
1024 | #define XINE_META_INFO_TITLE 0 |
1025 | #define XINE_META_INFO_COMMENT 1 |
1026 | #define XINE_META_INFO_ARTIST 2 |
1027 | #define XINE_META_INFO_GENRE 3 |
1028 | #define XINE_META_INFO_ALBUM 4 |
1029 | #define XINE_META_INFO_YEAR 5 /* may be full date */ |
1030 | #define XINE_META_INFO_VIDEOCODEC 6 |
1031 | #define XINE_META_INFO_AUDIOCODEC 7 |
1032 | #define XINE_META_INFO_SYSTEMLAYER 8 |
1033 | #define XINE_META_INFO_INPUT_PLUGIN 9 |
1034 | #define XINE_META_INFO_CDINDEX_DISCID 10 |
1035 | #define XINE_META_INFO_TRACK_NUMBER 11 |
1036 | #define XINE_META_INFO_COMPOSER 12 |
1037 | /* post-1.1.17; taken from the list at http://age.hobba.nl/audio/mirroredpages/ogg-tagging.html on 2009-12-11 */ |
1038 | #define XINE_META_INFO_PUBLISHER 13 |
1039 | #define XINE_META_INFO_COPYRIGHT 14 |
1040 | #define XINE_META_INFO_LICENSE 15 |
1041 | #define XINE_META_INFO_ARRANGER 16 |
1042 | #define XINE_META_INFO_LYRICIST 17 |
1043 | #define XINE_META_INFO_AUTHOR 18 |
1044 | #define XINE_META_INFO_CONDUCTOR 19 |
1045 | #define XINE_META_INFO_PERFORMER 20 |
1046 | #define XINE_META_INFO_ENSEMBLE 21 |
1047 | #define XINE_META_INFO_OPUS 22 |
1048 | #define XINE_META_INFO_PART 23 |
1049 | #define XINE_META_INFO_PARTNUMBER 24 |
1050 | #define XINE_META_INFO_LOCATION 25 |
1051 | /* post-1.1.18.1 */ |
1052 | #define XINE_META_INFO_DISCNUMBER 26 |
1053 | |
1054 | |
1055 | /********************************************************************* |
1056 | * plugin management / autoplay / mrl browsing * |
1057 | *********************************************************************/ |
1058 | |
1059 | /* |
1060 | * note: the pointers to strings or string arrays returned |
1061 | * by some of these functions are pointers to statically |
1062 | * alloced internal xine memory chunks. |
1063 | * they're only valid between xine function calls |
1064 | * and should never be free()d. |
1065 | */ |
1066 | |
1067 | typedef struct { |
1068 | char *origin; /* file plugin: path */ |
1069 | char *mrl; /* <type>://<location> */ |
1070 | char *link; |
1071 | off_t size; /* size of this source, may be 0 */ |
1072 | uint32_t type; /* see below */ |
1073 | } xine_mrl_t; |
1074 | |
1075 | /* mrl types */ |
1076 | #define XINE_MRL_TYPE_unknown (0 << 0) |
1077 | #define XINE_MRL_TYPE_dvd (1 << 0) |
1078 | #define XINE_MRL_TYPE_vcd (1 << 1) |
1079 | #define XINE_MRL_TYPE_net (1 << 2) |
1080 | #define XINE_MRL_TYPE_rtp (1 << 3) |
1081 | #define XINE_MRL_TYPE_stdin (1 << 4) |
1082 | #define XINE_MRL_TYPE_cda (1 << 5) |
1083 | #define XINE_MRL_TYPE_file (1 << 6) |
1084 | #define XINE_MRL_TYPE_file_fifo (1 << 7) |
1085 | #define XINE_MRL_TYPE_file_chardev (1 << 8) |
1086 | #define XINE_MRL_TYPE_file_directory (1 << 9) |
1087 | #define XINE_MRL_TYPE_file_blockdev (1 << 10) |
1088 | #define XINE_MRL_TYPE_file_normal (1 << 11) |
1089 | #define XINE_MRL_TYPE_file_symlink (1 << 12) |
1090 | #define XINE_MRL_TYPE_file_sock (1 << 13) |
1091 | #define XINE_MRL_TYPE_file_exec (1 << 14) |
1092 | #define XINE_MRL_TYPE_file_backup (1 << 15) |
1093 | #define XINE_MRL_TYPE_file_hidden (1 << 16) |
1094 | |
1095 | /* get a list of browsable input plugin ids */ |
1096 | const char *const *xine_get_browsable_input_plugin_ids (xine_t *self) XINE_PROTECTED; |
1097 | |
1098 | /* |
1099 | * ask input plugin named <plugin_id> to return |
1100 | * a list of available MRLs in domain/directory <start_mrl>. |
1101 | * |
1102 | * <start_mrl> may be NULL indicating the toplevel domain/dir |
1103 | * returns <start_mrl> if <start_mrl> is a valid MRL, not a directory |
1104 | * returns NULL if <start_mrl> is an invalid MRL, not even a directory. |
1105 | */ |
1106 | xine_mrl_t **xine_get_browse_mrls (xine_t *self, |
1107 | const char *plugin_id, |
1108 | const char *start_mrl, |
1109 | int *num_mrls) XINE_PROTECTED; |
1110 | |
1111 | /* get a list of plugins that support the autoplay feature */ |
1112 | const char *const *xine_get_autoplay_input_plugin_ids (xine_t *self) XINE_PROTECTED; |
1113 | |
1114 | /* get autoplay MRL list from input plugin named <plugin_id> */ |
1115 | const char * const *xine_get_autoplay_mrls (xine_t *self, |
1116 | const char *plugin_id, |
1117 | int *num_mrls) XINE_PROTECTED; |
1118 | |
1119 | /* get a list of file extensions for file types supported by xine |
1120 | * the list is separated by spaces |
1121 | * |
1122 | * the pointer returned can be free()ed when no longer used */ |
1123 | char *xine_get_file_extensions (xine_t *self) XINE_PROTECTED; |
1124 | |
1125 | /* get a list of mime types supported by xine |
1126 | * |
1127 | * the pointer returned can be free()ed when no longer used */ |
1128 | char *xine_get_mime_types (xine_t *self) XINE_PROTECTED; |
1129 | |
1130 | /* get the demuxer identifier that handles a given mime type |
1131 | * |
1132 | * the pointer returned can be free()ed when no longer used |
1133 | * returns NULL if no demuxer is available to handle this. */ |
1134 | char *xine_get_demux_for_mime_type (xine_t *self, const char *mime_type) XINE_PROTECTED; |
1135 | |
1136 | /* get a description string for a plugin */ |
1137 | const char *xine_get_input_plugin_description (xine_t *self, |
1138 | const char *plugin_id) XINE_PROTECTED; |
1139 | const char *xine_get_demux_plugin_description (xine_t *self, |
1140 | const char *plugin_id) XINE_PROTECTED; |
1141 | const char *xine_get_spu_plugin_description (xine_t *self, |
1142 | const char *plugin_id) XINE_PROTECTED; |
1143 | const char *xine_get_audio_plugin_description (xine_t *self, |
1144 | const char *plugin_id) XINE_PROTECTED; |
1145 | const char *xine_get_video_plugin_description (xine_t *self, |
1146 | const char *plugin_id) XINE_PROTECTED; |
1147 | const char *xine_get_audio_driver_plugin_description (xine_t *self, |
1148 | const char *plugin_id) XINE_PROTECTED; |
1149 | const char *xine_get_video_driver_plugin_description (xine_t *self, |
1150 | const char *plugin_id) XINE_PROTECTED; |
1151 | const char *xine_get_post_plugin_description (xine_t *self, |
1152 | const char *plugin_id) XINE_PROTECTED; |
1153 | |
1154 | /* get lists of available audio and video output plugins */ |
1155 | const char *const *xine_list_audio_output_plugins (xine_t *self) XINE_PROTECTED; |
1156 | const char *const *xine_list_video_output_plugins (xine_t *self) XINE_PROTECTED; |
1157 | /* typemask is (1ULL << XINE_VISUAL_TYPE_FOO) | ... */ |
1158 | const char *const *xine_list_video_output_plugins_typed (xine_t *self, uint64_t typemask) XINE_PROTECTED; |
1159 | |
1160 | /* get list of available demultiplexor plugins */ |
1161 | const char *const *xine_list_demuxer_plugins(xine_t *self) XINE_PROTECTED; |
1162 | |
1163 | /* get list of available input plugins */ |
1164 | const char *const *xine_list_input_plugins(xine_t *self) XINE_PROTECTED; |
1165 | |
1166 | /* get list of available subpicture plugins */ |
1167 | const char *const *xine_list_spu_plugins(xine_t *self) XINE_PROTECTED; |
1168 | |
1169 | /* get list of available audio and video decoder plugins */ |
1170 | const char *const *xine_list_audio_decoder_plugins(xine_t *self) XINE_PROTECTED; |
1171 | const char *const *xine_list_video_decoder_plugins(xine_t *self) XINE_PROTECTED; |
1172 | |
1173 | /* unload unused plugins */ |
1174 | void xine_plugins_garbage_collector(xine_t *self) XINE_PROTECTED; |
1175 | |
1176 | |
1177 | /********************************************************************* |
1178 | * visual specific gui <-> xine engine communication * |
1179 | *********************************************************************/ |
1180 | |
1181 | /* new (preferred) method to talk to video driver. */ |
1182 | int xine_port_send_gui_data (xine_video_port_t *vo, |
1183 | int type, void *data) XINE_PROTECTED; |
1184 | |
1185 | typedef struct { |
1186 | |
1187 | /* area of that drawable to be used by video */ |
1188 | int x,y,w,h; |
1189 | |
1190 | } x11_rectangle_t; |
1191 | |
1192 | /* |
1193 | * this is the visual data struct any x11 gui |
1194 | * must supply to the xine_open_video_driver call |
1195 | * ("data" parameter) |
1196 | */ |
1197 | typedef struct { |
1198 | |
1199 | /* some information about the display */ |
1200 | void *display; /* Display* */ |
1201 | int screen; |
1202 | |
1203 | /* drawable to display the video in/on */ |
1204 | unsigned long d; /* Drawable */ |
1205 | |
1206 | void *user_data; |
1207 | |
1208 | /* |
1209 | * dest size callback |
1210 | * |
1211 | * this will be called by the video driver to find out |
1212 | * how big the video output area size will be for a |
1213 | * given video size. The ui should _not_ adjust its |
1214 | * video out area, just do some calculations and return |
1215 | * the size. This will be called for every frame, ui |
1216 | * implementation should be fast. |
1217 | * dest_pixel_aspect should be set to the used display pixel aspect. |
1218 | * NOTE: Semantics has changed: video_width and video_height |
1219 | * are no longer pixel aspect corrected. Get the old semantics |
1220 | * in the UI with |
1221 | * *dest_pixel_aspect = display_pixel_aspect; |
1222 | * if (video_pixel_aspect >= display_pixel_aspect) |
1223 | * video_width = video_width * video_pixel_aspect / display_pixel_aspect + .5; |
1224 | * else |
1225 | * video_height = video_height * display_pixel_aspect / video_pixel_aspect + .5; |
1226 | */ |
1227 | void (*dest_size_cb) (void *user_data, |
1228 | int video_width, int video_height, |
1229 | double video_pixel_aspect, |
1230 | int *dest_width, int *dest_height, |
1231 | double *dest_pixel_aspect); |
1232 | |
1233 | /* |
1234 | * frame output callback |
1235 | * |
1236 | * this will be called by the video driver for every frame |
1237 | * it's about to draw. ui can adapt its size if necessary |
1238 | * here. |
1239 | * note: the ui doesn't have to adjust itself to this |
1240 | * size, this is just to be taken as a hint. |
1241 | * ui must return the actual size of the video output |
1242 | * area and the video output driver will do its best |
1243 | * to adjust the video frames to that size (while |
1244 | * preserving aspect ratio and stuff). |
1245 | * dest_x, dest_y: offset inside window |
1246 | * dest_width, dest_height: available drawing space |
1247 | * dest_pixel_aspect: display pixel aspect |
1248 | * win_x, win_y: window absolute screen position |
1249 | * NOTE: Semantics has changed: video_width and video_height |
1250 | * are no longer pixel aspect corrected. Get the old semantics |
1251 | * in the UI with |
1252 | * *dest_pixel_aspect = display_pixel_aspect; |
1253 | * if (video_pixel_aspect >= display_pixel_aspect) |
1254 | * video_width = video_width * video_pixel_aspect / display_pixel_aspect + .5; |
1255 | * else |
1256 | * video_height = video_height * display_pixel_aspect / video_pixel_aspect + .5; |
1257 | */ |
1258 | void (*frame_output_cb) (void *user_data, |
1259 | int video_width, int video_height, |
1260 | double video_pixel_aspect, |
1261 | int *dest_x, int *dest_y, |
1262 | int *dest_width, int *dest_height, |
1263 | double *dest_pixel_aspect, |
1264 | int *win_x, int *win_y); |
1265 | |
1266 | /* |
1267 | * lock display callback |
1268 | * |
1269 | * this callback is called when the video driver |
1270 | * needs access to the x11 display connection |
1271 | * |
1272 | * note: to enable this you MUST use XINE_VISUAL_TYPE_X11_2 |
1273 | * note: if display_lock is NULL, the fallback is used |
1274 | * note: fallback for this function is XLockDisplay(display) |
1275 | */ |
1276 | void (*lock_display) (void *user_data); |
1277 | |
1278 | /* |
1279 | * unlock display callback |
1280 | * |
1281 | * this callback is called when the video driver |
1282 | * doesn't need access to the x11 display connection anymore |
1283 | * |
1284 | * note: to enable this you MUST use XINE_VISUAL_TYPE_X11_2 |
1285 | * note: if display_unlock is NULL, the fallback is used |
1286 | * note: fallback for this function is XUnlockDisplay(display) |
1287 | */ |
1288 | void (*unlock_display) (void *user_data); |
1289 | |
1290 | } x11_visual_t; |
1291 | |
1292 | /* |
1293 | * this is the visual data struct any xcb gui |
1294 | * must supply to the xine_open_video_driver call |
1295 | * ("data" parameter) |
1296 | */ |
1297 | typedef struct { |
1298 | |
1299 | /* some information about the display */ |
1300 | void *connection; /* xcb_connection_t */ |
1301 | void *screen; /* xcb_screen_t */ |
1302 | |
1303 | /* window to display the video in / on */ |
1304 | unsigned int window; /* xcb_window_t */ |
1305 | |
1306 | void *user_data; |
1307 | |
1308 | /* |
1309 | * dest size callback |
1310 | * |
1311 | * this will be called by the video driver to find out |
1312 | * how big the video output area size will be for a |
1313 | * given video size. The ui should _not_ adjust its |
1314 | * video out area, just do some calculations and return |
1315 | * the size. This will be called for every frame, ui |
1316 | * implementation should be fast. |
1317 | * dest_pixel_aspect should be set to the used display pixel aspect. |
1318 | * NOTE: Semantics has changed: video_width and video_height |
1319 | * are no longer pixel aspect corrected. Get the old semantics |
1320 | * in the UI with |
1321 | * *dest_pixel_aspect = display_pixel_aspect; |
1322 | * if (video_pixel_aspect >= display_pixel_aspect) |
1323 | * video_width = video_width * video_pixel_aspect / display_pixel_aspect + .5; |
1324 | * else |
1325 | * video_height = video_height * display_pixel_aspect / video_pixel_aspect + .5; |
1326 | */ |
1327 | void (*dest_size_cb) (void *user_data, |
1328 | int video_width, int video_height, |
1329 | double video_pixel_aspect, |
1330 | int *dest_width, int *dest_height, |
1331 | double *dest_pixel_aspect); |
1332 | |
1333 | /* |
1334 | * frame output callback |
1335 | * |
1336 | * this will be called by the video driver for every frame |
1337 | * it's about to draw. ui can adapt its size if necessary |
1338 | * here. |
1339 | * note: the ui doesn't have to adjust itself to this |
1340 | * size, this is just to be taken as a hint. |
1341 | * ui must return the actual size of the video output |
1342 | * area and the video output driver will do its best |
1343 | * to adjust the video frames to that size (while |
1344 | * preserving aspect ratio and stuff). |
1345 | * dest_x, dest_y: offset inside window |
1346 | * dest_width, dest_height: available drawing space |
1347 | * dest_pixel_aspect: display pixel aspect |
1348 | * win_x, win_y: window absolute screen position |
1349 | * NOTE: Semantics has changed: video_width and video_height |
1350 | * are no longer pixel aspect corrected. Get the old semantics |
1351 | * in the UI with |
1352 | * *dest_pixel_aspect = display_pixel_aspect; |
1353 | * if (video_pixel_aspect >= display_pixel_aspect) |
1354 | * video_width = video_width * video_pixel_aspect / display_pixel_aspect + .5; |
1355 | * else |
1356 | * video_height = video_height * display_pixel_aspect / video_pixel_aspect + .5; |
1357 | */ |
1358 | void (*frame_output_cb) (void *user_data, |
1359 | int video_width, int video_height, |
1360 | double video_pixel_aspect, |
1361 | int *dest_x, int *dest_y, |
1362 | int *dest_width, int *dest_height, |
1363 | double *dest_pixel_aspect, |
1364 | int *win_x, int *win_y); |
1365 | |
1366 | } xcb_visual_t; |
1367 | |
1368 | /************************************************** |
1369 | * XINE_VO_RAW struct definitions |
1370 | *************************************************/ |
1371 | /* frame_format definitions */ |
1372 | #define XINE_VORAW_YV12 1 |
1373 | #define XINE_VORAW_YUY2 2 |
1374 | #define XINE_VORAW_RGB 4 |
1375 | |
1376 | /* maximum number of overlays the raw driver can handle */ |
1377 | #define XINE_VORAW_MAX_OVL 16 |
1378 | |
1379 | /* raw_overlay_t struct used in raw_overlay_cb callback */ |
1380 | typedef struct { |
1381 | uint8_t *ovl_rgba; |
1382 | int ovl_w, ovl_h; /* overlay's width and height */ |
1383 | int ovl_x, ovl_y; /* overlay's top-left display position */ |
1384 | } raw_overlay_t; |
1385 | |
1386 | /* this is the visual data struct any raw gui |
1387 | * must supply to the xine_open_video_driver call |
1388 | * ("data" parameter) |
1389 | */ |
1390 | typedef struct { |
1391 | void *user_data; |
1392 | |
1393 | /* OR'ed frame_format |
1394 | * Unsupported frame formats are converted to rgb. |
1395 | * XINE_VORAW_RGB is always assumed by the driver, even if not set. |
1396 | * So a frontend must at least support rgb. |
1397 | * Be aware that rgb requires more cpu than yuv, |
1398 | * so avoid its usage for video playback. |
1399 | * However, it's useful for single frame capture (e.g. thumbs) |
1400 | */ |
1401 | int supported_formats; |
1402 | |
1403 | /* raw output callback |
1404 | * this will be called by the video driver for every frame |
1405 | * |
1406 | * If frame_format==XINE_VORAW_YV12, data0 points to frame_width*frame_height Y values |
1407 | * data1 points to (frame_width/2)*(frame_height/2) U values |
1408 | * data2 points to (frame_width/2)*(frame_height/2) V values |
1409 | * |
1410 | * If frame_format==XINE_VORAW_YUY2, data0 points to frame_width*frame_height*2 YU/Y²V values |
1411 | * data1 is NULL |
1412 | * data2 is NULL |
1413 | * |
1414 | * If frame_format==XINE_VORAW_RGB, data0 points to frame_width*frame_height*3 RGB values |
1415 | * data1 is NULL |
1416 | * data2 is NULL |
1417 | */ |
1418 | void (*raw_output_cb) (void *user_data, int frame_format, |
1419 | int frame_width, int frame_height, |
1420 | double frame_aspect, |
1421 | void *data0, void *data1, void *data2); |
1422 | |
1423 | /* raw overlay callback |
1424 | * this will be called by the video driver for every new overlay state |
1425 | * overlays_array points to an array of num_ovl raw_overlay_t |
1426 | * Note that num_ovl can be 0, meaning "end of overlay display" |
1427 | * num_ovl is at most XINE_VORAW_MAX_OVL */ |
1428 | void (*raw_overlay_cb) (void *user_data, int num_ovl, |
1429 | raw_overlay_t *overlays_array); |
1430 | } raw_visual_t; |
1431 | /********************************************** |
1432 | * end of vo_raw defs |
1433 | *********************************************/ |
1434 | |
1435 | /* |
1436 | * this is the visual data struct any fb gui |
1437 | * may supply to the xine_open_video_driver call |
1438 | * ("data" parameter) to get frame_output_cd calls |
1439 | */ |
1440 | |
1441 | typedef struct { |
1442 | |
1443 | void (*frame_output_cb) (void *user_data, |
1444 | int video_width, int video_height, |
1445 | double video_pixel_aspect, |
1446 | int *dest_x, int *dest_y, |
1447 | int *dest_width, int *dest_height, |
1448 | double *dest_pixel_aspect, |
1449 | int *win_x, int *win_y); |
1450 | |
1451 | void *user_data; |
1452 | |
1453 | } fb_visual_t; |
1454 | |
1455 | #ifdef WIN32 |
1456 | /* |
1457 | * this is the visual data struct any win32 gui should supply |
1458 | * (pass this to init_video_out_plugin or the xine_load_video_output_plugin |
1459 | * utility function) |
1460 | */ |
1461 | |
1462 | typedef struct { |
1463 | |
1464 | HWND WndHnd; /* handle of window associated with primary surface */ |
1465 | HINSTANCE HInst; /* handle of windows application instance */ |
1466 | RECT WndRect; /* rect of window client points translated to screen |
1467 | * cooridnates */ |
1468 | int FullScreen; /* is window fullscreen */ |
1469 | HBRUSH Brush; /* window brush for background color */ |
1470 | COLORREF ColorKey; /* window brush color key */ |
1471 | |
1472 | } win32_visual_t; |
1473 | |
1474 | /* |
1475 | * constants for gui_data_exchange's data_type parameter |
1476 | */ |
1477 | |
1478 | #define GUI_WIN32_MOVED_OR_RESIZED 0 |
1479 | |
1480 | #endif /* WIN32 */ |
1481 | |
1482 | /* |
1483 | * "type" constants for xine_port_send_gui_data(...) |
1484 | */ |
1485 | |
1486 | #ifndef XINE_DISABLE_DEPRECATED_FEATURES |
1487 | /* xevent *data */ |
1488 | #define XINE_GUI_SEND_COMPLETION_EVENT 1 /* DEPRECATED */ |
1489 | #endif |
1490 | |
1491 | /* Drawable data */ |
1492 | #define XINE_GUI_SEND_DRAWABLE_CHANGED 2 |
1493 | |
1494 | /* xevent *data */ |
1495 | #define XINE_GUI_SEND_EXPOSE_EVENT 3 |
1496 | |
1497 | /* x11_rectangle_t *data */ |
1498 | #define XINE_GUI_SEND_TRANSLATE_GUI_TO_VIDEO 4 |
1499 | |
1500 | /* int data */ |
1501 | #define XINE_GUI_SEND_VIDEOWIN_VISIBLE 5 |
1502 | |
1503 | /* *data contains chosen visual, select a new one or change it to NULL |
1504 | * to indicate the visual to use or that no visual will work */ |
1505 | /* XVisualInfo **data */ |
1506 | #define XINE_GUI_SEND_SELECT_VISUAL 8 |
1507 | |
1508 | /* Gui is about to destroy drawable */ |
1509 | #define XINE_GUI_SEND_WILL_DESTROY_DRAWABLE 9 |
1510 | |
1511 | |
1512 | /********************************************************************* |
1513 | * xine health check stuff * |
1514 | *********************************************************************/ |
1515 | |
1516 | #define XINE_HEALTH_CHECK_OK 0 |
1517 | #define XINE_HEALTH_CHECK_FAIL 1 |
1518 | #define XINE_HEALTH_CHECK_UNSUPPORTED 2 |
1519 | #define XINE_HEALTH_CHECK_NO_SUCH_CHECK 3 |
1520 | |
1521 | #define CHECK_KERNEL 0 |
1522 | #define CHECK_MTRR 1 |
1523 | #define CHECK_CDROM 2 |
1524 | #define CHECK_DVDROM 3 |
1525 | #define CHECK_DMA 4 |
1526 | #define CHECK_X 5 |
1527 | #define CHECK_XV 6 |
1528 | |
1529 | struct xine_health_check_s { |
1530 | const char* cdrom_dev; |
1531 | const char* dvd_dev; |
1532 | const char* msg; |
1533 | const char* title; |
1534 | const char* explanation; |
1535 | int status; |
1536 | }; |
1537 | |
1538 | typedef struct xine_health_check_s xine_health_check_t; |
1539 | xine_health_check_t* xine_health_check(xine_health_check_t*, int check_num) XINE_PROTECTED; |
1540 | |
1541 | |
1542 | /********************************************************************* |
1543 | * configuration system * |
1544 | *********************************************************************/ |
1545 | |
1546 | /* |
1547 | * config entry data types |
1548 | */ |
1549 | |
1550 | #define XINE_CONFIG_TYPE_UNKNOWN 0 |
1551 | #define XINE_CONFIG_TYPE_RANGE 1 |
1552 | #define XINE_CONFIG_TYPE_STRING 2 |
1553 | #define XINE_CONFIG_TYPE_ENUM 3 |
1554 | #define XINE_CONFIG_TYPE_NUM 4 |
1555 | #define XINE_CONFIG_TYPE_BOOL 5 |
1556 | |
1557 | /* For the string type (1.1.4 and later). These are stored in num_value. */ |
1558 | #define XINE_CONFIG_STRING_IS_STRING 0 |
1559 | #define XINE_CONFIG_STRING_IS_FILENAME 1 |
1560 | #define XINE_CONFIG_STRING_IS_DEVICE_NAME 2 |
1561 | #define XINE_CONFIG_STRING_IS_DIRECTORY_NAME 3 |
1562 | |
1563 | typedef struct xine_cfg_entry_s xine_cfg_entry_t; |
1564 | |
1565 | typedef void (*xine_config_cb_t) (void *user_data, |
1566 | xine_cfg_entry_t *entry); |
1567 | struct xine_cfg_entry_s { |
1568 | const char *key; /* unique id (example: gui.logo_mrl) */ |
1569 | |
1570 | int type; |
1571 | |
1572 | /* user experience level */ |
1573 | int exp_level; /* 0 => beginner, |
1574 | 10 => advanced user, |
1575 | 20 => expert */ |
1576 | |
1577 | /* type unknown */ |
1578 | char *unknown_value; |
1579 | |
1580 | /* type string */ |
1581 | char *str_value; |
1582 | char *str_default; |
1583 | |
1584 | /* common to range, enum, num, bool; |
1585 | * num_value is also used by string to indicate what's required: |
1586 | * plain string, file name, device name, directory name |
1587 | */ |
1588 | int num_value; |
1589 | int num_default; |
1590 | |
1591 | /* type range specific: */ |
1592 | int range_min; |
1593 | int range_max; |
1594 | |
1595 | /* type enum specific: */ |
1596 | char **enum_values; |
1597 | |
1598 | /* help info for the user (UTF-8) |
1599 | * the help string must be word wrapped by the frontend. |
1600 | * it might contain \n to mark paragraph breaks. |
1601 | */ |
1602 | const char *description; |
1603 | const char *help; |
1604 | |
1605 | /* callback function and data for live changeable values */ |
1606 | /* some config entries will take effect immediately, although they |
1607 | * do not have a callback registered; such values will have some |
1608 | * non-NULL dummy value in callback_data; so if you want to check, |
1609 | * if a config change will require restarting xine, check for |
1610 | * callback_data == NULL */ |
1611 | xine_config_cb_t callback; |
1612 | void *callback_data; |
1613 | |
1614 | }; |
1615 | |
1616 | const char *xine_config_register_string (xine_t *self, |
1617 | const char *key, |
1618 | const char *def_value, |
1619 | const char *description, |
1620 | const char *help, |
1621 | int exp_level, |
1622 | xine_config_cb_t changed_cb, |
1623 | void *cb_data) XINE_PROTECTED; |
1624 | |
1625 | const char *xine_config_register_filename (xine_t *self, |
1626 | const char *key, |
1627 | const char *def_value, |
1628 | int req_type, /* XINE_CONFIG_STRING_IS_* */ |
1629 | const char *description, |
1630 | const char *help, |
1631 | int exp_level, |
1632 | xine_config_cb_t changed_cb, |
1633 | void *cb_data) XINE_PROTECTED; |
1634 | |
1635 | int xine_config_register_range (xine_t *self, |
1636 | const char *key, |
1637 | int def_value, |
1638 | int min, int max, |
1639 | const char *description, |
1640 | const char *help, |
1641 | int exp_level, |
1642 | xine_config_cb_t changed_cb, |
1643 | void *cb_data) XINE_PROTECTED; |
1644 | |
1645 | int xine_config_register_enum (xine_t *self, |
1646 | const char *key, |
1647 | int def_value, |
1648 | char **values, |
1649 | const char *description, |
1650 | const char *help, |
1651 | int exp_level, |
1652 | xine_config_cb_t changed_cb, |
1653 | void *cb_data) XINE_PROTECTED; |
1654 | |
1655 | int xine_config_register_num (xine_t *self, |
1656 | const char *key, |
1657 | int def_value, |
1658 | const char *description, |
1659 | const char *help, |
1660 | int exp_level, |
1661 | xine_config_cb_t changed_cb, |
1662 | void *cb_data) XINE_PROTECTED; |
1663 | |
1664 | int xine_config_register_bool (xine_t *self, |
1665 | const char *key, |
1666 | int def_value, |
1667 | const char *description, |
1668 | const char *help, |
1669 | int exp_level, |
1670 | xine_config_cb_t changed_cb, |
1671 | void *cb_data) XINE_PROTECTED; |
1672 | |
1673 | /* |
1674 | * the following functions will copy data from the internal xine_config |
1675 | * data database to the xine_cfg_entry_t *entry you provide |
1676 | * |
1677 | * they return 1 on success, 0 on failure |
1678 | */ |
1679 | |
1680 | /* get first config item */ |
1681 | int xine_config_get_first_entry (xine_t *self, xine_cfg_entry_t *entry) XINE_PROTECTED; |
1682 | |
1683 | /* get next config item (iterate through the items) */ |
1684 | int xine_config_get_next_entry (xine_t *self, xine_cfg_entry_t *entry) XINE_PROTECTED; |
1685 | |
1686 | /* search for a config entry by key */ |
1687 | int xine_config_lookup_entry (xine_t *self, const char *key, |
1688 | xine_cfg_entry_t *entry) XINE_PROTECTED; |
1689 | |
1690 | /* |
1691 | * update a config entry (which was returned from lookup_entry() ) |
1692 | * |
1693 | * xine will make a deep copy of the data in the entry into its internal |
1694 | * config database. |
1695 | */ |
1696 | void xine_config_update_entry (xine_t *self, |
1697 | const xine_cfg_entry_t *entry) XINE_PROTECTED; |
1698 | |
1699 | /* |
1700 | * translation of old configuration entry names |
1701 | */ |
1702 | typedef struct { |
1703 | const char *old_name, *new_name; |
1704 | } xine_config_entry_translation_t; |
1705 | |
1706 | void xine_config_set_translation_user (const xine_config_entry_translation_t *) XINE_PROTECTED; |
1707 | |
1708 | /* |
1709 | * load/save config data from/to afile (e.g. $HOME/.xine/config) |
1710 | */ |
1711 | void xine_config_load (xine_t *self, const char *cfg_filename) XINE_PROTECTED; |
1712 | void xine_config_save (xine_t *self, const char *cfg_filename) XINE_PROTECTED; |
1713 | void xine_config_reset (xine_t *self) XINE_PROTECTED; |
1714 | |
1715 | |
1716 | /********************************************************************* |
1717 | * asynchroneous xine event mechanism * |
1718 | *********************************************************************/ |
1719 | |
1720 | /* |
1721 | * to receive events you have to register an event queue with |
1722 | * the xine engine (xine_event_new_queue, see below). |
1723 | * |
1724 | * then you can either |
1725 | * 1) check for incoming events regularly (xine_event_get/wait), |
1726 | * process them and free them using xine_event_free |
1727 | * 2) use xine_event_create_listener_thread and specify a callback |
1728 | * which will then be called for each event |
1729 | * |
1730 | * to send events to every module listening you don't need |
1731 | * to register an event queue but simply call xine_event_send. |
1732 | * |
1733 | * front ends should listen for one of MRL_REFERENCE and MRL_REFERENCE_EXT |
1734 | * since both will be sent for compatibility reasons |
1735 | */ |
1736 | |
1737 | /* event types */ |
1738 | #define XINE_EVENT_UI_PLAYBACK_FINISHED 1 /* frontend can e.g. move on to next playlist entry */ |
1739 | #define XINE_EVENT_UI_CHANNELS_CHANGED 2 /* inform ui that new channel info is available */ |
1740 | #define XINE_EVENT_UI_SET_TITLE 3 /* request title display change in ui */ |
1741 | #define XINE_EVENT_UI_MESSAGE 4 /* message (dialog) for the ui to display */ |
1742 | #define XINE_EVENT_FRAME_FORMAT_CHANGE 5 /* e.g. aspect ratio change during dvd playback */ |
1743 | #define XINE_EVENT_AUDIO_LEVEL 6 /* report current audio level (l/r/mute) */ |
1744 | #define XINE_EVENT_QUIT 7 /* last event sent when stream is disposed */ |
1745 | #define XINE_EVENT_PROGRESS 8 /* index creation/network connections */ |
1746 | #define XINE_EVENT_MRL_REFERENCE 9 /* (deprecated) demuxer->frontend: MRL reference(s) for the real stream */ |
1747 | #define XINE_EVENT_UI_NUM_BUTTONS 10 /* number of buttons for interactive menus */ |
1748 | #define XINE_EVENT_SPU_BUTTON 11 /* the mouse pointer enter/leave a button */ |
1749 | #define XINE_EVENT_DROPPED_FRAMES 12 /* number of dropped frames is too high */ |
1750 | #define XINE_EVENT_MRL_REFERENCE_EXT 13 /* demuxer->frontend: MRL reference(s) for the real stream */ |
1751 | #define XINE_EVENT_AUDIO_AMP_LEVEL 14 /* report current audio amp level (l/r/mute) */ |
1752 | #define XINE_EVENT_NBC_STATS 15 /* nbc buffer status */ |
1753 | |
1754 | |
1755 | /* input events coming from frontend */ |
1756 | #define XINE_EVENT_INPUT_MOUSE_BUTTON 101 |
1757 | #define XINE_EVENT_INPUT_MOUSE_MOVE 102 |
1758 | #define XINE_EVENT_INPUT_MENU1 103 |
1759 | #define XINE_EVENT_INPUT_MENU2 104 |
1760 | #define XINE_EVENT_INPUT_MENU3 105 |
1761 | #define XINE_EVENT_INPUT_MENU4 106 |
1762 | #define XINE_EVENT_INPUT_MENU5 107 |
1763 | #define XINE_EVENT_INPUT_MENU6 108 |
1764 | #define XINE_EVENT_INPUT_MENU7 109 |
1765 | #define XINE_EVENT_INPUT_UP 110 |
1766 | #define XINE_EVENT_INPUT_DOWN 111 |
1767 | #define XINE_EVENT_INPUT_LEFT 112 |
1768 | #define XINE_EVENT_INPUT_RIGHT 113 |
1769 | #define XINE_EVENT_INPUT_SELECT 114 |
1770 | #define XINE_EVENT_INPUT_NEXT 115 |
1771 | #define XINE_EVENT_INPUT_PREVIOUS 116 |
1772 | #define XINE_EVENT_INPUT_ANGLE_NEXT 117 |
1773 | #define XINE_EVENT_INPUT_ANGLE_PREVIOUS 118 |
1774 | #define XINE_EVENT_INPUT_BUTTON_FORCE 119 |
1775 | #define XINE_EVENT_INPUT_NUMBER_0 120 |
1776 | #define XINE_EVENT_INPUT_NUMBER_1 121 |
1777 | #define XINE_EVENT_INPUT_NUMBER_2 122 |
1778 | #define XINE_EVENT_INPUT_NUMBER_3 123 |
1779 | #define XINE_EVENT_INPUT_NUMBER_4 124 |
1780 | #define XINE_EVENT_INPUT_NUMBER_5 125 |
1781 | #define XINE_EVENT_INPUT_NUMBER_6 126 |
1782 | #define XINE_EVENT_INPUT_NUMBER_7 127 |
1783 | #define XINE_EVENT_INPUT_NUMBER_8 128 |
1784 | #define XINE_EVENT_INPUT_NUMBER_9 129 |
1785 | #define XINE_EVENT_INPUT_NUMBER_10_ADD 130 |
1786 | |
1787 | /* specific event types */ |
1788 | #define XINE_EVENT_SET_V4L2 200 |
1789 | #define XINE_EVENT_PVR_SAVE 201 |
1790 | #define XINE_EVENT_PVR_REPORT_NAME 202 |
1791 | #define XINE_EVENT_PVR_REALTIME 203 |
1792 | #define XINE_EVENT_PVR_PAUSE 204 |
1793 | #define XINE_EVENT_SET_MPEG_DATA 205 |
1794 | |
1795 | /* VDR specific event types */ |
1796 | #define XINE_EVENT_VDR_RED 300 |
1797 | #define XINE_EVENT_VDR_GREEN 301 |
1798 | #define XINE_EVENT_VDR_YELLOW 302 |
1799 | #define XINE_EVENT_VDR_BLUE 303 |
1800 | #define XINE_EVENT_VDR_PLAY 304 |
1801 | #define XINE_EVENT_VDR_PAUSE 305 |
1802 | #define XINE_EVENT_VDR_STOP 306 |
1803 | #define XINE_EVENT_VDR_RECORD 307 |
1804 | #define XINE_EVENT_VDR_FASTFWD 308 |
1805 | #define XINE_EVENT_VDR_FASTREW 309 |
1806 | #define XINE_EVENT_VDR_POWER 310 |
1807 | #define XINE_EVENT_VDR_CHANNELPLUS 311 |
1808 | #define XINE_EVENT_VDR_CHANNELMINUS 312 |
1809 | #define XINE_EVENT_VDR_SCHEDULE 313 |
1810 | #define XINE_EVENT_VDR_CHANNELS 314 |
1811 | #define XINE_EVENT_VDR_TIMERS 315 |
1812 | #define XINE_EVENT_VDR_RECORDINGS 316 |
1813 | #define XINE_EVENT_VDR_SETUP 317 |
1814 | #define XINE_EVENT_VDR_COMMANDS 318 |
1815 | #define XINE_EVENT_VDR_BACK 319 |
1816 | #define XINE_EVENT_VDR_USER1 320 |
1817 | #define XINE_EVENT_VDR_USER2 321 |
1818 | #define XINE_EVENT_VDR_USER3 322 |
1819 | #define XINE_EVENT_VDR_USER4 323 |
1820 | #define XINE_EVENT_VDR_USER5 324 |
1821 | #define XINE_EVENT_VDR_USER6 325 |
1822 | #define XINE_EVENT_VDR_USER7 326 |
1823 | #define XINE_EVENT_VDR_USER8 327 |
1824 | #define XINE_EVENT_VDR_USER9 328 |
1825 | #define XINE_EVENT_VDR_VOLPLUS 329 |
1826 | #define XINE_EVENT_VDR_VOLMINUS 330 |
1827 | #define XINE_EVENT_VDR_MUTE 331 |
1828 | #define XINE_EVENT_VDR_AUDIO 332 |
1829 | #define XINE_EVENT_VDR_INFO 333 |
1830 | #define XINE_EVENT_VDR_CHANNELPREVIOUS 334 |
1831 | #define XINE_EVENT_VDR_SUBTITLES 335 |
1832 | #define XINE_EVENT_VDR_USER0 336 |
1833 | /* some space for further keys */ |
1834 | #define XINE_EVENT_VDR_SETVIDEOWINDOW 350 |
1835 | #define XINE_EVENT_VDR_FRAMESIZECHANGED 351 |
1836 | #define XINE_EVENT_VDR_SELECTAUDIO 352 |
1837 | #define XINE_EVENT_VDR_TRICKSPEEDMODE 353 |
1838 | #define XINE_EVENT_VDR_PLUGINSTARTED 354 |
1839 | #define XINE_EVENT_VDR_DISCONTINUITY 355 |
1840 | |
1841 | /* events generated from post plugins */ |
1842 | #define XINE_EVENT_POST_TVTIME_FILMMODE_CHANGE 400 |
1843 | |
1844 | /* |
1845 | * xine event struct |
1846 | */ |
1847 | typedef struct { |
1848 | xine_stream_t *stream; /* stream this event belongs to */ |
1849 | |
1850 | void *data; /* contents depending on type */ |
1851 | int data_length; |
1852 | |
1853 | int type; /* event type (constants see above) */ |
1854 | |
1855 | /* you do not have to provide this, it will be filled in by xine_event_send() */ |
1856 | struct timeval tv; /* timestamp of event creation */ |
1857 | } xine_event_t; |
1858 | |
1859 | /* |
1860 | * input event dynamic data |
1861 | */ |
1862 | typedef struct { |
1863 | xine_event_t event; |
1864 | uint8_t button; /* Generally 1 = left, 2 = mid, 3 = right */ |
1865 | uint16_t x,y; /* In Image space */ |
1866 | } xine_input_data_t; |
1867 | |
1868 | /* |
1869 | * UI event dynamic data - send information to/from UI. |
1870 | */ |
1871 | typedef struct { |
1872 | int num_buttons; |
1873 | int str_len; |
1874 | char str[256]; /* might be longer */ |
1875 | } xine_ui_data_t; |
1876 | |
1877 | /* |
1878 | * Send messages to UI. used mostly to report errors. |
1879 | */ |
1880 | typedef struct { |
1881 | /* |
1882 | * old xine-ui versions expect xine_ui_data_t type. |
1883 | * this struct is added for compatibility. |
1884 | */ |
1885 | xine_ui_data_t compatibility; |
1886 | |
1887 | /* See XINE_MSG_xxx for defined types. */ |
1888 | int type; |
1889 | |
1890 | /* defined types are provided with a standard explanation. |
1891 | * note: zero means no explanation. |
1892 | */ |
1893 | int explanation; /* add to struct address to get a valid (char *) */ |
1894 | |
1895 | /* parameters are zero terminated strings */ |
1896 | int num_parameters; |
1897 | int parameters; /* add to struct address to get a valid (char *) */ |
1898 | |
1899 | /* where messages are stored, will be longer |
1900 | * |
1901 | * this field begins with the message text itself (\0-terminated), |
1902 | * followed by (optional) \0-terminated parameter strings |
1903 | * the end marker is \0 \0 |
1904 | */ |
1905 | char messages[1]; |
1906 | } xine_ui_message_data_t; |
1907 | |
1908 | |
1909 | /* |
1910 | * notify frame format change |
1911 | */ |
1912 | typedef struct { |
1913 | int width; |
1914 | int height; |
1915 | /* these are aspect codes as defined in MPEG2, because this |
1916 | * is only used for DVD playback, pan_scan is a boolean flag */ |
1917 | int aspect; |
1918 | int pan_scan; |
1919 | } xine_format_change_data_t; |
1920 | |
1921 | /* |
1922 | * audio level for left/right channel |
1923 | */ |
1924 | typedef struct { |
1925 | int left; |
1926 | int right; /* 0..100 % */ |
1927 | int mute; |
1928 | } xine_audio_level_data_t; |
1929 | |
1930 | /* |
1931 | * index generation / buffering |
1932 | */ |
1933 | typedef struct { |
1934 | const char *description; /* e.g. "connecting..." */ |
1935 | int percent; |
1936 | } xine_progress_data_t; |
1937 | |
1938 | /* |
1939 | * nbc buffer status |
1940 | */ |
1941 | typedef struct { |
1942 | int v_percent; /* fill of video buffer */ |
1943 | int64_t v_remaining; /* remaining time in ms till underrun */ |
1944 | int64_t v_bitrate; /* current bitrate */ |
1945 | int v_in_disc; /* in discontinuity */ |
1946 | int a_percent; /* like video, but for audio */ |
1947 | int64_t a_remaining; |
1948 | int64_t a_bitrate; |
1949 | int a_in_disc; |
1950 | int buffering; /* currently filling buffer */ |
1951 | int enabled; /* buffer disabled by engine */ |
1952 | int type; /* 0=buffer put, 1=buffer get */ |
1953 | } xine_nbc_stats_data_t; |
1954 | |
1955 | /* |
1956 | * mrl reference data is sent by demuxers when a reference stream is found. |
1957 | * this stream just contains pointers (urls) to the real data, which are |
1958 | * passed to frontend using this event type. (examples: .asx, .mov and .ram) |
1959 | * |
1960 | * ideally, frontends should add these mrls to a "hierarchical playlist". |
1961 | * that is, instead of the original file, the ones provided here should be |
1962 | * played instead. on pratice, just using a simple playlist should work. |
1963 | * |
1964 | * mrl references should be played in the same order they are received, just |
1965 | * after the current stream finishes. |
1966 | * alternative entries may be provided and should be used in case of |
1967 | * failure of the primary stream (the one with alternative=0). |
1968 | * |
1969 | * sample playlist: |
1970 | * 1) http://something/something.ram |
1971 | * 1a) rtsp://something/realsomething1.rm (alternative=0) |
1972 | * 1b) pnm://something/realsomething1.rm (alternative=1) |
1973 | * 2) http://another/another.avi |
1974 | * |
1975 | * 1 and 2 are the original items on this playlist. 1a and 1b were received |
1976 | * by events (they are the mrl references enclosed in 1). 1a is played after |
1977 | * receiving the finished event from 1. note: 1b is usually ignored, it should |
1978 | * only be used in case 1a fails to open. |
1979 | * |
1980 | * An event listener which accepts XINE_EVENT_MRL_REFERENCE_EXT events |
1981 | * *must* ignore XINE_EVENT_MRL_REFERENCE events. |
1982 | */ |
1983 | typedef struct { |
1984 | int alternative; /* alternative playlist number, usually 0 */ |
1985 | char mrl[1]; /* might (will) be longer */ |
1986 | } xine_mrl_reference_data_t XINE_DEPRECATED; |
1987 | |
1988 | typedef struct { |
1989 | int alternative; /* as above */ |
1990 | uint32_t start_time, duration; /* milliseconds */ |
1991 | uint32_t spare[20]; /* for future expansion */ |
1992 | const char mrl[1]; /* might (will) be longer */ |
1993 | /*const char title[]; ** immediately follows MRL's terminating NUL */ |
1994 | } xine_mrl_reference_data_ext_t; |
1995 | |
1996 | /* |
1997 | * configuration options for video4linux-like input plugins |
1998 | */ |
1999 | typedef struct { |
2000 | /* input selection */ |
2001 | int input; /* select active input from card */ |
2002 | int channel; /* channel number */ |
2003 | int radio; /* ask for a radio channel */ |
2004 | uint32_t frequency; /* frequency divided by 62.5KHz or 62.5 Hz */ |
2005 | uint32_t transmission; /* The transmission standard. */ |
2006 | |
2007 | /* video parameters */ |
2008 | uint32_t framerate_numerator; /* framerate as numerator/denominator */ |
2009 | uint32_t framerate_denominator; |
2010 | uint32_t framelines; /* Total lines per frame including blanking */ |
2011 | uint64_t standard_id; /* One of the V4L2_STD_* values */ |
2012 | uint32_t colorstandard; /* One of the V4L2_COLOR_STD_* values */ |
2013 | uint32_t colorsubcarrier; /* The color subcarrier frequency */ |
2014 | int frame_width; /* scaled frame width */ |
2015 | int frame_height; /* scaled frame height */ |
2016 | |
2017 | /* let some spare space so we can add new fields without breaking |
2018 | * binary api compatibility. |
2019 | */ |
2020 | uint32_t spare[20]; |
2021 | |
2022 | /* used by pvr plugin */ |
2023 | int32_t session_id; /* -1 stops pvr recording */ |
2024 | |
2025 | } xine_set_v4l2_data_t; |
2026 | |
2027 | /* |
2028 | * configuration options for plugins that can do a kind of mpeg encoding |
2029 | * note: highly experimental api :) |
2030 | */ |
2031 | typedef struct { |
2032 | |
2033 | /* mpeg2 parameters */ |
2034 | int bitrate_vbr; /* 1 = vbr, 0 = cbr */ |
2035 | int bitrate_mean; /* mean (target) bitrate in kbps*/ |
2036 | int bitrate_peak; /* peak (max) bitrate in kbps */ |
2037 | int gop_size; /* GOP size in frames */ |
2038 | int gop_closure; /* open/closed GOP */ |
2039 | int b_frames; /* number of B frames to use */ |
2040 | int aspect_ratio; /* XINE_VO_ASPECT_xxx */ |
2041 | |
2042 | /* let some spare space so we can add new fields without breaking |
2043 | * binary api compatibility. |
2044 | */ |
2045 | uint32_t spare[20]; |
2046 | |
2047 | } xine_set_mpeg_data_t; |
2048 | |
2049 | typedef struct { |
2050 | int direction; /* 0 leave, 1 enter */ |
2051 | int32_t button; /* button number */ |
2052 | } xine_spu_button_t; |
2053 | |
2054 | #ifdef XINE_ENABLE_EXPERIMENTAL_FEATURES |
2055 | |
2056 | /* |
2057 | * ask pvr to save (ie. do not discard) the current session |
2058 | * see comments on input_pvr.c to understand how it works. |
2059 | */ |
2060 | typedef struct { |
2061 | /* mode values: |
2062 | * -1 = do nothing, just set the name |
2063 | * 0 = truncate current session and save from now on |
2064 | * 1 = save from last sync point |
2065 | * 2 = save everything on current session |
2066 | */ |
2067 | int mode; |
2068 | int id; |
2069 | char name[256]; /* name for saving, might be longer */ |
2070 | } xine_pvr_save_data_t; |
2071 | |
2072 | typedef struct { |
2073 | /* mode values: |
2074 | * 0 = non realtime |
2075 | * 1 = realtime |
2076 | */ |
2077 | int mode; |
2078 | } xine_pvr_realtime_t; |
2079 | |
2080 | typedef struct { |
2081 | /* mode values: |
2082 | * 0 = playing |
2083 | * 1 = paused |
2084 | */ |
2085 | int mode; |
2086 | } xine_pvr_pause_t; |
2087 | |
2088 | #endif |
2089 | |
2090 | /* event XINE_EVENT_DROPPED_FRAMES is generated if libxine detects a |
2091 | * high number of dropped frames (above configured thresholds). it can |
2092 | * be used by the front end to warn about performance problems. |
2093 | */ |
2094 | typedef struct { |
2095 | /* these values are given for 1000 frames delivered */ |
2096 | /* (that is, divide by 10 to get percentages) */ |
2097 | int skipped_frames; |
2098 | int skipped_threshold; |
2099 | int discarded_frames; |
2100 | int discarded_threshold; |
2101 | } xine_dropped_frames_t; |
2102 | |
2103 | |
2104 | /* |
2105 | * Defined message types for XINE_EVENT_UI_MESSAGE |
2106 | * This is the mechanism to report async errors from engine. |
2107 | * |
2108 | * If frontend knows about the XINE_MSG_xxx type it may safely |
2109 | * ignore the 'explanation' field and provide its own custom |
2110 | * dialogue to the 'parameters'. |
2111 | * |
2112 | * right column specifies the usual parameters. |
2113 | */ |
2114 | |
2115 | #define XINE_MSG_NO_ERROR 0 /* (messages to UI) */ |
2116 | #define XINE_MSG_GENERAL_WARNING 1 /* (warning message) */ |
2117 | #define XINE_MSG_UNKNOWN_HOST 2 /* (host name) */ |
2118 | #define XINE_MSG_UNKNOWN_DEVICE 3 /* (device name) */ |
2119 | #define XINE_MSG_NETWORK_UNREACHABLE 4 /* none */ |
2120 | #define XINE_MSG_CONNECTION_REFUSED 5 /* (host name) */ |
2121 | #define XINE_MSG_FILE_NOT_FOUND 6 /* (file name or mrl) */ |
2122 | #define XINE_MSG_READ_ERROR 7 /* (device/file/mrl) */ |
2123 | #define XINE_MSG_LIBRARY_LOAD_ERROR 8 /* (library/decoder) */ |
2124 | #define XINE_MSG_ENCRYPTED_SOURCE 9 /* none */ |
2125 | #define XINE_MSG_SECURITY 10 /* (security message) */ |
2126 | #define XINE_MSG_AUDIO_OUT_UNAVAILABLE 11 /* none */ |
2127 | #define XINE_MSG_PERMISSION_ERROR 12 /* (file name or mrl) */ |
2128 | #define XINE_MSG_FILE_EMPTY 13 /* file is empty */ |
2129 | #define XINE_MSG_AUTHENTICATION_NEEDED 14 /* (mrl, likely http) */ |
2130 | |
2131 | /* opaque xine_event_queue_t */ |
2132 | typedef struct xine_event_queue_s xine_event_queue_t; |
2133 | |
2134 | /* |
2135 | * register a new event queue |
2136 | * |
2137 | * you have to receive messages from this queue regularly |
2138 | * |
2139 | * use xine_event_dispose_queue to unregister and free the queue |
2140 | */ |
2141 | xine_event_queue_t *xine_event_new_queue (xine_stream_t *stream) XINE_PROTECTED; |
2142 | void xine_event_dispose_queue (xine_event_queue_t *queue) XINE_PROTECTED; |
2143 | |
2144 | /* |
2145 | * receive events (poll) |
2146 | * |
2147 | * use xine_event_free on the events received from these calls |
2148 | * when they're no longer needed |
2149 | */ |
2150 | xine_event_t *xine_event_get (xine_event_queue_t *queue) XINE_PROTECTED; |
2151 | xine_event_t *xine_event_wait (xine_event_queue_t *queue) XINE_PROTECTED; |
2152 | void xine_event_free (xine_event_t *event) XINE_PROTECTED; |
2153 | |
2154 | /* |
2155 | * receive events (callback) |
2156 | * |
2157 | * a thread is created which will receive all events from |
2158 | * the specified queue, call your callback on each of them |
2159 | * and will then free the event when your callback returns |
2160 | * |
2161 | */ |
2162 | typedef void (*xine_event_listener_cb_t) (void *user_data, |
2163 | const xine_event_t *event); |
2164 | void xine_event_create_listener_thread (xine_event_queue_t *queue, |
2165 | xine_event_listener_cb_t callback, |
2166 | void *user_data) XINE_PROTECTED; |
2167 | |
2168 | /* |
2169 | * send an event to all queues |
2170 | * |
2171 | * the event will be copied so you can free or reuse |
2172 | * *event as soon as xine_event_send returns. |
2173 | */ |
2174 | void xine_event_send (xine_stream_t *stream, const xine_event_t *event) XINE_PROTECTED; |
2175 | |
2176 | |
2177 | /********************************************************************* |
2178 | * OSD (on screen display) * |
2179 | *********************************************************************/ |
2180 | |
2181 | #define XINE_TEXT_PALETTE_SIZE 11 |
2182 | |
2183 | #define XINE_OSD_TEXT1 (0 * XINE_TEXT_PALETTE_SIZE) |
2184 | #define XINE_OSD_TEXT2 (1 * XINE_TEXT_PALETTE_SIZE) |
2185 | #define XINE_OSD_TEXT3 (2 * XINE_TEXT_PALETTE_SIZE) |
2186 | #define XINE_OSD_TEXT4 (3 * XINE_TEXT_PALETTE_SIZE) |
2187 | #define XINE_OSD_TEXT5 (4 * XINE_TEXT_PALETTE_SIZE) |
2188 | #define XINE_OSD_TEXT6 (5 * XINE_TEXT_PALETTE_SIZE) |
2189 | #define XINE_OSD_TEXT7 (6 * XINE_TEXT_PALETTE_SIZE) |
2190 | #define XINE_OSD_TEXT8 (7 * XINE_TEXT_PALETTE_SIZE) |
2191 | #define XINE_OSD_TEXT9 (8 * XINE_TEXT_PALETTE_SIZE) |
2192 | #define XINE_OSD_TEXT10 (9 * XINE_TEXT_PALETTE_SIZE) |
2193 | |
2194 | /* white text, black border, transparent background */ |
2195 | #define XINE_TEXTPALETTE_WHITE_BLACK_TRANSPARENT 0 |
2196 | /* white text, noborder, transparent background */ |
2197 | #define XINE_TEXTPALETTE_WHITE_NONE_TRANSPARENT 1 |
2198 | /* white text, no border, translucid background */ |
2199 | #define XINE_TEXTPALETTE_WHITE_NONE_TRANSLUCID 2 |
2200 | /* yellow text, black border, transparent background */ |
2201 | #define XINE_TEXTPALETTE_YELLOW_BLACK_TRANSPARENT 3 |
2202 | |
2203 | #define XINE_OSD_CAP_FREETYPE2 0x0001 /* freetype2 support compiled in */ |
2204 | #define XINE_OSD_CAP_UNSCALED 0x0002 /* unscaled overlays supp. by vo drv */ |
2205 | #define XINE_OSD_CAP_CUSTOM_EXTENT 0x0004 /* hardware scaled to match video output window */ |
2206 | #define XINE_OSD_CAP_ARGB_LAYER 0x0008 /* supports ARGB true color pixmaps */ |
2207 | #define XINE_OSD_CAP_VIDEO_WINDOW 0x0010 /* can scale video to an area within osd extent */ |
2208 | |
2209 | typedef struct xine_osd_s xine_osd_t; |
2210 | |
2211 | xine_osd_t *xine_osd_new (xine_stream_t *self, int x, int y, |
2212 | int width, int height) XINE_PROTECTED; |
2213 | uint32_t xine_osd_get_capabilities (xine_osd_t *self) XINE_PROTECTED; |
2214 | void xine_osd_draw_point (xine_osd_t *self, int x, int y, int color) XINE_PROTECTED; |
2215 | |
2216 | void xine_osd_draw_line (xine_osd_t *self, int x1, int y1, |
2217 | int x2, int y2, int color) XINE_PROTECTED; |
2218 | void xine_osd_draw_rect (xine_osd_t *self, int x1, int y1, |
2219 | int x2, int y2, |
2220 | int color, int filled ) XINE_PROTECTED; |
2221 | /* x1 and y1 specifies the upper left corner of the text to be rendered */ |
2222 | void xine_osd_draw_text (xine_osd_t *self, int x1, int y1, |
2223 | const char *text, int color_base) XINE_PROTECTED; |
2224 | void xine_osd_draw_bitmap (xine_osd_t *self, uint8_t *bitmap, |
2225 | int x1, int y1, int width, int height, |
2226 | uint8_t *palette_map) XINE_PROTECTED; |
2227 | /* for freetype2 fonts the height is the maximum height for the whole font and not |
2228 | * only for the specified text */ |
2229 | void xine_osd_get_text_size (xine_osd_t *self, const char *text, |
2230 | int *width, int *height) XINE_PROTECTED; |
2231 | /* with freetype2 support compiled in, you can also specify a font file |
2232 | as 'fontname' here */ |
2233 | int xine_osd_set_font (xine_osd_t *self, const char *fontname, |
2234 | int size) XINE_PROTECTED; |
2235 | /* |
2236 | * specifying encoding of texts |
2237 | * "" ... means current locale encoding (default) |
2238 | * NULL ... means latin1 |
2239 | */ |
2240 | void xine_osd_set_encoding(xine_osd_t *self, const char *encoding) XINE_PROTECTED; |
2241 | /* set position were overlay will be blended */ |
2242 | void xine_osd_set_position (xine_osd_t *self, int x, int y) XINE_PROTECTED; |
2243 | void xine_osd_show (xine_osd_t *self, int64_t vpts) XINE_PROTECTED; |
2244 | void xine_osd_show_unscaled (xine_osd_t *self, int64_t vpts) XINE_PROTECTED; |
2245 | void xine_osd_hide (xine_osd_t *self, int64_t vpts) XINE_PROTECTED; |
2246 | /* empty drawing area */ |
2247 | void xine_osd_clear (xine_osd_t *self) XINE_PROTECTED; |
2248 | /* |
2249 | * set on existing text palette |
2250 | * (-1 to set used specified palette) |
2251 | * |
2252 | * color_base specifies the first color index to use for this text |
2253 | * palette. The OSD palette is then modified starting at this |
2254 | * color index, up to the size of the text palette. |
2255 | * |
2256 | * Use OSD_TEXT1, OSD_TEXT2, ... for some preassigned color indices. |
2257 | * |
2258 | * These palettes are not working well with the true type fonts. |
2259 | * First thing is that these fonts cannot have a border. So you get |
2260 | * the best results by loading a linearly blending palette from the |
2261 | * background (at index 0) to the forground color (at index 10). |
2262 | */ |
2263 | void xine_osd_set_text_palette (xine_osd_t *self, |
2264 | int palette_number, |
2265 | int color_base ) XINE_PROTECTED; |
2266 | /* get palette (color and transparency) */ |
2267 | void xine_osd_get_palette (xine_osd_t *self, uint32_t *color, |
2268 | uint8_t *trans) XINE_PROTECTED; |
2269 | void xine_osd_set_palette (xine_osd_t *self, |
2270 | const uint32_t *const color, |
2271 | const uint8_t *const trans ) XINE_PROTECTED; |
2272 | |
2273 | /* |
2274 | * Set an ARGB buffer to be blended into video. |
2275 | * The buffer must stay valid while the OSD is on screen. |
2276 | * Pass a NULL pointer to safely remove the buffer from |
2277 | * the OSD layer. Only the dirty area will be |
2278 | * updated on screen. For convenience the whole |
2279 | * OSD object will be considered dirty when setting |
2280 | * a different buffer pointer. |
2281 | * see also XINE_OSD_CAP_ARGB_LAYER |
2282 | */ |
2283 | void xine_osd_set_argb_buffer(xine_osd_t *self, uint32_t *argb_buffer, |
2284 | int dirty_x, int dirty_y, int dirty_width, int dirty_height) XINE_PROTECTED; |
2285 | |
2286 | /* |
2287 | * define extent of reference coordinate system |
2288 | * for video resolution independent osds. |
2289 | * see also XINE_OSD_CAP_CUSTOM_EXTENT |
2290 | */ |
2291 | void xine_osd_set_extent(xine_osd_t *self, int extent_width, int extent_height) XINE_PROTECTED; |
2292 | |
2293 | /* |
2294 | * define area within osd extent to output |
2295 | * video to while osd is on screen |
2296 | * see also XINE_OSD_CAP_VIDEO_WINDOW |
2297 | */ |
2298 | void xine_osd_set_video_window(xine_osd_t *self, int window_x, int window_y, int window_width, int window_height) XINE_PROTECTED; |
2299 | |
2300 | /* |
2301 | * close osd rendering engine |
2302 | * loaded fonts are unloaded |
2303 | * osd objects are closed |
2304 | */ |
2305 | void xine_osd_free (xine_osd_t *self) XINE_PROTECTED; |
2306 | |
2307 | #ifdef __cplusplus |
2308 | } |
2309 | #endif |
2310 | |
2311 | #endif |
2312 |
Warning: That file was not part of the compilation database. It may have many parsing errors.