From 19d6e2179bcf9b2747ddf61eda6a55861de242b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Wed, 19 Dec 2007 01:57:19 +0100 Subject: Don't change the whole xine.h.in into xine.h, just split out the version information in xine/version.h. --HG-- rename : include/xine.h.in => include/xine.h --- .hgignore | 2 +- configure.ac | 3 +- include/Makefile.am | 13 +- include/xine.h | 2071 ++++++++++++++++++++++++++++++++++++++++++++ include/xine.h.in | 2076 --------------------------------------------- include/xine/Makefile.am | 4 + include/xine/version.h.in | 25 + 7 files changed, 2106 insertions(+), 2088 deletions(-) create mode 100644 include/xine.h delete mode 100644 include/xine.h.in create mode 100644 include/xine/Makefile.am create mode 100644 include/xine/version.h.in diff --git a/.hgignore b/.hgignore index fc33e55c8..38db51c92 100644 --- a/.hgignore +++ b/.hgignore @@ -65,7 +65,7 @@ doc/hackersguide/*.png doc/hackersguide/hackersguide.html doc/Doxyfile -include/xine.h +include/xine/version.h misc/SlackBuild misc/build_rpms.sh diff --git a/configure.ac b/configure.ac index 9c6c52302..5b067077f 100644 --- a/configure.ac +++ b/configure.ac @@ -1152,7 +1152,8 @@ contrib/nosefart/Makefile contrib/vidix/Makefile contrib/vidix/drivers/Makefile include/Makefile -include/xine.h +include/xine/Makefile +include/xine/version.h lib/Makefile m4/Makefile m4/gettext/Makefile diff --git a/include/Makefile.am b/include/Makefile.am index 673f508fa..2b5a7eeb2 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,4 +1,5 @@ -EXTRA_DIST = xine.h.in +SUBDIRS = xine +#EXTRA_DIST = xine.h.in if GENERATED_INTTYPES_H inttypes_h = inttypes.h @@ -8,15 +9,7 @@ include_HEADERS = xine.h noinst_HEADERS = config.h configure.h -CONFIG_CLEAN_FILES = xine.h $(inttypes_h) - -mostlyclean-generic: - -rm -f *~ \#* .*~ .\#* - -maintainer-clean-generic: - -@echo "This command is intended for maintainers to use;" - -@echo "it deletes files that may require special tools to rebuild." - -rm -f Makefile.in configure.h.in +CONFIG_CLEAN_FILES = $(inttypes_h) install-data-local: install-includeHEADERS sed -e '/^\/\*_x_/d' xine.h > $(DESTDIR)$(includedir)/xine.h diff --git a/include/xine.h b/include/xine.h new file mode 100644 index 000000000..4eaccf96c --- /dev/null +++ b/include/xine.h @@ -0,0 +1,2071 @@ +/* + * Copyright (C) 2000-2006 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * public xine-lib (libxine) interface and documentation + * + * + * some programming guidelines about this api: + * ------------------------------------------- + * + * (1) libxine has (per stream instance) a fairly static memory + * model + * (2) as a rule of thumb, never free() or realloc() any pointers + * returned by the xine engine (unless stated otherwise) + * or, in other words: + * do not free() stuff you have not malloc()ed + * (3) xine is multi-threaded, make sure your programming environment + * can handle this. + * for x11-related stuff this means that you either have to properly + * use xlockdisplay() or use two seperate connections to the x-server + * + */ +/*_x_ Lines formatted like this one are xine-lib developer comments. */ +/*_x_ They will be removed from the installed version of this header. */ + +#ifndef HAVE_XINE_H +#define HAVE_XINE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include +#include + +#ifdef WIN32 +#include +#include +#endif + +#ifdef XINE_COMPILE +#include +#include "attributes.h" +#else +#include +#include +#endif +#include + +/* This enables some experimental features. These are not part of the + * official libxine API, so use them only, if you absolutely need them. + * Although we make efforts to keep even this part of the API as stable + * as possible, this is not guaranteed. Incompatible changes can occur. + */ +/* #define XINE_ENABLE_EXPERIMENTAL_FEATURES */ + +/* This disables some deprecated features. These are still part of the + * official libxine API and you may still use them. During the current + * major release series, these will always be available and will stay + * compatible. However, removal is likely to occur as soon as possible. + */ +/* #define XINE_DISABLE_DEPRECATED_FEATURES */ + + +/********************************************************************* + * xine opaque data types * + *********************************************************************/ + +typedef struct xine_s xine_t; +typedef struct xine_stream_s xine_stream_t; +typedef struct xine_audio_port_s xine_audio_port_t; +typedef struct xine_video_port_s xine_video_port_t; + +/********************************************************************* + * global engine handling * + *********************************************************************/ + +/* + * version information + */ + +/* dynamic info from actually linked libxine */ +const char *xine_get_version_string (void) XINE_PROTECTED; +void xine_get_version (int *major, int *minor, int *sub) XINE_PROTECTED; + +/* compare given version to libxine version, + return 1 if compatible, 0 otherwise */ +int xine_check_version (int major, int minor, int sub) XINE_PROTECTED; + +/* + * pre-init the xine engine + * + * will first malloc and init a xine_t, create an empty config + * system, then scan through all installed plugins and add them + * to an internal list for later use. + * + * to fully init the xine engine, you have to load config values + * (either using your own storage method and calling + * xine_config_register_entry, or by using the xine_load_config + * utility function - see below) and then call xine_init + * + * the only proper way to shut down the xine engine is to + * call xine_exit() - do not try to free() the xine pointer + * yourself and do not try to access any internal data structures + */ +xine_t *xine_new (void) XINE_PROTECTED; + +/* + * post_init the xine engine + */ +void xine_init (xine_t *self) XINE_PROTECTED; + +/* + * helper functions to find and init audio/video drivers + * from xine's plugin collection + * + * id : identifier of the driver, may be NULL for auto-detection + * data : special data struct for ui/driver communications, depends + * on driver + * visual: video driver flavor selector, constants see below + * + * both functions may return NULL if driver failed to load, was not + * found ... + * + * use xine_close_audio/video_driver() to close loaded drivers + * and free resources allocated by them + */ +xine_audio_port_t *xine_open_audio_driver (xine_t *self, const char *id, + void *data) XINE_PROTECTED; +xine_video_port_t *xine_open_video_driver (xine_t *self, const char *id, + int visual, void *data) XINE_PROTECTED; + +void xine_close_audio_driver (xine_t *self, xine_audio_port_t *driver) XINE_PROTECTED; +void xine_close_video_driver (xine_t *self, xine_video_port_t *driver) XINE_PROTECTED; + +/* valid visual types */ +#define XINE_VISUAL_TYPE_NONE 0 +#define XINE_VISUAL_TYPE_X11 1 +#define XINE_VISUAL_TYPE_X11_2 10 +#define XINE_VISUAL_TYPE_AA 2 +#define XINE_VISUAL_TYPE_FB 3 +#define XINE_VISUAL_TYPE_GTK 4 +#define XINE_VISUAL_TYPE_DFB 5 +#define XINE_VISUAL_TYPE_PM 6 /* used by the OS/2 port */ +#define XINE_VISUAL_TYPE_DIRECTX 7 /* used by the win32/msvc port */ +#define XINE_VISUAL_TYPE_CACA 8 +#define XINE_VISUAL_TYPE_MACOSX 9 +#define XINE_VISUAL_TYPE_XCB 11 + +/* + * free all resources, close all plugins, close engine. + * self pointer is no longer valid after this call. + */ +void xine_exit (xine_t *self) XINE_PROTECTED; + + +/********************************************************************* + * stream handling * + *********************************************************************/ + +/* + * create a new stream for media playback/access + * + * returns xine_stream_t* if OK, + * NULL on error (use xine_get_error for details) + * + * the only proper way to free the stream pointer returned by this + * function is to call xine_dispose() on it. do not try to access any + * fields in xine_stream_t, they're all private and subject to change + * without further notice. + */ +xine_stream_t *xine_stream_new (xine_t *self, + xine_audio_port_t *ao, xine_video_port_t *vo) XINE_PROTECTED; + +/* + * Make one stream the slave of another. + * This establishes a binary master slave relation on streams, where + * certain operations (specified by parameter "affection") on the master + * stream are also applied to the slave stream. + * If you want more than one stream to react to one master, you have to + * apply the calls in a top down way: + * xine_stream_master_slave(stream1, stream2, 3); + * xine_stream_master_slave(stream2, stream3, 3); + * This will make stream1 affect stream2 and stream2 affect stream3, so + * effectively, operations on stream1 propagate to stream2 and 3. + * + * Please note that subsequent master_slave calls on the same streams + * will overwrite their previous master/slave setting. + * Be sure to not mess around. + * + * returns 1 on success, 0 on failure + */ +int xine_stream_master_slave(xine_stream_t *master, xine_stream_t *slave, + int affection) XINE_PROTECTED; + +/* affection is some of the following ORed together: */ +/* playing the master plays the slave */ +#define XINE_MASTER_SLAVE_PLAY (1<<0) +/* slave stops on master stop */ +#define XINE_MASTER_SLAVE_STOP (1<<1) +/* slave is synced to master's speed */ +#define XINE_MASTER_SLAVE_SPEED (1<<2) + +/* + * open a stream + * + * look for input / demux / decoder plugins, find out about the format + * see if it is supported, set up internal buffers and threads + * + * returns 1 if OK, 0 on error (use xine_get_error for details) + */ +int xine_open (xine_stream_t *stream, const char *mrl) XINE_PROTECTED; + +/* + * play a stream from a given position + * + * start_pos: 0..65535 + * start_time: milliseconds + * if both start position parameters are != 0 start_pos will be used + * for non-seekable streams both values will be ignored + * + * returns 1 if OK, 0 on error (use xine_get_error for details) + */ +int xine_play (xine_stream_t *stream, int start_pos, int start_time) XINE_PROTECTED; + +/* + * set xine to a trick mode for fast forward, backwards playback, + * low latency seeking. Please note that this works only with some + * input plugins. mode constants see below. + * + * returns 1 if OK, 0 on error (use xine_get_error for details) + */ +int xine_trick_mode (xine_stream_t *stream, int mode, int value) XINE_PROTECTED; + +/* trick modes */ +#define XINE_TRICK_MODE_OFF 0 +#define XINE_TRICK_MODE_SEEK_TO_POSITION 1 +#define XINE_TRICK_MODE_SEEK_TO_TIME 2 +#define XINE_TRICK_MODE_FAST_FORWARD 3 +#define XINE_TRICK_MODE_FAST_REWIND 4 + +/* + * stop stream playback + * xine_stream_t stays valid for new xine_open or xine_play + */ +void xine_stop (xine_stream_t *stream) XINE_PROTECTED; + +/* + * stop stream playback, free all stream-related resources + * xine_stream_t stays valid for new xine_open + */ +void xine_close (xine_stream_t *stream) XINE_PROTECTED; + +/* + * ask current/recent input plugin to eject media - may or may not work, + * depending on input plugin capabilities + */ +int xine_eject (xine_stream_t *stream) XINE_PROTECTED; + +/* + * stop playback, dispose all stream-related resources + * xine_stream_t no longer valid when after this + */ +void xine_dispose (xine_stream_t *stream) XINE_PROTECTED; + +/* + * set/get engine parameters. + */ +void xine_engine_set_param(xine_t *self, int param, int value) XINE_PROTECTED; +int xine_engine_get_param(xine_t *self, int param) XINE_PROTECTED; + +#define XINE_ENGINE_PARAM_VERBOSITY 1 + +/* + * set/get xine stream parameters + * e.g. playback speed, constants see below + */ +void xine_set_param (xine_stream_t *stream, int param, int value) XINE_PROTECTED; +int xine_get_param (xine_stream_t *stream, int param) XINE_PROTECTED; + +/* + * xine stream parameters + */ +#define XINE_PARAM_SPEED 1 /* see below */ +#define XINE_PARAM_AV_OFFSET 2 /* unit: 1/90000 sec */ +#define XINE_PARAM_AUDIO_CHANNEL_LOGICAL 3 /* -1 => auto, -2 => off */ +#define XINE_PARAM_SPU_CHANNEL 4 +#define XINE_PARAM_VIDEO_CHANNEL 5 +#define XINE_PARAM_AUDIO_VOLUME 6 /* 0..100 */ +#define XINE_PARAM_AUDIO_MUTE 7 /* 1=>mute, 0=>unmute */ +#define XINE_PARAM_AUDIO_COMPR_LEVEL 8 /* <100=>off, % compress otherw*/ +#define XINE_PARAM_AUDIO_AMP_LEVEL 9 /* 0..200, 100=>100% (default) */ +#define XINE_PARAM_AUDIO_REPORT_LEVEL 10 /* 1=>send events, 0=> don't */ +#define XINE_PARAM_VERBOSITY 11 /* control console output */ +#define XINE_PARAM_SPU_OFFSET 12 /* unit: 1/90000 sec */ +#define XINE_PARAM_IGNORE_VIDEO 13 /* disable video decoding */ +#define XINE_PARAM_IGNORE_AUDIO 14 /* disable audio decoding */ +#define XINE_PARAM_IGNORE_SPU 15 /* disable spu decoding */ +#define XINE_PARAM_BROADCASTER_PORT 16 /* 0: disable, x: server port */ +#define XINE_PARAM_METRONOM_PREBUFFER 17 /* unit: 1/90000 sec */ +#define XINE_PARAM_EQ_30HZ 18 /* equalizer gains -100..100 */ +#define XINE_PARAM_EQ_60HZ 19 /* equalizer gains -100..100 */ +#define XINE_PARAM_EQ_125HZ 20 /* equalizer gains -100..100 */ +#define XINE_PARAM_EQ_250HZ 21 /* equalizer gains -100..100 */ +#define XINE_PARAM_EQ_500HZ 22 /* equalizer gains -100..100 */ +#define XINE_PARAM_EQ_1000HZ 23 /* equalizer gains -100..100 */ +#define XINE_PARAM_EQ_2000HZ 24 /* equalizer gains -100..100 */ +#define XINE_PARAM_EQ_4000HZ 25 /* equalizer gains -100..100 */ +#define XINE_PARAM_EQ_8000HZ 26 /* equalizer gains -100..100 */ +#define XINE_PARAM_EQ_16000HZ 27 /* equalizer gains -100..100 */ +#define XINE_PARAM_AUDIO_CLOSE_DEVICE 28 /* force closing audio device */ +#define XINE_PARAM_AUDIO_AMP_MUTE 29 /* 1=>mute, 0=>unmute */ +#define XINE_PARAM_FINE_SPEED 30 /* 1.000.000 => normal speed */ +#define XINE_PARAM_EARLY_FINISHED_EVENT 31 /* send event when demux finish*/ +#define XINE_PARAM_GAPLESS_SWITCH 32 /* next stream only gapless swi*/ +#define XINE_PARAM_DELAY_FINISHED_EVENT 33 /* 1/10sec,0=>disable,-1=>forev*/ + +/* + * speed values for XINE_PARAM_SPEED parameter. + * + * alternatively, one may use XINE_PARAM_FINE_SPEED for greater + * control of the speed value, where: + * XINE_PARAM_SPEED / 4 <-> XINE_PARAM_FINE_SPEED / 1000000 + */ +#define XINE_SPEED_PAUSE 0 +#define XINE_SPEED_SLOW_4 1 +#define XINE_SPEED_SLOW_2 2 +#define XINE_SPEED_NORMAL 4 +#define XINE_SPEED_FAST_2 8 +#define XINE_SPEED_FAST_4 16 + +/* normal speed value for XINE_PARAM_FINE_SPEED parameter */ +#define XINE_FINE_SPEED_NORMAL 1000000 + +/* video parameters */ +#define XINE_PARAM_VO_DEINTERLACE 0x01000000 /* bool */ +#define XINE_PARAM_VO_ASPECT_RATIO 0x01000001 /* see below */ +#define XINE_PARAM_VO_HUE 0x01000002 /* 0..65535 */ +#define XINE_PARAM_VO_SATURATION 0x01000003 /* 0..65535 */ +#define XINE_PARAM_VO_CONTRAST 0x01000004 /* 0..65535 */ +#define XINE_PARAM_VO_BRIGHTNESS 0x01000005 /* 0..65535 */ +#define XINE_PARAM_VO_ZOOM_X 0x01000008 /* percent */ +#define XINE_PARAM_VO_ZOOM_Y 0x0100000d /* percent */ +#define XINE_PARAM_VO_PAN_SCAN 0x01000009 /* bool */ +#define XINE_PARAM_VO_TVMODE 0x0100000a /* ??? */ +#define XINE_PARAM_VO_WINDOW_WIDTH 0x0100000f /* readonly */ +#define XINE_PARAM_VO_WINDOW_HEIGHT 0x01000010 /* readonly */ +#define XINE_PARAM_VO_CROP_LEFT 0x01000020 /* crop frame pixels */ +#define XINE_PARAM_VO_CROP_RIGHT 0x01000021 /* crop frame pixels */ +#define XINE_PARAM_VO_CROP_TOP 0x01000022 /* crop frame pixels */ +#define XINE_PARAM_VO_CROP_BOTTOM 0x01000023 /* crop frame pixels */ + + +#define XINE_VO_ZOOM_STEP 100 +#define XINE_VO_ZOOM_MAX 400 +#define XINE_VO_ZOOM_MIN -85 + +/* possible ratios for XINE_PARAM_VO_ASPECT_RATIO */ +#define XINE_VO_ASPECT_AUTO 0 +#define XINE_VO_ASPECT_SQUARE 1 /* 1:1 */ +#define XINE_VO_ASPECT_4_3 2 /* 4:3 */ +#define XINE_VO_ASPECT_ANAMORPHIC 3 /* 16:9 */ +#define XINE_VO_ASPECT_DVB 4 /* 2.11:1 */ +#define XINE_VO_ASPECT_NUM_RATIOS 5 +#ifndef XINE_DISABLE_DEPRECATED_FEATURES +#define XINE_VO_ASPECT_PAN_SCAN 41 +#define XINE_VO_ASPECT_DONT_TOUCH 42 +#endif + +/* stream format detection strategies */ + +/* recognize stream type first by content then by extension. */ +#define XINE_DEMUX_DEFAULT_STRATEGY 0 +/* recognize stream type first by extension then by content. */ +#define XINE_DEMUX_REVERT_STRATEGY 1 +/* recognize stream type by content only. */ +#define XINE_DEMUX_CONTENT_STRATEGY 2 +/* recognize stream type by extension only. */ +#define XINE_DEMUX_EXTENSION_STRATEGY 3 + +/* verbosity settings */ +#define XINE_VERBOSITY_NONE 0 +#define XINE_VERBOSITY_LOG 1 +#define XINE_VERBOSITY_DEBUG 2 + +/* + * snapshot function + * + * image format can be YUV 4:2:0 or 4:2:2 + * will copy the image data into memory that points to + * (interleaved for yuv 4:2:2 or planary for 4:2:0) + * + * returns 1 on success, 0 failure. + */ +int xine_get_current_frame (xine_stream_t *stream, + int *width, int *height, + int *ratio_code, int *format, + uint8_t *img) XINE_PROTECTED; + +/* xine image formats */ +#define XINE_IMGFMT_YV12 (('2'<<24)|('1'<<16)|('V'<<8)|'Y') +#define XINE_IMGFMT_YUY2 (('2'<<24)|('Y'<<16)|('U'<<8)|'Y') +#define XINE_IMGFMT_XVMC (('C'<<24)|('M'<<16)|('v'<<8)|'X') +#define XINE_IMGFMT_XXMC (('C'<<24)|('M'<<16)|('x'<<8)|'X') + +/* get current xine's virtual presentation timestamp (1/90000 sec) + * note: this is mostly internal data. + * one can use vpts with xine_osd_show() and xine_osd_hide(). + */ +int64_t xine_get_current_vpts(xine_stream_t *stream) XINE_PROTECTED; + + +/********************************************************************* + * media processing * + *********************************************************************/ + +#ifdef XINE_ENABLE_EXPERIMENTAL_FEATURES + +/* + * access to decoded audio and video frames from a stream + * these functions are intended to provide the basis for + * re-encoding and other video processing applications + * + * note that the xine playback engine will block when + * rendering to a framegrab port: to unblock the stream, + * you must fetch the frames manually with the + * xine_get_next_* functions. this ensures that a + * framegrab port is guaranteed to never miss a frame. + * + */ + +xine_video_port_t *xine_new_framegrab_video_port (xine_t *self) XINE_PROTECTED; + +typedef struct { + + int64_t vpts; /* timestamp 1/90000 sec for a/v sync */ + int64_t duration; + double aspect_ratio; + int width, height; + int colorspace; /* XINE_IMGFMT_* */ + + int pos_stream; /* bytes from stream start */ + int pos_time; /* milliseconds */ + + int frame_number; /* frame number (may be unknown) */ + + uint8_t *data; + void *xine_frame; /* used internally by xine engine */ +} xine_video_frame_t; + +int xine_get_next_video_frame (xine_video_port_t *port, + xine_video_frame_t *frame) XINE_PROTECTED; + +void xine_free_video_frame (xine_video_port_t *port, xine_video_frame_t *frame) XINE_PROTECTED; + +xine_audio_port_t *xine_new_framegrab_audio_port (xine_t *self) XINE_PROTECTED; + +typedef struct { + + int64_t vpts; /* timestamp 1/90000 sec for a/v sync */ + int num_samples; + int sample_rate; + int num_channels; + int bits_per_sample; /* per channel */ + + uint8_t *data; + void *xine_frame; /* used internally by xine engine */ + + off_t pos_stream; /* bytes from stream start */ + int pos_time; /* milliseconds */ +} xine_audio_frame_t; + +int xine_get_next_audio_frame (xine_audio_port_t *port, + xine_audio_frame_t *frame) XINE_PROTECTED; + +void xine_free_audio_frame (xine_audio_port_t *port, xine_audio_frame_t *frame) XINE_PROTECTED; + + /* + * maybe future aproach: + */ + +int xine_get_video_frame (xine_stream_t *stream, + int timestamp, /* msec */ + int *width, int *height, + int *ratio_code, + int *duration, /* msec */ + int *format, + uint8_t *img) XINE_PROTECTED; + +/* TODO: xine_get_audio_frame */ + +#endif + + +/********************************************************************* + * post plugin handling * + *********************************************************************/ + +/* + * post effect plugin functions + * + * after the data leaves the decoder it can pass an arbitrary tree + * of post plugins allowing for effects to be applied to the video + * frames/audio buffers before they reach the output stage + */ + +typedef struct xine_post_s xine_post_t; + +struct xine_post_s { + + /* a NULL-terminated array of audio input ports this post plugin + * provides; you can hand these to other post plugin's outputs or + * pass them to the initialization of streams + */ + xine_audio_port_t **audio_input; + + /* a NULL-terminated array of video input ports this post plugin + * provides; you can hand these to other post plugin's outputs or + * pass them to the initialization of streams + */ + xine_video_port_t **video_input; + + /* the type of the post plugin + * one of XINE_POST_TYPE_* can be used here + */ + int type; + +}; + +/* + * initialize a post plugin + * + * returns xine_post_t* on success, NULL on failure + * + * Initializes the post plugin with the given name and connects its + * outputs to the NULL-terminated arrays of audio and video ports. + * Some plugins also care about the number of inputs you request + * (e.g. mixer plugins), others simply ignore this number. + */ +xine_post_t *xine_post_init(xine_t *xine, const char *name, + int inputs, + xine_audio_port_t **audio_target, + xine_video_port_t **video_target) XINE_PROTECTED; + +/* get a list of all available post plugins */ +const char *const *xine_list_post_plugins(xine_t *xine) XINE_PROTECTED; + +/* get a list of all post plugins of one type */ +const char *const *xine_list_post_plugins_typed(xine_t *xine, uint32_t type) XINE_PROTECTED; + +/* + * post plugin input/output + * + * These structures encapsulate inputs/outputs for post plugins + * to transfer arbitrary data. Frontends can also provide inputs + * and outputs and connect them to post plugins to exchange data + * with them. + */ + +typedef struct xine_post_in_s xine_post_in_t; +typedef struct xine_post_out_s xine_post_out_t; + +struct xine_post_in_s { + + /* the name identifying this input */ + const char *name; + + /* the data pointer; input is directed to this memory location, + * so you simply access the pointer to access the input data */ + void *data; + + /* the datatype of this input, use one of XINE_POST_DATA_* here */ + int type; + +}; + +struct xine_post_out_s { + + /* the name identifying this output */ + const char *name; + + /* the data pointer; output should be directed to this memory location, + * so in the easy case you simply write through the pointer */ + void *data; + + /* this function is called, when the output should be redirected + * to another input, you sould set the data pointer to direct + * any output to this new input; + * a special situation is, when this function is called with a NULL + * argument: in this case you should disconnect the data pointer + * from any output and if necessary to avoid writing to some stray + * memory you should make it point to some dummy location, + * returns 1 on success, 0 on failure; + * if you do not implement rewiring, set this to NULL */ + int (*rewire) (xine_post_out_t *self, void *data); + + /* the datatype of this output, use one of XINE_POST_DATA_* here */ + int type; + +}; + +/* get a list of all inputs of a post plugin */ +const char *const *xine_post_list_inputs(xine_post_t *self) XINE_PROTECTED; + +/* get a list of all outputs of a post plugin */ +const char *const *xine_post_list_outputs(xine_post_t *self) XINE_PROTECTED; + +/* retrieve one specific input of a post plugin */ +xine_post_in_t *xine_post_input(xine_post_t *self, const char *name) XINE_PROTECTED; + +/* retrieve one specific output of a post plugin */ +xine_post_out_t *xine_post_output(xine_post_t *self, const char *name) XINE_PROTECTED; + +/* + * wire an input to an output + * returns 1 on success, 0 on failure + */ +int xine_post_wire(xine_post_out_t *source, xine_post_in_t *target) XINE_PROTECTED; + +/* + * wire a video port to a video output + * This can be used to rewire different post plugins to the video output + * plugin layer. The ports you hand in at xine_post_init() will already + * be wired with the post plugin, so you need this function for + * _re_connecting only. + * + * returns 1 on success, 0 on failure + */ +int xine_post_wire_video_port(xine_post_out_t *source, xine_video_port_t *vo) XINE_PROTECTED; + +/* + * wire an audio port to an audio output + * This can be used to rewire different post plugins to the audio output + * plugin layer. The ports you hand in at xine_post_init() will already + * be wired with the post plugin, so you need this function for + * _re_connecting only. + * + * returns 1 on success, 0 on failure + */ +int xine_post_wire_audio_port(xine_post_out_t *source, xine_audio_port_t *ao) XINE_PROTECTED; + +/* + * Extracts an output for a stream. Use this to rewire the outputs of streams. + */ +xine_post_out_t * xine_get_video_source(xine_stream_t *stream) XINE_PROTECTED; +xine_post_out_t * xine_get_audio_source(xine_stream_t *stream) XINE_PROTECTED; + +/* + * disposes the post plugin + * please make sure that no other post plugin and no stream is + * connected to any of this plugin's inputs + */ +void xine_post_dispose(xine_t *xine, xine_post_t *self) XINE_PROTECTED; + + +/* post plugin types */ +#define XINE_POST_TYPE_VIDEO_FILTER 0x010000 +#define XINE_POST_TYPE_VIDEO_VISUALIZATION 0x010001 +#define XINE_POST_TYPE_VIDEO_COMPOSE 0x010002 +#define XINE_POST_TYPE_AUDIO_FILTER 0x020000 +#define XINE_POST_TYPE_AUDIO_VISUALIZATION 0x020001 + + +/* post plugin data types */ + +/* video port data + * input->data is a xine_video_port_t* + * output->data usually is a xine_video_port_t** + */ +#define XINE_POST_DATA_VIDEO 0 + +/* audio port data + * input->data is a xine_audio_port_t* + * output->data usually is a xine_audio_port_t** + */ +#define XINE_POST_DATA_AUDIO 1 + +/* integer data + * input->data is a int* + * output->data usually is a int* + */ +#define XINE_POST_DATA_INT 3 + +/* double precision floating point data + * input->data is a double* + * output->data usually is a double* + */ +#define XINE_POST_DATA_DOUBLE 4 + +/* parameters api (used by frontends) + * input->data is xine_post_api_t* (see below) + */ +#define XINE_POST_DATA_PARAMETERS 5 + +/* defines a single parameter entry. */ +typedef struct { + int type; /* POST_PARAM_TYPE_xxx */ + char *name; /* name of this parameter */ + int size; /* sizeof(parameter) */ + int offset; /* offset in bytes from struct ptr */ + char **enum_values; /* enumeration (first=0) or NULL */ + double range_min; /* minimum value */ + double range_max; /* maximum value */ + int readonly; /* 0 = read/write, 1=read-only */ + char *description; /* user-friendly description */ +} xine_post_api_parameter_t; + +/* description of parameters struct (params). */ +typedef struct { + int struct_size; /* sizeof(params) */ + xine_post_api_parameter_t *parameter; /* list of parameters */ +} xine_post_api_descr_t; + +typedef struct { + /* + * method to set all the read/write parameters. + * params is a struct * defined by xine_post_api_descr_t + */ + int (*set_parameters) (xine_post_t *self, void *params); + + /* + * method to get all parameters. + */ + int (*get_parameters) (xine_post_t *self, void *params); + + /* + * method to get params struct definition + */ + xine_post_api_descr_t * (*get_param_descr) (void); + + /* + * method to get plugin and parameters help (UTF-8) + * the help string must be word wrapped by the frontend. + * it might contain \n to mark paragraph breaks. + */ + char * (*get_help) (void); +} xine_post_api_t; + +/* post parameter types */ +#define POST_PARAM_TYPE_LAST 0 /* terminator of parameter list */ +#define POST_PARAM_TYPE_INT 1 /* integer (or vector of integers) */ +#define POST_PARAM_TYPE_DOUBLE 2 /* double (or vector of doubles) */ +#define POST_PARAM_TYPE_CHAR 3 /* char (or vector of chars = string) */ +#define POST_PARAM_TYPE_STRING 4 /* (char *), ASCIIZ */ +#define POST_PARAM_TYPE_STRINGLIST 5 /* (char **) list, NULL terminated */ +#define POST_PARAM_TYPE_BOOL 6 /* integer (0 or 1) */ + + +/********************************************************************* + * information retrieval * + *********************************************************************/ + +/* + * xine log functions + * + * frontends can display xine log output using these functions + */ +int xine_get_log_section_count(xine_t *self) XINE_PROTECTED; + +/* return a NULL terminated array of log sections names */ +const char *const *xine_get_log_names(xine_t *self) XINE_PROTECTED; + +/* print some log information to section */ +void xine_log (xine_t *self, int buf, + const char *format, ...) XINE_FORMAT_PRINTF(3, 4) XINE_PROTECTED; +void xine_vlog(xine_t *self, int buf, + const char *format, va_list args) XINE_FORMAT_PRINTF(3, 0) XINE_PROTECTED; + +/* get log messages of specified section */ +char *const *xine_get_log (xine_t *self, int buf) XINE_PROTECTED; + +/* log callback will be called whenever something is logged */ +typedef void (*xine_log_cb_t) (void *user_data, int section); +void xine_register_log_cb (xine_t *self, xine_log_cb_t cb, + void *user_data) XINE_PROTECTED; + +/* + * error handling / engine status + */ + +/* return last error */ +int xine_get_error (xine_stream_t *stream) XINE_PROTECTED; + +/* get current xine engine status (constants see below) */ +int xine_get_status (xine_stream_t *stream) XINE_PROTECTED; + +/* + * engine status codes + */ +#define XINE_STATUS_IDLE 0 /* no mrl assigned */ +#define XINE_STATUS_STOP 1 +#define XINE_STATUS_PLAY 2 +#define XINE_STATUS_QUIT 3 + +/* + * xine error codes + */ +#define XINE_ERROR_NONE 0 +#define XINE_ERROR_NO_INPUT_PLUGIN 1 +#define XINE_ERROR_NO_DEMUX_PLUGIN 2 +#define XINE_ERROR_DEMUX_FAILED 3 +#define XINE_ERROR_MALFORMED_MRL 4 +#define XINE_ERROR_INPUT_FAILED 5 + +/* + * try to find out audio/spu language of given channel + * (use -1 for current channel) + * + * lang must point to a buffer of at least XINE_LANG_MAX bytes + * + * returns 1 on success, 0 on failure + */ +int xine_get_audio_lang (xine_stream_t *stream, int channel, + char *lang) XINE_PROTECTED; +int xine_get_spu_lang (xine_stream_t *stream, int channel, + char *lang) XINE_PROTECTED; +/*_x_ increasing this number means an incompatible ABI breakage! */ +#define XINE_LANG_MAX 32 + +/* + * get position / length information + * + * depending of the nature and system layer of the stream, + * some or all of this information may be unavailable or incorrect + * (e.g. live network streams may not have a valid length) + * + * returns 1 on success, 0 on failure (data was not updated, + * probably because it's not known yet... try again later) + */ +int xine_get_pos_length (xine_stream_t *stream, + int *pos_stream, /* 0..65535 */ + int *pos_time, /* milliseconds */ + int *length_time) /* milliseconds */ + XINE_PROTECTED; + +/* + * get information about the stream such as + * video width/height, codecs, audio format, title, author... + * strings are UTF-8 encoded. + * + * constants see below + */ +uint32_t xine_get_stream_info (xine_stream_t *stream, int info) XINE_PROTECTED; +const char *xine_get_meta_info (xine_stream_t *stream, int info) XINE_PROTECTED; + +/* xine_get_stream_info */ +#define XINE_STREAM_INFO_BITRATE 0 +#define XINE_STREAM_INFO_SEEKABLE 1 +#define XINE_STREAM_INFO_VIDEO_WIDTH 2 +#define XINE_STREAM_INFO_VIDEO_HEIGHT 3 +#define XINE_STREAM_INFO_VIDEO_RATIO 4 /* *10000 */ +#define XINE_STREAM_INFO_VIDEO_CHANNELS 5 +#define XINE_STREAM_INFO_VIDEO_STREAMS 6 +#define XINE_STREAM_INFO_VIDEO_BITRATE 7 +#define XINE_STREAM_INFO_VIDEO_FOURCC 8 +#define XINE_STREAM_INFO_VIDEO_HANDLED 9 /* codec available? */ +#define XINE_STREAM_INFO_FRAME_DURATION 10 /* 1/90000 sec */ +#define XINE_STREAM_INFO_AUDIO_CHANNELS 11 +#define XINE_STREAM_INFO_AUDIO_BITS 12 +#define XINE_STREAM_INFO_AUDIO_SAMPLERATE 13 +#define XINE_STREAM_INFO_AUDIO_BITRATE 14 +#define XINE_STREAM_INFO_AUDIO_FOURCC 15 +#define XINE_STREAM_INFO_AUDIO_HANDLED 16 /* codec available? */ +#define XINE_STREAM_INFO_HAS_CHAPTERS 17 +#define XINE_STREAM_INFO_HAS_VIDEO 18 +#define XINE_STREAM_INFO_HAS_AUDIO 19 +#define XINE_STREAM_INFO_IGNORE_VIDEO 20 +#define XINE_STREAM_INFO_IGNORE_AUDIO 21 +#define XINE_STREAM_INFO_IGNORE_SPU 22 +#define XINE_STREAM_INFO_VIDEO_HAS_STILL 23 +#define XINE_STREAM_INFO_MAX_AUDIO_CHANNEL 24 +#define XINE_STREAM_INFO_MAX_SPU_CHANNEL 25 +#define XINE_STREAM_INFO_AUDIO_MODE 26 +#define XINE_STREAM_INFO_SKIPPED_FRAMES 27 /* for 1000 frames delivered */ +#define XINE_STREAM_INFO_DISCARDED_FRAMES 28 /* for 1000 frames delivered */ +#define XINE_STREAM_INFO_VIDEO_AFD 29 +#define XINE_STREAM_INFO_DVD_TITLE_NUMBER 30 +#define XINE_STREAM_INFO_DVD_TITLE_COUNT 31 +#define XINE_STREAM_INFO_DVD_CHAPTER_NUMBER 32 +#define XINE_STREAM_INFO_DVD_CHAPTER_COUNT 33 +#define XINE_STREAM_INFO_DVD_ANGLE_NUMBER 34 +#define XINE_STREAM_INFO_DVD_ANGLE_COUNT 35 + +/* possible values for XINE_STREAM_INFO_VIDEO_AFD */ +#define XINE_VIDEO_AFD_NOT_PRESENT -1 +#define XINE_VIDEO_AFD_RESERVED_0 0 +#define XINE_VIDEO_AFD_RESERVED_1 1 +#define XINE_VIDEO_AFD_BOX_16_9_TOP 2 +#define XINE_VIDEO_AFD_BOX_14_9_TOP 3 +#define XINE_VIDEO_AFD_BOX_GT_16_9_CENTRE 4 +#define XINE_VIDEO_AFD_RESERVED_5 5 +#define XINE_VIDEO_AFD_RESERVED_6 6 +#define XINE_VIDEO_AFD_RESERVED_7 7 +#define XINE_VIDEO_AFD_SAME_AS_FRAME 8 +#define XINE_VIDEO_AFD_4_3_CENTRE 9 +#define XINE_VIDEO_AFD_16_9_CENTRE 10 +#define XINE_VIDEO_AFD_14_9_CENTRE 11 +#define XINE_VIDEO_AFD_RESERVED_12 12 +#define XINE_VIDEO_AFD_4_3_PROTECT_14_9 13 +#define XINE_VIDEO_AFD_16_9_PROTECT_14_9 14 +#define XINE_VIDEO_AFD_16_9_PROTECT_4_3 15 + +/* xine_get_meta_info */ +#define XINE_META_INFO_TITLE 0 +#define XINE_META_INFO_COMMENT 1 +#define XINE_META_INFO_ARTIST 2 +#define XINE_META_INFO_GENRE 3 +#define XINE_META_INFO_ALBUM 4 +#define XINE_META_INFO_YEAR 5 +#define XINE_META_INFO_VIDEOCODEC 6 +#define XINE_META_INFO_AUDIOCODEC 7 +#define XINE_META_INFO_SYSTEMLAYER 8 +#define XINE_META_INFO_INPUT_PLUGIN 9 +#define XINE_META_INFO_CDINDEX_DISCID 10 +#define XINE_META_INFO_TRACK_NUMBER 11 + + +/********************************************************************* + * plugin management / autoplay / mrl browsing * + *********************************************************************/ + +/* + * note: the pointers to strings or string arrays returned + * by some of these functions are pointers to statically + * alloced internal xine memory chunks. + * they're only valid between xine function calls + * and should never be free()d. + */ + +typedef struct { + char *origin; /* file plugin: path */ + char *mrl; /* :// */ + char *link; + off_t size; /* size of this source, may be 0 */ + uint32_t type; /* see below */ +} xine_mrl_t; + +/* mrl types */ +#define XINE_MRL_TYPE_unknown (0 << 0) +#define XINE_MRL_TYPE_dvd (1 << 0) +#define XINE_MRL_TYPE_vcd (1 << 1) +#define XINE_MRL_TYPE_net (1 << 2) +#define XINE_MRL_TYPE_rtp (1 << 3) +#define XINE_MRL_TYPE_stdin (1 << 4) +#define XINE_MRL_TYPE_cda (1 << 5) +#define XINE_MRL_TYPE_file (1 << 6) +#define XINE_MRL_TYPE_file_fifo (1 << 7) +#define XINE_MRL_TYPE_file_chardev (1 << 8) +#define XINE_MRL_TYPE_file_directory (1 << 9) +#define XINE_MRL_TYPE_file_blockdev (1 << 10) +#define XINE_MRL_TYPE_file_normal (1 << 11) +#define XINE_MRL_TYPE_file_symlink (1 << 12) +#define XINE_MRL_TYPE_file_sock (1 << 13) +#define XINE_MRL_TYPE_file_exec (1 << 14) +#define XINE_MRL_TYPE_file_backup (1 << 15) +#define XINE_MRL_TYPE_file_hidden (1 << 16) + +/* get a list of browsable input plugin ids */ +const char *const *xine_get_browsable_input_plugin_ids (xine_t *self) XINE_PROTECTED; + +/* + * ask input plugin named to return + * a list of available MRLs in domain/directory . + * + * may be NULL indicating the toplevel domain/dir + * returns if is a valid MRL, not a directory + * returns NULL if is an invalid MRL, not even a directory. + */ +xine_mrl_t **xine_get_browse_mrls (xine_t *self, + const char *plugin_id, + const char *start_mrl, + int *num_mrls) XINE_PROTECTED; + +/* get a list of plugins that support the autoplay feature */ +const char *const *xine_get_autoplay_input_plugin_ids (xine_t *self) XINE_PROTECTED; + +/* get autoplay MRL list from input plugin named */ +char **xine_get_autoplay_mrls (xine_t *self, + const char *plugin_id, + int *num_mrls) XINE_PROTECTED; + +/* get a list of file extensions for file types supported by xine + * the list is separated by spaces + * + * the pointer returned can be free()ed when no longer used */ +char *xine_get_file_extensions (xine_t *self) XINE_PROTECTED; + +/* get a list of mime types supported by xine + * + * the pointer returned can be free()ed when no longer used */ +char *xine_get_mime_types (xine_t *self) XINE_PROTECTED; + +/* get the demuxer identifier that handles a given mime type + * + * the pointer returned can be free()ed when no longer used + * returns NULL if no demuxer is available to handle this. */ +char *xine_get_demux_for_mime_type (xine_t *self, const char *mime_type) XINE_PROTECTED; + +/* get a description string for a plugin */ +const char *xine_get_input_plugin_description (xine_t *self, + const char *plugin_id) XINE_PROTECTED; +const char *xine_get_demux_plugin_description (xine_t *self, + const char *plugin_id) XINE_PROTECTED; +const char *xine_get_spu_plugin_description (xine_t *self, + const char *plugin_id) XINE_PROTECTED; +const char *xine_get_audio_plugin_description (xine_t *self, + const char *plugin_id) XINE_PROTECTED; +const char *xine_get_video_plugin_description (xine_t *self, + const char *plugin_id) XINE_PROTECTED; +const char *xine_get_audio_driver_plugin_description (xine_t *self, + const char *plugin_id) XINE_PROTECTED; +const char *xine_get_video_driver_plugin_description (xine_t *self, + const char *plugin_id) XINE_PROTECTED; +const char *xine_get_post_plugin_description (xine_t *self, + const char *plugin_id) XINE_PROTECTED; + +/* get lists of available audio and video output plugins */ +const char *const *xine_list_audio_output_plugins (xine_t *self) XINE_PROTECTED; +const char *const *xine_list_video_output_plugins (xine_t *self) XINE_PROTECTED; + +/* get list of available demultiplexor plugins */ +const char *const *xine_list_demuxer_plugins(xine_t *self) XINE_PROTECTED; + +/* get list of available input plugins */ +const char *const *xine_list_input_plugins(xine_t *self) XINE_PROTECTED; + +/* get list of available subpicture plugins */ +const char *const *xine_list_spu_plugins(xine_t *self) XINE_PROTECTED; + +/* get list of available audio and video decoder plugins */ +const char *const *xine_list_audio_decoder_plugins(xine_t *self) XINE_PROTECTED; +const char *const *xine_list_video_decoder_plugins(xine_t *self) XINE_PROTECTED; + +/* unload unused plugins */ +void xine_plugins_garbage_collector(xine_t *self) XINE_PROTECTED; + + +/********************************************************************* + * visual specific gui <-> xine engine communication * + *********************************************************************/ + +/* new (preferred) method to talk to video driver. */ +int xine_port_send_gui_data (xine_video_port_t *vo, + int type, void *data) XINE_PROTECTED; + +typedef struct { + + /* area of that drawable to be used by video */ + int x,y,w,h; + +} x11_rectangle_t; + +/* + * this is the visual data struct any x11 gui + * must supply to the xine_open_video_driver call + * ("data" parameter) + */ +typedef struct { + + /* some information about the display */ + void *display; /* Display* */ + int screen; + + /* drawable to display the video in/on */ + unsigned long d; /* Drawable */ + + void *user_data; + + /* + * dest size callback + * + * this will be called by the video driver to find out + * how big the video output area size will be for a + * given video size. The ui should _not_ adjust it's + * video out area, just do some calculations and return + * the size. This will be called for every frame, ui + * implementation should be fast. + * dest_pixel_aspect should be set to the used display pixel aspect. + * NOTE: Semantics has changed: video_width and video_height + * are no longer pixel aspect corrected. Get the old semantics + * in the UI with + * *dest_pixel_aspect = display_pixel_aspect; + * if (video_pixel_aspect >= display_pixel_aspect) + * video_width = video_width * video_pixel_aspect / display_pixel_aspect + .5; + * else + * video_height = video_height * display_pixel_aspect / video_pixel_aspect + .5; + */ + void (*dest_size_cb) (void *user_data, + int video_width, int video_height, + double video_pixel_aspect, + int *dest_width, int *dest_height, + double *dest_pixel_aspect); + + /* + * frame output callback + * + * this will be called by the video driver for every frame + * it's about to draw. ui can adapt it's size if necessary + * here. + * note: the ui doesn't have to adjust itself to this + * size, this is just to be taken as a hint. + * ui must return the actual size of the video output + * area and the video output driver will do it's best + * to adjust the video frames to that size (while + * preserving aspect ratio and stuff). + * dest_x, dest_y: offset inside window + * dest_width, dest_height: available drawing space + * dest_pixel_aspect: display pixel aspect + * win_x, win_y: window absolute screen position + * NOTE: Semantics has changed: video_width and video_height + * are no longer pixel aspect corrected. Get the old semantics + * in the UI with + * *dest_pixel_aspect = display_pixel_aspect; + * if (video_pixel_aspect >= display_pixel_aspect) + * video_width = video_width * video_pixel_aspect / display_pixel_aspect + .5; + * else + * video_height = video_height * display_pixel_aspect / video_pixel_aspect + .5; + */ + void (*frame_output_cb) (void *user_data, + int video_width, int video_height, + double video_pixel_aspect, + int *dest_x, int *dest_y, + int *dest_width, int *dest_height, + double *dest_pixel_aspect, + int *win_x, int *win_y); + + /* + * lock display callback + * + * this callback is called when the video driver + * needs access to the x11 display connection + * + * note: to enable this you MUST use XINE_VISUAL_TYPE_X11_2 + * note: if display_lock is NULL, the fallback is used + * note: fallback for this function is XLockDisplay(display) + */ + void (*lock_display) (void *user_data); + + /* + * unlock display callback + * + * this callback is called when the video driver + * doesn't need access to the x11 display connection anymore + * + * note: to enable this you MUST use XINE_VISUAL_TYPE_X11_2 + * note: if display_unlock is NULL, the fallback is used + * note: fallback for this function is XUnlockDisplay(display) + */ + void (*unlock_display) (void *user_data); + +} x11_visual_t; + +/* + * this is the visual data struct any xcb gui + * must supply to the xine_open_video_driver call + * ("data" parameter) + */ +typedef struct { + + /* some information about the display */ + void *connection; /* xcb_connection_t */ + void *screen; /* xcb_screen_t */ + + /* window to display the video in / on */ + unsigned int window; /* xcb_window_t */ + + void *user_data; + + /* + * dest size callback + * + * this will be called by the video driver to find out + * how big the video output area size will be for a + * given video size. The ui should _not_ adjust it's + * video out area, just do some calculations and return + * the size. This will be called for every frame, ui + * implementation should be fast. + * dest_pixel_aspect should be set to the used display pixel aspect. + * NOTE: Semantics has changed: video_width and video_height + * are no longer pixel aspect corrected. Get the old semantics + * in the UI with + * *dest_pixel_aspect = display_pixel_aspect; + * if (video_pixel_aspect >= display_pixel_aspect) + * video_width = video_width * video_pixel_aspect / display_pixel_aspect + .5; + * else + * video_height = video_height * display_pixel_aspect / video_pixel_aspect + .5; + */ + void (*dest_size_cb) (void *user_data, + int video_width, int video_height, + double video_pixel_aspect, + int *dest_width, int *dest_height, + double *dest_pixel_aspect); + + /* + * frame output callback + * + * this will be called by the video driver for every frame + * it's about to draw. ui can adapt it's size if necessary + * here. + * note: the ui doesn't have to adjust itself to this + * size, this is just to be taken as a hint. + * ui must return the actual size of the video output + * area and the video output driver will do it's best + * to adjust the video frames to that size (while + * preserving aspect ratio and stuff). + * dest_x, dest_y: offset inside window + * dest_width, dest_height: available drawing space + * dest_pixel_aspect: display pixel aspect + * win_x, win_y: window absolute screen position + * NOTE: Semantics has changed: video_width and video_height + * are no longer pixel aspect corrected. Get the old semantics + * in the UI with + * *dest_pixel_aspect = display_pixel_aspect; + * if (video_pixel_aspect >= display_pixel_aspect) + * video_width = video_width * video_pixel_aspect / display_pixel_aspect + .5; + * else + * video_height = video_height * display_pixel_aspect / video_pixel_aspect + .5; + */ + void (*frame_output_cb) (void *user_data, + int video_width, int video_height, + double video_pixel_aspect, + int *dest_x, int *dest_y, + int *dest_width, int *dest_height, + double *dest_pixel_aspect, + int *win_x, int *win_y); + +} xcb_visual_t; + +/* + * this is the visual data struct any fb gui + * may supply to the xine_open_video_driver call + * ("data" parameter) to get frame_output_cd calls + */ + +typedef struct { + + void (*frame_output_cb) (void *user_data, + int video_width, int video_height, + double video_pixel_aspect, + int *dest_x, int *dest_y, + int *dest_width, int *dest_height, + double *dest_pixel_aspect, + int *win_x, int *win_y); + + void *user_data; + +} fb_visual_t; + +#ifdef WIN32 +/* + * this is the visual data struct any win32 gui should supply + * (pass this to init_video_out_plugin or the xine_load_video_output_plugin + * utility function) + */ + +typedef struct { + + HWND WndHnd; /* handle of window associated with primary surface */ + HINSTANCE HInst; /* handle of windows application instance */ + RECT WndRect; /* rect of window client points translated to screen + * cooridnates */ + int FullScreen; /* is window fullscreen */ + HBRUSH Brush; /* window brush for background color */ + COLORREF ColorKey; /* window brush color key */ + +} win32_visual_t; + +/* + * constants for gui_data_exchange's data_type parameter + */ + +#define GUI_WIN32_MOVED_OR_RESIZED 0 + +#endif /* WIN32 */ + +/* + * "type" constants for xine_port_send_gui_data(...) + */ + +#ifndef XINE_DISABLE_DEPRECATED_FEATURES +/* xevent *data */ +#define XINE_GUI_SEND_COMPLETION_EVENT 1 /* DEPRECATED */ +#endif + +/* Drawable data */ +#define XINE_GUI_SEND_DRAWABLE_CHANGED 2 + +/* xevent *data */ +#define XINE_GUI_SEND_EXPOSE_EVENT 3 + +/* x11_rectangle_t *data */ +#define XINE_GUI_SEND_TRANSLATE_GUI_TO_VIDEO 4 + +/* int data */ +#define XINE_GUI_SEND_VIDEOWIN_VISIBLE 5 + +/* *data contains chosen visual, select a new one or change it to NULL + * to indicate the visual to use or that no visual will work */ +/* XVisualInfo **data */ +#define XINE_GUI_SEND_SELECT_VISUAL 8 + +/* Gui is about to destroy drawable */ +#define XINE_GUI_SEND_WILL_DESTROY_DRAWABLE 9 + + +/********************************************************************* + * xine health check stuff * + *********************************************************************/ + +#define XINE_HEALTH_CHECK_OK 0 +#define XINE_HEALTH_CHECK_FAIL 1 +#define XINE_HEALTH_CHECK_UNSUPPORTED 2 +#define XINE_HEALTH_CHECK_NO_SUCH_CHECK 3 + +#define CHECK_KERNEL 0 +#define CHECK_MTRR 1 +#define CHECK_CDROM 2 +#define CHECK_DVDROM 3 +#define CHECK_DMA 4 +#define CHECK_X 5 +#define CHECK_XV 6 + +struct xine_health_check_s { + const char* cdrom_dev; + const char* dvd_dev; + char* msg; + char* title; + char* explanation; + int status; +}; + +typedef struct xine_health_check_s xine_health_check_t; +xine_health_check_t* xine_health_check(xine_health_check_t*, int check_num) XINE_PROTECTED; + + +/********************************************************************* + * configuration system * + *********************************************************************/ + +/* + * config entry data types + */ + +#define XINE_CONFIG_TYPE_UNKNOWN 0 +#define XINE_CONFIG_TYPE_RANGE 1 +#define XINE_CONFIG_TYPE_STRING 2 +#define XINE_CONFIG_TYPE_ENUM 3 +#define XINE_CONFIG_TYPE_NUM 4 +#define XINE_CONFIG_TYPE_BOOL 5 + +/* For the string type (1.1.4 and later). These are stored in num_value. */ +#define XINE_CONFIG_STRING_IS_STRING 0 +#define XINE_CONFIG_STRING_IS_FILENAME 1 +#define XINE_CONFIG_STRING_IS_DEVICE_NAME 2 +#define XINE_CONFIG_STRING_IS_DIRECTORY_NAME 3 + +typedef struct xine_cfg_entry_s xine_cfg_entry_t; + +typedef void (*xine_config_cb_t) (void *user_data, + xine_cfg_entry_t *entry); +struct xine_cfg_entry_s { + const char *key; /* unique id (example: gui.logo_mrl) */ + + int type; + + /* user experience level */ + int exp_level; /* 0 => beginner, + 10 => advanced user, + 20 => expert */ + + /* type unknown */ + char *unknown_value; + + /* type string */ + char *str_value; + char *str_default; + + /* common to range, enum, num, bool; + * num_value is also used by string to indicate what's required: + * plain string, file name, device name, directory name + */ + int num_value; + int num_default; + + /* type range specific: */ + int range_min; + int range_max; + + /* type enum specific: */ + char **enum_values; + + /* help info for the user (UTF-8) + * the help string must be word wrapped by the frontend. + * it might contain \n to mark paragraph breaks. + */ + const char *description; + const char *help; + + /* callback function and data for live changeable values */ + /* some config entries will take effect immediately, although they + * do not have a callback registered; such values will have some + * non-NULL dummy value in callback_data; so if you want to check, + * if a config change will require restarting xine, check for + * callback_data == NULL */ + xine_config_cb_t callback; + void *callback_data; + +}; + +const char *xine_config_register_string (xine_t *self, + const char *key, + const char *def_value, + const char *description, + const char *help, + int exp_level, + xine_config_cb_t changed_cb, + void *cb_data) XINE_PROTECTED; + +const char *xine_config_register_filename (xine_t *self, + const char *key, + const char *def_value, + int req_type, /* XINE_CONFIG_STRING_IS_* */ + const char *description, + const char *help, + int exp_level, + xine_config_cb_t changed_cb, + void *cb_data) XINE_PROTECTED; + +int xine_config_register_range (xine_t *self, + const char *key, + int def_value, + int min, int max, + const char *description, + const char *help, + int exp_level, + xine_config_cb_t changed_cb, + void *cb_data) XINE_PROTECTED; + +int xine_config_register_enum (xine_t *self, + const char *key, + int def_value, + char **values, + const char *description, + const char *help, + int exp_level, + xine_config_cb_t changed_cb, + void *cb_data) XINE_PROTECTED; + +int xine_config_register_num (xine_t *self, + const char *key, + int def_value, + const char *description, + const char *help, + int exp_level, + xine_config_cb_t changed_cb, + void *cb_data) XINE_PROTECTED; + +int xine_config_register_bool (xine_t *self, + const char *key, + int def_value, + const char *description, + const char *help, + int exp_level, + xine_config_cb_t changed_cb, + void *cb_data) XINE_PROTECTED; + +/* + * the following functions will copy data from the internal xine_config + * data database to the xine_cfg_entry_t *entry you provide + * + * they return 1 on success, 0 on failure + */ + +/* get first config item */ +int xine_config_get_first_entry (xine_t *self, xine_cfg_entry_t *entry) XINE_PROTECTED; + +/* get next config item (iterate through the items) */ +int xine_config_get_next_entry (xine_t *self, xine_cfg_entry_t *entry) XINE_PROTECTED; + +/* search for a config entry by key */ +int xine_config_lookup_entry (xine_t *self, const char *key, + xine_cfg_entry_t *entry) XINE_PROTECTED; + +/* + * update a config entry (which was returned from lookup_entry() ) + * + * xine will make a deep copy of the data in the entry into it's internal + * config database. + */ +void xine_config_update_entry (xine_t *self, + const xine_cfg_entry_t *entry) XINE_PROTECTED; + +/* + * translation of old configuration entry names + */ +typedef struct { + const char *old_name, *new_name; +} xine_config_entry_translation_t; + +void xine_config_set_translation_user (const xine_config_entry_translation_t *) XINE_PROTECTED; + +/* + * load/save config data from/to afile (e.g. $HOME/.xine/config) + */ +void xine_config_load (xine_t *self, const char *cfg_filename) XINE_PROTECTED; +void xine_config_save (xine_t *self, const char *cfg_filename) XINE_PROTECTED; +void xine_config_reset (xine_t *self) XINE_PROTECTED; + + +/********************************************************************* + * asynchroneous xine event mechanism * + *********************************************************************/ + +/* + * to receive events you have to register an event queue with + * the xine engine (xine_event_new_queue, see below). + * + * then you can either + * 1) check for incoming events regularly (xine_event_get/wait), + * process them and free them using xine_event_free + * 2) use xine_event_create_listener_thread and specify a callback + * which will then be called for each event + * + * to send events to every module listening you don't need + * to register an event queue but simply call xine_event_send. + * + * front ends should listen for one of MRL_REFERENCE and MRL_REFERENCE_EXT + * since both will be sent for compatibility reasons + */ + +/* event types */ +#define XINE_EVENT_UI_PLAYBACK_FINISHED 1 /* frontend can e.g. move on to next playlist entry */ +#define XINE_EVENT_UI_CHANNELS_CHANGED 2 /* inform ui that new channel info is available */ +#define XINE_EVENT_UI_SET_TITLE 3 /* request title display change in ui */ +#define XINE_EVENT_UI_MESSAGE 4 /* message (dialog) for the ui to display */ +#define XINE_EVENT_FRAME_FORMAT_CHANGE 5 /* e.g. aspect ratio change during dvd playback */ +#define XINE_EVENT_AUDIO_LEVEL 6 /* report current audio level (l/r/mute) */ +#define XINE_EVENT_QUIT 7 /* last event sent when stream is disposed */ +#define XINE_EVENT_PROGRESS 8 /* index creation/network connections */ +#define XINE_EVENT_MRL_REFERENCE 9 /* (deprecated) demuxer->frontend: MRL reference(s) for the real stream */ +#define XINE_EVENT_UI_NUM_BUTTONS 10 /* number of buttons for interactive menus */ +#define XINE_EVENT_SPU_BUTTON 11 /* the mouse pointer enter/leave a button */ +#define XINE_EVENT_DROPPED_FRAMES 12 /* number of dropped frames is too high */ +#define XINE_EVENT_MRL_REFERENCE_EXT 13 /* demuxer->frontend: MRL reference(s) for the real stream */ +#define XINE_EVENT_AUDIO_AMP_LEVEL 14 /* report current audio amp level (l/r/mute) */ + + +/* input events coming from frontend */ +#define XINE_EVENT_INPUT_MOUSE_BUTTON 101 +#define XINE_EVENT_INPUT_MOUSE_MOVE 102 +#define XINE_EVENT_INPUT_MENU1 103 +#define XINE_EVENT_INPUT_MENU2 104 +#define XINE_EVENT_INPUT_MENU3 105 +#define XINE_EVENT_INPUT_MENU4 106 +#define XINE_EVENT_INPUT_MENU5 107 +#define XINE_EVENT_INPUT_MENU6 108 +#define XINE_EVENT_INPUT_MENU7 109 +#define XINE_EVENT_INPUT_UP 110 +#define XINE_EVENT_INPUT_DOWN 111 +#define XINE_EVENT_INPUT_LEFT 112 +#define XINE_EVENT_INPUT_RIGHT 113 +#define XINE_EVENT_INPUT_SELECT 114 +#define XINE_EVENT_INPUT_NEXT 115 +#define XINE_EVENT_INPUT_PREVIOUS 116 +#define XINE_EVENT_INPUT_ANGLE_NEXT 117 +#define XINE_EVENT_INPUT_ANGLE_PREVIOUS 118 +#define XINE_EVENT_INPUT_BUTTON_FORCE 119 +#define XINE_EVENT_INPUT_NUMBER_0 120 +#define XINE_EVENT_INPUT_NUMBER_1 121 +#define XINE_EVENT_INPUT_NUMBER_2 122 +#define XINE_EVENT_INPUT_NUMBER_3 123 +#define XINE_EVENT_INPUT_NUMBER_4 124 +#define XINE_EVENT_INPUT_NUMBER_5 125 +#define XINE_EVENT_INPUT_NUMBER_6 126 +#define XINE_EVENT_INPUT_NUMBER_7 127 +#define XINE_EVENT_INPUT_NUMBER_8 128 +#define XINE_EVENT_INPUT_NUMBER_9 129 +#define XINE_EVENT_INPUT_NUMBER_10_ADD 130 + +/* specific event types */ +#define XINE_EVENT_SET_V4L2 200 +#define XINE_EVENT_PVR_SAVE 201 +#define XINE_EVENT_PVR_REPORT_NAME 202 +#define XINE_EVENT_PVR_REALTIME 203 +#define XINE_EVENT_PVR_PAUSE 204 +#define XINE_EVENT_SET_MPEG_DATA 205 + +/* VDR specific event types */ +#define XINE_EVENT_VDR_RED 300 +#define XINE_EVENT_VDR_GREEN 301 +#define XINE_EVENT_VDR_YELLOW 302 +#define XINE_EVENT_VDR_BLUE 303 +#define XINE_EVENT_VDR_PLAY 304 +#define XINE_EVENT_VDR_PAUSE 305 +#define XINE_EVENT_VDR_STOP 306 +#define XINE_EVENT_VDR_RECORD 307 +#define XINE_EVENT_VDR_FASTFWD 308 +#define XINE_EVENT_VDR_FASTREW 309 +#define XINE_EVENT_VDR_POWER 310 +#define XINE_EVENT_VDR_CHANNELPLUS 311 +#define XINE_EVENT_VDR_CHANNELMINUS 312 +#define XINE_EVENT_VDR_SCHEDULE 313 +#define XINE_EVENT_VDR_CHANNELS 314 +#define XINE_EVENT_VDR_TIMERS 315 +#define XINE_EVENT_VDR_RECORDINGS 316 +#define XINE_EVENT_VDR_SETUP 317 +#define XINE_EVENT_VDR_COMMANDS 318 +#define XINE_EVENT_VDR_BACK 319 +#define XINE_EVENT_VDR_USER1 320 +#define XINE_EVENT_VDR_USER2 321 +#define XINE_EVENT_VDR_USER3 322 +#define XINE_EVENT_VDR_USER4 323 +#define XINE_EVENT_VDR_USER5 324 +#define XINE_EVENT_VDR_USER6 325 +#define XINE_EVENT_VDR_USER7 326 +#define XINE_EVENT_VDR_USER8 327 +#define XINE_EVENT_VDR_USER9 328 +#define XINE_EVENT_VDR_VOLPLUS 329 +#define XINE_EVENT_VDR_VOLMINUS 330 +#define XINE_EVENT_VDR_MUTE 331 +#define XINE_EVENT_VDR_AUDIO 332 +#define XINE_EVENT_VDR_INFO 333 +#define XINE_EVENT_VDR_CHANNELPREVIOUS 334 +#define XINE_EVENT_VDR_SUBTITLES 335 +/* some space for further keys */ +#define XINE_EVENT_VDR_SETVIDEOWINDOW 350 +#define XINE_EVENT_VDR_FRAMESIZECHANGED 351 +#define XINE_EVENT_VDR_SELECTAUDIO 352 +#define XINE_EVENT_VDR_TRICKSPEEDMODE 353 +#define XINE_EVENT_VDR_PLUGINSTARTED 354 + +/* events generated from post plugins */ +#define XINE_EVENT_POST_TVTIME_FILMMODE_CHANGE 400 + +/* + * xine event struct + */ +typedef struct { + xine_stream_t *stream; /* stream this event belongs to */ + + void *data; /* contents depending on type */ + int data_length; + + int type; /* event type (constants see above) */ + + /* you do not have to provide this, it will be filled in by xine_event_send() */ + struct timeval tv; /* timestamp of event creation */ +} xine_event_t; + +/* + * input event dynamic data + */ +typedef struct { + xine_event_t event; + uint8_t button; /* Generally 1 = left, 2 = mid, 3 = right */ + uint16_t x,y; /* In Image space */ +} xine_input_data_t; + +/* + * UI event dynamic data - send information to/from UI. + */ +typedef struct { + int num_buttons; + int str_len; + char str[256]; /* might be longer */ +} xine_ui_data_t; + +/* + * Send messages to UI. used mostly to report errors. + */ +typedef struct { + /* + * old xine-ui versions expect xine_ui_data_t type. + * this struct is added for compatibility. + */ + xine_ui_data_t compatibility; + + /* See XINE_MSG_xxx for defined types. */ + int type; + + /* defined types are provided with a standard explanation. + * note: zero means no explanation. + */ + int explanation; /* add to struct address to get a valid (char *) */ + + /* parameters are zero terminated strings */ + int num_parameters; + int parameters; /* add to struct address to get a valid (char *) */ + + /* where messages are stored, will be longer + * + * this field begins with the message text itself (\0-terminated), + * followed by (optional) \0-terminated parameter strings + * the end marker is \0 \0 + */ + char messages[1]; +} xine_ui_message_data_t; + + +/* + * notify frame format change + */ +typedef struct { + int width; + int height; + /* these are aspect codes as defined in MPEG2, because this + * is only used for DVD playback, pan_scan is a boolean flag */ + int aspect; + int pan_scan; +} xine_format_change_data_t; + +/* + * audio level for left/right channel + */ +typedef struct { + int left; + int right; /* 0..100 % */ + int mute; +} xine_audio_level_data_t; + +/* + * index generation / buffering + */ +typedef struct { + const char *description; /* e.g. "connecting..." */ + int percent; +} xine_progress_data_t; + +/* + * mrl reference data is sent by demuxers when a reference stream is found. + * this stream just contains pointers (urls) to the real data, which are + * passed to frontend using this event type. (examples: .asx, .mov and .ram) + * + * ideally, frontends should add these mrls to a "hierarchical playlist". + * that is, instead of the original file, the ones provided here should be + * played instead. on pratice, just using a simple playlist should work. + * + * mrl references should be played in the same order they are received, just + * after the current stream finishes. + * alternative entries may be provided and should be used in case of + * failure of the primary stream (the one with alternative=0). + * + * sample playlist: + * 1) http://something/something.ram + * 1a) rtsp://something/realsomething1.rm (alternative=0) + * 1b) pnm://something/realsomething1.rm (alternative=1) + * 2) http://another/another.avi + * + * 1 and 2 are the original items on this playlist. 1a and 1b were received + * by events (they are the mrl references enclosed in 1). 1a is played after + * receiving the finished event from 1. note: 1b is usually ignored, it should + * only be used in case 1a fails to open. + * + * An event listener which accepts XINE_EVENT_MRL_REFERENCE_EXT events + * *must* ignore XINE_EVENT_MRL_REFERENCE events. + */ +typedef struct { + int alternative; /* alternative playlist number, usually 0 */ + char mrl[1]; /* might (will) be longer */ +} xine_mrl_reference_data_t; + +typedef struct { + int alternative; /* as above */ + uint32_t start_time, duration; /* milliseconds */ + uint32_t spare[20]; /* for future expansion */ + const char mrl[1]; /* might (will) be longer */ +/*const char title[]; ** immediately follows MRL's terminating NUL */ +} xine_mrl_reference_data_ext_t; + +/* + * configuration options for video4linux-like input plugins + */ +typedef struct { + /* input selection */ + int input; /* select active input from card */ + int channel; /* channel number */ + int radio; /* ask for a radio channel */ + uint32_t frequency; /* frequency divided by 62.5KHz or 62.5 Hz */ + uint32_t transmission; /* The transmission standard. */ + + /* video parameters */ + uint32_t framerate_numerator; /* framerate as numerator/denominator */ + uint32_t framerate_denominator; + uint32_t framelines; /* Total lines per frame including blanking */ + uint64_t standard_id; /* One of the V4L2_STD_* values */ + uint32_t colorstandard; /* One of the V4L2_COLOR_STD_* values */ + uint32_t colorsubcarrier; /* The color subcarrier frequency */ + int frame_width; /* scaled frame width */ + int frame_height; /* scaled frame height */ + + /* let some spare space so we can add new fields without breaking + * binary api compatibility. + */ + uint32_t spare[20]; + + /* used by pvr plugin */ + int32_t session_id; /* -1 stops pvr recording */ + +} xine_set_v4l2_data_t; + +/* + * configuration options for plugins that can do a kind of mpeg encoding + * note: highly experimental api :) + */ +typedef struct { + + /* mpeg2 parameters */ + int bitrate_vbr; /* 1 = vbr, 0 = cbr */ + int bitrate_mean; /* mean (target) bitrate in kbps*/ + int bitrate_peak; /* peak (max) bitrate in kbps */ + int gop_size; /* GOP size in frames */ + int gop_closure; /* open/closed GOP */ + int b_frames; /* number of B frames to use */ + int aspect_ratio; /* XINE_VO_ASPECT_xxx */ + + /* let some spare space so we can add new fields without breaking + * binary api compatibility. + */ + uint32_t spare[20]; + +} xine_set_mpeg_data_t; + +typedef struct { + int direction; /* 0 leave, 1 enter */ + int32_t button; /* button number */ +} xine_spu_button_t; + +#ifdef XINE_ENABLE_EXPERIMENTAL_FEATURES + +/* + * ask pvr to save (ie. do not discard) the current session + * see comments on input_pvr.c to understand how it works. + */ +typedef struct { + /* mode values: + * -1 = do nothing, just set the name + * 0 = truncate current session and save from now on + * 1 = save from last sync point + * 2 = save everything on current session + */ + int mode; + int id; + char name[256]; /* name for saving, might be longer */ +} xine_pvr_save_data_t; + +typedef struct { + /* mode values: + * 0 = non realtime + * 1 = realtime + */ + int mode; +} xine_pvr_realtime_t; + +typedef struct { + /* mode values: + * 0 = playing + * 1 = paused + */ + int mode; +} xine_pvr_pause_t; + +#endif + +/* event XINE_EVENT_DROPPED_FRAMES is generated if libxine detects a + * high number of dropped frames (above configured thresholds). it can + * be used by the front end to warn about performance problems. + */ +typedef struct { + /* these values are given for 1000 frames delivered */ + /* (that is, divide by 10 to get percentages) */ + int skipped_frames; + int skipped_threshold; + int discarded_frames; + int discarded_threshold; +} xine_dropped_frames_t; + + +/* + * Defined message types for XINE_EVENT_UI_MESSAGE + * This is the mechanism to report async errors from engine. + * + * If frontend knows about the XINE_MSG_xxx type it may safely + * ignore the 'explanation' field and provide it's own custom + * dialog to the 'parameters'. + * + * right column specifies the usual parameters. + */ + +#define XINE_MSG_NO_ERROR 0 /* (messages to UI) */ +#define XINE_MSG_GENERAL_WARNING 1 /* (warning message) */ +#define XINE_MSG_UNKNOWN_HOST 2 /* (host name) */ +#define XINE_MSG_UNKNOWN_DEVICE 3 /* (device name) */ +#define XINE_MSG_NETWORK_UNREACHABLE 4 /* none */ +#define XINE_MSG_CONNECTION_REFUSED 5 /* (host name) */ +#define XINE_MSG_FILE_NOT_FOUND 6 /* (file name or mrl) */ +#define XINE_MSG_READ_ERROR 7 /* (device/file/mrl) */ +#define XINE_MSG_LIBRARY_LOAD_ERROR 8 /* (library/decoder) */ +#define XINE_MSG_ENCRYPTED_SOURCE 9 /* none */ +#define XINE_MSG_SECURITY 10 /* (security message) */ +#define XINE_MSG_AUDIO_OUT_UNAVAILABLE 11 /* none */ +#define XINE_MSG_PERMISSION_ERROR 12 /* (file name or mrl) */ +#define XINE_MSG_FILE_EMPTY 13 /* file is empty */ +#define XINE_MSG_AUTHENTICATION_NEEDED 14 /* (mrl, likely http) */ + +/* opaque xine_event_queue_t */ +typedef struct xine_event_queue_s xine_event_queue_t; + +/* + * register a new event queue + * + * you have to receive messages from this queue regularly + * + * use xine_event_dispose_queue to unregister and free the queue + */ +xine_event_queue_t *xine_event_new_queue (xine_stream_t *stream) XINE_PROTECTED; +void xine_event_dispose_queue (xine_event_queue_t *queue) XINE_PROTECTED; + +/* + * receive events (poll) + * + * use xine_event_free on the events received from these calls + * when they're no longer needed + */ +xine_event_t *xine_event_get (xine_event_queue_t *queue) XINE_PROTECTED; +xine_event_t *xine_event_wait (xine_event_queue_t *queue) XINE_PROTECTED; +void xine_event_free (xine_event_t *event) XINE_PROTECTED; + +/* + * receive events (callback) + * + * a thread is created which will receive all events from + * the specified queue, call your callback on each of them + * and will then free the event when your callback returns + * + */ +typedef void (*xine_event_listener_cb_t) (void *user_data, + const xine_event_t *event); +void xine_event_create_listener_thread (xine_event_queue_t *queue, + xine_event_listener_cb_t callback, + void *user_data) XINE_PROTECTED; + +/* + * send an event to all queues + * + * the event will be copied so you can free or reuse + * *event as soon as xine_event_send returns. + */ +void xine_event_send (xine_stream_t *stream, const xine_event_t *event) XINE_PROTECTED; + + +/********************************************************************* + * OSD (on screen display) * + *********************************************************************/ + +#define XINE_TEXT_PALETTE_SIZE 11 + +#define XINE_OSD_TEXT1 (0 * XINE_TEXT_PALETTE_SIZE) +#define XINE_OSD_TEXT2 (1 * XINE_TEXT_PALETTE_SIZE) +#define XINE_OSD_TEXT3 (2 * XINE_TEXT_PALETTE_SIZE) +#define XINE_OSD_TEXT4 (3 * XINE_TEXT_PALETTE_SIZE) +#define XINE_OSD_TEXT5 (4 * XINE_TEXT_PALETTE_SIZE) +#define XINE_OSD_TEXT6 (5 * XINE_TEXT_PALETTE_SIZE) +#define XINE_OSD_TEXT7 (6 * XINE_TEXT_PALETTE_SIZE) +#define XINE_OSD_TEXT8 (7 * XINE_TEXT_PALETTE_SIZE) +#define XINE_OSD_TEXT9 (8 * XINE_TEXT_PALETTE_SIZE) +#define XINE_OSD_TEXT10 (9 * XINE_TEXT_PALETTE_SIZE) + +/* white text, black border, transparent background */ +#define XINE_TEXTPALETTE_WHITE_BLACK_TRANSPARENT 0 +/* white text, noborder, transparent background */ +#define XINE_TEXTPALETTE_WHITE_NONE_TRANSPARENT 1 +/* white text, no border, translucid background */ +#define XINE_TEXTPALETTE_WHITE_NONE_TRANSLUCID 2 +/* yellow text, black border, transparent background */ +#define XINE_TEXTPALETTE_YELLOW_BLACK_TRANSPARENT 3 + +#define XINE_OSD_CAP_FREETYPE2 0x0001 /* freetype2 support compiled in */ +#define XINE_OSD_CAP_UNSCALED 0x0002 /* unscaled overlays supp. by vo drv */ + +typedef struct xine_osd_s xine_osd_t; + +xine_osd_t *xine_osd_new (xine_stream_t *self, int x, int y, + int width, int height) XINE_PROTECTED; +uint32_t xine_osd_get_capabilities (xine_osd_t *self) XINE_PROTECTED; +void xine_osd_draw_point (xine_osd_t *self, int x, int y, int color) XINE_PROTECTED; + +void xine_osd_draw_line (xine_osd_t *self, int x1, int y1, + int x2, int y2, int color) XINE_PROTECTED; +void xine_osd_draw_rect (xine_osd_t *self, int x1, int y1, + int x2, int y2, + int color, int filled ) XINE_PROTECTED; +/* x1 and y1 specifies the upper left corner of the text to be rendered */ +void xine_osd_draw_text (xine_osd_t *self, int x1, int y1, + const char *text, int color_base) XINE_PROTECTED; +void xine_osd_draw_bitmap (xine_osd_t *self, uint8_t *bitmap, + int x1, int y1, int width, int height, + uint8_t *palette_map) XINE_PROTECTED; +/* for freetype2 fonts the height is the maximum height for the whole font and not + * only for the specified text */ +void xine_osd_get_text_size (xine_osd_t *self, const char *text, + int *width, int *height) XINE_PROTECTED; +/* with freetype2 support compiled in, you can also specify a font file + as 'fontname' here */ +int xine_osd_set_font (xine_osd_t *self, const char *fontname, + int size) XINE_PROTECTED; +/* + * specifying encoding of texts + * "" ... means current locale encoding (default) + * NULL ... means latin1 + */ +void xine_osd_set_encoding(xine_osd_t *self, const char *encoding) XINE_PROTECTED; +/* set position were overlay will be blended */ +void xine_osd_set_position (xine_osd_t *self, int x, int y) XINE_PROTECTED; +void xine_osd_show (xine_osd_t *self, int64_t vpts) XINE_PROTECTED; +void xine_osd_show_unscaled (xine_osd_t *self, int64_t vpts) XINE_PROTECTED; +void xine_osd_hide (xine_osd_t *self, int64_t vpts) XINE_PROTECTED; +/* empty drawing area */ +void xine_osd_clear (xine_osd_t *self) XINE_PROTECTED; +/* + * set on existing text palette + * (-1 to set used specified palette) + * + * color_base specifies the first color index to use for this text + * palette. The OSD palette is then modified starting at this + * color index, up to the size of the text palette. + * + * Use OSD_TEXT1, OSD_TEXT2, ... for some preassigned color indices. + * + * These palettes are not working well with the true type fonts. + * First thing is that these fonts cannot have a border. So you get + * the best results by loading a linearly blending palette from the + * background (at index 0) to the forground color (at index 10). + */ +void xine_osd_set_text_palette (xine_osd_t *self, + int palette_number, + int color_base ) XINE_PROTECTED; +/* get palette (color and transparency) */ +void xine_osd_get_palette (xine_osd_t *self, uint32_t *color, + uint8_t *trans) XINE_PROTECTED; +void xine_osd_set_palette (xine_osd_t *self, + const uint32_t *const color, + const uint8_t *const trans ) XINE_PROTECTED; +/* + * close osd rendering engine + * loaded fonts are unloaded + * osd objects are closed + */ +void xine_osd_free (xine_osd_t *self) XINE_PROTECTED; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/xine.h.in b/include/xine.h.in deleted file mode 100644 index 5a06eab65..000000000 --- a/include/xine.h.in +++ /dev/null @@ -1,2076 +0,0 @@ -/* - * Copyright (C) 2000-2006 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * public xine-lib (libxine) interface and documentation - * - * - * some programming guidelines about this api: - * ------------------------------------------- - * - * (1) libxine has (per stream instance) a fairly static memory - * model - * (2) as a rule of thumb, never free() or realloc() any pointers - * returned by the xine engine (unless stated otherwise) - * or, in other words: - * do not free() stuff you have not malloc()ed - * (3) xine is multi-threaded, make sure your programming environment - * can handle this. - * for x11-related stuff this means that you either have to properly - * use xlockdisplay() or use two seperate connections to the x-server - * - */ -/*_x_ Lines formatted like this one are xine-lib developer comments. */ -/*_x_ They will be removed from the installed version of this header. */ - -#ifndef HAVE_XINE_H -#define HAVE_XINE_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include -#include - -#ifdef WIN32 -#include -#include -#endif - -#ifdef XINE_COMPILE -#include -#include "attributes.h" -#else -#include -#include -#endif - -/* This enables some experimental features. These are not part of the - * official libxine API, so use them only, if you absolutely need them. - * Although we make efforts to keep even this part of the API as stable - * as possible, this is not guaranteed. Incompatible changes can occur. - */ -/* #define XINE_ENABLE_EXPERIMENTAL_FEATURES */ - -/* This disables some deprecated features. These are still part of the - * official libxine API and you may still use them. During the current - * major release series, these will always be available and will stay - * compatible. However, removal is likely to occur as soon as possible. - */ -/* #define XINE_DISABLE_DEPRECATED_FEATURES */ - - -/********************************************************************* - * xine opaque data types * - *********************************************************************/ - -typedef struct xine_s xine_t; -typedef struct xine_stream_s xine_stream_t; -typedef struct xine_audio_port_s xine_audio_port_t; -typedef struct xine_video_port_s xine_video_port_t; - -/********************************************************************* - * global engine handling * - *********************************************************************/ - -/* - * version information - */ - -/* dynamic info from actually linked libxine */ -const char *xine_get_version_string (void) XINE_PROTECTED; -void xine_get_version (int *major, int *minor, int *sub) XINE_PROTECTED; - -/* compare given version to libxine version, - return 1 if compatible, 0 otherwise */ -int xine_check_version (int major, int minor, int sub) XINE_PROTECTED; - -/* static info - which libxine release this header came from */ -#define XINE_MAJOR_VERSION @XINE_MAJOR@ -#define XINE_MINOR_VERSION @XINE_MINOR@ -#define XINE_SUB_VERSION @XINE_SUB@ -#define XINE_VERSION "@VERSION@" - -/* - * pre-init the xine engine - * - * will first malloc and init a xine_t, create an empty config - * system, then scan through all installed plugins and add them - * to an internal list for later use. - * - * to fully init the xine engine, you have to load config values - * (either using your own storage method and calling - * xine_config_register_entry, or by using the xine_load_config - * utility function - see below) and then call xine_init - * - * the only proper way to shut down the xine engine is to - * call xine_exit() - do not try to free() the xine pointer - * yourself and do not try to access any internal data structures - */ -xine_t *xine_new (void) XINE_PROTECTED; - -/* - * post_init the xine engine - */ -void xine_init (xine_t *self) XINE_PROTECTED; - -/* - * helper functions to find and init audio/video drivers - * from xine's plugin collection - * - * id : identifier of the driver, may be NULL for auto-detection - * data : special data struct for ui/driver communications, depends - * on driver - * visual: video driver flavor selector, constants see below - * - * both functions may return NULL if driver failed to load, was not - * found ... - * - * use xine_close_audio/video_driver() to close loaded drivers - * and free resources allocated by them - */ -xine_audio_port_t *xine_open_audio_driver (xine_t *self, const char *id, - void *data) XINE_PROTECTED; -xine_video_port_t *xine_open_video_driver (xine_t *self, const char *id, - int visual, void *data) XINE_PROTECTED; - -void xine_close_audio_driver (xine_t *self, xine_audio_port_t *driver) XINE_PROTECTED; -void xine_close_video_driver (xine_t *self, xine_video_port_t *driver) XINE_PROTECTED; - -/* valid visual types */ -#define XINE_VISUAL_TYPE_NONE 0 -#define XINE_VISUAL_TYPE_X11 1 -#define XINE_VISUAL_TYPE_X11_2 10 -#define XINE_VISUAL_TYPE_AA 2 -#define XINE_VISUAL_TYPE_FB 3 -#define XINE_VISUAL_TYPE_GTK 4 -#define XINE_VISUAL_TYPE_DFB 5 -#define XINE_VISUAL_TYPE_PM 6 /* used by the OS/2 port */ -#define XINE_VISUAL_TYPE_DIRECTX 7 /* used by the win32/msvc port */ -#define XINE_VISUAL_TYPE_CACA 8 -#define XINE_VISUAL_TYPE_MACOSX 9 -#define XINE_VISUAL_TYPE_XCB 11 - -/* - * free all resources, close all plugins, close engine. - * self pointer is no longer valid after this call. - */ -void xine_exit (xine_t *self) XINE_PROTECTED; - - -/********************************************************************* - * stream handling * - *********************************************************************/ - -/* - * create a new stream for media playback/access - * - * returns xine_stream_t* if OK, - * NULL on error (use xine_get_error for details) - * - * the only proper way to free the stream pointer returned by this - * function is to call xine_dispose() on it. do not try to access any - * fields in xine_stream_t, they're all private and subject to change - * without further notice. - */ -xine_stream_t *xine_stream_new (xine_t *self, - xine_audio_port_t *ao, xine_video_port_t *vo) XINE_PROTECTED; - -/* - * Make one stream the slave of another. - * This establishes a binary master slave relation on streams, where - * certain operations (specified by parameter "affection") on the master - * stream are also applied to the slave stream. - * If you want more than one stream to react to one master, you have to - * apply the calls in a top down way: - * xine_stream_master_slave(stream1, stream2, 3); - * xine_stream_master_slave(stream2, stream3, 3); - * This will make stream1 affect stream2 and stream2 affect stream3, so - * effectively, operations on stream1 propagate to stream2 and 3. - * - * Please note that subsequent master_slave calls on the same streams - * will overwrite their previous master/slave setting. - * Be sure to not mess around. - * - * returns 1 on success, 0 on failure - */ -int xine_stream_master_slave(xine_stream_t *master, xine_stream_t *slave, - int affection) XINE_PROTECTED; - -/* affection is some of the following ORed together: */ -/* playing the master plays the slave */ -#define XINE_MASTER_SLAVE_PLAY (1<<0) -/* slave stops on master stop */ -#define XINE_MASTER_SLAVE_STOP (1<<1) -/* slave is synced to master's speed */ -#define XINE_MASTER_SLAVE_SPEED (1<<2) - -/* - * open a stream - * - * look for input / demux / decoder plugins, find out about the format - * see if it is supported, set up internal buffers and threads - * - * returns 1 if OK, 0 on error (use xine_get_error for details) - */ -int xine_open (xine_stream_t *stream, const char *mrl) XINE_PROTECTED; - -/* - * play a stream from a given position - * - * start_pos: 0..65535 - * start_time: milliseconds - * if both start position parameters are != 0 start_pos will be used - * for non-seekable streams both values will be ignored - * - * returns 1 if OK, 0 on error (use xine_get_error for details) - */ -int xine_play (xine_stream_t *stream, int start_pos, int start_time) XINE_PROTECTED; - -/* - * set xine to a trick mode for fast forward, backwards playback, - * low latency seeking. Please note that this works only with some - * input plugins. mode constants see below. - * - * returns 1 if OK, 0 on error (use xine_get_error for details) - */ -int xine_trick_mode (xine_stream_t *stream, int mode, int value) XINE_PROTECTED; - -/* trick modes */ -#define XINE_TRICK_MODE_OFF 0 -#define XINE_TRICK_MODE_SEEK_TO_POSITION 1 -#define XINE_TRICK_MODE_SEEK_TO_TIME 2 -#define XINE_TRICK_MODE_FAST_FORWARD 3 -#define XINE_TRICK_MODE_FAST_REWIND 4 - -/* - * stop stream playback - * xine_stream_t stays valid for new xine_open or xine_play - */ -void xine_stop (xine_stream_t *stream) XINE_PROTECTED; - -/* - * stop stream playback, free all stream-related resources - * xine_stream_t stays valid for new xine_open - */ -void xine_close (xine_stream_t *stream) XINE_PROTECTED; - -/* - * ask current/recent input plugin to eject media - may or may not work, - * depending on input plugin capabilities - */ -int xine_eject (xine_stream_t *stream) XINE_PROTECTED; - -/* - * stop playback, dispose all stream-related resources - * xine_stream_t no longer valid when after this - */ -void xine_dispose (xine_stream_t *stream) XINE_PROTECTED; - -/* - * set/get engine parameters. - */ -void xine_engine_set_param(xine_t *self, int param, int value) XINE_PROTECTED; -int xine_engine_get_param(xine_t *self, int param) XINE_PROTECTED; - -#define XINE_ENGINE_PARAM_VERBOSITY 1 - -/* - * set/get xine stream parameters - * e.g. playback speed, constants see below - */ -void xine_set_param (xine_stream_t *stream, int param, int value) XINE_PROTECTED; -int xine_get_param (xine_stream_t *stream, int param) XINE_PROTECTED; - -/* - * xine stream parameters - */ -#define XINE_PARAM_SPEED 1 /* see below */ -#define XINE_PARAM_AV_OFFSET 2 /* unit: 1/90000 sec */ -#define XINE_PARAM_AUDIO_CHANNEL_LOGICAL 3 /* -1 => auto, -2 => off */ -#define XINE_PARAM_SPU_CHANNEL 4 -#define XINE_PARAM_VIDEO_CHANNEL 5 -#define XINE_PARAM_AUDIO_VOLUME 6 /* 0..100 */ -#define XINE_PARAM_AUDIO_MUTE 7 /* 1=>mute, 0=>unmute */ -#define XINE_PARAM_AUDIO_COMPR_LEVEL 8 /* <100=>off, % compress otherw*/ -#define XINE_PARAM_AUDIO_AMP_LEVEL 9 /* 0..200, 100=>100% (default) */ -#define XINE_PARAM_AUDIO_REPORT_LEVEL 10 /* 1=>send events, 0=> don't */ -#define XINE_PARAM_VERBOSITY 11 /* control console output */ -#define XINE_PARAM_SPU_OFFSET 12 /* unit: 1/90000 sec */ -#define XINE_PARAM_IGNORE_VIDEO 13 /* disable video decoding */ -#define XINE_PARAM_IGNORE_AUDIO 14 /* disable audio decoding */ -#define XINE_PARAM_IGNORE_SPU 15 /* disable spu decoding */ -#define XINE_PARAM_BROADCASTER_PORT 16 /* 0: disable, x: server port */ -#define XINE_PARAM_METRONOM_PREBUFFER 17 /* unit: 1/90000 sec */ -#define XINE_PARAM_EQ_30HZ 18 /* equalizer gains -100..100 */ -#define XINE_PARAM_EQ_60HZ 19 /* equalizer gains -100..100 */ -#define XINE_PARAM_EQ_125HZ 20 /* equalizer gains -100..100 */ -#define XINE_PARAM_EQ_250HZ 21 /* equalizer gains -100..100 */ -#define XINE_PARAM_EQ_500HZ 22 /* equalizer gains -100..100 */ -#define XINE_PARAM_EQ_1000HZ 23 /* equalizer gains -100..100 */ -#define XINE_PARAM_EQ_2000HZ 24 /* equalizer gains -100..100 */ -#define XINE_PARAM_EQ_4000HZ 25 /* equalizer gains -100..100 */ -#define XINE_PARAM_EQ_8000HZ 26 /* equalizer gains -100..100 */ -#define XINE_PARAM_EQ_16000HZ 27 /* equalizer gains -100..100 */ -#define XINE_PARAM_AUDIO_CLOSE_DEVICE 28 /* force closing audio device */ -#define XINE_PARAM_AUDIO_AMP_MUTE 29 /* 1=>mute, 0=>unmute */ -#define XINE_PARAM_FINE_SPEED 30 /* 1.000.000 => normal speed */ -#define XINE_PARAM_EARLY_FINISHED_EVENT 31 /* send event when demux finish*/ -#define XINE_PARAM_GAPLESS_SWITCH 32 /* next stream only gapless swi*/ -#define XINE_PARAM_DELAY_FINISHED_EVENT 33 /* 1/10sec,0=>disable,-1=>forev*/ - -/* - * speed values for XINE_PARAM_SPEED parameter. - * - * alternatively, one may use XINE_PARAM_FINE_SPEED for greater - * control of the speed value, where: - * XINE_PARAM_SPEED / 4 <-> XINE_PARAM_FINE_SPEED / 1000000 - */ -#define XINE_SPEED_PAUSE 0 -#define XINE_SPEED_SLOW_4 1 -#define XINE_SPEED_SLOW_2 2 -#define XINE_SPEED_NORMAL 4 -#define XINE_SPEED_FAST_2 8 -#define XINE_SPEED_FAST_4 16 - -/* normal speed value for XINE_PARAM_FINE_SPEED parameter */ -#define XINE_FINE_SPEED_NORMAL 1000000 - -/* video parameters */ -#define XINE_PARAM_VO_DEINTERLACE 0x01000000 /* bool */ -#define XINE_PARAM_VO_ASPECT_RATIO 0x01000001 /* see below */ -#define XINE_PARAM_VO_HUE 0x01000002 /* 0..65535 */ -#define XINE_PARAM_VO_SATURATION 0x01000003 /* 0..65535 */ -#define XINE_PARAM_VO_CONTRAST 0x01000004 /* 0..65535 */ -#define XINE_PARAM_VO_BRIGHTNESS 0x01000005 /* 0..65535 */ -#define XINE_PARAM_VO_ZOOM_X 0x01000008 /* percent */ -#define XINE_PARAM_VO_ZOOM_Y 0x0100000d /* percent */ -#define XINE_PARAM_VO_PAN_SCAN 0x01000009 /* bool */ -#define XINE_PARAM_VO_TVMODE 0x0100000a /* ??? */ -#define XINE_PARAM_VO_WINDOW_WIDTH 0x0100000f /* readonly */ -#define XINE_PARAM_VO_WINDOW_HEIGHT 0x01000010 /* readonly */ -#define XINE_PARAM_VO_CROP_LEFT 0x01000020 /* crop frame pixels */ -#define XINE_PARAM_VO_CROP_RIGHT 0x01000021 /* crop frame pixels */ -#define XINE_PARAM_VO_CROP_TOP 0x01000022 /* crop frame pixels */ -#define XINE_PARAM_VO_CROP_BOTTOM 0x01000023 /* crop frame pixels */ - - -#define XINE_VO_ZOOM_STEP 100 -#define XINE_VO_ZOOM_MAX 400 -#define XINE_VO_ZOOM_MIN -85 - -/* possible ratios for XINE_PARAM_VO_ASPECT_RATIO */ -#define XINE_VO_ASPECT_AUTO 0 -#define XINE_VO_ASPECT_SQUARE 1 /* 1:1 */ -#define XINE_VO_ASPECT_4_3 2 /* 4:3 */ -#define XINE_VO_ASPECT_ANAMORPHIC 3 /* 16:9 */ -#define XINE_VO_ASPECT_DVB 4 /* 2.11:1 */ -#define XINE_VO_ASPECT_NUM_RATIOS 5 -#ifndef XINE_DISABLE_DEPRECATED_FEATURES -#define XINE_VO_ASPECT_PAN_SCAN 41 -#define XINE_VO_ASPECT_DONT_TOUCH 42 -#endif - -/* stream format detection strategies */ - -/* recognize stream type first by content then by extension. */ -#define XINE_DEMUX_DEFAULT_STRATEGY 0 -/* recognize stream type first by extension then by content. */ -#define XINE_DEMUX_REVERT_STRATEGY 1 -/* recognize stream type by content only. */ -#define XINE_DEMUX_CONTENT_STRATEGY 2 -/* recognize stream type by extension only. */ -#define XINE_DEMUX_EXTENSION_STRATEGY 3 - -/* verbosity settings */ -#define XINE_VERBOSITY_NONE 0 -#define XINE_VERBOSITY_LOG 1 -#define XINE_VERBOSITY_DEBUG 2 - -/* - * snapshot function - * - * image format can be YUV 4:2:0 or 4:2:2 - * will copy the image data into memory that points to - * (interleaved for yuv 4:2:2 or planary for 4:2:0) - * - * returns 1 on success, 0 failure. - */ -int xine_get_current_frame (xine_stream_t *stream, - int *width, int *height, - int *ratio_code, int *format, - uint8_t *img) XINE_PROTECTED; - -/* xine image formats */ -#define XINE_IMGFMT_YV12 (('2'<<24)|('1'<<16)|('V'<<8)|'Y') -#define XINE_IMGFMT_YUY2 (('2'<<24)|('Y'<<16)|('U'<<8)|'Y') -#define XINE_IMGFMT_XVMC (('C'<<24)|('M'<<16)|('v'<<8)|'X') -#define XINE_IMGFMT_XXMC (('C'<<24)|('M'<<16)|('x'<<8)|'X') - -/* get current xine's virtual presentation timestamp (1/90000 sec) - * note: this is mostly internal data. - * one can use vpts with xine_osd_show() and xine_osd_hide(). - */ -int64_t xine_get_current_vpts(xine_stream_t *stream) XINE_PROTECTED; - - -/********************************************************************* - * media processing * - *********************************************************************/ - -#ifdef XINE_ENABLE_EXPERIMENTAL_FEATURES - -/* - * access to decoded audio and video frames from a stream - * these functions are intended to provide the basis for - * re-encoding and other video processing applications - * - * note that the xine playback engine will block when - * rendering to a framegrab port: to unblock the stream, - * you must fetch the frames manually with the - * xine_get_next_* functions. this ensures that a - * framegrab port is guaranteed to never miss a frame. - * - */ - -xine_video_port_t *xine_new_framegrab_video_port (xine_t *self) XINE_PROTECTED; - -typedef struct { - - int64_t vpts; /* timestamp 1/90000 sec for a/v sync */ - int64_t duration; - double aspect_ratio; - int width, height; - int colorspace; /* XINE_IMGFMT_* */ - - int pos_stream; /* bytes from stream start */ - int pos_time; /* milliseconds */ - - int frame_number; /* frame number (may be unknown) */ - - uint8_t *data; - void *xine_frame; /* used internally by xine engine */ -} xine_video_frame_t; - -int xine_get_next_video_frame (xine_video_port_t *port, - xine_video_frame_t *frame) XINE_PROTECTED; - -void xine_free_video_frame (xine_video_port_t *port, xine_video_frame_t *frame) XINE_PROTECTED; - -xine_audio_port_t *xine_new_framegrab_audio_port (xine_t *self) XINE_PROTECTED; - -typedef struct { - - int64_t vpts; /* timestamp 1/90000 sec for a/v sync */ - int num_samples; - int sample_rate; - int num_channels; - int bits_per_sample; /* per channel */ - - uint8_t *data; - void *xine_frame; /* used internally by xine engine */ - - off_t pos_stream; /* bytes from stream start */ - int pos_time; /* milliseconds */ -} xine_audio_frame_t; - -int xine_get_next_audio_frame (xine_audio_port_t *port, - xine_audio_frame_t *frame) XINE_PROTECTED; - -void xine_free_audio_frame (xine_audio_port_t *port, xine_audio_frame_t *frame) XINE_PROTECTED; - - /* - * maybe future aproach: - */ - -int xine_get_video_frame (xine_stream_t *stream, - int timestamp, /* msec */ - int *width, int *height, - int *ratio_code, - int *duration, /* msec */ - int *format, - uint8_t *img) XINE_PROTECTED; - -/* TODO: xine_get_audio_frame */ - -#endif - - -/********************************************************************* - * post plugin handling * - *********************************************************************/ - -/* - * post effect plugin functions - * - * after the data leaves the decoder it can pass an arbitrary tree - * of post plugins allowing for effects to be applied to the video - * frames/audio buffers before they reach the output stage - */ - -typedef struct xine_post_s xine_post_t; - -struct xine_post_s { - - /* a NULL-terminated array of audio input ports this post plugin - * provides; you can hand these to other post plugin's outputs or - * pass them to the initialization of streams - */ - xine_audio_port_t **audio_input; - - /* a NULL-terminated array of video input ports this post plugin - * provides; you can hand these to other post plugin's outputs or - * pass them to the initialization of streams - */ - xine_video_port_t **video_input; - - /* the type of the post plugin - * one of XINE_POST_TYPE_* can be used here - */ - int type; - -}; - -/* - * initialize a post plugin - * - * returns xine_post_t* on success, NULL on failure - * - * Initializes the post plugin with the given name and connects its - * outputs to the NULL-terminated arrays of audio and video ports. - * Some plugins also care about the number of inputs you request - * (e.g. mixer plugins), others simply ignore this number. - */ -xine_post_t *xine_post_init(xine_t *xine, const char *name, - int inputs, - xine_audio_port_t **audio_target, - xine_video_port_t **video_target) XINE_PROTECTED; - -/* get a list of all available post plugins */ -const char *const *xine_list_post_plugins(xine_t *xine) XINE_PROTECTED; - -/* get a list of all post plugins of one type */ -const char *const *xine_list_post_plugins_typed(xine_t *xine, uint32_t type) XINE_PROTECTED; - -/* - * post plugin input/output - * - * These structures encapsulate inputs/outputs for post plugins - * to transfer arbitrary data. Frontends can also provide inputs - * and outputs and connect them to post plugins to exchange data - * with them. - */ - -typedef struct xine_post_in_s xine_post_in_t; -typedef struct xine_post_out_s xine_post_out_t; - -struct xine_post_in_s { - - /* the name identifying this input */ - const char *name; - - /* the data pointer; input is directed to this memory location, - * so you simply access the pointer to access the input data */ - void *data; - - /* the datatype of this input, use one of XINE_POST_DATA_* here */ - int type; - -}; - -struct xine_post_out_s { - - /* the name identifying this output */ - const char *name; - - /* the data pointer; output should be directed to this memory location, - * so in the easy case you simply write through the pointer */ - void *data; - - /* this function is called, when the output should be redirected - * to another input, you sould set the data pointer to direct - * any output to this new input; - * a special situation is, when this function is called with a NULL - * argument: in this case you should disconnect the data pointer - * from any output and if necessary to avoid writing to some stray - * memory you should make it point to some dummy location, - * returns 1 on success, 0 on failure; - * if you do not implement rewiring, set this to NULL */ - int (*rewire) (xine_post_out_t *self, void *data); - - /* the datatype of this output, use one of XINE_POST_DATA_* here */ - int type; - -}; - -/* get a list of all inputs of a post plugin */ -const char *const *xine_post_list_inputs(xine_post_t *self) XINE_PROTECTED; - -/* get a list of all outputs of a post plugin */ -const char *const *xine_post_list_outputs(xine_post_t *self) XINE_PROTECTED; - -/* retrieve one specific input of a post plugin */ -xine_post_in_t *xine_post_input(xine_post_t *self, const char *name) XINE_PROTECTED; - -/* retrieve one specific output of a post plugin */ -xine_post_out_t *xine_post_output(xine_post_t *self, const char *name) XINE_PROTECTED; - -/* - * wire an input to an output - * returns 1 on success, 0 on failure - */ -int xine_post_wire(xine_post_out_t *source, xine_post_in_t *target) XINE_PROTECTED; - -/* - * wire a video port to a video output - * This can be used to rewire different post plugins to the video output - * plugin layer. The ports you hand in at xine_post_init() will already - * be wired with the post plugin, so you need this function for - * _re_connecting only. - * - * returns 1 on success, 0 on failure - */ -int xine_post_wire_video_port(xine_post_out_t *source, xine_video_port_t *vo) XINE_PROTECTED; - -/* - * wire an audio port to an audio output - * This can be used to rewire different post plugins to the audio output - * plugin layer. The ports you hand in at xine_post_init() will already - * be wired with the post plugin, so you need this function for - * _re_connecting only. - * - * returns 1 on success, 0 on failure - */ -int xine_post_wire_audio_port(xine_post_out_t *source, xine_audio_port_t *ao) XINE_PROTECTED; - -/* - * Extracts an output for a stream. Use this to rewire the outputs of streams. - */ -xine_post_out_t * xine_get_video_source(xine_stream_t *stream) XINE_PROTECTED; -xine_post_out_t * xine_get_audio_source(xine_stream_t *stream) XINE_PROTECTED; - -/* - * disposes the post plugin - * please make sure that no other post plugin and no stream is - * connected to any of this plugin's inputs - */ -void xine_post_dispose(xine_t *xine, xine_post_t *self) XINE_PROTECTED; - - -/* post plugin types */ -#define XINE_POST_TYPE_VIDEO_FILTER 0x010000 -#define XINE_POST_TYPE_VIDEO_VISUALIZATION 0x010001 -#define XINE_POST_TYPE_VIDEO_COMPOSE 0x010002 -#define XINE_POST_TYPE_AUDIO_FILTER 0x020000 -#define XINE_POST_TYPE_AUDIO_VISUALIZATION 0x020001 - - -/* post plugin data types */ - -/* video port data - * input->data is a xine_video_port_t* - * output->data usually is a xine_video_port_t** - */ -#define XINE_POST_DATA_VIDEO 0 - -/* audio port data - * input->data is a xine_audio_port_t* - * output->data usually is a xine_audio_port_t** - */ -#define XINE_POST_DATA_AUDIO 1 - -/* integer data - * input->data is a int* - * output->data usually is a int* - */ -#define XINE_POST_DATA_INT 3 - -/* double precision floating point data - * input->data is a double* - * output->data usually is a double* - */ -#define XINE_POST_DATA_DOUBLE 4 - -/* parameters api (used by frontends) - * input->data is xine_post_api_t* (see below) - */ -#define XINE_POST_DATA_PARAMETERS 5 - -/* defines a single parameter entry. */ -typedef struct { - int type; /* POST_PARAM_TYPE_xxx */ - char *name; /* name of this parameter */ - int size; /* sizeof(parameter) */ - int offset; /* offset in bytes from struct ptr */ - char **enum_values; /* enumeration (first=0) or NULL */ - double range_min; /* minimum value */ - double range_max; /* maximum value */ - int readonly; /* 0 = read/write, 1=read-only */ - char *description; /* user-friendly description */ -} xine_post_api_parameter_t; - -/* description of parameters struct (params). */ -typedef struct { - int struct_size; /* sizeof(params) */ - xine_post_api_parameter_t *parameter; /* list of parameters */ -} xine_post_api_descr_t; - -typedef struct { - /* - * method to set all the read/write parameters. - * params is a struct * defined by xine_post_api_descr_t - */ - int (*set_parameters) (xine_post_t *self, void *params); - - /* - * method to get all parameters. - */ - int (*get_parameters) (xine_post_t *self, void *params); - - /* - * method to get params struct definition - */ - xine_post_api_descr_t * (*get_param_descr) (void); - - /* - * method to get plugin and parameters help (UTF-8) - * the help string must be word wrapped by the frontend. - * it might contain \n to mark paragraph breaks. - */ - char * (*get_help) (void); -} xine_post_api_t; - -/* post parameter types */ -#define POST_PARAM_TYPE_LAST 0 /* terminator of parameter list */ -#define POST_PARAM_TYPE_INT 1 /* integer (or vector of integers) */ -#define POST_PARAM_TYPE_DOUBLE 2 /* double (or vector of doubles) */ -#define POST_PARAM_TYPE_CHAR 3 /* char (or vector of chars = string) */ -#define POST_PARAM_TYPE_STRING 4 /* (char *), ASCIIZ */ -#define POST_PARAM_TYPE_STRINGLIST 5 /* (char **) list, NULL terminated */ -#define POST_PARAM_TYPE_BOOL 6 /* integer (0 or 1) */ - - -/********************************************************************* - * information retrieval * - *********************************************************************/ - -/* - * xine log functions - * - * frontends can display xine log output using these functions - */ -int xine_get_log_section_count(xine_t *self) XINE_PROTECTED; - -/* return a NULL terminated array of log sections names */ -const char *const *xine_get_log_names(xine_t *self) XINE_PROTECTED; - -/* print some log information to section */ -void xine_log (xine_t *self, int buf, - const char *format, ...) XINE_FORMAT_PRINTF(3, 4) XINE_PROTECTED; -void xine_vlog(xine_t *self, int buf, - const char *format, va_list args) XINE_FORMAT_PRINTF(3, 0) XINE_PROTECTED; - -/* get log messages of specified section */ -char *const *xine_get_log (xine_t *self, int buf) XINE_PROTECTED; - -/* log callback will be called whenever something is logged */ -typedef void (*xine_log_cb_t) (void *user_data, int section); -void xine_register_log_cb (xine_t *self, xine_log_cb_t cb, - void *user_data) XINE_PROTECTED; - -/* - * error handling / engine status - */ - -/* return last error */ -int xine_get_error (xine_stream_t *stream) XINE_PROTECTED; - -/* get current xine engine status (constants see below) */ -int xine_get_status (xine_stream_t *stream) XINE_PROTECTED; - -/* - * engine status codes - */ -#define XINE_STATUS_IDLE 0 /* no mrl assigned */ -#define XINE_STATUS_STOP 1 -#define XINE_STATUS_PLAY 2 -#define XINE_STATUS_QUIT 3 - -/* - * xine error codes - */ -#define XINE_ERROR_NONE 0 -#define XINE_ERROR_NO_INPUT_PLUGIN 1 -#define XINE_ERROR_NO_DEMUX_PLUGIN 2 -#define XINE_ERROR_DEMUX_FAILED 3 -#define XINE_ERROR_MALFORMED_MRL 4 -#define XINE_ERROR_INPUT_FAILED 5 - -/* - * try to find out audio/spu language of given channel - * (use -1 for current channel) - * - * lang must point to a buffer of at least XINE_LANG_MAX bytes - * - * returns 1 on success, 0 on failure - */ -int xine_get_audio_lang (xine_stream_t *stream, int channel, - char *lang) XINE_PROTECTED; -int xine_get_spu_lang (xine_stream_t *stream, int channel, - char *lang) XINE_PROTECTED; -/*_x_ increasing this number means an incompatible ABI breakage! */ -#define XINE_LANG_MAX 32 - -/* - * get position / length information - * - * depending of the nature and system layer of the stream, - * some or all of this information may be unavailable or incorrect - * (e.g. live network streams may not have a valid length) - * - * returns 1 on success, 0 on failure (data was not updated, - * probably because it's not known yet... try again later) - */ -int xine_get_pos_length (xine_stream_t *stream, - int *pos_stream, /* 0..65535 */ - int *pos_time, /* milliseconds */ - int *length_time) /* milliseconds */ - XINE_PROTECTED; - -/* - * get information about the stream such as - * video width/height, codecs, audio format, title, author... - * strings are UTF-8 encoded. - * - * constants see below - */ -uint32_t xine_get_stream_info (xine_stream_t *stream, int info) XINE_PROTECTED; -const char *xine_get_meta_info (xine_stream_t *stream, int info) XINE_PROTECTED; - -/* xine_get_stream_info */ -#define XINE_STREAM_INFO_BITRATE 0 -#define XINE_STREAM_INFO_SEEKABLE 1 -#define XINE_STREAM_INFO_VIDEO_WIDTH 2 -#define XINE_STREAM_INFO_VIDEO_HEIGHT 3 -#define XINE_STREAM_INFO_VIDEO_RATIO 4 /* *10000 */ -#define XINE_STREAM_INFO_VIDEO_CHANNELS 5 -#define XINE_STREAM_INFO_VIDEO_STREAMS 6 -#define XINE_STREAM_INFO_VIDEO_BITRATE 7 -#define XINE_STREAM_INFO_VIDEO_FOURCC 8 -#define XINE_STREAM_INFO_VIDEO_HANDLED 9 /* codec available? */ -#define XINE_STREAM_INFO_FRAME_DURATION 10 /* 1/90000 sec */ -#define XINE_STREAM_INFO_AUDIO_CHANNELS 11 -#define XINE_STREAM_INFO_AUDIO_BITS 12 -#define XINE_STREAM_INFO_AUDIO_SAMPLERATE 13 -#define XINE_STREAM_INFO_AUDIO_BITRATE 14 -#define XINE_STREAM_INFO_AUDIO_FOURCC 15 -#define XINE_STREAM_INFO_AUDIO_HANDLED 16 /* codec available? */ -#define XINE_STREAM_INFO_HAS_CHAPTERS 17 -#define XINE_STREAM_INFO_HAS_VIDEO 18 -#define XINE_STREAM_INFO_HAS_AUDIO 19 -#define XINE_STREAM_INFO_IGNORE_VIDEO 20 -#define XINE_STREAM_INFO_IGNORE_AUDIO 21 -#define XINE_STREAM_INFO_IGNORE_SPU 22 -#define XINE_STREAM_INFO_VIDEO_HAS_STILL 23 -#define XINE_STREAM_INFO_MAX_AUDIO_CHANNEL 24 -#define XINE_STREAM_INFO_MAX_SPU_CHANNEL 25 -#define XINE_STREAM_INFO_AUDIO_MODE 26 -#define XINE_STREAM_INFO_SKIPPED_FRAMES 27 /* for 1000 frames delivered */ -#define XINE_STREAM_INFO_DISCARDED_FRAMES 28 /* for 1000 frames delivered */ -#define XINE_STREAM_INFO_VIDEO_AFD 29 -#define XINE_STREAM_INFO_DVD_TITLE_NUMBER 30 -#define XINE_STREAM_INFO_DVD_TITLE_COUNT 31 -#define XINE_STREAM_INFO_DVD_CHAPTER_NUMBER 32 -#define XINE_STREAM_INFO_DVD_CHAPTER_COUNT 33 -#define XINE_STREAM_INFO_DVD_ANGLE_NUMBER 34 -#define XINE_STREAM_INFO_DVD_ANGLE_COUNT 35 - -/* possible values for XINE_STREAM_INFO_VIDEO_AFD */ -#define XINE_VIDEO_AFD_NOT_PRESENT -1 -#define XINE_VIDEO_AFD_RESERVED_0 0 -#define XINE_VIDEO_AFD_RESERVED_1 1 -#define XINE_VIDEO_AFD_BOX_16_9_TOP 2 -#define XINE_VIDEO_AFD_BOX_14_9_TOP 3 -#define XINE_VIDEO_AFD_BOX_GT_16_9_CENTRE 4 -#define XINE_VIDEO_AFD_RESERVED_5 5 -#define XINE_VIDEO_AFD_RESERVED_6 6 -#define XINE_VIDEO_AFD_RESERVED_7 7 -#define XINE_VIDEO_AFD_SAME_AS_FRAME 8 -#define XINE_VIDEO_AFD_4_3_CENTRE 9 -#define XINE_VIDEO_AFD_16_9_CENTRE 10 -#define XINE_VIDEO_AFD_14_9_CENTRE 11 -#define XINE_VIDEO_AFD_RESERVED_12 12 -#define XINE_VIDEO_AFD_4_3_PROTECT_14_9 13 -#define XINE_VIDEO_AFD_16_9_PROTECT_14_9 14 -#define XINE_VIDEO_AFD_16_9_PROTECT_4_3 15 - -/* xine_get_meta_info */ -#define XINE_META_INFO_TITLE 0 -#define XINE_META_INFO_COMMENT 1 -#define XINE_META_INFO_ARTIST 2 -#define XINE_META_INFO_GENRE 3 -#define XINE_META_INFO_ALBUM 4 -#define XINE_META_INFO_YEAR 5 -#define XINE_META_INFO_VIDEOCODEC 6 -#define XINE_META_INFO_AUDIOCODEC 7 -#define XINE_META_INFO_SYSTEMLAYER 8 -#define XINE_META_INFO_INPUT_PLUGIN 9 -#define XINE_META_INFO_CDINDEX_DISCID 10 -#define XINE_META_INFO_TRACK_NUMBER 11 - - -/********************************************************************* - * plugin management / autoplay / mrl browsing * - *********************************************************************/ - -/* - * note: the pointers to strings or string arrays returned - * by some of these functions are pointers to statically - * alloced internal xine memory chunks. - * they're only valid between xine function calls - * and should never be free()d. - */ - -typedef struct { - char *origin; /* file plugin: path */ - char *mrl; /* :// */ - char *link; - off_t size; /* size of this source, may be 0 */ - uint32_t type; /* see below */ -} xine_mrl_t; - -/* mrl types */ -#define XINE_MRL_TYPE_unknown (0 << 0) -#define XINE_MRL_TYPE_dvd (1 << 0) -#define XINE_MRL_TYPE_vcd (1 << 1) -#define XINE_MRL_TYPE_net (1 << 2) -#define XINE_MRL_TYPE_rtp (1 << 3) -#define XINE_MRL_TYPE_stdin (1 << 4) -#define XINE_MRL_TYPE_cda (1 << 5) -#define XINE_MRL_TYPE_file (1 << 6) -#define XINE_MRL_TYPE_file_fifo (1 << 7) -#define XINE_MRL_TYPE_file_chardev (1 << 8) -#define XINE_MRL_TYPE_file_directory (1 << 9) -#define XINE_MRL_TYPE_file_blockdev (1 << 10) -#define XINE_MRL_TYPE_file_normal (1 << 11) -#define XINE_MRL_TYPE_file_symlink (1 << 12) -#define XINE_MRL_TYPE_file_sock (1 << 13) -#define XINE_MRL_TYPE_file_exec (1 << 14) -#define XINE_MRL_TYPE_file_backup (1 << 15) -#define XINE_MRL_TYPE_file_hidden (1 << 16) - -/* get a list of browsable input plugin ids */ -const char *const *xine_get_browsable_input_plugin_ids (xine_t *self) XINE_PROTECTED; - -/* - * ask input plugin named to return - * a list of available MRLs in domain/directory . - * - * may be NULL indicating the toplevel domain/dir - * returns if is a valid MRL, not a directory - * returns NULL if is an invalid MRL, not even a directory. - */ -xine_mrl_t **xine_get_browse_mrls (xine_t *self, - const char *plugin_id, - const char *start_mrl, - int *num_mrls) XINE_PROTECTED; - -/* get a list of plugins that support the autoplay feature */ -const char *const *xine_get_autoplay_input_plugin_ids (xine_t *self) XINE_PROTECTED; - -/* get autoplay MRL list from input plugin named */ -char **xine_get_autoplay_mrls (xine_t *self, - const char *plugin_id, - int *num_mrls) XINE_PROTECTED; - -/* get a list of file extensions for file types supported by xine - * the list is separated by spaces - * - * the pointer returned can be free()ed when no longer used */ -char *xine_get_file_extensions (xine_t *self) XINE_PROTECTED; - -/* get a list of mime types supported by xine - * - * the pointer returned can be free()ed when no longer used */ -char *xine_get_mime_types (xine_t *self) XINE_PROTECTED; - -/* get the demuxer identifier that handles a given mime type - * - * the pointer returned can be free()ed when no longer used - * returns NULL if no demuxer is available to handle this. */ -char *xine_get_demux_for_mime_type (xine_t *self, const char *mime_type) XINE_PROTECTED; - -/* get a description string for a plugin */ -const char *xine_get_input_plugin_description (xine_t *self, - const char *plugin_id) XINE_PROTECTED; -const char *xine_get_demux_plugin_description (xine_t *self, - const char *plugin_id) XINE_PROTECTED; -const char *xine_get_spu_plugin_description (xine_t *self, - const char *plugin_id) XINE_PROTECTED; -const char *xine_get_audio_plugin_description (xine_t *self, - const char *plugin_id) XINE_PROTECTED; -const char *xine_get_video_plugin_description (xine_t *self, - const char *plugin_id) XINE_PROTECTED; -const char *xine_get_audio_driver_plugin_description (xine_t *self, - const char *plugin_id) XINE_PROTECTED; -const char *xine_get_video_driver_plugin_description (xine_t *self, - const char *plugin_id) XINE_PROTECTED; -const char *xine_get_post_plugin_description (xine_t *self, - const char *plugin_id) XINE_PROTECTED; - -/* get lists of available audio and video output plugins */ -const char *const *xine_list_audio_output_plugins (xine_t *self) XINE_PROTECTED; -const char *const *xine_list_video_output_plugins (xine_t *self) XINE_PROTECTED; - -/* get list of available demultiplexor plugins */ -const char *const *xine_list_demuxer_plugins(xine_t *self) XINE_PROTECTED; - -/* get list of available input plugins */ -const char *const *xine_list_input_plugins(xine_t *self) XINE_PROTECTED; - -/* get list of available subpicture plugins */ -const char *const *xine_list_spu_plugins(xine_t *self) XINE_PROTECTED; - -/* get list of available audio and video decoder plugins */ -const char *const *xine_list_audio_decoder_plugins(xine_t *self) XINE_PROTECTED; -const char *const *xine_list_video_decoder_plugins(xine_t *self) XINE_PROTECTED; - -/* unload unused plugins */ -void xine_plugins_garbage_collector(xine_t *self) XINE_PROTECTED; - - -/********************************************************************* - * visual specific gui <-> xine engine communication * - *********************************************************************/ - -/* new (preferred) method to talk to video driver. */ -int xine_port_send_gui_data (xine_video_port_t *vo, - int type, void *data) XINE_PROTECTED; - -typedef struct { - - /* area of that drawable to be used by video */ - int x,y,w,h; - -} x11_rectangle_t; - -/* - * this is the visual data struct any x11 gui - * must supply to the xine_open_video_driver call - * ("data" parameter) - */ -typedef struct { - - /* some information about the display */ - void *display; /* Display* */ - int screen; - - /* drawable to display the video in/on */ - unsigned long d; /* Drawable */ - - void *user_data; - - /* - * dest size callback - * - * this will be called by the video driver to find out - * how big the video output area size will be for a - * given video size. The ui should _not_ adjust it's - * video out area, just do some calculations and return - * the size. This will be called for every frame, ui - * implementation should be fast. - * dest_pixel_aspect should be set to the used display pixel aspect. - * NOTE: Semantics has changed: video_width and video_height - * are no longer pixel aspect corrected. Get the old semantics - * in the UI with - * *dest_pixel_aspect = display_pixel_aspect; - * if (video_pixel_aspect >= display_pixel_aspect) - * video_width = video_width * video_pixel_aspect / display_pixel_aspect + .5; - * else - * video_height = video_height * display_pixel_aspect / video_pixel_aspect + .5; - */ - void (*dest_size_cb) (void *user_data, - int video_width, int video_height, - double video_pixel_aspect, - int *dest_width, int *dest_height, - double *dest_pixel_aspect); - - /* - * frame output callback - * - * this will be called by the video driver for every frame - * it's about to draw. ui can adapt it's size if necessary - * here. - * note: the ui doesn't have to adjust itself to this - * size, this is just to be taken as a hint. - * ui must return the actual size of the video output - * area and the video output driver will do it's best - * to adjust the video frames to that size (while - * preserving aspect ratio and stuff). - * dest_x, dest_y: offset inside window - * dest_width, dest_height: available drawing space - * dest_pixel_aspect: display pixel aspect - * win_x, win_y: window absolute screen position - * NOTE: Semantics has changed: video_width and video_height - * are no longer pixel aspect corrected. Get the old semantics - * in the UI with - * *dest_pixel_aspect = display_pixel_aspect; - * if (video_pixel_aspect >= display_pixel_aspect) - * video_width = video_width * video_pixel_aspect / display_pixel_aspect + .5; - * else - * video_height = video_height * display_pixel_aspect / video_pixel_aspect + .5; - */ - void (*frame_output_cb) (void *user_data, - int video_width, int video_height, - double video_pixel_aspect, - int *dest_x, int *dest_y, - int *dest_width, int *dest_height, - double *dest_pixel_aspect, - int *win_x, int *win_y); - - /* - * lock display callback - * - * this callback is called when the video driver - * needs access to the x11 display connection - * - * note: to enable this you MUST use XINE_VISUAL_TYPE_X11_2 - * note: if display_lock is NULL, the fallback is used - * note: fallback for this function is XLockDisplay(display) - */ - void (*lock_display) (void *user_data); - - /* - * unlock display callback - * - * this callback is called when the video driver - * doesn't need access to the x11 display connection anymore - * - * note: to enable this you MUST use XINE_VISUAL_TYPE_X11_2 - * note: if display_unlock is NULL, the fallback is used - * note: fallback for this function is XUnlockDisplay(display) - */ - void (*unlock_display) (void *user_data); - -} x11_visual_t; - -/* - * this is the visual data struct any xcb gui - * must supply to the xine_open_video_driver call - * ("data" parameter) - */ -typedef struct { - - /* some information about the display */ - void *connection; /* xcb_connection_t */ - void *screen; /* xcb_screen_t */ - - /* window to display the video in / on */ - unsigned int window; /* xcb_window_t */ - - void *user_data; - - /* - * dest size callback - * - * this will be called by the video driver to find out - * how big the video output area size will be for a - * given video size. The ui should _not_ adjust it's - * video out area, just do some calculations and return - * the size. This will be called for every frame, ui - * implementation should be fast. - * dest_pixel_aspect should be set to the used display pixel aspect. - * NOTE: Semantics has changed: video_width and video_height - * are no longer pixel aspect corrected. Get the old semantics - * in the UI with - * *dest_pixel_aspect = display_pixel_aspect; - * if (video_pixel_aspect >= display_pixel_aspect) - * video_width = video_width * video_pixel_aspect / display_pixel_aspect + .5; - * else - * video_height = video_height * display_pixel_aspect / video_pixel_aspect + .5; - */ - void (*dest_size_cb) (void *user_data, - int video_width, int video_height, - double video_pixel_aspect, - int *dest_width, int *dest_height, - double *dest_pixel_aspect); - - /* - * frame output callback - * - * this will be called by the video driver for every frame - * it's about to draw. ui can adapt it's size if necessary - * here. - * note: the ui doesn't have to adjust itself to this - * size, this is just to be taken as a hint. - * ui must return the actual size of the video output - * area and the video output driver will do it's best - * to adjust the video frames to that size (while - * preserving aspect ratio and stuff). - * dest_x, dest_y: offset inside window - * dest_width, dest_height: available drawing space - * dest_pixel_aspect: display pixel aspect - * win_x, win_y: window absolute screen position - * NOTE: Semantics has changed: video_width and video_height - * are no longer pixel aspect corrected. Get the old semantics - * in the UI with - * *dest_pixel_aspect = display_pixel_aspect; - * if (video_pixel_aspect >= display_pixel_aspect) - * video_width = video_width * video_pixel_aspect / display_pixel_aspect + .5; - * else - * video_height = video_height * display_pixel_aspect / video_pixel_aspect + .5; - */ - void (*frame_output_cb) (void *user_data, - int video_width, int video_height, - double video_pixel_aspect, - int *dest_x, int *dest_y, - int *dest_width, int *dest_height, - double *dest_pixel_aspect, - int *win_x, int *win_y); - -} xcb_visual_t; - -/* - * this is the visual data struct any fb gui - * may supply to the xine_open_video_driver call - * ("data" parameter) to get frame_output_cd calls - */ - -typedef struct { - - void (*frame_output_cb) (void *user_data, - int video_width, int video_height, - double video_pixel_aspect, - int *dest_x, int *dest_y, - int *dest_width, int *dest_height, - double *dest_pixel_aspect, - int *win_x, int *win_y); - - void *user_data; - -} fb_visual_t; - -#ifdef WIN32 -/* - * this is the visual data struct any win32 gui should supply - * (pass this to init_video_out_plugin or the xine_load_video_output_plugin - * utility function) - */ - -typedef struct { - - HWND WndHnd; /* handle of window associated with primary surface */ - HINSTANCE HInst; /* handle of windows application instance */ - RECT WndRect; /* rect of window client points translated to screen - * cooridnates */ - int FullScreen; /* is window fullscreen */ - HBRUSH Brush; /* window brush for background color */ - COLORREF ColorKey; /* window brush color key */ - -} win32_visual_t; - -/* - * constants for gui_data_exchange's data_type parameter - */ - -#define GUI_WIN32_MOVED_OR_RESIZED 0 - -#endif /* WIN32 */ - -/* - * "type" constants for xine_port_send_gui_data(...) - */ - -#ifndef XINE_DISABLE_DEPRECATED_FEATURES -/* xevent *data */ -#define XINE_GUI_SEND_COMPLETION_EVENT 1 /* DEPRECATED */ -#endif - -/* Drawable data */ -#define XINE_GUI_SEND_DRAWABLE_CHANGED 2 - -/* xevent *data */ -#define XINE_GUI_SEND_EXPOSE_EVENT 3 - -/* x11_rectangle_t *data */ -#define XINE_GUI_SEND_TRANSLATE_GUI_TO_VIDEO 4 - -/* int data */ -#define XINE_GUI_SEND_VIDEOWIN_VISIBLE 5 - -/* *data contains chosen visual, select a new one or change it to NULL - * to indicate the visual to use or that no visual will work */ -/* XVisualInfo **data */ -#define XINE_GUI_SEND_SELECT_VISUAL 8 - -/* Gui is about to destroy drawable */ -#define XINE_GUI_SEND_WILL_DESTROY_DRAWABLE 9 - - -/********************************************************************* - * xine health check stuff * - *********************************************************************/ - -#define XINE_HEALTH_CHECK_OK 0 -#define XINE_HEALTH_CHECK_FAIL 1 -#define XINE_HEALTH_CHECK_UNSUPPORTED 2 -#define XINE_HEALTH_CHECK_NO_SUCH_CHECK 3 - -#define CHECK_KERNEL 0 -#define CHECK_MTRR 1 -#define CHECK_CDROM 2 -#define CHECK_DVDROM 3 -#define CHECK_DMA 4 -#define CHECK_X 5 -#define CHECK_XV 6 - -struct xine_health_check_s { - const char* cdrom_dev; - const char* dvd_dev; - char* msg; - char* title; - char* explanation; - int status; -}; - -typedef struct xine_health_check_s xine_health_check_t; -xine_health_check_t* xine_health_check(xine_health_check_t*, int check_num) XINE_PROTECTED; - - -/********************************************************************* - * configuration system * - *********************************************************************/ - -/* - * config entry data types - */ - -#define XINE_CONFIG_TYPE_UNKNOWN 0 -#define XINE_CONFIG_TYPE_RANGE 1 -#define XINE_CONFIG_TYPE_STRING 2 -#define XINE_CONFIG_TYPE_ENUM 3 -#define XINE_CONFIG_TYPE_NUM 4 -#define XINE_CONFIG_TYPE_BOOL 5 - -/* For the string type (1.1.4 and later). These are stored in num_value. */ -#define XINE_CONFIG_STRING_IS_STRING 0 -#define XINE_CONFIG_STRING_IS_FILENAME 1 -#define XINE_CONFIG_STRING_IS_DEVICE_NAME 2 -#define XINE_CONFIG_STRING_IS_DIRECTORY_NAME 3 - -typedef struct xine_cfg_entry_s xine_cfg_entry_t; - -typedef void (*xine_config_cb_t) (void *user_data, - xine_cfg_entry_t *entry); -struct xine_cfg_entry_s { - const char *key; /* unique id (example: gui.logo_mrl) */ - - int type; - - /* user experience level */ - int exp_level; /* 0 => beginner, - 10 => advanced user, - 20 => expert */ - - /* type unknown */ - char *unknown_value; - - /* type string */ - char *str_value; - char *str_default; - - /* common to range, enum, num, bool; - * num_value is also used by string to indicate what's required: - * plain string, file name, device name, directory name - */ - int num_value; - int num_default; - - /* type range specific: */ - int range_min; - int range_max; - - /* type enum specific: */ - char **enum_values; - - /* help info for the user (UTF-8) - * the help string must be word wrapped by the frontend. - * it might contain \n to mark paragraph breaks. - */ - const char *description; - const char *help; - - /* callback function and data for live changeable values */ - /* some config entries will take effect immediately, although they - * do not have a callback registered; such values will have some - * non-NULL dummy value in callback_data; so if you want to check, - * if a config change will require restarting xine, check for - * callback_data == NULL */ - xine_config_cb_t callback; - void *callback_data; - -}; - -const char *xine_config_register_string (xine_t *self, - const char *key, - const char *def_value, - const char *description, - const char *help, - int exp_level, - xine_config_cb_t changed_cb, - void *cb_data) XINE_PROTECTED; - -const char *xine_config_register_filename (xine_t *self, - const char *key, - const char *def_value, - int req_type, /* XINE_CONFIG_STRING_IS_* */ - const char *description, - const char *help, - int exp_level, - xine_config_cb_t changed_cb, - void *cb_data) XINE_PROTECTED; - -int xine_config_register_range (xine_t *self, - const char *key, - int def_value, - int min, int max, - const char *description, - const char *help, - int exp_level, - xine_config_cb_t changed_cb, - void *cb_data) XINE_PROTECTED; - -int xine_config_register_enum (xine_t *self, - const char *key, - int def_value, - char **values, - const char *description, - const char *help, - int exp_level, - xine_config_cb_t changed_cb, - void *cb_data) XINE_PROTECTED; - -int xine_config_register_num (xine_t *self, - const char *key, - int def_value, - const char *description, - const char *help, - int exp_level, - xine_config_cb_t changed_cb, - void *cb_data) XINE_PROTECTED; - -int xine_config_register_bool (xine_t *self, - const char *key, - int def_value, - const char *description, - const char *help, - int exp_level, - xine_config_cb_t changed_cb, - void *cb_data) XINE_PROTECTED; - -/* - * the following functions will copy data from the internal xine_config - * data database to the xine_cfg_entry_t *entry you provide - * - * they return 1 on success, 0 on failure - */ - -/* get first config item */ -int xine_config_get_first_entry (xine_t *self, xine_cfg_entry_t *entry) XINE_PROTECTED; - -/* get next config item (iterate through the items) */ -int xine_config_get_next_entry (xine_t *self, xine_cfg_entry_t *entry) XINE_PROTECTED; - -/* search for a config entry by key */ -int xine_config_lookup_entry (xine_t *self, const char *key, - xine_cfg_entry_t *entry) XINE_PROTECTED; - -/* - * update a config entry (which was returned from lookup_entry() ) - * - * xine will make a deep copy of the data in the entry into it's internal - * config database. - */ -void xine_config_update_entry (xine_t *self, - const xine_cfg_entry_t *entry) XINE_PROTECTED; - -/* - * translation of old configuration entry names - */ -typedef struct { - const char *old_name, *new_name; -} xine_config_entry_translation_t; - -void xine_config_set_translation_user (const xine_config_entry_translation_t *) XINE_PROTECTED; - -/* - * load/save config data from/to afile (e.g. $HOME/.xine/config) - */ -void xine_config_load (xine_t *self, const char *cfg_filename) XINE_PROTECTED; -void xine_config_save (xine_t *self, const char *cfg_filename) XINE_PROTECTED; -void xine_config_reset (xine_t *self) XINE_PROTECTED; - - -/********************************************************************* - * asynchroneous xine event mechanism * - *********************************************************************/ - -/* - * to receive events you have to register an event queue with - * the xine engine (xine_event_new_queue, see below). - * - * then you can either - * 1) check for incoming events regularly (xine_event_get/wait), - * process them and free them using xine_event_free - * 2) use xine_event_create_listener_thread and specify a callback - * which will then be called for each event - * - * to send events to every module listening you don't need - * to register an event queue but simply call xine_event_send. - * - * front ends should listen for one of MRL_REFERENCE and MRL_REFERENCE_EXT - * since both will be sent for compatibility reasons - */ - -/* event types */ -#define XINE_EVENT_UI_PLAYBACK_FINISHED 1 /* frontend can e.g. move on to next playlist entry */ -#define XINE_EVENT_UI_CHANNELS_CHANGED 2 /* inform ui that new channel info is available */ -#define XINE_EVENT_UI_SET_TITLE 3 /* request title display change in ui */ -#define XINE_EVENT_UI_MESSAGE 4 /* message (dialog) for the ui to display */ -#define XINE_EVENT_FRAME_FORMAT_CHANGE 5 /* e.g. aspect ratio change during dvd playback */ -#define XINE_EVENT_AUDIO_LEVEL 6 /* report current audio level (l/r/mute) */ -#define XINE_EVENT_QUIT 7 /* last event sent when stream is disposed */ -#define XINE_EVENT_PROGRESS 8 /* index creation/network connections */ -#define XINE_EVENT_MRL_REFERENCE 9 /* (deprecated) demuxer->frontend: MRL reference(s) for the real stream */ -#define XINE_EVENT_UI_NUM_BUTTONS 10 /* number of buttons for interactive menus */ -#define XINE_EVENT_SPU_BUTTON 11 /* the mouse pointer enter/leave a button */ -#define XINE_EVENT_DROPPED_FRAMES 12 /* number of dropped frames is too high */ -#define XINE_EVENT_MRL_REFERENCE_EXT 13 /* demuxer->frontend: MRL reference(s) for the real stream */ -#define XINE_EVENT_AUDIO_AMP_LEVEL 14 /* report current audio amp level (l/r/mute) */ - - -/* input events coming from frontend */ -#define XINE_EVENT_INPUT_MOUSE_BUTTON 101 -#define XINE_EVENT_INPUT_MOUSE_MOVE 102 -#define XINE_EVENT_INPUT_MENU1 103 -#define XINE_EVENT_INPUT_MENU2 104 -#define XINE_EVENT_INPUT_MENU3 105 -#define XINE_EVENT_INPUT_MENU4 106 -#define XINE_EVENT_INPUT_MENU5 107 -#define XINE_EVENT_INPUT_MENU6 108 -#define XINE_EVENT_INPUT_MENU7 109 -#define XINE_EVENT_INPUT_UP 110 -#define XINE_EVENT_INPUT_DOWN 111 -#define XINE_EVENT_INPUT_LEFT 112 -#define XINE_EVENT_INPUT_RIGHT 113 -#define XINE_EVENT_INPUT_SELECT 114 -#define XINE_EVENT_INPUT_NEXT 115 -#define XINE_EVENT_INPUT_PREVIOUS 116 -#define XINE_EVENT_INPUT_ANGLE_NEXT 117 -#define XINE_EVENT_INPUT_ANGLE_PREVIOUS 118 -#define XINE_EVENT_INPUT_BUTTON_FORCE 119 -#define XINE_EVENT_INPUT_NUMBER_0 120 -#define XINE_EVENT_INPUT_NUMBER_1 121 -#define XINE_EVENT_INPUT_NUMBER_2 122 -#define XINE_EVENT_INPUT_NUMBER_3 123 -#define XINE_EVENT_INPUT_NUMBER_4 124 -#define XINE_EVENT_INPUT_NUMBER_5 125 -#define XINE_EVENT_INPUT_NUMBER_6 126 -#define XINE_EVENT_INPUT_NUMBER_7 127 -#define XINE_EVENT_INPUT_NUMBER_8 128 -#define XINE_EVENT_INPUT_NUMBER_9 129 -#define XINE_EVENT_INPUT_NUMBER_10_ADD 130 - -/* specific event types */ -#define XINE_EVENT_SET_V4L2 200 -#define XINE_EVENT_PVR_SAVE 201 -#define XINE_EVENT_PVR_REPORT_NAME 202 -#define XINE_EVENT_PVR_REALTIME 203 -#define XINE_EVENT_PVR_PAUSE 204 -#define XINE_EVENT_SET_MPEG_DATA 205 - -/* VDR specific event types */ -#define XINE_EVENT_VDR_RED 300 -#define XINE_EVENT_VDR_GREEN 301 -#define XINE_EVENT_VDR_YELLOW 302 -#define XINE_EVENT_VDR_BLUE 303 -#define XINE_EVENT_VDR_PLAY 304 -#define XINE_EVENT_VDR_PAUSE 305 -#define XINE_EVENT_VDR_STOP 306 -#define XINE_EVENT_VDR_RECORD 307 -#define XINE_EVENT_VDR_FASTFWD 308 -#define XINE_EVENT_VDR_FASTREW 309 -#define XINE_EVENT_VDR_POWER 310 -#define XINE_EVENT_VDR_CHANNELPLUS 311 -#define XINE_EVENT_VDR_CHANNELMINUS 312 -#define XINE_EVENT_VDR_SCHEDULE 313 -#define XINE_EVENT_VDR_CHANNELS 314 -#define XINE_EVENT_VDR_TIMERS 315 -#define XINE_EVENT_VDR_RECORDINGS 316 -#define XINE_EVENT_VDR_SETUP 317 -#define XINE_EVENT_VDR_COMMANDS 318 -#define XINE_EVENT_VDR_BACK 319 -#define XINE_EVENT_VDR_USER1 320 -#define XINE_EVENT_VDR_USER2 321 -#define XINE_EVENT_VDR_USER3 322 -#define XINE_EVENT_VDR_USER4 323 -#define XINE_EVENT_VDR_USER5 324 -#define XINE_EVENT_VDR_USER6 325 -#define XINE_EVENT_VDR_USER7 326 -#define XINE_EVENT_VDR_USER8 327 -#define XINE_EVENT_VDR_USER9 328 -#define XINE_EVENT_VDR_VOLPLUS 329 -#define XINE_EVENT_VDR_VOLMINUS 330 -#define XINE_EVENT_VDR_MUTE 331 -#define XINE_EVENT_VDR_AUDIO 332 -#define XINE_EVENT_VDR_INFO 333 -#define XINE_EVENT_VDR_CHANNELPREVIOUS 334 -#define XINE_EVENT_VDR_SUBTITLES 335 -/* some space for further keys */ -#define XINE_EVENT_VDR_SETVIDEOWINDOW 350 -#define XINE_EVENT_VDR_FRAMESIZECHANGED 351 -#define XINE_EVENT_VDR_SELECTAUDIO 352 -#define XINE_EVENT_VDR_TRICKSPEEDMODE 353 -#define XINE_EVENT_VDR_PLUGINSTARTED 354 - -/* events generated from post plugins */ -#define XINE_EVENT_POST_TVTIME_FILMMODE_CHANGE 400 - -/* - * xine event struct - */ -typedef struct { - xine_stream_t *stream; /* stream this event belongs to */ - - void *data; /* contents depending on type */ - int data_length; - - int type; /* event type (constants see above) */ - - /* you do not have to provide this, it will be filled in by xine_event_send() */ - struct timeval tv; /* timestamp of event creation */ -} xine_event_t; - -/* - * input event dynamic data - */ -typedef struct { - xine_event_t event; - uint8_t button; /* Generally 1 = left, 2 = mid, 3 = right */ - uint16_t x,y; /* In Image space */ -} xine_input_data_t; - -/* - * UI event dynamic data - send information to/from UI. - */ -typedef struct { - int num_buttons; - int str_len; - char str[256]; /* might be longer */ -} xine_ui_data_t; - -/* - * Send messages to UI. used mostly to report errors. - */ -typedef struct { - /* - * old xine-ui versions expect xine_ui_data_t type. - * this struct is added for compatibility. - */ - xine_ui_data_t compatibility; - - /* See XINE_MSG_xxx for defined types. */ - int type; - - /* defined types are provided with a standard explanation. - * note: zero means no explanation. - */ - int explanation; /* add to struct address to get a valid (char *) */ - - /* parameters are zero terminated strings */ - int num_parameters; - int parameters; /* add to struct address to get a valid (char *) */ - - /* where messages are stored, will be longer - * - * this field begins with the message text itself (\0-terminated), - * followed by (optional) \0-terminated parameter strings - * the end marker is \0 \0 - */ - char messages[1]; -} xine_ui_message_data_t; - - -/* - * notify frame format change - */ -typedef struct { - int width; - int height; - /* these are aspect codes as defined in MPEG2, because this - * is only used for DVD playback, pan_scan is a boolean flag */ - int aspect; - int pan_scan; -} xine_format_change_data_t; - -/* - * audio level for left/right channel - */ -typedef struct { - int left; - int right; /* 0..100 % */ - int mute; -} xine_audio_level_data_t; - -/* - * index generation / buffering - */ -typedef struct { - const char *description; /* e.g. "connecting..." */ - int percent; -} xine_progress_data_t; - -/* - * mrl reference data is sent by demuxers when a reference stream is found. - * this stream just contains pointers (urls) to the real data, which are - * passed to frontend using this event type. (examples: .asx, .mov and .ram) - * - * ideally, frontends should add these mrls to a "hierarchical playlist". - * that is, instead of the original file, the ones provided here should be - * played instead. on pratice, just using a simple playlist should work. - * - * mrl references should be played in the same order they are received, just - * after the current stream finishes. - * alternative entries may be provided and should be used in case of - * failure of the primary stream (the one with alternative=0). - * - * sample playlist: - * 1) http://something/something.ram - * 1a) rtsp://something/realsomething1.rm (alternative=0) - * 1b) pnm://something/realsomething1.rm (alternative=1) - * 2) http://another/another.avi - * - * 1 and 2 are the original items on this playlist. 1a and 1b were received - * by events (they are the mrl references enclosed in 1). 1a is played after - * receiving the finished event from 1. note: 1b is usually ignored, it should - * only be used in case 1a fails to open. - * - * An event listener which accepts XINE_EVENT_MRL_REFERENCE_EXT events - * *must* ignore XINE_EVENT_MRL_REFERENCE events. - */ -typedef struct { - int alternative; /* alternative playlist number, usually 0 */ - char mrl[1]; /* might (will) be longer */ -} xine_mrl_reference_data_t; - -typedef struct { - int alternative; /* as above */ - uint32_t start_time, duration; /* milliseconds */ - uint32_t spare[20]; /* for future expansion */ - const char mrl[1]; /* might (will) be longer */ -/*const char title[]; ** immediately follows MRL's terminating NUL */ -} xine_mrl_reference_data_ext_t; - -/* - * configuration options for video4linux-like input plugins - */ -typedef struct { - /* input selection */ - int input; /* select active input from card */ - int channel; /* channel number */ - int radio; /* ask for a radio channel */ - uint32_t frequency; /* frequency divided by 62.5KHz or 62.5 Hz */ - uint32_t transmission; /* The transmission standard. */ - - /* video parameters */ - uint32_t framerate_numerator; /* framerate as numerator/denominator */ - uint32_t framerate_denominator; - uint32_t framelines; /* Total lines per frame including blanking */ - uint64_t standard_id; /* One of the V4L2_STD_* values */ - uint32_t colorstandard; /* One of the V4L2_COLOR_STD_* values */ - uint32_t colorsubcarrier; /* The color subcarrier frequency */ - int frame_width; /* scaled frame width */ - int frame_height; /* scaled frame height */ - - /* let some spare space so we can add new fields without breaking - * binary api compatibility. - */ - uint32_t spare[20]; - - /* used by pvr plugin */ - int32_t session_id; /* -1 stops pvr recording */ - -} xine_set_v4l2_data_t; - -/* - * configuration options for plugins that can do a kind of mpeg encoding - * note: highly experimental api :) - */ -typedef struct { - - /* mpeg2 parameters */ - int bitrate_vbr; /* 1 = vbr, 0 = cbr */ - int bitrate_mean; /* mean (target) bitrate in kbps*/ - int bitrate_peak; /* peak (max) bitrate in kbps */ - int gop_size; /* GOP size in frames */ - int gop_closure; /* open/closed GOP */ - int b_frames; /* number of B frames to use */ - int aspect_ratio; /* XINE_VO_ASPECT_xxx */ - - /* let some spare space so we can add new fields without breaking - * binary api compatibility. - */ - uint32_t spare[20]; - -} xine_set_mpeg_data_t; - -typedef struct { - int direction; /* 0 leave, 1 enter */ - int32_t button; /* button number */ -} xine_spu_button_t; - -#ifdef XINE_ENABLE_EXPERIMENTAL_FEATURES - -/* - * ask pvr to save (ie. do not discard) the current session - * see comments on input_pvr.c to understand how it works. - */ -typedef struct { - /* mode values: - * -1 = do nothing, just set the name - * 0 = truncate current session and save from now on - * 1 = save from last sync point - * 2 = save everything on current session - */ - int mode; - int id; - char name[256]; /* name for saving, might be longer */ -} xine_pvr_save_data_t; - -typedef struct { - /* mode values: - * 0 = non realtime - * 1 = realtime - */ - int mode; -} xine_pvr_realtime_t; - -typedef struct { - /* mode values: - * 0 = playing - * 1 = paused - */ - int mode; -} xine_pvr_pause_t; - -#endif - -/* event XINE_EVENT_DROPPED_FRAMES is generated if libxine detects a - * high number of dropped frames (above configured thresholds). it can - * be used by the front end to warn about performance problems. - */ -typedef struct { - /* these values are given for 1000 frames delivered */ - /* (that is, divide by 10 to get percentages) */ - int skipped_frames; - int skipped_threshold; - int discarded_frames; - int discarded_threshold; -} xine_dropped_frames_t; - - -/* - * Defined message types for XINE_EVENT_UI_MESSAGE - * This is the mechanism to report async errors from engine. - * - * If frontend knows about the XINE_MSG_xxx type it may safely - * ignore the 'explanation' field and provide it's own custom - * dialog to the 'parameters'. - * - * right column specifies the usual parameters. - */ - -#define XINE_MSG_NO_ERROR 0 /* (messages to UI) */ -#define XINE_MSG_GENERAL_WARNING 1 /* (warning message) */ -#define XINE_MSG_UNKNOWN_HOST 2 /* (host name) */ -#define XINE_MSG_UNKNOWN_DEVICE 3 /* (device name) */ -#define XINE_MSG_NETWORK_UNREACHABLE 4 /* none */ -#define XINE_MSG_CONNECTION_REFUSED 5 /* (host name) */ -#define XINE_MSG_FILE_NOT_FOUND 6 /* (file name or mrl) */ -#define XINE_MSG_READ_ERROR 7 /* (device/file/mrl) */ -#define XINE_MSG_LIBRARY_LOAD_ERROR 8 /* (library/decoder) */ -#define XINE_MSG_ENCRYPTED_SOURCE 9 /* none */ -#define XINE_MSG_SECURITY 10 /* (security message) */ -#define XINE_MSG_AUDIO_OUT_UNAVAILABLE 11 /* none */ -#define XINE_MSG_PERMISSION_ERROR 12 /* (file name or mrl) */ -#define XINE_MSG_FILE_EMPTY 13 /* file is empty */ -#define XINE_MSG_AUTHENTICATION_NEEDED 14 /* (mrl, likely http) */ - -/* opaque xine_event_queue_t */ -typedef struct xine_event_queue_s xine_event_queue_t; - -/* - * register a new event queue - * - * you have to receive messages from this queue regularly - * - * use xine_event_dispose_queue to unregister and free the queue - */ -xine_event_queue_t *xine_event_new_queue (xine_stream_t *stream) XINE_PROTECTED; -void xine_event_dispose_queue (xine_event_queue_t *queue) XINE_PROTECTED; - -/* - * receive events (poll) - * - * use xine_event_free on the events received from these calls - * when they're no longer needed - */ -xine_event_t *xine_event_get (xine_event_queue_t *queue) XINE_PROTECTED; -xine_event_t *xine_event_wait (xine_event_queue_t *queue) XINE_PROTECTED; -void xine_event_free (xine_event_t *event) XINE_PROTECTED; - -/* - * receive events (callback) - * - * a thread is created which will receive all events from - * the specified queue, call your callback on each of them - * and will then free the event when your callback returns - * - */ -typedef void (*xine_event_listener_cb_t) (void *user_data, - const xine_event_t *event); -void xine_event_create_listener_thread (xine_event_queue_t *queue, - xine_event_listener_cb_t callback, - void *user_data) XINE_PROTECTED; - -/* - * send an event to all queues - * - * the event will be copied so you can free or reuse - * *event as soon as xine_event_send returns. - */ -void xine_event_send (xine_stream_t *stream, const xine_event_t *event) XINE_PROTECTED; - - -/********************************************************************* - * OSD (on screen display) * - *********************************************************************/ - -#define XINE_TEXT_PALETTE_SIZE 11 - -#define XINE_OSD_TEXT1 (0 * XINE_TEXT_PALETTE_SIZE) -#define XINE_OSD_TEXT2 (1 * XINE_TEXT_PALETTE_SIZE) -#define XINE_OSD_TEXT3 (2 * XINE_TEXT_PALETTE_SIZE) -#define XINE_OSD_TEXT4 (3 * XINE_TEXT_PALETTE_SIZE) -#define XINE_OSD_TEXT5 (4 * XINE_TEXT_PALETTE_SIZE) -#define XINE_OSD_TEXT6 (5 * XINE_TEXT_PALETTE_SIZE) -#define XINE_OSD_TEXT7 (6 * XINE_TEXT_PALETTE_SIZE) -#define XINE_OSD_TEXT8 (7 * XINE_TEXT_PALETTE_SIZE) -#define XINE_OSD_TEXT9 (8 * XINE_TEXT_PALETTE_SIZE) -#define XINE_OSD_TEXT10 (9 * XINE_TEXT_PALETTE_SIZE) - -/* white text, black border, transparent background */ -#define XINE_TEXTPALETTE_WHITE_BLACK_TRANSPARENT 0 -/* white text, noborder, transparent background */ -#define XINE_TEXTPALETTE_WHITE_NONE_TRANSPARENT 1 -/* white text, no border, translucid background */ -#define XINE_TEXTPALETTE_WHITE_NONE_TRANSLUCID 2 -/* yellow text, black border, transparent background */ -#define XINE_TEXTPALETTE_YELLOW_BLACK_TRANSPARENT 3 - -#define XINE_OSD_CAP_FREETYPE2 0x0001 /* freetype2 support compiled in */ -#define XINE_OSD_CAP_UNSCALED 0x0002 /* unscaled overlays supp. by vo drv */ - -typedef struct xine_osd_s xine_osd_t; - -xine_osd_t *xine_osd_new (xine_stream_t *self, int x, int y, - int width, int height) XINE_PROTECTED; -uint32_t xine_osd_get_capabilities (xine_osd_t *self) XINE_PROTECTED; -void xine_osd_draw_point (xine_osd_t *self, int x, int y, int color) XINE_PROTECTED; - -void xine_osd_draw_line (xine_osd_t *self, int x1, int y1, - int x2, int y2, int color) XINE_PROTECTED; -void xine_osd_draw_rect (xine_osd_t *self, int x1, int y1, - int x2, int y2, - int color, int filled ) XINE_PROTECTED; -/* x1 and y1 specifies the upper left corner of the text to be rendered */ -void xine_osd_draw_text (xine_osd_t *self, int x1, int y1, - const char *text, int color_base) XINE_PROTECTED; -void xine_osd_draw_bitmap (xine_osd_t *self, uint8_t *bitmap, - int x1, int y1, int width, int height, - uint8_t *palette_map) XINE_PROTECTED; -/* for freetype2 fonts the height is the maximum height for the whole font and not - * only for the specified text */ -void xine_osd_get_text_size (xine_osd_t *self, const char *text, - int *width, int *height) XINE_PROTECTED; -/* with freetype2 support compiled in, you can also specify a font file - as 'fontname' here */ -int xine_osd_set_font (xine_osd_t *self, const char *fontname, - int size) XINE_PROTECTED; -/* - * specifying encoding of texts - * "" ... means current locale encoding (default) - * NULL ... means latin1 - */ -void xine_osd_set_encoding(xine_osd_t *self, const char *encoding) XINE_PROTECTED; -/* set position were overlay will be blended */ -void xine_osd_set_position (xine_osd_t *self, int x, int y) XINE_PROTECTED; -void xine_osd_show (xine_osd_t *self, int64_t vpts) XINE_PROTECTED; -void xine_osd_show_unscaled (xine_osd_t *self, int64_t vpts) XINE_PROTECTED; -void xine_osd_hide (xine_osd_t *self, int64_t vpts) XINE_PROTECTED; -/* empty drawing area */ -void xine_osd_clear (xine_osd_t *self) XINE_PROTECTED; -/* - * set on existing text palette - * (-1 to set used specified palette) - * - * color_base specifies the first color index to use for this text - * palette. The OSD palette is then modified starting at this - * color index, up to the size of the text palette. - * - * Use OSD_TEXT1, OSD_TEXT2, ... for some preassigned color indices. - * - * These palettes are not working well with the true type fonts. - * First thing is that these fonts cannot have a border. So you get - * the best results by loading a linearly blending palette from the - * background (at index 0) to the forground color (at index 10). - */ -void xine_osd_set_text_palette (xine_osd_t *self, - int palette_number, - int color_base ) XINE_PROTECTED; -/* get palette (color and transparency) */ -void xine_osd_get_palette (xine_osd_t *self, uint32_t *color, - uint8_t *trans) XINE_PROTECTED; -void xine_osd_set_palette (xine_osd_t *self, - const uint32_t *const color, - const uint8_t *const trans ) XINE_PROTECTED; -/* - * close osd rendering engine - * loaded fonts are unloaded - * osd objects are closed - */ -void xine_osd_free (xine_osd_t *self) XINE_PROTECTED; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/xine/Makefile.am b/include/xine/Makefile.am new file mode 100644 index 000000000..f143d83c4 --- /dev/null +++ b/include/xine/Makefile.am @@ -0,0 +1,4 @@ +EXTRA_DIST = version.h.in + +xineincludedir = $(includedir)/xine +xineinclude_HEADERS = version.h diff --git a/include/xine/version.h.in b/include/xine/version.h.in new file mode 100644 index 000000000..75072708d --- /dev/null +++ b/include/xine/version.h.in @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2007 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + */ + +/* static info - which libxine release this header came from */ +#define XINE_MAJOR_VERSION @XINE_MAJOR@ +#define XINE_MINOR_VERSION @XINE_MINOR@ +#define XINE_SUB_VERSION @XINE_SUB@ +#define XINE_VERSION "@VERSION@" -- cgit v1.2.3 From f80c8d4d48e7a5ef6ac6c9f2a4dfdb39f40aaff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Wed, 19 Dec 2007 02:10:56 +0100 Subject: Consolidate all public include files into include/xine directory. --HG-- rename : src/xine-engine/alphablend.h => include/xine/alphablend.h rename : src/xine-utils/array.h => include/xine/array.h rename : src/xine-utils/attributes.h => include/xine/attributes.h rename : src/xine-engine/audio_decoder.h => include/xine/audio_decoder.h rename : src/xine-engine/audio_out.h => include/xine/audio_out.h rename : src/xine-engine/broadcaster.h => include/xine/broadcaster.h rename : src/xine-engine/buffer.h => include/xine/buffer.h rename : src/xine-utils/compat.h => include/xine/compat.h rename : src/xine-engine/configfile.h => include/xine/configfile.h rename : src/demuxers/demux.h => include/xine/demux.h rename : src/xine-engine/info_helper.h => include/xine/info_helper.h rename : src/input/input_plugin.h => include/xine/input_plugin.h rename : src/xine-engine/io_helper.h => include/xine/io_helper.h rename : src/xine-utils/list.h => include/xine/list.h rename : src/xine-engine/metronom.h => include/xine/metronom.h rename : src/xine-engine/osd.h => include/xine/osd.h rename : src/xine-engine/plugin_catalog.h => include/xine/plugin_catalog.h rename : src/xine-utils/pool.h => include/xine/pool.h rename : src/xine-engine/post.h => include/xine/post.h rename : src/xine-engine/refcounter.h => include/xine/refcounter.h rename : src/xine-engine/resample.h => include/xine/resample.h rename : src/xine-utils/ring_buffer.h => include/xine/ring_buffer.h rename : src/xine-engine/scratch.h => include/xine/scratch.h rename : src/xine-utils/sorted_array.h => include/xine/sorted_array.h rename : src/xine-engine/spu.h => include/xine/spu.h rename : src/xine-engine/spu_decoder.h => include/xine/spu_decoder.h rename : src/xine-engine/video_decoder.h => include/xine/video_decoder.h rename : src/xine-engine/video_out.h => include/xine/video_out.h rename : src/xine-engine/video_overlay.h => include/xine/video_overlay.h rename : src/xine-engine/vo_scale.h => include/xine/vo_scale.h rename : src/xine-utils/xine_buffer.h => include/xine/xine_buffer.h rename : src/xine-engine/xine_internal.h => include/xine/xine_internal.h rename : src/xine-engine/xine_plugin.h => include/xine/xine_plugin.h rename : src/xine-engine/xineintl.h => include/xine/xineintl.h rename : src/xine-utils/xineutils.h => include/xine/xineutils.h rename : src/xine-utils/xmllexer.h => include/xine/xmllexer.h rename : src/xine-utils/xmlparser.h => include/xine/xmlparser.h --- include/xine/Makefile.am | 9 +- include/xine/alphablend.h | 113 +++++ include/xine/array.h | 57 +++ include/xine/attributes.h | 86 ++++ include/xine/audio_decoder.h | 105 +++++ include/xine/audio_out.h | 352 ++++++++++++++ include/xine/broadcaster.h | 46 ++ include/xine/buffer.h | 718 +++++++++++++++++++++++++++++ include/xine/compat.h | 55 +++ include/xine/configfile.h | 218 +++++++++ include/xine/demux.h | 220 +++++++++ include/xine/info_helper.h | 180 ++++++++ include/xine/input_plugin.h | 420 +++++++++++++++++ include/xine/io_helper.h | 141 ++++++ include/xine/list.h | 104 +++++ include/xine/metronom.h | 364 +++++++++++++++ include/xine/osd.h | 365 +++++++++++++++ include/xine/plugin_catalog.h | 95 ++++ include/xine/pool.h | 48 ++ include/xine/post.h | 405 ++++++++++++++++ include/xine/refcounter.h | 46 ++ include/xine/resample.h | 62 +++ include/xine/ring_buffer.h | 55 +++ include/xine/scratch.h | 56 +++ include/xine/sorted_array.h | 94 ++++ include/xine/spu.h | 44 ++ include/xine/spu_decoder.h | 151 ++++++ include/xine/video_decoder.h | 111 +++++ include/xine/video_out.h | 466 +++++++++++++++++++ include/xine/video_overlay.h | 68 +++ include/xine/vo_scale.h | 203 ++++++++ include/xine/xine_buffer.h | 136 ++++++ include/xine/xine_internal.h | 546 ++++++++++++++++++++++ include/xine/xine_plugin.h | 105 +++++ include/xine/xineintl.h | 54 +++ include/xine/xineutils.h | 972 +++++++++++++++++++++++++++++++++++++++ include/xine/xmllexer.h | 59 +++ include/xine/xmlparser.h | 99 ++++ src/demuxers/Makefile.am | 2 - src/demuxers/demux.h | 220 --------- src/input/input_plugin.h | 420 ----------------- src/vdr/Makefile.am | 2 - src/xine-engine/Makefile.am | 6 - src/xine-engine/alphablend.h | 113 ----- src/xine-engine/audio_decoder.h | 105 ----- src/xine-engine/audio_out.h | 352 -------------- src/xine-engine/broadcaster.h | 46 -- src/xine-engine/buffer.h | 718 ----------------------------- src/xine-engine/configfile.h | 218 --------- src/xine-engine/info_helper.h | 180 -------- src/xine-engine/io_helper.h | 141 ------ src/xine-engine/metronom.h | 364 --------------- src/xine-engine/osd.h | 365 --------------- src/xine-engine/plugin_catalog.h | 95 ---- src/xine-engine/post.h | 405 ---------------- src/xine-engine/refcounter.h | 46 -- src/xine-engine/resample.h | 62 --- src/xine-engine/scratch.h | 56 --- src/xine-engine/spu.h | 44 -- src/xine-engine/spu_decoder.h | 151 ------ src/xine-engine/video_decoder.h | 111 ----- src/xine-engine/video_out.h | 466 ------------------- src/xine-engine/video_overlay.h | 68 --- src/xine-engine/vo_scale.h | 203 -------- src/xine-engine/xine_internal.h | 546 ---------------------- src/xine-engine/xine_plugin.h | 105 ----- src/xine-engine/xineintl.h | 54 --- src/xine-utils/Makefile.am | 13 - src/xine-utils/array.h | 57 --- src/xine-utils/attributes.h | 86 ---- src/xine-utils/compat.h | 55 --- src/xine-utils/list.h | 104 ----- src/xine-utils/pool.h | 48 -- src/xine-utils/ring_buffer.h | 55 --- src/xine-utils/sorted_array.h | 94 ---- src/xine-utils/xine_buffer.h | 136 ------ src/xine-utils/xineutils.h | 972 --------------------------------------- src/xine-utils/xmllexer.h | 59 --- src/xine-utils/xmlparser.h | 99 ---- 79 files changed, 7427 insertions(+), 7443 deletions(-) create mode 100644 include/xine/alphablend.h create mode 100644 include/xine/array.h create mode 100644 include/xine/attributes.h create mode 100644 include/xine/audio_decoder.h create mode 100644 include/xine/audio_out.h create mode 100644 include/xine/broadcaster.h create mode 100644 include/xine/buffer.h create mode 100644 include/xine/compat.h create mode 100644 include/xine/configfile.h create mode 100644 include/xine/demux.h create mode 100644 include/xine/info_helper.h create mode 100644 include/xine/input_plugin.h create mode 100644 include/xine/io_helper.h create mode 100644 include/xine/list.h create mode 100644 include/xine/metronom.h create mode 100644 include/xine/osd.h create mode 100644 include/xine/plugin_catalog.h create mode 100644 include/xine/pool.h create mode 100644 include/xine/post.h create mode 100644 include/xine/refcounter.h create mode 100644 include/xine/resample.h create mode 100644 include/xine/ring_buffer.h create mode 100644 include/xine/scratch.h create mode 100644 include/xine/sorted_array.h create mode 100644 include/xine/spu.h create mode 100644 include/xine/spu_decoder.h create mode 100644 include/xine/video_decoder.h create mode 100644 include/xine/video_out.h create mode 100644 include/xine/video_overlay.h create mode 100644 include/xine/vo_scale.h create mode 100644 include/xine/xine_buffer.h create mode 100644 include/xine/xine_internal.h create mode 100644 include/xine/xine_plugin.h create mode 100644 include/xine/xineintl.h create mode 100644 include/xine/xineutils.h create mode 100644 include/xine/xmllexer.h create mode 100644 include/xine/xmlparser.h delete mode 100644 src/demuxers/demux.h delete mode 100644 src/input/input_plugin.h delete mode 100644 src/xine-engine/alphablend.h delete mode 100644 src/xine-engine/audio_decoder.h delete mode 100644 src/xine-engine/audio_out.h delete mode 100644 src/xine-engine/broadcaster.h delete mode 100644 src/xine-engine/buffer.h delete mode 100644 src/xine-engine/configfile.h delete mode 100644 src/xine-engine/info_helper.h delete mode 100644 src/xine-engine/io_helper.h delete mode 100644 src/xine-engine/metronom.h delete mode 100644 src/xine-engine/osd.h delete mode 100644 src/xine-engine/plugin_catalog.h delete mode 100644 src/xine-engine/post.h delete mode 100644 src/xine-engine/refcounter.h delete mode 100644 src/xine-engine/resample.h delete mode 100644 src/xine-engine/scratch.h delete mode 100644 src/xine-engine/spu.h delete mode 100644 src/xine-engine/spu_decoder.h delete mode 100644 src/xine-engine/video_decoder.h delete mode 100644 src/xine-engine/video_out.h delete mode 100644 src/xine-engine/video_overlay.h delete mode 100644 src/xine-engine/vo_scale.h delete mode 100644 src/xine-engine/xine_internal.h delete mode 100644 src/xine-engine/xine_plugin.h delete mode 100644 src/xine-engine/xineintl.h delete mode 100644 src/xine-utils/array.h delete mode 100644 src/xine-utils/attributes.h delete mode 100644 src/xine-utils/compat.h delete mode 100644 src/xine-utils/list.h delete mode 100644 src/xine-utils/pool.h delete mode 100644 src/xine-utils/ring_buffer.h delete mode 100644 src/xine-utils/sorted_array.h delete mode 100644 src/xine-utils/xine_buffer.h delete mode 100644 src/xine-utils/xineutils.h delete mode 100644 src/xine-utils/xmllexer.h delete mode 100644 src/xine-utils/xmlparser.h diff --git a/include/xine/Makefile.am b/include/xine/Makefile.am index f143d83c4..2861460be 100644 --- a/include/xine/Makefile.am +++ b/include/xine/Makefile.am @@ -1,4 +1,11 @@ EXTRA_DIST = version.h.in xineincludedir = $(includedir)/xine -xineinclude_HEADERS = version.h +xineinclude_HEADERS = version.h buffer.h metronom.h configfile.h vo_scale.h \ + audio_out.h resample.h video_out.h xine_internal.h spu_decoder.h \ + video_overlay.h osd.h spu.h scratch.h xine_plugin.h xineintl.h \ + plugin_catalog.h audio_decoder.h video_decoder.h post.h \ + io_helper.h broadcaster.h info_helper.h refcounter.h alphablend.h \ + demux.h input_plugin.h attributes.h compat.h xine_buffer.h \ + xineutils.h xmllexer.h xmlparser.h list.h array.h sorted_array.h \ + pool.h ring_buffer.h diff --git a/include/xine/alphablend.h b/include/xine/alphablend.h new file mode 100644 index 000000000..f8c9ad540 --- /dev/null +++ b/include/xine/alphablend.h @@ -0,0 +1,113 @@ +/* + * + * Copyright (C) 2000 Thomas Mirlacher + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA. + * + * The author may be reached as + * + *------------------------------------------------------------ + * + */ + +#ifndef __ALPHABLEND_H__ +#define __ALPHABLEND_H__ + +#include "video_out.h" + +typedef struct { + void *buffer; + int buffer_size; + + int disable_exact_blending; + + int offset_x, offset_y; +} alphablend_t; + +void _x_alphablend_init(alphablend_t *extra_data, xine_t *xine) XINE_PROTECTED; +void _x_alphablend_free(alphablend_t *extra_data) XINE_PROTECTED; + +typedef struct { /* CLUT == Color LookUp Table */ + uint8_t cb; + uint8_t cr; + uint8_t y; + uint8_t foo; +} XINE_PACKED clut_t; + + +#define XX44_PALETTE_SIZE 32 + +typedef struct { + unsigned size; + unsigned max_used; + uint32_t cluts[XX44_PALETTE_SIZE]; + /* cache palette entries for both colors and hili_colors */ + int lookup_cache[OVL_PALETTE_SIZE*2]; +} xx44_palette_t; + + +void _x_blend_rgb16 (uint8_t * img, vo_overlay_t * img_overl, + int img_width, int img_height, + int dst_width, int dst_height, + alphablend_t *extra_data) XINE_PROTECTED; + +void _x_blend_rgb24 (uint8_t * img, vo_overlay_t * img_overl, + int img_width, int img_height, + int dst_width, int dst_height, + alphablend_t *extra_data) XINE_PROTECTED; + +void _x_blend_rgb32 (uint8_t * img, vo_overlay_t * img_overl, + int img_width, int img_height, + int dst_width, int dst_height, + alphablend_t *extra_data) XINE_PROTECTED; + +void _x_blend_yuv (uint8_t *dst_base[3], vo_overlay_t * img_overl, + int dst_width, int dst_height, int dst_pitches[3], + alphablend_t *extra_data) XINE_PROTECTED; + +void _x_blend_yuy2 (uint8_t * dst_img, vo_overlay_t * img_overl, + int dst_width, int dst_height, int dst_pitch, + alphablend_t *extra_data) XINE_PROTECTED; + +/* + * This function isn't too smart about blending. We want to avoid creating new + * colors in the palette as a result from two non-zero colors needed to be + * blended. Instead we choose the color with the highest alpha value to be + * visible. Some parts of the code taken from the "VeXP" project. + */ + +void _x_blend_xx44 (uint8_t *dst_img, vo_overlay_t *img_overl, + int dst_width, int dst_height, int dst_pitch, + alphablend_t *extra_data, + xx44_palette_t *palette,int ia44) XINE_PROTECTED; + +/* + * Functions to handle the xine-specific palette. + */ + +void _x_clear_xx44_palette(xx44_palette_t *p) XINE_PROTECTED; +void _x_init_xx44_palette(xx44_palette_t *p, unsigned num_entries) XINE_PROTECTED; +void _x_dispose_xx44_palette(xx44_palette_t *p) XINE_PROTECTED; + +/* + * Convert the xine-specific palette to something useful. + */ + +void _x_xx44_to_xvmc_palette(const xx44_palette_t *p,unsigned char *xvmc_palette, + unsigned first_xx44_entry, unsigned num_xx44_entries, + unsigned num_xvmc_components, char *xvmc_components) XINE_PROTECTED; + + +#endif diff --git a/include/xine/array.h b/include/xine/array.h new file mode 100644 index 000000000..ae2093823 --- /dev/null +++ b/include/xine/array.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2000-2006 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * Array that can grow automatically when you add elements. + * Inserting an element in the middle of the array implies memory moves. + */ +#ifndef XINE_ARRAY_H +#define XINE_ARRAY_H + +/* Array type */ +typedef struct xine_array_s xine_array_t; + +/* Constructor */ +xine_array_t *xine_array_new(size_t initial_size) XINE_PROTECTED; + +/* Destructor */ +void xine_array_delete(xine_array_t *array) XINE_PROTECTED; + +/* Returns the number of element stored in the array */ +size_t xine_array_size(const xine_array_t *array) XINE_PROTECTED; + +/* Removes all elements from an array */ +void xine_array_clear(xine_array_t *array) XINE_PROTECTED; + +/* Adds the element at the end of the array */ +void xine_array_add(xine_array_t *array, void *value) XINE_PROTECTED; + +/* Inserts an element into an array at the position specified */ +void xine_array_insert(xine_array_t *array, unsigned int position, void *value) XINE_PROTECTED; + +/* Removes one element from an array at the position specified */ +void xine_array_remove(xine_array_t *array, unsigned int position) XINE_PROTECTED; + +/* Get the element at the position specified */ +void *xine_array_get(const xine_array_t *array, unsigned int position) XINE_PROTECTED; + +/* Set the element at the position specified */ +void xine_array_set(xine_array_t *array, unsigned int position, void *value) XINE_PROTECTED; + +#endif + diff --git a/include/xine/attributes.h b/include/xine/attributes.h new file mode 100644 index 000000000..b25c76572 --- /dev/null +++ b/include/xine/attributes.h @@ -0,0 +1,86 @@ +/* + * attributes.h + * Copyright (C) 1999-2000 Aaron Holtzman + * Copyright (C) 2001-2007 xine developers + * + * This file was originally part of mpeg2dec, a free MPEG-2 video stream + * decoder. + * + * mpeg2dec is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * mpeg2dec is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + */ + +/* use gcc attribs to align critical data structures */ + +#ifndef ATTRIBUTE_H_ +#define ATTRIBUTE_H_ + +#ifdef ATTRIBUTE_ALIGNED_MAX +#define ATTR_ALIGN(align) __attribute__ ((__aligned__ ((ATTRIBUTE_ALIGNED_MAX < align) ? ATTRIBUTE_ALIGNED_MAX : align))) +#else +#define ATTR_ALIGN(align) +#endif + +#ifdef XINE_COMPILE +# include "configure.h" +#endif + +/* Export protected only for libxine functions */ +#if defined(XINE_LIBRARY_COMPILE) && defined(SUPPORT_ATTRIBUTE_VISIBILITY_PROTECTED) +# define XINE_PROTECTED __attribute__((__visibility__("protected"))) +#elif defined(XINE_LIBRARY_COMPILE) && defined(SUPPORT_ATTRIBUTE_VISIBILITY_DEFAULT) +# define XINE_PROTECTED __attribute__((__visibility__("default"))) +#else +# define XINE_PROTECTED +#endif + +#ifdef SUPPORT_ATTRIBUTE_SENTINEL +# define XINE_SENTINEL __attribute__((__sentinel__)) +#else +# define XINE_SENTINEL +#endif + +#ifndef __attr_unused +# ifdef SUPPORT_ATTRIBUTE_UNUSED +# define __attr_unused __attribute__((__unused__)) +# else +# define __attr_unused +# endif +#endif + +/* Format attributes */ +#ifdef SUPPORT_ATTRIBUTE_FORMAT +# define XINE_FORMAT_PRINTF(fmt,var) __attribute__((__format__(__printf__, fmt, var))) +#else +# define XINE_FORMAT_PRINTF(fmt,var) +#endif +#ifdef SUPPORT_ATTRIBUTE_FORMAT_ARG +# define XINE_FORMAT_PRINTF_ARG(fmt) __attribute__((__format_arg__(fmt))) +#else +# define XINE_FORMAT_PRINTF_ARG(fmt) +#endif + +#ifdef SUPPORT_ATTRIBUTE_PACKED +# define XINE_PACKED __attribute__((packed)) +#else +# define XINE_PACKED +#endif + +#ifdef SUPPORT_ATTRIBUTE_MALLOC +# define XINE_MALLOC __attribute__((__malloc__)) +#else +# define XINE_MALLOC +#endif + +#endif /* ATTRIBUTE_H_ */ diff --git a/include/xine/audio_decoder.h b/include/xine/audio_decoder.h new file mode 100644 index 000000000..307692b81 --- /dev/null +++ b/include/xine/audio_decoder.h @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2000-2004 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * xine audio decoder plugin interface + */ + +#ifndef HAVE_AUDIO_DECODER_H +#define HAVE_AUDIO_DECODER_H + +#ifdef XINE_COMPILE +# include +# include "buffer.h" +#else +# include +# include +#endif + +#define AUDIO_DECODER_IFACE_VERSION 16 + +/* + * generic xine audio decoder plugin interface + */ + +typedef struct audio_decoder_class_s audio_decoder_class_t; +typedef struct audio_decoder_s audio_decoder_t; + +struct audio_decoder_class_s { + + /* + * open a new instance of this plugin class + */ + audio_decoder_t* (*open_plugin) (audio_decoder_class_t *this, xine_stream_t *stream); + + /** + * @brief short human readable identifier for this plugin class + */ + const char *identifier; + + /** + * @brief human readable (verbose = 1 line) description for this plugin class + * + * The description is passed to gettext() to internationalise. + */ + const char *description; + + /** + * @brief Optional non-standard catalog to use with dgettext() for description. + */ + const char *textdomain; + + /* + * free all class-related resources + */ + + void (*dispose) (audio_decoder_class_t *this); +}; + +#define default_audio_decoder_class_dispose (void (*) (audio_decoder_class_t *this))free + +struct audio_decoder_s { + + /* + * decode data from buf and feed decoded samples to + * audio output + */ + void (*decode_data) (audio_decoder_t *this, buf_element_t *buf); + + /* + * reset decoder after engine flush (prepare for new + * audio data not related to recently decoded data) + */ + void (*reset) (audio_decoder_t *this); + + /* + * inform decoder that a time reference discontinuity has happened. + * that is, it must forget any currently held pts value + */ + void (*discontinuity) (audio_decoder_t *this); + + /* + * close down, free all resources + */ + void (*dispose) (audio_decoder_t *this); + + void *node; /* used by plugin loader */ + +}; + +#endif diff --git a/include/xine/audio_out.h b/include/xine/audio_out.h new file mode 100644 index 000000000..bd1b910df --- /dev/null +++ b/include/xine/audio_out.h @@ -0,0 +1,352 @@ +/* + * Copyright (C) 2000-2004 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + */ +#ifndef HAVE_AUDIO_OUT_H +#define HAVE_AUDIO_OUT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(XINE_COMPILE) +#include +#include "metronom.h" +#include "configfile.h" +#include "xineutils.h" +#else +#include +#include +#include +#include +#endif + + +#define AUDIO_OUT_IFACE_VERSION 9 + +/* + * ao_driver_s contains the driver every audio output + * driver plugin has to implement. + */ + +typedef struct ao_driver_s ao_driver_t; + +struct ao_driver_s { + + /* + * + * find out what output modes + capatilities are supported by + * this plugin (constants for the bit vector to return see above) + * + * See AO_CAP_* bellow. + */ + uint32_t (*get_capabilities) (ao_driver_t *); + + /* + * open the driver and make it ready to receive audio data + * buffers may be flushed(!) + * + * return value: 0 : failure, >0 : output sample rate + */ + int (*open)(ao_driver_t *, uint32_t bits, uint32_t rate, int mode); + + /* return the number of audio channels + */ + int (*num_channels)(ao_driver_t *self_gen); + + /* return the number of bytes per frame. + * A frame is equivalent to one sample being output on every audio channel. + */ + int (*bytes_per_frame)(ao_driver_t *self_gen); + + /* return the delay is frames measured by + * looking at pending samples in the audio output device + */ + int (*delay)(ao_driver_t *self_gen); + + /* + * return gap tolerance (in pts) needed for this driver + */ + int (*get_gap_tolerance) (ao_driver_t *self_gen); + + /* + * write audio data to audio output device + * return value: + * >0 => audio samples were processed ok + * 0 => audio samples were not yet processed, + * call write_audio_data with the _same_ samples again + */ + int (*write)(ao_driver_t *, + int16_t* audio_data, uint32_t num_samples); + + /* + * this is called when the decoder no longer uses the audio + * output driver - the driver should get ready to get opened() again + */ + void (*close)(ao_driver_t *); + + /* + * shut down this audio output driver plugin and + * free all resources allocated + */ + void (*exit) (ao_driver_t *); + + /* + * Get, Set a property of audio driver. + * + * get_property() return 1 in success, 0 on failure. + * set_property() return value on success, ~value on failure. + * + * See AO_PROP_* below for available properties. + */ + int (*get_property) (ao_driver_t *, int property); + + int (*set_property) (ao_driver_t *, int property, int value); + + + /* + * misc control operations on the audio device. + * + * See AO_CTRL_* below. + */ + int (*control) (ao_driver_t *, int cmd, /* arg */ ...); + + void *node; +}; + +typedef struct ao_format_s ao_format_t; + +struct ao_format_s { + uint32_t bits; + uint32_t rate; + int mode; +}; + +typedef struct audio_fifo_s audio_fifo_t; + +typedef struct audio_buffer_s audio_buffer_t; + +struct audio_buffer_s { + + audio_buffer_t *next; + + int16_t *mem; + int mem_size; + int num_frames; + + int64_t vpts; + uint32_t frame_header_count; + uint32_t first_access_unit; + + /* extra info coming from input or demuxers */ + extra_info_t *extra_info; + + xine_stream_t *stream; /* stream that send that buffer */ + + ao_format_t format; /* let each buffer carry it's own format info */ +}; + +/* + * xine_audio_port_s contains the port every audio decoder talks to + * + * Remember that adding new functions to this structure requires + * adaption of the post plugin decoration layer. Be sure to look into + * src/xine-engine/post.[ch]. + */ + +struct xine_audio_port_s { + uint32_t (*get_capabilities) (xine_audio_port_t *); /* for constants see below */ + + /* * Get/Set audio property + * + * See AO_PROP_* bellow + */ + int (*get_property) (xine_audio_port_t *, int property); + int (*set_property) (xine_audio_port_t *, int property, int value); + + /* open audio driver for audio output + * return value: 0:failure, >0:output sample rate + */ + /* when you are not a full-blown stream, but still need to open the port + * (e.g. you are a post plugin) it is legal to pass an anonymous stream */ + int (*open) (xine_audio_port_t *, xine_stream_t *stream, + uint32_t bits, uint32_t rate, int mode); + + /* + * get a piece of memory for audio data + */ + audio_buffer_t * (*get_buffer) (xine_audio_port_t *); + + /* + * append a buffer filled with audio data to the audio fifo + * for output + */ + /* when the frame does not originate from a stream, it is legal to pass an anonymous stream */ + void (*put_buffer) (xine_audio_port_t *, audio_buffer_t *buf, xine_stream_t *stream); + + /* audio driver is no longer used by decoder => close */ + /* when you are not a full-blown stream, but still need to close the port + * (e.g. you are a post plugin) it is legal to pass an anonymous stream */ + void (*close) (xine_audio_port_t *self, xine_stream_t *stream); + + /* called on xine exit */ + void (*exit) (xine_audio_port_t *); + + /* + * misc control operations on the audio device. + * + * See AO_CTRL_* below. + */ + int (*control) (xine_audio_port_t *, int cmd, /* arg */ ...); + + /* + * Flush audio_out fifo. + */ + void (*flush) (xine_audio_port_t *); + + /* + * Check if port is opened for this stream and get parameters. + * The stream can be anonymous. + */ + int (*status) (xine_audio_port_t *, xine_stream_t *stream, + uint32_t *bits, uint32_t *rate, int *mode); + +}; + +typedef struct audio_driver_class_s audio_driver_class_t; + +struct audio_driver_class_s { + + /* + * open a new instance of this plugin class + */ + ao_driver_t* (*open_plugin) (audio_driver_class_t *, const void *data); + + /** + * @brief short human readable identifier for this plugin class + */ + const char *identifier; + + /** + * @brief human readable (verbose = 1 line) description for this plugin class + * + * The description is passed to gettext() to internationalise. + */ + const char *description; + + /** + * @brief Optional non-standard catalog to use with dgettext() for description. + */ + const char *textdomain; + + /* + * free all class-related resources + */ + + void (*dispose) (audio_driver_class_t *); +}; + +#define default_audio_driver_class_dispose (void (*) (audio_driver_class_t *this))free + +/** + * @brief Initialise the audio_out sync routines + * + * @internal + */ +xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver, int grab_only); + +/* + * audio output modes + capabilities + */ + +#define AO_CAP_NOCAP 0x00000000 /* driver has no capabilities */ +#define AO_CAP_MODE_A52 0x00000001 /* driver supports A/52 output */ +#define AO_CAP_MODE_AC5 0x00000002 /* driver supports AC5 output */ +/* 1 sample == 2 bytes (C) */ +#define AO_CAP_MODE_MONO 0x00000004 /* driver supports mono output */ +/* 1 sample == 4 bytes (L,R) */ +#define AO_CAP_MODE_STEREO 0x00000008 /* driver supports stereo output */ +/* 1 sample == 8 bytes (L,R,LR,RR) */ +#define AO_CAP_MODE_4CHANNEL 0x00000010 /* driver supports 4 channels */ +/* + * Sound cards generally support, 1,2,4,6 channels, but rarely 5. + * So xine will take 4.1, 5 and 6 channel a52 streams and + * down or upmix it correctly to fill the 6 output channels. + * Are there any requests for 2.1 out there? + */ +/* 1 sample == 12 bytes (L,R,LR,RR,Null,LFE) */ +#define AO_CAP_MODE_4_1CHANNEL 0x00000020 /* driver supports 4.1 channels */ +/* 1 sample == 12 bytes (L,R,LR,RR,C, Null) */ +#define AO_CAP_MODE_5CHANNEL 0x00000040 /* driver supports 5 channels */ +/* 1 sample == 12 bytes (L,R,LR,RR,C,LFE) */ +#define AO_CAP_MODE_5_1CHANNEL 0x00000080 /* driver supports 5.1 channels */ + +/* + * converts the audio output mode into the number of channels + */ +int _x_ao_mode2channels( int mode ) XINE_PROTECTED; +/* + * converts the number of channels into the audio output mode + */ +int _x_ao_channels2mode( int channels ) XINE_PROTECTED; + +#define AO_CAP_MIXER_VOL 0x00000100 /* driver supports mixer control */ +#define AO_CAP_PCM_VOL 0x00000200 /* driver supports pcm control */ +#define AO_CAP_MUTE_VOL 0x00000400 /* driver can mute volume */ +#define AO_CAP_8BITS 0x00000800 /* driver support 8-bit samples */ +#define AO_CAP_16BITS 0x00001000 /* driver support 16-bit samples */ +#define AO_CAP_24BITS 0x00002000 /* driver support 24-bit samples */ +#define AO_CAP_FLOAT32 0x00004000 /* driver support 32-bit samples. i.e. Floats */ + +/* properties supported by get/set_property() */ +#define AO_PROP_MIXER_VOL 0 +#define AO_PROP_PCM_VOL 1 +#define AO_PROP_MUTE_VOL 2 +#define AO_PROP_COMPRESSOR 3 +#define AO_PROP_DISCARD_BUFFERS 4 +#define AO_PROP_BUFS_IN_FIFO 5 /* read-only */ +#define AO_PROP_AMP 6 /* amplifier */ +#define AO_PROP_EQ_30HZ 7 /* equalizer */ +#define AO_PROP_EQ_60HZ 8 /* equalizer */ +#define AO_PROP_EQ_125HZ 9 /* equalizer */ +#define AO_PROP_EQ_250HZ 10 /* equalizer */ +#define AO_PROP_EQ_500HZ 11 /* equalizer */ +#define AO_PROP_EQ_1000HZ 12 /* equalizer */ +#define AO_PROP_EQ_2000HZ 13 /* equalizer */ +#define AO_PROP_EQ_4000HZ 14 /* equalizer */ +#define AO_PROP_EQ_8000HZ 15 /* equalizer */ +#define AO_PROP_EQ_16000HZ 16 /* equalizer */ +#define AO_PROP_CLOSE_DEVICE 17 /* force closing audio device */ +#define AO_PROP_AMP_MUTE 18 /* amplifier mute */ +#define AO_PROP_NUM_STREAMS 19 /* read-only */ +#define AO_PROP_CLOCK_SPEED 20 /* inform audio_out that speed has changed */ +#define AO_NUM_PROPERTIES 21 + +/* audio device control ops */ +#define AO_CTRL_PLAY_PAUSE 0 +#define AO_CTRL_PLAY_RESUME 1 +#define AO_CTRL_FLUSH_BUFFERS 2 + +/* above that value audio frames are discarded */ +#define AO_MAX_GAP 15000 + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/xine/broadcaster.h b/include/xine/broadcaster.h new file mode 100644 index 000000000..093fb4af0 --- /dev/null +++ b/include/xine/broadcaster.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2000-2003 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * broadcaster.h + */ + +#ifndef HAVE_BROADCASTER_H +#define HAVE_BROADCASTER_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +typedef struct broadcaster_s broadcaster_t; + +broadcaster_t *_x_init_broadcaster(xine_stream_t *stream, int port) XINE_PROTECTED; +void _x_close_broadcaster(broadcaster_t *this) XINE_PROTECTED; +int _x_get_broadcaster_port(broadcaster_t *this) XINE_PROTECTED; + + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/include/xine/buffer.h b/include/xine/buffer.h new file mode 100644 index 000000000..ce209c9da --- /dev/null +++ b/include/xine/buffer.h @@ -0,0 +1,718 @@ +/* + * Copyright (C) 2000-2004 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + * contents: + * + * buffer_entry structure - serves as a transport encapsulation + * of the mpeg audio/video data through xine + * + * free buffer pool management routines + * + * FIFO buffer structures/routines + */ + +#ifndef HAVE_BUFFER_H +#define HAVE_BUFFER_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +#ifdef XINE_COMPILE +# include +# include "attributes.h" +#else +# include +# include +#endif + +#define BUF_MAX_CALLBACKS 5 + +/** + * @defgroup buffer_types Buffer Types + * + * a buffer type ID describes the contents of a buffer + * it consists of three fields: + * + * buf_type = 0xMMDDCCCC + * + * MM : major buffer type (CONTROL, VIDEO, AUDIO, SPU) + * DD : decoder selection (e.g. MPEG, OPENDIVX ... for VIDEO) + * CCCC : channel number or other subtype information for the decoder + */ +/*@{*/ + +#define BUF_MAJOR_MASK 0xFF000000 +#define BUF_DECODER_MASK 0x00FF0000 + +/** + * @defgroup buffer_ctrl Control buffer types + */ +/*@{*/ +#define BUF_CONTROL_BASE 0x01000000 +#define BUF_CONTROL_START 0x01000000 +#define BUF_CONTROL_END 0x01010000 +#define BUF_CONTROL_QUIT 0x01020000 +#define BUF_CONTROL_DISCONTINUITY 0x01030000 /**< former AVSYNC_RESET */ +#define BUF_CONTROL_NOP 0x01040000 +#define BUF_CONTROL_AUDIO_CHANNEL 0x01050000 +#define BUF_CONTROL_SPU_CHANNEL 0x01060000 +#define BUF_CONTROL_NEWPTS 0x01070000 +#define BUF_CONTROL_RESET_DECODER 0x01080000 +#define BUF_CONTROL_HEADERS_DONE 0x01090000 +#define BUF_CONTROL_FLUSH_DECODER 0x010a0000 +#define BUF_CONTROL_RESET_TRACK_MAP 0x010b0000 +/*@}*/ + +/** + * @defgroup buffer_video Video buffer types + * @note (please keep in sync with buffer_types.c) + */ +/*@{*/ +#define BUF_VIDEO_BASE 0x02000000 +#define BUF_VIDEO_UNKNOWN 0x02ff0000 /**< no decoder should handle this one */ +#define BUF_VIDEO_MPEG 0x02000000 +#define BUF_VIDEO_MPEG4 0x02010000 +#define BUF_VIDEO_CINEPAK 0x02020000 +#define BUF_VIDEO_SORENSON_V1 0x02030000 +#define BUF_VIDEO_MSMPEG4_V2 0x02040000 +#define BUF_VIDEO_MSMPEG4_V3 0x02050000 +#define BUF_VIDEO_MJPEG 0x02060000 +#define BUF_VIDEO_IV50 0x02070000 +#define BUF_VIDEO_IV41 0x02080000 +#define BUF_VIDEO_IV32 0x02090000 +#define BUF_VIDEO_IV31 0x020a0000 +#define BUF_VIDEO_ATIVCR1 0x020b0000 +#define BUF_VIDEO_ATIVCR2 0x020c0000 +#define BUF_VIDEO_I263 0x020d0000 +#define BUF_VIDEO_RV10 0x020e0000 +#define BUF_VIDEO_RGB 0x02100000 +#define BUF_VIDEO_YUY2 0x02110000 +#define BUF_VIDEO_JPEG 0x02120000 +#define BUF_VIDEO_WMV7 0x02130000 +#define BUF_VIDEO_WMV8 0x02140000 +#define BUF_VIDEO_MSVC 0x02150000 +#define BUF_VIDEO_DV 0x02160000 +#define BUF_VIDEO_REAL 0x02170000 +#define BUF_VIDEO_VP31 0x02180000 +#define BUF_VIDEO_H263 0x02190000 +#define BUF_VIDEO_3IVX 0x021A0000 +#define BUF_VIDEO_CYUV 0x021B0000 +#define BUF_VIDEO_DIVX5 0x021C0000 +#define BUF_VIDEO_XVID 0x021D0000 +#define BUF_VIDEO_SMC 0x021E0000 +#define BUF_VIDEO_RPZA 0x021F0000 +#define BUF_VIDEO_QTRLE 0x02200000 +#define BUF_VIDEO_MSRLE 0x02210000 +#define BUF_VIDEO_DUCKTM1 0x02220000 +#define BUF_VIDEO_FLI 0x02230000 +#define BUF_VIDEO_ROQ 0x02240000 +#define BUF_VIDEO_SORENSON_V3 0x02250000 +#define BUF_VIDEO_MSMPEG4_V1 0x02260000 +#define BUF_VIDEO_MSS1 0x02270000 +#define BUF_VIDEO_IDCIN 0x02280000 +#define BUF_VIDEO_PGVV 0x02290000 +#define BUF_VIDEO_ZYGO 0x022A0000 +#define BUF_VIDEO_TSCC 0x022B0000 +#define BUF_VIDEO_YVU9 0x022C0000 +#define BUF_VIDEO_VQA 0x022D0000 +#define BUF_VIDEO_GREY 0x022E0000 +#define BUF_VIDEO_XXAN 0x022F0000 +#define BUF_VIDEO_WC3 0x02300000 +#define BUF_VIDEO_YV12 0x02310000 +#define BUF_VIDEO_SEGA 0x02320000 +#define BUF_VIDEO_RV20 0x02330000 +#define BUF_VIDEO_RV30 0x02340000 +#define BUF_VIDEO_MVI2 0x02350000 +#define BUF_VIDEO_UCOD 0x02360000 +#define BUF_VIDEO_WMV9 0x02370000 +#define BUF_VIDEO_INTERPLAY 0x02380000 +#define BUF_VIDEO_RV40 0x02390000 +#define BUF_VIDEO_PSX_MDEC 0x023A0000 +#define BUF_VIDEO_YUV_FRAMES 0x023B0000 /**< uncompressed YUV, delivered by v4l input plugin */ +#define BUF_VIDEO_HUFFYUV 0x023C0000 +#define BUF_VIDEO_IMAGE 0x023D0000 +#define BUF_VIDEO_THEORA 0x023E0000 +#define BUF_VIDEO_4XM 0x023F0000 +#define BUF_VIDEO_I420 0x02400000 +#define BUF_VIDEO_VP4 0x02410000 +#define BUF_VIDEO_VP5 0x02420000 +#define BUF_VIDEO_VP6 0x02430000 +#define BUF_VIDEO_VMD 0x02440000 +#define BUF_VIDEO_MSZH 0x02450000 +#define BUF_VIDEO_ZLIB 0x02460000 +#define BUF_VIDEO_8BPS 0x02470000 +#define BUF_VIDEO_ASV1 0x02480000 +#define BUF_VIDEO_ASV2 0x02490000 +#define BUF_VIDEO_BITPLANE 0x024A0000 /**< Amiga typical picture and animation format */ +#define BUF_VIDEO_BITPLANE_BR1 0x024B0000 /**< the same with Bytrun compression 1 */ +#define BUF_VIDEO_FLV1 0x024C0000 +#define BUF_VIDEO_H264 0x024D0000 +#define BUF_VIDEO_MJPEG_B 0x024E0000 +#define BUF_VIDEO_H261 0x024F0000 +#define BUF_VIDEO_AASC 0x02500000 +#define BUF_VIDEO_LOCO 0x02510000 +#define BUF_VIDEO_QDRW 0x02520000 +#define BUF_VIDEO_QPEG 0x02530000 +#define BUF_VIDEO_ULTI 0x02540000 +#define BUF_VIDEO_WNV1 0x02550000 +#define BUF_VIDEO_XL 0x02560000 +#define BUF_VIDEO_RT21 0x02570000 +#define BUF_VIDEO_FPS1 0x02580000 +#define BUF_VIDEO_DUCKTM2 0x02590000 +#define BUF_VIDEO_CSCD 0x025A0000 +#define BUF_VIDEO_ALGMM 0x025B0000 +#define BUF_VIDEO_ZMBV 0x025C0000 +#define BUF_VIDEO_AVS 0x025D0000 +#define BUF_VIDEO_SMACKER 0x025E0000 +#define BUF_VIDEO_NUV 0x025F0000 +#define BUF_VIDEO_KMVC 0x02600000 +#define BUF_VIDEO_FLASHSV 0x02610000 +#define BUF_VIDEO_CAVS 0x02620000 +#define BUF_VIDEO_VP6F 0x02630000 +#define BUF_VIDEO_THEORA_RAW 0x02640000 +#define BUF_VIDEO_VC1 0x02650000 +/*@}*/ + +/** + * @defgroup buffer_audio Audio buffer types + * @note (please keep in sync with buffer_types.c) + */ +/*@{*/ +#define BUF_AUDIO_BASE 0x03000000 +#define BUF_AUDIO_UNKNOWN 0x03ff0000 /**< no decoder should handle this one */ +#define BUF_AUDIO_A52 0x03000000 +#define BUF_AUDIO_MPEG 0x03010000 +#define BUF_AUDIO_LPCM_BE 0x03020000 +#define BUF_AUDIO_LPCM_LE 0x03030000 +#define BUF_AUDIO_WMAV1 0x03040000 +#define BUF_AUDIO_DTS 0x03050000 +#define BUF_AUDIO_MSADPCM 0x03060000 +#define BUF_AUDIO_MSIMAADPCM 0x03070000 +#define BUF_AUDIO_MSGSM 0x03080000 +#define BUF_AUDIO_VORBIS 0x03090000 +#define BUF_AUDIO_IMC 0x030a0000 +#define BUF_AUDIO_LH 0x030b0000 +#define BUF_AUDIO_VOXWARE 0x030c0000 +#define BUF_AUDIO_ACELPNET 0x030d0000 +#define BUF_AUDIO_AAC 0x030e0000 +#define BUF_AUDIO_DNET 0x030f0000 +#define BUF_AUDIO_VIVOG723 0x03100000 +#define BUF_AUDIO_DK3ADPCM 0x03110000 +#define BUF_AUDIO_DK4ADPCM 0x03120000 +#define BUF_AUDIO_ROQ 0x03130000 +#define BUF_AUDIO_QTIMAADPCM 0x03140000 +#define BUF_AUDIO_MAC3 0x03150000 +#define BUF_AUDIO_MAC6 0x03160000 +#define BUF_AUDIO_QDESIGN1 0x03170000 +#define BUF_AUDIO_QDESIGN2 0x03180000 +#define BUF_AUDIO_QCLP 0x03190000 +#define BUF_AUDIO_SMJPEG_IMA 0x031A0000 +#define BUF_AUDIO_VQA_IMA 0x031B0000 +#define BUF_AUDIO_MULAW 0x031C0000 +#define BUF_AUDIO_ALAW 0x031D0000 +#define BUF_AUDIO_GSM610 0x031E0000 +#define BUF_AUDIO_EA_ADPCM 0x031F0000 +#define BUF_AUDIO_WMAV2 0x03200000 +#define BUF_AUDIO_COOK 0x03210000 +#define BUF_AUDIO_ATRK 0x03220000 +#define BUF_AUDIO_14_4 0x03230000 +#define BUF_AUDIO_28_8 0x03240000 +#define BUF_AUDIO_SIPRO 0x03250000 +#define BUF_AUDIO_WMAV3 0x03260000 +#define BUF_AUDIO_INTERPLAY 0x03270000 +#define BUF_AUDIO_XA_ADPCM 0x03280000 +#define BUF_AUDIO_WESTWOOD 0x03290000 +#define BUF_AUDIO_DIALOGIC_IMA 0x032A0000 +#define BUF_AUDIO_NSF 0x032B0000 +#define BUF_AUDIO_FLAC 0x032C0000 +#define BUF_AUDIO_DV 0x032D0000 +#define BUF_AUDIO_WMAV 0x032E0000 +#define BUF_AUDIO_SPEEX 0x032F0000 +#define BUF_AUDIO_RAWPCM 0x03300000 +#define BUF_AUDIO_4X_ADPCM 0x03310000 +#define BUF_AUDIO_VMD 0x03320000 +#define BUF_AUDIO_XAN_DPCM 0x03330000 +#define BUF_AUDIO_ALAC 0x03340000 +#define BUF_AUDIO_MPC 0x03350000 +#define BUF_AUDIO_SHORTEN 0x03360000 +#define BUF_AUDIO_WESTWOOD_SND1 0x03370000 +#define BUF_AUDIO_WMALL 0x03380000 +#define BUF_AUDIO_TRUESPEECH 0x03390000 +#define BUF_AUDIO_TTA 0x033A0000 +#define BUF_AUDIO_SMACKER 0x033B0000 +#define BUF_AUDIO_FLVADPCM 0x033C0000 +#define BUF_AUDIO_WAVPACK 0x033D0000 +/*@}*/ + +/** + * @defgroup buffer_spu SPU buffer types + */ +/*@{*/ +#define BUF_SPU_BASE 0x04000000 +#define BUF_SPU_DVD 0x04000000 +#define BUF_SPU_TEXT 0x04010000 +#define BUF_SPU_CC 0x04020000 +#define BUF_SPU_DVB 0x04030000 +#define BUF_SPU_SVCD 0x04040000 +#define BUF_SPU_CVD 0x04050000 +#define BUF_SPU_OGM 0x04060000 +#define BUF_SPU_CMML 0x04070000 +/*@}*/ + +/** + * @defgroup buffer_demux Demuxer block types + */ +/*@{*/ +#define BUF_DEMUX_BLOCK 0x05000000 +/*@}*/ + +/*@}*/ + +typedef struct extra_info_s extra_info_t; + +/** + * @brief Structure to pass information from input or demuxer plugins + * to output frames (past decoder). + * + * New data must be added after the existing fields to not break ABI + * (backward compatibility). + */ + +struct extra_info_s { + + int input_normpos; /**< remember where this buf came from in + * the input source (0..65535). can be + * either time or offset based. */ + int input_time; /**< time offset in miliseconds from + * beginning of stream */ + uint32_t frame_number; /**< number of current frame if known */ + + int seek_count; /**< internal engine use */ + int64_t vpts; /**< set on output layers only */ + + int invalid; /**< do not use this extra info to update anything */ + int total_time; /**< duration in miliseconds of the stream */ +}; + + +#define BUF_NUM_DEC_INFO 5 + +typedef struct buf_element_s buf_element_t; +struct buf_element_s { + buf_element_t *next; + + unsigned char *mem; + unsigned char *content; /**< start of raw content in mem (without header etc) */ + + int32_t size ; /**< size of _content_ */ + int32_t max_size; /**< size of pre-allocated memory pointed to by "mem" */ + int64_t pts; /**< presentation time stamp, used for a/v sync */ + int64_t disc_off; /**< discontinuity offset */ + + extra_info_t *extra_info; /**< extra info will be passed to frames */ + + uint32_t decoder_flags; /**< stuff like keyframe, is_header ... see below */ + + /** additional decoder flags and other dec-spec. stuff */ + uint32_t decoder_info[BUF_NUM_DEC_INFO]; + /** pointers to dec-spec. stuff */ + void *decoder_info_ptr[BUF_NUM_DEC_INFO]; + + void (*free_buffer) (buf_element_t *buf); + + void *source; /**< pointer to source of this buffer for + * free_buffer */ + + uint32_t type; +} ; + +/** keyframe should be set whenever possible (that is, when demuxer + * knows about frames and keyframes). */ +#define BUF_FLAG_KEYFRAME 0x0001 + +/** frame start/end. BUF_FLAG_FRAME_END is sent on last buf of a frame */ +#define BUF_FLAG_FRAME_START 0x0002 +#define BUF_FLAG_FRAME_END 0x0004 + +/** any out-of-band data needed to initialize decoder must have + * this flag set. */ +#define BUF_FLAG_HEADER 0x0008 + +/** preview buffers are normal data buffers that must not produce any + * output in decoders (may be used to sneak details about the stream + * to come). */ +#define BUF_FLAG_PREVIEW 0x0010 + +/** set when user stop the playback */ +#define BUF_FLAG_END_USER 0x0020 + +/** set when stream finished naturaly */ +#define BUF_FLAG_END_STREAM 0x0040 + +/** decoder_info[0] carries the frame step (1/90000). */ +#define BUF_FLAG_FRAMERATE 0x0080 + +/** hint to metronom that seeking has occurred */ +#define BUF_FLAG_SEEK 0x0100 + +/** special information inside, see below. */ +#define BUF_FLAG_SPECIAL 0x0200 + +/** header use standard xine_bmiheader or xine_waveformatex structs. + * xine_waveformatex is actually optional since the most important + * information for audio init is available from decoder_info[]. + * note: BUF_FLAG_HEADER must also be set. */ +#define BUF_FLAG_STDHEADER 0x0400 + +/** decoder_info[1] carries numerator for display aspect ratio + * decoder_info[2] carries denominator for display aspect ratio */ +#define BUF_FLAG_ASPECT 0x0800 + + +/** + * \defgroup buffer_special Special buffer types: + * Sometimes there is a need to relay special information from a demuxer + * to a video decoder. For example, some file types store palette data in + * the file header independant of the video data. The special buffer type + * offers a way to communicate this or any other custom, format-specific + * data to the decoder. + * + * The interface was designed in a way that did not require an API + * version bump. To send a special buffer type, set a buffer's flags field + * to BUF_FLAG_SPECIAL. Set the buffer's decoder_info[1] field to a + * number according to one of the special buffer subtypes defined below. + * The second and third decoder_info[] fields are defined according to + * your buffer type's requirements. + * + * Finally, remember to set the buffer's size to 0. This way, if a special + * buffer is sent to a decode that does not know how to handle it, the + * buffer will fall through to the case where the buffer's data content + * is accumulated and no harm will be done. + */ +/*@{*/ + +/** + * In a BUF_SPECIAL_PALETTE buffer: + * decoder_info[1] = BUF_SPECIAL_PALETTE + * decoder_info[2] = number of entries in palette table + * decoder_info_ptr[2] = pointer to palette table + * This buffer type is used to provide a file- and decoder-independent + * facility to transport RGB color palettes from demuxers to decoders. + * A palette table is an array of palette_entry_t structures. A decoder + * should not count on this array to exist for the duration of the + * program's execution and should copy, manipulate, and store the palette + * data privately if it needs the palette information. + */ +#define BUF_SPECIAL_PALETTE 1 + + +/* special buffer type 2 used to be defined but is now available for use */ + + +/** + * In a BUF_SPECIAL_ASPECT buffer: + * decoder_info[1] = BUF_SPECIAL_ASPECT + * decoder_info[2] = MPEG2 aspect ratio code + * decoder_info[3] = stream scale prohibitions + * This buffer is used to force mpeg decoders to use a certain aspect. + * Currently xine-dvdnav uses this, because it has more accurate information + * about the aspect from the dvd ifo-data. + * The stream scale prohibitions are also delivered, with bit 0 meaning + * "deny letterboxing" and bit 1 meaning "deny pan&scan" + */ +#define BUF_SPECIAL_ASPECT 3 + +/** + * In a BUF_SPECIAL_DECODER_CONFIG buffer: + * decoder_info[1] = BUF_SPECIAL_DECODER_CONFIG + * decoder_info[2] = data size + * decoder_info_ptr[2] = pointer to data + * This buffer is used to pass config information from .mp4 files + * (atom esds) to decoders. both mpeg4 and aac streams use that. + */ +#define BUF_SPECIAL_DECODER_CONFIG 4 + +/** + * In a BUF_SPECIAL_STSD_ATOM buffer: + * decoder_info[1] = BUF_SPECIAL_STSD_ATOM + * decoder_info[2] = size of the ImageDescription atom, minus the + * four length bytes at the beginning + * decoder_info_ptr[2] = pointer to ImageDescription atom, starting with + * the codec fourcc + * Some Quicktime decoders need information contained within the + * ImageDescription atom inside a Quicktime file's stsd atom. This + * special buffer carries the ImageDescription atom from the QT demuxer + * to an A/V decoder. + */ +#define BUF_SPECIAL_STSD_ATOM 5 + +/** + * In a BUF_SPECIAL_LPCM_CONFIG buffer: + * decoder_info[1] = BUF_SPECIAL_LPCM_CONFIG + * decoder_info[2] = config data + * lpcm data encoded into mpeg2 streams have a format configuration + * byte in every frame. this is used to detect the sample rate, + * number of bits and channels. + */ +#define BUF_SPECIAL_LPCM_CONFIG 6 + +/** + * In a BUF_SPECIAL_CHARSET_ENCODING buffer: + * decoder_info[1] = BUF_SPECIAL_CHARSET_ENCODING + * decoder_info[2] = size of charset encoding string + * decoder_info_ptr[2] = pointer to charset encoding string + * This is used mostly with subtitle buffers when encoding is + * known at demuxer level (take precedence over xine config + * settings such as subtitles.separate.src_encoding) + */ +#define BUF_SPECIAL_CHARSET_ENCODING 7 + + +/** + * In a BUF_SPECIAL_SPU_DVD_SUBTYPE: + * decoder_info[1] = BUF_SPECIAL_SPU_DVD_SUBTYPE + * decoder_info[2] = subtype + * decoder_info[3] = + * This buffer is pass SPU subtypes from DVDs + */ +#define BUF_SPECIAL_SPU_DVD_SUBTYPE 8 + + +#define SPU_DVD_SUBTYPE_CLUT 1 +#define SPU_DVD_SUBTYPE_PACKAGE 2 +#define SPU_DVD_SUBTYPE_VOBSUB_PACKAGE 3 +#define SPU_DVD_SUBTYPE_NAV 4 + +/** + * In a BUF_SPECIAL_SPU_DVB_DESCRIPTOR + * decoder_info[1] = BUF_SPECIAL_SPU_DVB_DESCRIPTOR + * decoder_info[2] = size of spu_dvb_descriptor_t + * decoder_info_ptr[2] = pointer to spu_dvb_descriptor_t, or NULL + * decoder_info[3] = + * + * This buffer is used to tell a DVBSUB decoder when the stream + * changes. For more information on how to write a DVBSUB decoder, + * see the comment at the top of src/demuxers/demux_ts.c + **/ +#define BUF_SPECIAL_SPU_DVB_DESCRIPTOR 9 + +/** + * In a BUF_SPECIAL_RV_CHUNK_TABLE: + * decoder_info[1] = BUF_SPECIAL_RV_CHUNK_TABLE + * decoder_info[2] = number of entries in chunk table + * decoder_info_ptr[2] = pointer to the chunk table + * + * This buffer transports the chunk table associated to each RealVideo frame. + */ +#define BUF_SPECIAL_RV_CHUNK_TABLE 10 +/*@}*/ + +typedef struct spu_dvb_descriptor_s spu_dvb_descriptor_t; +struct spu_dvb_descriptor_s +{ + char lang[4]; + long comp_page_id; + long aux_page_id; +} ; + +typedef struct palette_entry_s palette_entry_t; +struct palette_entry_s +{ + unsigned char r, g, b; +} ; + +typedef struct fifo_buffer_s fifo_buffer_t; +struct fifo_buffer_s +{ + buf_element_t *first, *last; + + int fifo_size; + uint32_t fifo_data_size; + void *fifo_empty_cb_data; + + pthread_mutex_t mutex; + pthread_cond_t not_empty; + + /* + * functions to access this fifo: + */ + + void (*put) (fifo_buffer_t *fifo, buf_element_t *buf); + + buf_element_t *(*get) (fifo_buffer_t *fifo); + + void (*clear) (fifo_buffer_t *fifo) ; + + int (*size) (fifo_buffer_t *fifo); + + int (*num_free) (fifo_buffer_t *fifo); + + uint32_t (*data_size) (fifo_buffer_t *fifo); + + void (*dispose) (fifo_buffer_t *fifo); + + /* + * alloc buffer for this fifo from global buf pool + * you don't have to use this function to allocate a buffer, + * an input plugin can decide to implement it's own + * buffer allocation functions + */ + + buf_element_t *(*buffer_pool_alloc) (fifo_buffer_t *self); + + + /* + * special functions, not used by demuxers + */ + + /* the same as buffer_pool_alloc but may fail if none is available */ + buf_element_t *(*buffer_pool_try_alloc) (fifo_buffer_t *self); + + /* the same as put but insert at the head of the fifo */ + void (*insert) (fifo_buffer_t *fifo, buf_element_t *buf); + + /* callbacks */ + void (*register_alloc_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, void *), void *cb_data); + void (*register_put_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, buf_element_t *buf, void *), void *cb_data); + void (*register_get_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, buf_element_t *buf, void *), void *cb_data); + void (*unregister_alloc_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, void *)); + void (*unregister_put_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, buf_element_t *buf, void *)); + void (*unregister_get_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, buf_element_t *buf, void *)); + + /* + * private variables for buffer pool management + */ + buf_element_t *buffer_pool_top; /* a stack actually */ + pthread_mutex_t buffer_pool_mutex; + pthread_cond_t buffer_pool_cond_not_empty; + int buffer_pool_num_free; + int buffer_pool_capacity; + int buffer_pool_buf_size; + void *buffer_pool_base; /*used to free mem chunk */ + void (*alloc_cb[BUF_MAX_CALLBACKS])(fifo_buffer_t *fifo, void *data_cb); + void (*put_cb[BUF_MAX_CALLBACKS])(fifo_buffer_t *fifo, buf_element_t *buf, void *data_cb); + void (*get_cb[BUF_MAX_CALLBACKS])(fifo_buffer_t *fifo, buf_element_t *buf, void *data_cb); + void *alloc_cb_data[BUF_MAX_CALLBACKS]; + void *put_cb_data[BUF_MAX_CALLBACKS]; + void *get_cb_data[BUF_MAX_CALLBACKS]; +} ; + +/** + * @brief Allocate and initialise new (empty) FIFO buffers. + * @param num_buffer Number of buffers to allocate. + * @param buf_size Size of each buffer. + * @internal Only used by video and audio decoder loops. + */ +fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size); + +/** + * @brief Allocate and initialise new dummy FIFO buffers. + * @param num_buffer Number of dummy buffers to allocate. + * @param buf_size Size of each buffer. + * @internal Only used by video and audio decoder loops. + */ +fifo_buffer_t *_x_dummy_fifo_buffer_new (int num_buffers, uint32_t buf_size); + + +/** + * @brief Returns the \ref buffer_video "BUF_VIDEO_xxx" for the given fourcc. + * @param fourcc_int 32-bit FOURCC value in machine endianness + * @sa _x_formattag_to_buf_audio + * + * example: fourcc_int = *(uint32_t *)fourcc_char; + */ +uint32_t _x_fourcc_to_buf_video( uint32_t fourcc_int ) XINE_PROTECTED; + +/** + * @brief Returns video codec name given the buffer type. + * @param buf_type One of the \ref buffer_video "BUF_VIDEO_xxx" values. + * @sa _x_buf_audio_name + */ +const char *_x_buf_video_name( uint32_t buf_type ) XINE_PROTECTED; + +/** + * @brief Returns the \ref buffer_audio "BUF_AUDIO_xxx" for the given formattag. + * @param formattagg 32-bit format tag value in machine endianness + * @sa _x_fourcc_to_buf_video + */ +uint32_t _x_formattag_to_buf_audio( uint32_t formattag ) XINE_PROTECTED; + +/** + * @brief Returns audio codec name given the buffer type. + * @param buf_type One of the \ref buffer_audio "BUF_AUDIO_xxx" values. + * @sa _x_buf_video_name + */ +const char *_x_buf_audio_name( uint32_t buf_type ) XINE_PROTECTED; + + +/** + * @brief xine version of BITMAPINFOHEADER. + * @note Should be safe to compile on 64bits machines. + * @note Will always use machine endian format, so demuxers reading + * stuff from win32 formats must use the function below. + */ +typedef struct XINE_PACKED { + int32_t biSize; + int32_t biWidth; + int32_t biHeight; + int16_t biPlanes; + int16_t biBitCount; + uint32_t biCompression; + int32_t biSizeImage; + int32_t biXPelsPerMeter; + int32_t biYPelsPerMeter; + int32_t biClrUsed; + int32_t biClrImportant; +} xine_bmiheader; + +/** + * @brief xine version of WAVEFORMATEX. + * @note The same comments from xine_bmiheader applies. + */ +typedef struct XINE_PACKED { + int16_t wFormatTag; + int16_t nChannels; + int32_t nSamplesPerSec; + int32_t nAvgBytesPerSec; + int16_t nBlockAlign; + int16_t wBitsPerSample; + int16_t cbSize; +} xine_waveformatex; + +/** Convert xine_bmiheader struct from little endian */ +void _x_bmiheader_le2me( xine_bmiheader *bih ) XINE_PROTECTED; + +/** Convert xine_waveformatex struct from little endian */ +void _x_waveformatex_le2me( xine_waveformatex *wavex ) XINE_PROTECTED; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/xine/compat.h b/include/xine/compat.h new file mode 100644 index 000000000..d4b95aeb3 --- /dev/null +++ b/include/xine/compat.h @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2000-2001 the xine project + * + * This file is part of xine, a unix video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + */ + +#ifndef XINE_COMPAT_H +#define XINE_COMPAT_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined _MSC_VER +#define __XINE_FUNCTION__ __FILE__ +#elif defined __GNUC__ +#define __XINE_FUNCTION__ __FUNCTION__ +#else +#define __XINE_FUNCTION__ __func__ +#endif + +#ifndef NAME_MAX +#define XINE_NAME_MAX 256 +#else +#define XINE_NAME_MAX NAME_MAX +#endif + +#ifndef PATH_MAX +#define XINE_PATH_MAX 768 +#else +#define XINE_PATH_MAX PATH_MAX +#endif + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/xine/configfile.h b/include/xine/configfile.h new file mode 100644 index 000000000..22a544c00 --- /dev/null +++ b/include/xine/configfile.h @@ -0,0 +1,218 @@ +/* + * Copyright (C) 2000-2004 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * config file management + */ + +#ifndef HAVE_CONFIGFILE_H +#define HAVE_CONFIGFILE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#ifdef XINE_COMPILE +# include "xine.h" +#else +# include +#endif + +#define CONFIG_FILE_VERSION 2 + +/** + * config entries above this experience + * level must never be changed from MRL + */ +#define XINE_CONFIG_SECURITY 30 + + +typedef struct cfg_entry_s cfg_entry_t; +typedef struct config_values_s config_values_t; + +struct cfg_entry_s { + cfg_entry_t *next; + config_values_t *config; + + char *key; + int type; + + /** user experience level */ + int exp_level; + + /** type unknown */ + char *unknown_value; + + /** type string */ + char *str_value; + char *str_default; + + /** common to range, enum, num, bool: */ + int num_value; + int num_default; + + /** type range specific: */ + int range_min; + int range_max; + + /** type enum specific: */ + char **enum_values; + + /** help info for the user */ + char *description; + char *help; + + /** callback function and data for live changeable values */ + xine_config_cb_t callback; + void *callback_data; +}; + +struct config_values_s { + + /* + * register config values + * + * these functions return the current value of the + * registered item, i.e. the default value if it was + * not found in the config file or the current value + * from the config file otherwise + */ + + char* (*register_string) (config_values_t *self, + const char *key, + const char *def_value, + const char *description, + const char *help, + int exp_level, + xine_config_cb_t changed_cb, + void *cb_data); + + char* (*register_filename) (config_values_t *self, + const char *key, + const char *def_value, + int req_type, + const char *description, + const char *help, + int exp_level, + xine_config_cb_t changed_cb, + void *cb_data); + + int (*register_range) (config_values_t *self, + const char *key, + int def_value, + int min, int max, + const char *description, + const char *help, + int exp_level, + xine_config_cb_t changed_cb, + void *cb_data); + + int (*register_enum) (config_values_t *self, + const char *key, + int def_value, + char **values, + const char *description, + const char *help, + int exp_level, + xine_config_cb_t changed_cb, + void *cb_data); + + int (*register_num) (config_values_t *self, + const char *key, + int def_value, + const char *description, + const char *help, + int exp_level, + xine_config_cb_t changed_cb, + void *cb_data); + + int (*register_bool) (config_values_t *self, + const char *key, + int def_value, + const char *description, + const char *help, + int exp_level, + xine_config_cb_t changed_cb, + void *cb_data); + + /** convenience function to update range, enum, num and bool values */ + void (*update_num) (config_values_t *self, const char *key, int value); + + /** convenience function to update string values */ + void (*update_string) (config_values_t *self, const char *key, const char *value); + + /** small utility function for enum handling */ + int (*parse_enum) (const char *str, const char **values); + + /** + * @brief lookup config entries + * + * remember to call the changed_cb if it exists + * and you changed the value of this item + */ + + cfg_entry_t* (*lookup_entry) (config_values_t *self, const char *key); + + /** + * unregister callback function + */ + void (*unregister_callback) (config_values_t *self, const char *key); + + /** + * dispose of all config entries in memory + */ + void (*dispose) (config_values_t *self); + + /* + * config values are stored here: + */ + cfg_entry_t *first, *last, *cur; + + /** + * mutex for modification to the config + */ + pthread_mutex_t config_lock; + + /** + * current config file's version number + */ + int current_version; +}; + +/** + * @brief allocate and init a new xine config object + * @internal + */ +config_values_t *_x_config_init (void); + +/** + * @brief interpret stream_setup part of mrls for config value changes + * @internal + */ + +int _x_config_change_opt(config_values_t *config, const char *opt); + + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/include/xine/demux.h b/include/xine/demux.h new file mode 100644 index 000000000..ee5ca42f0 --- /dev/null +++ b/include/xine/demux.h @@ -0,0 +1,220 @@ +/* + * Copyright (C) 2000-2003 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + */ + +#ifndef HAVE_DEMUX_H +#define HAVE_DEMUX_H + +#ifdef XINE_COMPILE +# include "input/input_plugin.h" +# include "buffer.h" +# include "xine_internal.h" +#else +# include +# include +# include +#endif + +#define DEMUXER_PLUGIN_IFACE_VERSION 27 + +#define DEMUX_OK 0 +#define DEMUX_FINISHED 1 + +#define DEMUX_CANNOT_HANDLE 0 +#define DEMUX_CAN_HANDLE 1 + +#define METHOD_BY_CONTENT 1 +#define METHOD_BY_MRL 2 +#define METHOD_EXPLICIT 3 + +typedef struct demux_class_s demux_class_t ; +typedef struct demux_plugin_s demux_plugin_t; + +struct demux_class_s { + + /* + * open a new instance of this plugin class + */ + demux_plugin_t* (*open_plugin) (demux_class_t *this, xine_stream_t *stream, input_plugin_t *input); + + /** + * @brief short human readable identifier for this plugin class + */ + const char *identifier; + + /** + * @brief human readable (verbose = 1 line) description for this plugin class + * + * The description is passed to gettext() to internationalise. + */ + const char *description; + + /** + * @brief Optional non-standard catalog to use with dgettext() for description. + */ + const char *textdomain; + + /** + * @brief MIME types supported for this plugin + */ + + const char* mimetypes; + + /** + * @brief space separated list of file extensions this demuxer is + * likely to handle + * + * (will be used to filter media files in file selection dialogs) + */ + const char* extensions; + + /* + * close down, free all resources + */ + void (*dispose) (demux_class_t *this); +}; + +#define default_demux_class_dispose (void (*) (demux_class_t *this))free + +/* + * any demux plugin must implement these functions + */ + +struct demux_plugin_s { + + /* + * send headers, followed by BUF_CONTROL_HEADERS_DONE down the + * fifos, then return. do not start demux thread (yet) + */ + + void (*send_headers) (demux_plugin_t *this); + + /* + * ask demux to seek + * + * for seekable streams, a start position can be specified + * + * start_pos : position in input source (0..65535) + * this is defined as most convenient to demuxer, can be + * either time or offset based. + * start_time : position measured in miliseconds from stream start + * playing : true if this is a new seek within an already playing stream + * false if playback of this stream has not started yet + * + * if both parameters are !=0 start_pos will be used + * for non-seekable streams both values will be ignored + * + * returns the demux status (like get_status, but immediately after + * starting the demuxer) + */ + + int (*seek) (demux_plugin_t *this, + off_t start_pos, int start_time, int playing ); + + /* + * send a chunk of data down to decoder fifos + * + * the meaning of "chunk" is specific to every demux, usually + * it involves parsing one unit of data from stream. + * + * this function will be called from demux loop and should return + * the demux current status + */ + + int (*send_chunk) (demux_plugin_t *this); + + /* + * free resources + */ + + void (*dispose) (demux_plugin_t *this) ; + + /* + * returns DEMUX_OK or DEMUX_FINISHED + */ + + int (*get_status) (demux_plugin_t *this) ; + + /* + * gets stream length in miliseconds (might be estimated) + * may return 0 for non-seekable streams + */ + + int (*get_stream_length) (demux_plugin_t *this); + + /* + * return capabilities of demuxed stream + */ + + uint32_t (*get_capabilities) (demux_plugin_t *this); + + /* + * request optional data from input plugin. + */ + int (*get_optional_data) (demux_plugin_t *this, void *data, int data_type); + + /* + * "backwards" link to plugin class + */ + + demux_class_t *demux_class; + + void *node; /* used by plugin loader */ + +} ; + +#define default_demux_plugin_dispose (void (*) (demux_plugin_t *this))free + +/* + * possible capabilites a demux plugin can have: + */ +#define DEMUX_CAP_NOCAP 0x00000000 + +/* + * DEMUX_CAP_AUDIOLANG: + * DEMUX_CAP_SPULANG: + * demux plugin knows something about audio/spu languages, + * e.g. knows that audio stream #0 is english, + * audio stream #1 is german, ... Same bits as INPUT + * capabilities . + */ + +#define DEMUX_CAP_AUDIOLANG 0x00000008 +#define DEMUX_CAP_SPULANG 0x00000010 + +/* + * DEMUX_CAP_CHAPTERS: + * The media streams provided by this plugin have an internal + * structure dividing it into segments usable for navigation. + * For those plugins, the behaviour of the skip button in UIs + * should be changed from "next MRL" to "next chapter" by + * sending XINE_EVENT_INPUT_NEXT. + * Same bits as INPUT capabilities. + */ + +#define DEMUX_CAP_CHAPTERS 0x00000080 + + +#define DEMUX_OPTIONAL_UNSUPPORTED 0 +#define DEMUX_OPTIONAL_SUCCESS 1 + +#define DEMUX_OPTIONAL_DATA_AUDIOLANG 2 +#define DEMUX_OPTIONAL_DATA_SPULANG 3 + +#endif diff --git a/include/xine/info_helper.h b/include/xine/info_helper.h new file mode 100644 index 000000000..d4123ba2b --- /dev/null +++ b/include/xine/info_helper.h @@ -0,0 +1,180 @@ +/* + * Copyright (C) 2000-2003 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * stream metainfo helper functions + * hide some xine engine details from demuxers and reduce code duplication + * + * $id$ + */ + +#ifndef INFO_HELPER_H +#define INFO_HELPER_H + +#include +#include "xine_internal.h" + +/* + * set a stream info + * + * params: + * *stream the xine stream + * info stream info id (see xine.h, XINE_STREAM_INFO_*) + * value the value to assign + * + */ +void _x_stream_info_set(xine_stream_t *stream, int info, int value) XINE_PROTECTED; + +/* + * reset a stream info (internal ones only) + * + * params : + * *stream the xine stream + * info meta info id (see xine.h, XINE_STREAM_INFO_*) + * + */ +void _x_stream_info_reset(xine_stream_t *stream, int info) XINE_PROTECTED; + +/* + * reset a stream info (public ones only) + * + * params : + * *stream the xine stream + * info meta info id (see xine.h, XINE_STREAM_INFO_*) + * + */ +void _x_stream_info_public_reset(xine_stream_t *stream, int info) XINE_PROTECTED; + +/* + * retrieve stream info (internal ones only) + * + * params : + * *stream the xine stream + * info meta info id (see xine.h, XINE_STREAM_INFO_*) + * + */ +uint32_t _x_stream_info_get(xine_stream_t *stream, int info) XINE_PROTECTED; + +/* + * retrieve stream info (public ones only) + * + * params : + * *stream the xine stream + * info meta info id (see xine.h, XINE_STREAM_INFO_*) + * + */ +uint32_t _x_stream_info_get_public(xine_stream_t *stream, int info) XINE_PROTECTED; + +/* + * set a stream meta info + * + * params: + * *stream the xine stream + * info meta info id (see xine.h, XINE_META_INFO_*) + * *str null-terminated string (using current locale) + * + */ +void _x_meta_info_set(xine_stream_t *stream, int info, const char *str) XINE_PROTECTED; + +/* + * set a stream meta info + * + * params: + * *stream the xine stream + * info meta info id (see xine.h, XINE_META_INFO_*) + * *str null-terminated string (using utf8) + * + */ +void _x_meta_info_set_utf8(xine_stream_t *stream, int info, const char *str) XINE_PROTECTED; + +/* + * set a stream meta info + * + * params: + * *stream the xine stream + * info meta info id (see xine.h, XINE_META_INFO_*) + * *str null-terminated string (using encoding below) + * *enc charset encoding of the string + * + */ +void _x_meta_info_set_generic(xine_stream_t *stream, int info, const char *str, const char *enc) XINE_PROTECTED; + +/* + * set a stream meta multiple info + * + * params: + * *stream the xine stream + * info meta info id (see xine.h, XINE_META_INFO_*) + * ... one or more meta info, followed by a NULL pointer + * + */ +void _x_meta_info_set_multi(xine_stream_t *stream, int info, ...) XINE_SENTINEL XINE_PROTECTED; + +/* + * set a stream meta info + * + * params: + * *stream the xine stream + * info meta info id (see xine.h, XINE_META_INFO_*) + * *buf char buffer (not a null-terminated string) + * len length of the metainfo + * + */ +void _x_meta_info_n_set(xine_stream_t *stream, int info, const char *buf, int len) XINE_PROTECTED; + +/* + * reset a stream meta info (internal ones only) + * + * params : + * *stream the xine stream + * info meta info id (see xine.h, XINE_META_INFO_*) + * + */ +void _x_meta_info_reset(xine_stream_t *stream, int info) XINE_PROTECTED; + +/* + * reset a stream meta info (public ones only) + * + * params : + * *stream the xine stream + * info meta info id (see xine.h, XINE_META_INFO_*) + * + */ +void _x_meta_info_public_reset(xine_stream_t *stream, int info) XINE_PROTECTED; + +/* + * retrieve stream meta info (internal ones only) + * + * params : + * *stream the xine stream + * info meta info id (see xine.h, XINE_META_INFO_*) + * + */ +const char *_x_meta_info_get(xine_stream_t *stream, int info) XINE_PROTECTED; + +/* + * retrieve stream meta info (public ones only) + * + * params : + * *stream the xine stream + * info meta info id (see xine.h, XINE_META_INFO_*) + * + */ +const char *_x_meta_info_get_public(xine_stream_t *stream, int info) XINE_PROTECTED; + +#endif /* INFO_HELPER_H */ diff --git a/include/xine/input_plugin.h b/include/xine/input_plugin.h new file mode 100644 index 000000000..2917721c9 --- /dev/null +++ b/include/xine/input_plugin.h @@ -0,0 +1,420 @@ +/* + * Copyright (C) 2000-2004 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + */ + +#ifndef HAVE_INPUT_PLUGIN_H +#define HAVE_INPUT_PLUGIN_H + +#include + +#ifdef XINE_COMPILE +# include +# include "xineutils.h" +# include "buffer.h" +# include "configfile.h" +#else +# include +# include +# include +# include +#endif + +#define INPUT_PLUGIN_IFACE_VERSION 18 + +typedef struct input_class_s input_class_t ; +typedef struct input_plugin_s input_plugin_t; + +struct input_class_s { + + /* + * create a new instance of this plugin class + * return NULL if the plugin does'nt handle the given mrl + */ + input_plugin_t* (*get_instance) (input_class_t *this, xine_stream_t *stream, const char *mrl); + + /** + * @brief short human readable identifier for this plugin class + */ + const char *identifier; + + /** + * @brief human readable (verbose = 1 line) description for this plugin class + * + * The description is passed to gettext() to internationalise. + */ + const char *description; + + /** + * @brief Optional non-standard catalog to use with dgettext() for description. + */ + const char *textdomain; + + /* + * ls function, optional: may be NULL + * return value: NULL => filename is a file, **char=> filename is a dir + */ + xine_mrl_t ** (*get_dir) (input_class_t *this, const char *filename, int *nFiles); + + /* + * generate autoplay list, optional: may be NULL + * return value: list of MRLs + */ + char ** (*get_autoplay_list) (input_class_t *this, int *num_files); + + /* + * close down, free all resources + */ + void (*dispose) (input_class_t *this); + + /* + * eject/load the media (if possible), optional: may be NULL + * + * returns 0 for temporary failures + */ + int (*eject_media) (input_class_t *this); +}; + +#define default_input_class_dispose (void (*) (input_class_t *this))free + +struct input_plugin_s { + + /* + * open the stream + * return 0 if an error occured + */ + int (*open) (input_plugin_t *this); + + /* + * return capabilities of the current playable entity. See + * get_current_pos below for a description of a "playable entity" + * Capabilities a created by "OR"ing a mask of constants listed + * below which start "INPUT_CAP". + * + * depending on the values set, some of the functions below + * will or will not get called or should (not) be able to + * do certain tasks. + * + * for example if INPUT_CAP_SEEKABLE is set, + * the seek() function is expected to work fully at any time. + * however, if the flag is not set, the seek() function should + * make a best-effort attempt to seek, e.g. at least + * relative forward seeking should work. + */ + uint32_t (*get_capabilities) (input_plugin_t *this); + + /* + * read nlen bytes, return number of bytes read + * Should block until some bytes available for read; + * a return value of 0 indicates no data available + */ + off_t (*read) (input_plugin_t *this, void *buf, off_t nlen); + + + /* + * read one block, return newly allocated block (or NULL on failure) + * for blocked input sources len must be == blocksize + * the fifo parameter is only used to get access to the buffer_pool_alloc function + */ + buf_element_t *(*read_block)(input_plugin_t *this, fifo_buffer_t *fifo, off_t len); + + + /* + * seek position, return new position + * + * if seeking failed, -1 is returned + */ + off_t (*seek) (input_plugin_t *this, off_t offset, int origin); + + + /* + * seek to time position, return new position + * time_offset is given in miliseconds + * + * if seeking failed, -1 is returned + * + * note: only SEEK_SET (0) is currently supported as origin + * note: may be NULL is not supported + */ + off_t (*seek_time) (input_plugin_t *this, int time_offset, int origin); + + + /* + * get current position in stream. + * + */ + off_t (*get_current_pos) (input_plugin_t *this); + + + /* + * get current time position in stream in miliseconds. + * + * note: may be NULL is not supported + */ + int (*get_current_time) (input_plugin_t *this); + + + /* + * return number of bytes in the next playable entity or -1 if the + * input is unlimited, as would be the case in a network stream. + * + * A "playable entity" tends to be the entities listed in a playback + * list or the units on which playback control generally works on. + * It might be the number of bytes in a VCD "segment" or "track" (if + * the track has no "entry" subdivisions), or the number of bytes in + * a PS (Program Segment or "Chapter") of a DVD. If there are no + * subdivisions of the input medium and it is considered one + * indivisible entity, it would be the byte count of that entity; + * for example, the length in bytes of an MPEG file. + + * This length information is used, for example when in setting the + * absolute or relative play position or possibly calculating the + * bit rate. + */ + off_t (*get_length) (input_plugin_t *this); + + + /* + * return block size in bytes of next complete playable entity (if + * supported, 0 otherwise). See the description above under + * get_length for a description of a "complete playable entity". + * + * this block size is only used for mpeg streams stored on + * a block oriented storage media, e.g. DVDs and VCDs, to speed + * up the demuxing process. only set this (and the INPUT_CAP_BLOCK + * flag) if this is the case for your input plugin. + * + * make this function simply return 0 if unsure. + */ + + uint32_t (*get_blocksize) (input_plugin_t *this); + + + /* + * return current MRL + */ + const char * (*get_mrl) (input_plugin_t *this); + + + /* + * request optional data from input plugin. + */ + int (*get_optional_data) (input_plugin_t *this, void *data, int data_type); + + + /* + * close stream, free instance resources + */ + void (*dispose) (input_plugin_t *this); + + /* + * "backward" link to input plugin class struct + */ + + input_class_t *input_class; + + void *node; /* used by plugin loader */ + +}; + +/* + * possible capabilites an input plugin can have: + */ +#define INPUT_CAP_NOCAP 0x00000000 + +/* + * INPUT_CAP_SEEKABLE: + * seek () works reliably. + * even for plugins that do not have this flag set + * it is a good idea to implement the seek() function + * in a "best effort" style anyway, so at least + * throw away data for network streams when seeking forward + */ + +#define INPUT_CAP_SEEKABLE 0x00000001 + +/* + * INPUT_CAP_BLOCK: + * means more or less that a block device sits behind + * this input plugin. get_blocksize must be implemented. + * will be used for fast and efficient demuxing of + * mpeg streams (demux_mpeg_block). + */ + +#define INPUT_CAP_BLOCK 0x00000002 + +/* + * INPUT_CAP_AUDIOLANG: + * INPUT_CAP_SPULANG: + * input plugin knows something about audio/spu languages, + * e.g. knows that audio stream #0 is english, + * audio stream #1 is german, ... + * *((int *)data) will provide the requested channel number + * and awaits the language back in (char *)data + */ + +#define INPUT_CAP_AUDIOLANG 0x00000008 +#define INPUT_CAP_SPULANG 0x00000010 + +/* + * INPUT_CAP_PREVIEW: + * get_optional_data can handle INPUT_OPTIONAL_DATA_PREVIEW + * so a non-seekable stream plugin can povide the first + * few bytes for demuxers to look at them and decide wheter + * they can handle the stream or not. the preview data must + * be buffered and delivered again through subsequent + * read() calls. + * caller must provide a buffer allocated with at least + * MAX_PREVIEW_SIZE bytes. + */ + +#define INPUT_CAP_PREVIEW 0x00000040 + +/* + * INPUT_CAP_CHAPTERS: + * The media streams provided by this plugin have an internal + * structure dividing it into segments usable for navigation. + * For those plugins, the behaviour of the skip button in UIs + * should be changed from "next MRL" to "next chapter" by + * sending XINE_EVENT_INPUT_NEXT. + */ + +#define INPUT_CAP_CHAPTERS 0x00000080 + +/* + * INPUT_CAP_RIP_FORBIDDEN: + * means that rip/disk saving must not be used. + * (probably at author's request) + */ + +#define INPUT_CAP_RIP_FORBIDDEN 0x00000100 + + +#define INPUT_IS_SEEKABLE(input) (((input)->get_capabilities(input) & INPUT_CAP_SEEKABLE) != 0) + +#define INPUT_OPTIONAL_UNSUPPORTED 0 +#define INPUT_OPTIONAL_SUCCESS 1 + +#define INPUT_OPTIONAL_DATA_AUDIOLANG 2 +#define INPUT_OPTIONAL_DATA_SPULANG 3 +#define INPUT_OPTIONAL_DATA_PREVIEW 7 + +#define MAX_MRL_ENTRIES 255 +#define MAX_PREVIEW_SIZE 4096 + +/* Types of mrls returned by get_dir() */ +#define mrl_unknown (0 << 0) +#define mrl_dvd (1 << 0) +#define mrl_vcd (1 << 1) +#define mrl_net (1 << 2) +#define mrl_rtp (1 << 3) +#define mrl_stdin (1 << 4) +#define mrl_cda (1 << 5) +#define mrl_file (1 << 6) +#define mrl_file_fifo (1 << 7) +#define mrl_file_chardev (1 << 8) +#define mrl_file_directory (1 << 9) +#define mrl_file_blockdev (1 << 10) +#define mrl_file_normal (1 << 11) +#define mrl_file_symlink (1 << 12) +#define mrl_file_sock (1 << 13) +#define mrl_file_exec (1 << 14) +#define mrl_file_backup (1 << 15) +#define mrl_file_hidden (1 << 16) + +/* + * Freeing/zeroing all of entries of given mrl. + */ +#define MRL_ZERO(m) { \ + if((m)) { \ + if((m)->origin) \ + free((m)->origin); \ + if((m)->mrl) \ + free((m)->mrl); \ + if((m)->link) \ + free((m)->link); \ + (m)->origin = NULL; \ + (m)->mrl = NULL; \ + (m)->link = NULL; \ + (m)->type = 0; \ + (m)->size = (off_t) 0; \ + } \ +} + +/* + * Duplicate two mrls entries (s = source, d = destination). + */ +#define MRL_DUPLICATE(s, d) { \ + _x_assert((s) != NULL); \ + _x_assert((d) != NULL); \ + \ + if((s)->origin) { \ + if((d)->origin) { \ + (d)->origin = (char *) realloc((d)->origin, strlen((s)->origin) + 1); \ + sprintf((d)->origin, "%s", (s)->origin); \ + } \ + else \ + (d)->origin = strdup((s)->origin); \ + } \ + else \ + (d)->origin = NULL; \ + \ + if((s)->mrl) { \ + if((d)->mrl) { \ + (d)->mrl = (char *) realloc((d)->mrl, strlen((s)->mrl) + 1); \ + sprintf((d)->mrl, "%s", (s)->mrl); \ + } \ + else \ + (d)->mrl = strdup((s)->mrl); \ + } \ + else \ + (d)->mrl = NULL; \ + \ + if((s)->link) { \ + if((d)->link) { \ + (d)->link = (char *) realloc((d)->link, strlen((s)->link) + 1); \ + sprintf((d)->link, "%s", (s)->link); \ + } \ + else \ + (d)->link = strdup((s)->link); \ + } \ + else \ + (d)->link = NULL; \ + \ + (d)->type = (s)->type; \ + (d)->size = (s)->size; \ +} + +/* + * Duplicate two arrays of mrls (s = source, d = destination). + */ +#define MRLS_DUPLICATE(s, d) { \ + int i = 0; \ + \ + _x_assert((s) != NULL); \ + _x_assert((d) != NULL); \ + \ + while((s) != NULL) { \ + d[i] = (xine_mrl_t *) malloc(sizeof(xine_mrl_t)); \ + MRL_DUPLICATE(s[i], d[i]); \ + i++; \ + } \ +} + + +#endif diff --git a/include/xine/io_helper.h b/include/xine/io_helper.h new file mode 100644 index 000000000..0aac8fcfc --- /dev/null +++ b/include/xine/io_helper.h @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2000-2003 the xine project, + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * abortable i/o helper functions + */ + +#ifndef IO_HELPER_H +#define IO_HELPER_H + +#include "xine_internal.h" + + +/* select states */ +#define XIO_READ_READY 1 +#define XIO_WRITE_READY 2 + +/* xine select return codes */ +#define XIO_READY 0 +#define XIO_ERROR 1 +#define XIO_ABORTED 2 +#define XIO_TIMEOUT 3 + + +/* + * Waits for a file descriptor/socket to change status. + * + * network input plugins should use this function in order to + * not freeze the engine. + * + * params : + * stream needed for aborting and reporting errors but may be NULL + * fd file/socket descriptor + * state XIO_READ_READY, XIO_WRITE_READY + * timeout_sec timeout in seconds + * + * An other thread can abort this function if stream != NULL by setting + * stream->demux_action_pending. + * + * return value : + * XIO_READY the file descriptor is ready for cmd + * XIO_ERROR an i/o error occured + * XIO_ABORTED command aborted by an other thread + * XIO_TIMEOUT the file descriptor is not ready after timeout_msec milliseconds + */ +int _x_io_select (xine_stream_t *stream, int fd, int state, int timeout_msec) XINE_PROTECTED; + + +/* + * open a tcp connection + * + * params : + * stream needed for reporting errors but may be NULL + * host address of target + * port port on target + * + * returns a socket descriptor or -1 if an error occured + */ +int _x_io_tcp_connect(xine_stream_t *stream, const char *host, int port) XINE_PROTECTED; + +/* + * wait for finish connection + * + * params : + * stream needed for aborting and reporting errors but may be NULL + * fd socket descriptor + * timeout_msec timeout in milliseconds + * + * return value: + * XIO_READY host respond, the socket is ready for cmd + * XIO_ERROR an i/o error occured + * XIO_ABORTED command aborted by an other thread + * XIO_TIMEOUT the file descriptor is not ready after timeout + */ +int _x_io_tcp_connect_finish(xine_stream_t *stream, int fd, int timeout_msec) XINE_PROTECTED; + +/* + * read from tcp socket checking demux_action_pending + * + * network input plugins should use this function in order to + * not freeze the engine. + * + * aborts with zero if no data is available and *abort is set + */ +off_t _x_io_tcp_read (xine_stream_t *stream, int s, void *buf, off_t todo) XINE_PROTECTED; + + +/* + * write to a tcp socket checking demux_action_pending + * + * network input plugins should use this function in order to + * not freeze the engine. + * + * aborts with zero if no data is available and *abort is set + */ +off_t _x_io_tcp_write (xine_stream_t *stream, int s, void *buf, off_t todo) XINE_PROTECTED; + +/* + * read from a file descriptor checking demux_action_pending + * + * the fifo input plugin should use this function in order to + * not freeze the engine. + * + * aborts with zero if no data is available and *abort is set + */ +off_t _x_io_file_read (xine_stream_t *stream, int fd, void *buf, off_t todo) XINE_PROTECTED; + + +/* + * write to a file descriptor checking demux_action_pending + * + * the fifo input plugin should use this function in order to + * not freeze the engine. + * + * aborts with zero if *abort is set + */ +off_t _x_io_file_write (xine_stream_t *stream, int fd, void *buf, off_t todo) XINE_PROTECTED; + +/* + * read a string from socket, return string length (same as strlen) + * the string is always '\0' terminated but given buffer size is never exceeded + * that is, _x_io_tcp_read_line(,,,X) <= (X-1) ; X > 0 + */ +int _x_io_tcp_read_line(xine_stream_t *stream, int sock, char *str, int size) XINE_PROTECTED; + +#endif diff --git a/include/xine/list.h b/include/xine/list.h new file mode 100644 index 000000000..e00e30d6c --- /dev/null +++ b/include/xine/list.h @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2000-2006 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * Doubly-linked linked list. + * + * Exemples: + * + * Create a list: + * xine_list_t *list = xine_list_new(); + * + * Delete a list: + * xine_list_delete(list); + * + * Walk thru a list: + * xine_list_iterator_t ite = xine_list_front(list); + * while (ite) { + * _useful code here_ + * ite = xine_list_next(list, ite); + * } + * + * The list elements are managed using memory chunks and a free list. The first + * chunk contains 32 elements, each following chunk is two time as big as the + * previous one, with a limit of 64K elements. + */ +#ifndef XINE_LIST_H +#define XINE_LIST_H + +/* Doubly-linked list type */ +typedef struct xine_list_s xine_list_t; + +/* List iterator */ +typedef void* xine_list_iterator_t; + +/* Constructor */ +xine_list_t *xine_list_new(void) XINE_PROTECTED; + +/* Destructor */ +void xine_list_delete(xine_list_t *list) XINE_PROTECTED; + +/* Returns the number of element stored in the list */ +unsigned int xine_list_size(xine_list_t *list) XINE_PROTECTED; + +/* Returns true if the number of elements is zero, false otherwise */ +unsigned int xine_list_empty(xine_list_t *list) XINE_PROTECTED; + +/* Adds the element at the beginning of the list */ +void xine_list_push_front(xine_list_t *list, void *value) XINE_PROTECTED; + +/* Adds the element at the end of the list */ +void xine_list_push_back(xine_list_t *list, void *value) XINE_PROTECTED; + +/* Remove all elements from a list */ +void xine_list_clear(xine_list_t *list) XINE_PROTECTED; + +/* Insert the element elem into the list at the position specified by the + iterator (before the element, if any, that was previously at the iterator's + position). The return value is an iterator that specifies the position of + the inserted element. */ +xine_list_iterator_t xine_list_insert(xine_list_t *list, + xine_list_iterator_t position, + void *value) XINE_PROTECTED; + +/* Remove one element from a list.*/ +void xine_list_remove(xine_list_t *list, xine_list_iterator_t position) XINE_PROTECTED; + +/* Returns an iterator that references the first element of the list */ +xine_list_iterator_t xine_list_front(xine_list_t *list) XINE_PROTECTED; + +/* Returns an iterator that references the last element of the list */ +xine_list_iterator_t xine_list_back(xine_list_t *list) XINE_PROTECTED; + +/* Perform a linear search of a given value, and returns an iterator that + references this value or NULL if not found */ +xine_list_iterator_t xine_list_find(xine_list_t *list, void *value) XINE_PROTECTED; + +/* Increments the iterator's value, so it specifies the next element in the list + or NULL at the end of the list */ +xine_list_iterator_t xine_list_next(xine_list_t *list, xine_list_iterator_t ite) XINE_PROTECTED; + +/* Increments the iterator's value, so it specifies the previous element in the list + or NULL at the beginning of the list */ +xine_list_iterator_t xine_list_prev(xine_list_t *list, xine_list_iterator_t ite) XINE_PROTECTED; + +/* Returns the value at the position specified by the iterator */ +void *xine_list_get_value(xine_list_t *list, xine_list_iterator_t ite) XINE_PROTECTED; + +#endif + diff --git a/include/xine/metronom.h b/include/xine/metronom.h new file mode 100644 index 000000000..77919f16e --- /dev/null +++ b/include/xine/metronom.h @@ -0,0 +1,364 @@ +/* + * Copyright (C) 2000-2004 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * metronom: general pts => virtual calculation/assoc + * + * virtual pts: unit 1/90000 sec, always increasing + * can be used for synchronization + * video/audio frame with same pts also have same vpts + * but pts is likely to differ from vpts + * + * the basic idea is: + * video_pts + video_wrap_offset = video_vpts + * audio_pts + audio_wrap_offset = audio_vpts + * + * - video_wrap_offset should be equal to audio_wrap_offset as to have + * perfect audio and video sync. They will differ on brief periods due + * discontinuity correction. + * - metronom should also interpolate vpts values most of the time as + * video_pts and audio_vpts are not given for every frame. + * - corrections to the frame rate may be needed to cope with bad + * encoded streams. + */ + +#ifndef HAVE_METRONOM_H +#define HAVE_METRONOM_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#ifdef XINE_COMPILE +# include "video_out.h" +# include "xine.h" +#else +# include +# include +#endif + +typedef struct metronom_s metronom_t ; +typedef struct metronom_clock_s metronom_clock_t; +typedef struct scr_plugin_s scr_plugin_t; + +/* metronom prebuffer can be adjusted with XINE_PARAM_METRONOM_PREBUFFER. + * it sets how much the first video/audio frame should be delayed to + * have some prebuffering at the output layers. reducing this value (about + * 1/8 sec) may result in faster seeking (good to simulate play backwards, + * for example). + */ +#define PREBUFFER_PTS_OFFSET 12000 + + /* see below */ +#define DISC_STREAMSTART 0 +#define DISC_RELATIVE 1 +#define DISC_ABSOLUTE 2 +#define DISC_STREAMSEEK 3 + +struct metronom_s { + + /* + * called by audio output driver to inform metronom about current audio + * samplerate + * + * parameter pts_per_smpls : 1/90000 sec per 65536 samples + */ + void (*set_audio_rate) (metronom_t *self, int64_t pts_per_smpls); + + /* + * called by video output driver for *every* frame + * + * parameter frame containing pts, scr, ... information + * + * will set vpts field in frame + * + * this function will also update video_wrap_offset if a discontinuity + * is detected (read the comentaries below about discontinuities). + * + */ + + void (*got_video_frame) (metronom_t *self, vo_frame_t *frame); + + /* + * called by audio output driver whenever audio samples are delivered to it + * + * parameter pts : pts for audio data if known, 0 otherwise + * nsamples : number of samples delivered + * + * return value: virtual pts for audio data + * + * this function will also update audio_wrap_offset if a discontinuity + * is detected (read the comentaries below about discontinuities). + * + */ + + int64_t (*got_audio_samples) (metronom_t *self, int64_t pts, + int nsamples); + + /* + * called by SPU decoder whenever a packet is delivered to it + * + * parameter pts : pts for SPU packet if known, 0 otherwise + * + * return value: virtual pts for SPU packet + * (this is the only pts to vpts function that cannot update the wrap_offset + * due to the lack of regularity on spu packets) + */ + + int64_t (*got_spu_packet) (metronom_t *self, int64_t pts); + + /* + * tell metronom about discontinuities. + * + * these functions are called due to a discontinuity detected at + * demux stage. + * + * there are different types of discontinuities: + * + * DISC_STREAMSTART : new stream starts, expect pts values to start + * from zero immediately + * DISC_RELATIVE : typically a wrap-around, expect pts with + * a specified offset from the former ones soon + * DISC_ABSOLUTE : typically a new menu stream (nav packets) + * pts will start from given value soon + * DISC_STREAMSEEK : used by video and audio decoder loop, + * when a buffer with BUF_FLAG_SEEK set is encountered; + * applies the necessary vpts offset for the seek in + * metronom, but keeps the vpts difference between + * audio and video, so that metronom doesn't cough + */ + void (*handle_audio_discontinuity) (metronom_t *self, int type, int64_t disc_off); + void (*handle_video_discontinuity) (metronom_t *self, int type, int64_t disc_off); + + /* + * set/get options for metronom, constants see below + */ + void (*set_option) (metronom_t *self, int option, int64_t value); + int64_t (*get_option) (metronom_t *self, int option); + + /* + * set a master metronom + * this is currently useful to sync independently generated streams + * (e.g. by post plugins) to the discontinuity domain of another + * metronom + */ + void (*set_master) (metronom_t *self, metronom_t *master); + + void (*exit) (metronom_t *self); + +#ifdef METRONOM_INTERNAL + /* + * metronom internal stuff + */ + xine_t *xine; + + metronom_t *master; + + int64_t pts_per_smpls; + + int64_t video_vpts; + int64_t spu_vpts; + int64_t audio_vpts; + int64_t audio_vpts_rmndr; /* the remainder for integer division */ + + int64_t vpts_offset; + + int64_t video_drift; + int64_t video_drift_step; + + int audio_samples; + int64_t audio_drift_step; + + int64_t prebuffer; + int64_t av_offset; + int64_t spu_offset; + + pthread_mutex_t lock; + + int have_video; + int have_audio; + int video_discontinuity_count; + int audio_discontinuity_count; + int discontinuity_handled_count; + pthread_cond_t video_discontinuity_reached; + pthread_cond_t audio_discontinuity_reached; + + int force_video_jump; + int force_audio_jump; + + int64_t img_duration; + int img_cpt; + int64_t last_video_pts; + int64_t last_audio_pts; + + int video_mode; +#endif +}; + +/* + * metronom options + */ + +#define METRONOM_AV_OFFSET 2 +#define METRONOM_ADJ_VPTS_OFFSET 3 +#define METRONOM_FRAME_DURATION 4 +#define METRONOM_SPU_OFFSET 5 +#define METRONOM_VPTS_OFFSET 6 +#define METRONOM_PREBUFFER 7 + +metronom_t *_x_metronom_init (int have_video, int have_audio, xine_t *xine) XINE_PROTECTED; + +/* FIXME: reorder this structure on the next cleanup to remove the dummies */ +struct metronom_clock_s { + + /* + * set/get options for clock, constants see below + */ + void (*set_option) (metronom_clock_t *self, int option, int64_t value); + int64_t (*get_option) (metronom_clock_t *self, int option); + + /* + * system clock reference (SCR) functions + */ + +#ifdef METRONOM_CLOCK_INTERNAL + /* + * start clock (no clock reset) + * at given pts + */ + void (*start_clock) (metronom_clock_t *self, int64_t pts); + + + /* + * stop metronom clock + */ + void (*stop_clock) (metronom_clock_t *self); + + + /* + * resume clock from where it was stopped + */ + void (*resume_clock) (metronom_clock_t *self); +#else + void *dummy1; + void *dummy2; + void *dummy3; +#endif + + + /* + * get current clock value in vpts + */ + int64_t (*get_current_time) (metronom_clock_t *self); + + + /* + * adjust master clock to external timer (e.g. audio hardware) + */ + void (*adjust_clock) (metronom_clock_t *self, int64_t desired_pts); + +#ifdef METRONOM_CLOCK_INTERNAL + /* + * set clock speed + * for constants see xine_internal.h + */ + + int (*set_fine_speed) (metronom_clock_t *self, int speed); +#else + void *dummy4; +#endif + + /* + * (un)register a System Clock Reference provider at the metronom + */ + int (*register_scr) (metronom_clock_t *self, scr_plugin_t *scr); + void (*unregister_scr) (metronom_clock_t *self, scr_plugin_t *scr); + +#ifdef METRONOM_CLOCK_INTERNAL + void (*exit) (metronom_clock_t *self); + + xine_t *xine; + + scr_plugin_t *scr_master; + scr_plugin_t **scr_list; + pthread_t sync_thread; + int thread_running; + int scr_adjustable; +#else + void *dummy5; + void *dummy6; + void *dummy7; + void *dummy8; + pthread_t dummy9; + int dummy10; + int dummy11; +#endif + + int speed; + +#ifdef METRONOM_CLOCK_INTERNAL + pthread_mutex_t lock; + pthread_cond_t cancel; +#endif +}; + +metronom_clock_t *_x_metronom_clock_init(xine_t *xine) XINE_PROTECTED; + +/* + * clock options + */ + +#define CLOCK_SCR_ADJUSTABLE 1 + +/* + * SCR (system clock reference) plugins + */ + +struct scr_plugin_s +{ + int (*get_priority) (scr_plugin_t *self); + + /* + * set/get clock speed + * + * for speed constants see xine_internal.h + * returns actual speed + */ + + int (*set_fine_speed) (scr_plugin_t *self, int speed); + + void (*adjust) (scr_plugin_t *self, int64_t vpts); + + void (*start) (scr_plugin_t *self, int64_t start_vpts); + + int64_t (*get_current) (scr_plugin_t *self); + + void (*exit) (scr_plugin_t *self); + + metronom_clock_t *clock; + + int interface_version; +}; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/xine/osd.h b/include/xine/osd.h new file mode 100644 index 000000000..7b04c0a17 --- /dev/null +++ b/include/xine/osd.h @@ -0,0 +1,365 @@ +/* + * Copyright (C) 2000-2003 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * OSD stuff (text and graphic primitives) + */ + +#ifndef HAVE_OSD_H +#define HAVE_OSD_H + +#ifdef HAVE_ICONV +# include +#endif + +#ifdef XINE_COMPILE +# include "video_overlay.h" +# ifdef __OSD_C__ +# include "alphablend.h" +# endif +#else +# include +#endif + +typedef struct osd_object_s osd_object_t; +typedef struct osd_renderer_s osd_renderer_t; +typedef struct osd_font_s osd_font_t; +typedef struct osd_ft2context_s osd_ft2context_t; + +struct osd_object_s { + osd_object_t *next; + osd_renderer_t *renderer; + + int width, height; /* work area dimentions */ + uint8_t *area; /* work area */ + int display_x,display_y; /* where to display it in screen */ + + /* clipping box inside work area */ + int x1, y1; + int x2, y2; + + uint32_t color[OVL_PALETTE_SIZE]; /* color lookup table */ + uint8_t trans[OVL_PALETTE_SIZE]; /* mixer key table */ + +#ifdef HAVE_ICONV + iconv_t cd; /* iconv handle of encoding */ + char *encoding; /* name of encoding */ +#endif + + osd_font_t *font; + osd_ft2context_t *ft2; + + int32_t handle; +}; + +/* this one is public */ +struct xine_osd_s { + osd_object_t osd; +}; + +struct osd_renderer_s { + + xine_stream_t *stream; + + /* + * open a new osd object. this will allocated an empty (all zero) drawing + * area where graphic primitives may be used. + * It is ok to specify big width and height values. The render will keep + * track of the smallest changed area to not generate too big overlays. + * A default palette is initialized (i sugest keeping color 0 as transparent + * for the sake of simplicity) + */ + osd_object_t* (*new_object) (osd_renderer_t *this, int width, int height); + + /* + * free osd object + */ + void (*free_object) (osd_object_t *osd_to_close); + + + /* + * send the osd to be displayed at given pts (0=now) + * the object is not changed. there may be subsequent drawing on it. + */ + int (*show) (osd_object_t *osd, int64_t vpts ); + + /* + * send event to hide osd at given pts (0=now) + * the object is not changed. there may be subsequent drawing on it. + */ + int (*hide) (osd_object_t *osd, int64_t vpts ); + + /* + * draw point. + */ + void (*point) (osd_object_t *osd, int x, int y, int color); + + /* + * Bresenham line implementation on osd object + */ + void (*line) (osd_object_t *osd, + int x1, int y1, int x2, int y2, int color ); + + /* + * filled rectangle + */ + void (*filled_rect) (osd_object_t *osd, + int x1, int y1, int x2, int y2, int color ); + + /* + * set palette (color and transparency) + */ + void (*set_palette) (osd_object_t *osd, const uint32_t *color, const uint8_t *trans ); + + /* + * set on existing text palette + * (-1 to set used specified palette) + * + * color_base specifies the first color index to use for this text + * palette. The OSD palette is then modified starting at this + * color index, up to the size of the text palette. + * + * Use OSD_TEXT1, OSD_TEXT2, ... for some preasssigned color indices. + */ + void (*set_text_palette) (osd_object_t *osd, int palette_number, + int color_base ); + + /* + * get palette (color and transparency) + */ + void (*get_palette) (osd_object_t *osd, uint32_t *color, + uint8_t *trans); + + /* + * set position were overlay will be blended + */ + void (*set_position) (osd_object_t *osd, int x, int y); + + /* + * set the font of osd object + */ + + int (*set_font) (osd_object_t *osd, const char *fontname, int size); + + /* + * set encoding of text + * + * NULL ... no conversion (iso-8859-1) + * "" ... locale encoding + */ + int (*set_encoding) (osd_object_t *osd, const char *encoding); + + /* + * render text in current encoding on x,y position + * no \n yet + * + * The text is assigned the colors starting at the index specified by + * color_base up to the size of the text palette. + * + * Use OSD_TEXT1, OSD_TEXT2, ... for some preasssigned color indices. + */ + int (*render_text) (osd_object_t *osd, int x1, int y1, + const char *text, int color_base); + + /* + * get width and height of how text will be renderized + */ + int (*get_text_size) (osd_object_t *osd, const char *text, + int *width, int *height); + + /* + * close osd rendering engine + * loaded fonts are unloaded + * osd objects are closed + */ + void (*close) (osd_renderer_t *this); + + /* + * clear an osd object (empty drawing area) + */ + void (*clear) (osd_object_t *osd ); + + /* + * paste a bitmap with optional palette mapping + */ + void (*draw_bitmap) (osd_object_t *osd, uint8_t *bitmap, + int x1, int y1, int width, int height, + uint8_t *palette_map); + + /* + * send the osd to be displayed (unscaled) at given pts (0=now) + * the object is not changed. there may be subsequent drawing on it. + * overlay is blended at output (screen) resolution. + */ + int (*show_unscaled) (osd_object_t *osd, int64_t vpts ); + + /* + * see xine.h for defined XINE_OSD_CAP_ values. + */ + uint32_t (*get_capabilities) (osd_object_t *osd); + + /* private stuff */ + + pthread_mutex_t osd_mutex; + video_overlay_event_t event; + osd_object_t *osds; /* instances of osd */ + osd_font_t *fonts; /* loaded fonts */ + int textpalette; /* default textpalette */ + +}; + +/* + * initialize the osd rendering engine + */ +osd_renderer_t *_x_osd_renderer_init( xine_stream_t *stream ); + + +/* + * The size of a text palette + */ + +#define TEXT_PALETTE_SIZE 11 + +/* + * Preassigned color indices for rendering text + * (more can be added, not exceeding OVL_PALETTE_SIZE) + */ + +#define OSD_TEXT1 (0 * TEXT_PALETTE_SIZE) +#define OSD_TEXT2 (1 * TEXT_PALETTE_SIZE) +#define OSD_TEXT3 (2 * TEXT_PALETTE_SIZE) +#define OSD_TEXT4 (3 * TEXT_PALETTE_SIZE) +#define OSD_TEXT5 (4 * TEXT_PALETTE_SIZE) +#define OSD_TEXT6 (5 * TEXT_PALETTE_SIZE) +#define OSD_TEXT7 (6 * TEXT_PALETTE_SIZE) +#define OSD_TEXT8 (7 * TEXT_PALETTE_SIZE) +#define OSD_TEXT9 (8 * TEXT_PALETTE_SIZE) +#define OSD_TEXT10 (9 * TEXT_PALETTE_SIZE) + +/* + * Defined palettes for rendering osd text + * (more can be added later) + */ + +#define NUMBER_OF_TEXT_PALETTES 4 +#define TEXTPALETTE_WHITE_BLACK_TRANSPARENT 0 +#define TEXTPALETTE_WHITE_NONE_TRANSPARENT 1 +#define TEXTPALETTE_WHITE_NONE_TRANSLUCID 2 +#define TEXTPALETTE_YELLOW_BLACK_TRANSPARENT 3 + +#ifdef __OSD_C__ + +/* This text descriptions are used for config screen */ +static const char *textpalettes_str[NUMBER_OF_TEXT_PALETTES+1] = { + "white-black-transparent", + "white-none-transparent", + "white-none-translucid", + "yellow-black-transparent", + NULL}; + + +/* + Palette entries as used by osd fonts: + + 0: not used by font, always transparent + 1: font background, usually transparent, may be used to implement + translucid boxes where the font will be printed. + 2-5: transition between background and border (usually only alpha + value changes). + 6: font border. if the font is to be displayed without border this + will probably be adjusted to font background or near. + 7-9: transition between border and foreground + 10: font color (foreground) +*/ + +/* + The palettes below were made by hand, ie, i just throw + values that seemed to do the transitions i wanted. + This can surelly be improved a lot. [Miguel] +*/ + +static const clut_t textpalettes_color[NUMBER_OF_TEXT_PALETTES][TEXT_PALETTE_SIZE] = { +/* white, black border, transparent */ + { + CLUT_Y_CR_CB_INIT(0x00, 0x00, 0x00), /*0*/ + CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*1*/ + CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*2*/ + CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*3*/ + CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*4*/ + CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*5*/ + CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*6*/ + CLUT_Y_CR_CB_INIT(0x40, 0x80, 0x80), /*7*/ + CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*8*/ + CLUT_Y_CR_CB_INIT(0xc0, 0x80, 0x80), /*9*/ + CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*10*/ + }, + /* white, no border, transparent */ + { + CLUT_Y_CR_CB_INIT(0x00, 0x00, 0x00), /*0*/ + CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*1*/ + CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*2*/ + CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*3*/ + CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*4*/ + CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*5*/ + CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*6*/ + CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*7*/ + CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*8*/ + CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*9*/ + CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*10*/ + }, + /* white, no border, translucid */ + { + CLUT_Y_CR_CB_INIT(0x00, 0x00, 0x00), /*0*/ + CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*1*/ + CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*2*/ + CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*3*/ + CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*4*/ + CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*5*/ + CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*6*/ + CLUT_Y_CR_CB_INIT(0xa0, 0x80, 0x80), /*7*/ + CLUT_Y_CR_CB_INIT(0xc0, 0x80, 0x80), /*8*/ + CLUT_Y_CR_CB_INIT(0xe0, 0x80, 0x80), /*9*/ + CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*10*/ + }, + /* yellow, black border, transparent */ + { + CLUT_Y_CR_CB_INIT(0x00, 0x00, 0x00), /*0*/ + CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*1*/ + CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*2*/ + CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*3*/ + CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*4*/ + CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*5*/ + CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*6*/ + CLUT_Y_CR_CB_INIT(0x40, 0x84, 0x60), /*7*/ + CLUT_Y_CR_CB_INIT(0x70, 0x88, 0x40), /*8*/ + CLUT_Y_CR_CB_INIT(0xb0, 0x8a, 0x20), /*9*/ + CLUT_Y_CR_CB_INIT(0xff, 0x90, 0x00), /*10*/ + }, +}; + +static const uint8_t textpalettes_trans[NUMBER_OF_TEXT_PALETTES][TEXT_PALETTE_SIZE] = { + {0, 0, 3, 6, 8, 10, 12, 14, 15, 15, 15 }, + {0, 0, 0, 0, 0, 0, 2, 6, 9, 12, 15 }, + {0, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15 }, + {0, 0, 3, 6, 8, 10, 12, 14, 15, 15, 15 }, +}; + +#endif /* __OSD_C__ */ + +#endif + diff --git a/include/xine/plugin_catalog.h b/include/xine/plugin_catalog.h new file mode 100644 index 000000000..fd9afb959 --- /dev/null +++ b/include/xine/plugin_catalog.h @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2000-2003 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * xine-internal header: Definitions for plugin lists + */ + +#ifndef _PLUGIN_CATALOG_H +#define _PLUGIN_CATALOG_H + +#ifdef XINE_COMPILE +# include "xine_plugin.h" +# include "xineutils.h" +#else +# include +# include +#endif + +#define DECODER_MAX 128 +#define PLUGIN_MAX 256 + +/* the engine takes this many plugins for one stream type */ +#define PLUGINS_PER_TYPE 10 + +typedef struct { + char *filename; + off_t filesize; + time_t filemtime; + void *lib_handle; + int ref; /* count number of classes */ + int no_unload; /* set if the file can't be unloaded */ +} plugin_file_t ; + +typedef struct { + plugin_file_t *file; + plugin_info_t *info; + void *plugin_class; + int ref; /* count intances of plugins */ + int priority; +} plugin_node_t ; + +struct plugin_catalog_s { + xine_sarray_t *plugin_lists[PLUGIN_TYPE_MAX]; + + xine_sarray_t *cache_list; + xine_list_t *file_list; + + plugin_node_t *audio_decoder_map[DECODER_MAX][PLUGINS_PER_TYPE]; + plugin_node_t *video_decoder_map[DECODER_MAX][PLUGINS_PER_TYPE]; + plugin_node_t *spu_decoder_map[DECODER_MAX][PLUGINS_PER_TYPE]; + + const char *ids[PLUGIN_MAX]; + + /* memory block for the decoder priority config entry descriptions */ + char *prio_desc[DECODER_MAX]; + + pthread_mutex_t lock; + + int plugin_count; + int decoder_count; +}; +typedef struct plugin_catalog_s plugin_catalog_t; + +/* + * load plugins into catalog + * + * all input+demux plugins will be fully loaded+initialized + * decoder plugins are loaded on demand + * video/audio output plugins have special load/probe functions + */ +void _x_scan_plugins (xine_t *this) XINE_PROTECTED; + + +/* + * dispose all currently loaded plugins (shutdown) + */ + +void _x_dispose_plugins (xine_t *this) XINE_PROTECTED; + +#endif diff --git a/include/xine/pool.h b/include/xine/pool.h new file mode 100644 index 000000000..918da82a2 --- /dev/null +++ b/include/xine/pool.h @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2000-2006 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * Object Pool + */ + +#include +#include + +typedef struct xine_pool_s xine_pool_t; + +/* Creates a new pool + * object_size: sizeof(your struct) + * create_object: function called to create an object (can be NULL) + * prepare_object: function called to prepare an object to returned to the client (can be NULL) + * return_object: function called to prepare an object to returned to the pool (can be NULL) + * delete_object: function called to delete an object (can be NULL) + */ +xine_pool_t *xine_pool_new(size_t object_size, + void (create_object)(void *object), + void (prepare_object)(void *object), + void (return_object)(void *object), + void (delete_object)(void *object)) XINE_PROTECTED; + +/* Deletes a pool */ +void xine_pool_delete(xine_pool_t *pool) XINE_PROTECTED; + +/* Get an object from the pool */ +void *xine_pool_get(xine_pool_t *pool) XINE_PROTECTED; + +/* Returns an object to the pool */ +void xine_pool_put(xine_pool_t *pool, void *object) XINE_PROTECTED; diff --git a/include/xine/post.h b/include/xine/post.h new file mode 100644 index 000000000..1995ca82f --- /dev/null +++ b/include/xine/post.h @@ -0,0 +1,405 @@ +/* + * Copyright (C) 2000-2004 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * post plugin definitions + */ + +#ifndef XINE_POST_H +#define XINE_POST_H + +#ifdef XINE_COMPILE +# include "xine.h" +# include "video_out.h" +# include "audio_out.h" +# include "xine_internal.h" +# include "xineutils.h" +#else +# include +# include +# include +# include +# include +#endif + +#define POST_PLUGIN_IFACE_VERSION 9 + + +typedef struct post_class_s post_class_t; +typedef struct post_plugin_s post_plugin_t; +typedef struct post_in_s post_in_t; +typedef struct post_out_s post_out_t; + +struct post_class_s { + + /* + * open a new instance of this plugin class + */ + post_plugin_t* (*open_plugin) (post_class_t *this, int inputs, + xine_audio_port_t **audio_target, + xine_video_port_t **video_target); + + /** + * @brief short human readable identifier for this plugin class + */ + const char *identifier; + + /** + * @brief human readable (verbose = 1 line) description for this plugin class + * + * The description is passed to gettext() to internationalise. + */ + const char *description; + + /** + * @brief Optional non-standard catalog to use with dgettext() for description. + */ + const char *textdomain; + + /* + * free all class-related resources + */ + + void (*dispose) (post_class_t *this); +}; + +#define default_post_class_dispose (void (*) (post_class_t *this))free + +struct post_plugin_s { + + /* public part of the plugin */ + xine_post_t xine_post; + + /* + * the connections announced by the plugin + * the plugin must fill these with xine_post_{in,out}_t on init + */ + xine_list_t *input; + xine_list_t *output; + + /* + * close down, free all resources + */ + void (*dispose) (post_plugin_t *this); + + /* plugins don't have to init the stuff below */ + + /* + * the running ticket + * + * the plugin must assure to check for ticket revocation in + * intervals of finite length; this means that you must release + * the ticket before any operation that might block; + * note that all port functions are safe in this respect + * + * the running ticket is assigned to you by the engine + */ + xine_ticket_t *running_ticket; + + /* this is needed by the engine to decrement the reference counter + * on disposal of the plugin, but since this is useful, we expose it */ + xine_t *xine; + + /* used when the user requests a list of all inputs/outputs */ + const char **input_ids; + const char **output_ids; + + /* used by plugin loader */ + void *node; + + /* has dispose been called */ + int dispose_pending; +}; + +/* helper function to initialize a post_plugin_t */ +void _x_post_init(post_plugin_t *post, int num_audio_inputs, int num_video_inputs) XINE_PROTECTED; + +struct post_in_s { + + /* public part of the input */ + xine_post_in_t xine_in; + + /* backward reference so that you have access to the post plugin */ + post_plugin_t *post; + + /* you can fill this to your liking */ + void *user_data; +}; + +struct post_out_s { + + /* public part of the output */ + xine_post_out_t xine_out; + + /* backward reference so that you have access to the post plugin */ + post_plugin_t *post; + + /* you can fill this to your liking */ + void *user_data; +}; + + +/* Post plugins work by intercepting calls to video or audio ports + * in the sense of the decorator design pattern. They reuse the + * functions of a given target port, but add own functionality in + * front of that port by creating a new port structure and filling in + * the function pointers with pointers to own functions that + * would do something and then call the original port function. + * + * Much the same is done with video frames which have their own + * set of functions attached that you might need to decorate. + */ + + +/* helper structure for intercepting video port calls */ +typedef struct post_video_port_s post_video_port_t; +struct post_video_port_s { + + /* the new public port with replaced function pointers */ + xine_video_port_t new_port; + + /* the original port to call its functions from inside yours */ + xine_video_port_t *original_port; + + /* if you want to decide yourself, whether a given frame should + * be intercepted, fill in this function; get_frame() acts as + * a template method and asks your function; return a boolean; + * the default is to intercept all frames */ + int (*intercept_frame)(post_video_port_t *self, vo_frame_t *frame); + + /* the new frame function pointers */ + vo_frame_t *new_frame; + + /* if you want to decide yourself, whether the preprocessing functions + * should still be routed when draw is intercepted, fill in this + * function; _x_post_intercept_video_frame() acts as a template method + * and asks your function; return a boolean; the default is _not_ to + * route preprocessing functions when draw is intercepted */ + int (*route_preprocessing_procs)(post_video_port_t *self, vo_frame_t *frame); + + /* if you want to decide yourself, whether the overlay manager should + * be intercepted, fill in this function; get_overlay_manager() acts as + * a template method and asks your function; return a boolean; + * the default is _not_ to intercept the overlay manager */ + int (*intercept_ovl)(post_video_port_t *self); + + /* the new public overlay manager with replaced function pointers */ + video_overlay_manager_t *new_manager; + + /* the original manager to call its functions from inside yours */ + video_overlay_manager_t *original_manager; + + /* usage counter: how many objects are floating around that need + * these pointers to exist */ + int usage_count; + pthread_mutex_t usage_lock; + + /* the stream we are being fed by; NULL means no stream is connected; + * this may be an anonymous stream */ + xine_stream_t *stream; + + /* point to a mutex here, if you need some synchronization */ + pthread_mutex_t *port_lock; + pthread_mutex_t *frame_lock; + pthread_mutex_t *manager_lock; + + /* backward reference so that you have access to the post plugin + * when the call only gives you the port */ + post_plugin_t *post; + + /* you can fill this to your liking */ + void *user_data; + +#ifdef POST_INTERNAL + /* some of the above members are to be directly included here, but + * adding the structures would mean that post_video_port_t becomes + * depended of the sizes of these structs; solution: we add pointers + * above and have them point into the memory provided here; + * note that the overlay manager needs to be first so that we can + * reconstruct the post_video_port_t* from overlay manager calls */ + + /* any change here requires a change in _x_post_ovl_manager_to_port() + * below! */ + + video_overlay_manager_t manager_storage; + vo_frame_t frame_storage; + + /* this is used to keep a linked list of free vo_frame_t's */ + vo_frame_t *free_frame_slots; + pthread_mutex_t free_frames_lock; +#endif +}; + +/* use this to create a new decorated video port in which + * port functions will be replaced with own implementations; + * for convenience, this can also create a related post_in_t and post_out_t */ +post_video_port_t *_x_post_intercept_video_port(post_plugin_t *post, xine_video_port_t *port, + post_in_t **input, post_out_t **output) XINE_PROTECTED; + +/* use this to decorate and to undecorate a frame so that its functions + * can be replaced with own implementations, decoration is usually done in + * get_frame(), undecoration in frame->free() */ +vo_frame_t *_x_post_intercept_video_frame(vo_frame_t *frame, post_video_port_t *port) XINE_PROTECTED; +vo_frame_t *_x_post_restore_video_frame(vo_frame_t *frame, post_video_port_t *port) XINE_PROTECTED; + +/* when you want to pass a frame call on to the original issuer of the frame, + * you need to propagate potential changes up and down the pipe, so the usual + * procedure for this situation would be: + * + * _x_post_frame_copy_down(frame, frame->next); + * frame->next->function(frame->next); + * _x_post_frame_copy_up(frame, frame->next); + */ +void _x_post_frame_copy_down(vo_frame_t *from, vo_frame_t *to) XINE_PROTECTED; +void _x_post_frame_copy_up(vo_frame_t *to, vo_frame_t *from) XINE_PROTECTED; + +/* when you shortcut a frames usual draw() travel so that it will never reach + * the draw() function of the original issuer, you still have to do some + * housekeeping on the frame, before returning control up the pipe */ +void _x_post_frame_u_turn(vo_frame_t *frame, xine_stream_t *stream) XINE_PROTECTED; + +/* use this to create a new, trivially decorated overlay manager in which + * port functions can be replaced with own implementations */ +void _x_post_intercept_overlay_manager(video_overlay_manager_t *manager, post_video_port_t *port) XINE_PROTECTED; + +/* pointer retrieval functions */ +static inline post_video_port_t *_x_post_video_frame_to_port(vo_frame_t *frame) { + return (post_video_port_t *)frame->port; +} + +static inline post_video_port_t *_x_post_ovl_manager_to_port(video_overlay_manager_t *manager) { +#ifdef POST_INTERNAL + return (post_video_port_t *)( (uint8_t *)manager - + (unsigned)&(((post_video_port_t *)NULL)->manager_storage) ); +#else + return (post_video_port_t *)( (uint8_t *)manager - sizeof(post_video_port_t) ); +#endif +} + + +/* helper structure for intercepting audio port calls */ +typedef struct post_audio_port_s post_audio_port_t; +struct post_audio_port_s { + + /* the new public port with replaced function pointers */ + xine_audio_port_t new_port; + + /* the original port to call its functions from inside yours */ + xine_audio_port_t *original_port; + + /* the stream we are being fed by; NULL means no stream is connected; + * this may be an anonymous stream */ + xine_stream_t *stream; + + pthread_mutex_t usage_lock; + /* usage counter: how many objects are floating around that need + * these pointers to exist */ + int usage_count; + + /* some values remembered by (port->open) () */ + uint32_t bits; + uint32_t rate; + uint32_t mode; + + /* point to a mutex here, if you need some synchronization */ + pthread_mutex_t *port_lock; + + /* backward reference so that you have access to the post plugin + * when the call only gives you the port */ + post_plugin_t *post; + + /* you can fill this to your liking */ + void *user_data; +}; + +/* use this to create a new decorated audio port in which + * port functions will be replaced with own implementations */ +post_audio_port_t *_x_post_intercept_audio_port(post_plugin_t *post, xine_audio_port_t *port, + post_in_t **input, post_out_t **output) XINE_PROTECTED; + + +/* this will allow pending rewire operations, calling this at the beginning + * of decoder-called functions like get_buffer() and open() is a good idea + * (if you do not intercept get_buffer() or open(), this will be done automatically) */ +static inline void _x_post_rewire(post_plugin_t *post) { + if (post->running_ticket->ticket_revoked) + post->running_ticket->renew(post->running_ticket, 1); +} + +/* with these functions you can switch interruptions like rewiring or engine pausing + * off for a block of code; use this only when really necessary */ +static inline void _x_post_lock(post_plugin_t *post) { + post->running_ticket->acquire(post->running_ticket, 1); +} +static inline void _x_post_unlock(post_plugin_t *post) { + post->running_ticket->release(post->running_ticket, 1); + _x_post_rewire(post); +} + +/* the standard disposal operation; returns 1 if the plugin is really + * disposed and you should free everything you malloc()ed yourself */ +int _x_post_dispose(post_plugin_t *post) XINE_PROTECTED; + + +/* macros to handle usage counter */ + +/* WARNING! + * note that _x_post_dec_usage() can call dispose, so be sure to + * not use any potentially already freed memory after this */ + +#define _x_post_inc_usage(port) \ +do { \ + pthread_mutex_lock(&(port)->usage_lock); \ + (port)->usage_count++; \ + pthread_mutex_unlock(&(port)->usage_lock); \ +} while(0) + +#define _x_post_dec_usage(port) \ +do { \ + pthread_mutex_lock(&(port)->usage_lock); \ + (port)->usage_count--; \ + if ((port)->usage_count == 0) { \ + if ((port)->post->dispose_pending) { \ + pthread_mutex_unlock(&(port)->usage_lock); \ + (port)->post->dispose((port)->post); \ + } else \ + pthread_mutex_unlock(&(port)->usage_lock); \ + } else \ + pthread_mutex_unlock(&(port)->usage_lock); \ +} while(0) + + +/* macros to create parameter descriptors */ + +#define START_PARAM_DESCR( param_t ) \ +static param_t temp_s; \ +static xine_post_api_parameter_t temp_p[] = { + +#define PARAM_ITEM( param_type, var, enumv, min, max, readonly, descr ) \ +{ param_type, #var, sizeof(temp_s.var), \ + (char*)&temp_s.var-(char*)&temp_s, enumv, min, max, readonly, descr }, + +#define END_PARAM_DESCR( name ) \ + { POST_PARAM_TYPE_LAST, NULL, 0, 0, NULL, 0, 0, 1, NULL } \ +}; \ +static xine_post_api_descr_t name = { \ + sizeof( temp_s ), \ + temp_p \ +}; + +#endif diff --git a/include/xine/refcounter.h b/include/xine/refcounter.h new file mode 100644 index 000000000..a662a974e --- /dev/null +++ b/include/xine/refcounter.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2000-2004 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + */ +#ifndef HAVE_REFCOUNTER_H +#define HAVE_REFCOUNTER_H + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +typedef struct { + pthread_mutex_t lock; + void* object; /* referenced object */ + void (*destructor)(void *); /* object destructor */ + int count; +} refcounter_t; + +typedef void (*refcounter_destructor)(void*); + +refcounter_t* _x_new_refcounter(void *object, refcounter_destructor destructor) XINE_PROTECTED; + +int _x_refcounter_inc(refcounter_t *refcounter) XINE_PROTECTED; + +int _x_refcounter_dec(refcounter_t *refcounter) XINE_PROTECTED; + +void _x_refcounter_dispose(refcounter_t *refcounter) XINE_PROTECTED; + +#endif /* HAVE_REFCOUNTER_H */ diff --git a/include/xine/resample.h b/include/xine/resample.h new file mode 100644 index 000000000..40b4de486 --- /dev/null +++ b/include/xine/resample.h @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2000-2003 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * utilitiy functions for audio drivers + * + * FIXME: not all of them are implemented yet + */ + +#ifndef HAVE_RESAMPLE_H +#define HAVE_RESAMPLE_H + +#define RESAMPLE_MAX_CHANNELS 6 + +void _x_audio_out_resample_stereo(int16_t* last_sample, + int16_t* input_samples, uint32_t in_samples, + int16_t* output_samples, uint32_t out_samples) XINE_PROTECTED; + +void _x_audio_out_resample_mono(int16_t* last_sample, + int16_t* input_samples, uint32_t in_samples, + int16_t* output_samples, uint32_t out_samples) XINE_PROTECTED; + +void _x_audio_out_resample_4channel(int16_t* last_sample, + int16_t* input_samples, uint32_t in_samples, + int16_t* output_samples, uint32_t out_samples) XINE_PROTECTED; + +void _x_audio_out_resample_5channel(int16_t* last_sample, + int16_t* input_samples, uint32_t in_samples, + int16_t* output_samples, uint32_t out_samples) XINE_PROTECTED; + +void _x_audio_out_resample_6channel(int16_t* last_sample, + int16_t* input_samples, uint32_t in_samples, + int16_t* output_samples, uint32_t out_samples) XINE_PROTECTED; + +void _x_audio_out_resample_8to16(int8_t* input_samples, + int16_t* output_samples, uint32_t samples) XINE_PROTECTED; + +void _x_audio_out_resample_16to8(int16_t* input_samples, + int8_t* output_samples, uint32_t samples) XINE_PROTECTED; + +void _x_audio_out_resample_monotostereo(int16_t* input_samples, + int16_t* output_samples, uint32_t frames) XINE_PROTECTED; + +void _x_audio_out_resample_stereotomono(int16_t* input_samples, + int16_t* output_samples, uint32_t frames) XINE_PROTECTED; + +#endif diff --git a/include/xine/ring_buffer.h b/include/xine/ring_buffer.h new file mode 100644 index 000000000..efcffd3b7 --- /dev/null +++ b/include/xine/ring_buffer.h @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2000-2006 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * Fifo + Ring Buffer + */ +typedef struct xine_ring_buffer_s xine_ring_buffer_t; + +/* Creates a new ring buffer */ +xine_ring_buffer_t *xine_ring_buffer_new(size_t size) XINE_PROTECTED; + +/* Deletes a ring buffer */ +void xine_ring_buffer_delete(xine_ring_buffer_t *ring_buffer) XINE_PROTECTED; + +/* Returns a new chunk of the specified size */ +/* Might block if the ring buffer is full */ +void *xine_ring_buffer_alloc(xine_ring_buffer_t *ring_buffer, size_t size) XINE_PROTECTED; + +/* Put a chunk into the ring */ +void xine_ring_buffer_put(xine_ring_buffer_t *ring_buffer, void *chunk) XINE_PROTECTED; + +/* Get a chunk of a specified size from the ring buffer + * Might block if the ring buffer is empty + * param size: the desired size + * param rsize: the size of the chunk returned + * rsize is not equal to size at the end of stream, the caller MUST check + * rsize value. + */ +void *xine_ring_buffer_get(xine_ring_buffer_t *ring_buffer, size_t size, size_t *rsize) XINE_PROTECTED; + +/* Releases the chunk, makes memory available for the alloc function */ +void xine_ring_buffer_release(xine_ring_buffer_t *ring_buffer, void *chunk) XINE_PROTECTED; + +/* Closes the ring buffer + * The writer uses this function to signal the end of stream to the reader. + * The reader MUST check the rsize value returned by the get function. + */ +void xine_ring_buffer_close(xine_ring_buffer_t *ring_buffer) XINE_PROTECTED; + + diff --git a/include/xine/scratch.h b/include/xine/scratch.h new file mode 100644 index 000000000..c0e591d31 --- /dev/null +++ b/include/xine/scratch.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2000-2006 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * scratch buffer for log output + */ + +#ifndef HAVE_SCRATCH_H +#define HAVE_SCRATCH_H + +#include +#include + +typedef struct scratch_buffer_s scratch_buffer_t; + +#define SCRATCH_LINE_LEN_MAX 1024 + +struct scratch_buffer_s { + + void +#if __GNUC__ >= 3 + __attribute__((__format__(__printf__, 2, 0))) +#endif + (*scratch_printf) (scratch_buffer_t *this, const char *format, va_list ap); + + char **(*get_content) (scratch_buffer_t *this); + + void (*dispose) (scratch_buffer_t *this); + + char **lines; + char **ordered; + + int num_lines; + int cur; + + pthread_mutex_t lock; +}; + +scratch_buffer_t *_x_new_scratch_buffer (int num_lines) XINE_PROTECTED; + +#endif diff --git a/include/xine/sorted_array.h b/include/xine/sorted_array.h new file mode 100644 index 000000000..a1894eca3 --- /dev/null +++ b/include/xine/sorted_array.h @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2000-2006 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * Sorted array which grows automatically when you add elements. + * A binary search is used to find the position of a new element. + * + * Example: + * Let's create de comparison method for integers: + * + * int int_comparator(void *a, void *b) { + * if ((int)a < (int)b) { + * return -1; + * } else if ((int)a == (int)b) { + * return 0; + * } else { + * return 1; + * } + * } + * + * Create a sorted array for integers: + * xine_sarray_t *sarray = xine_sarray_new(10, int_comparator); + * + * Add elements: + * xine_sarray_add(sarray, (void*)4); + * xine_sarray_add(sarray, (void*)28); + * xine_sarray_add(sarray, (void*)7); + * + * Find an element: + * int pos = xine_sarray_binary_search(sarray, (void*)7); + * if (pos >= 0) + * FOUND + * else + * NOT FOUND + * + * Delete the array: + * xine_sarray_delete(sarray); + */ +#ifndef XINE_SORTED_ARRAY_H +#define XINE_SORTED_ARRAY_H + +#include "array.h" + +/* Array type */ +typedef struct xine_sarray_s xine_sarray_t; + +/* Array element comparator */ +typedef int (*xine_sarray_comparator_t)(void*, void*); + +/* Constructor */ +xine_sarray_t *xine_sarray_new(size_t initial_size, xine_sarray_comparator_t comparator) XINE_PROTECTED; + +/* Destructor */ +void xine_sarray_delete(xine_sarray_t *sarray) XINE_PROTECTED; + +/* Returns the number of element stored in the array */ +size_t xine_sarray_size(const xine_sarray_t *sarray) XINE_PROTECTED; + +/* Removes all elements from an array */ +void xine_sarray_clear(xine_sarray_t *sarray) XINE_PROTECTED; + +/* Adds the element into the array + Returns the insertion position */ +int xine_sarray_add(xine_sarray_t *sarray, void *value) XINE_PROTECTED; + +/* Removes one element from an array at the position specified */ +void xine_sarray_remove(xine_sarray_t *sarray, unsigned int position) XINE_PROTECTED; + +/* Get the element at the position specified */ +void *xine_sarray_get(xine_sarray_t *sarray, unsigned int position) XINE_PROTECTED; + +/* Returns the index of the search key, if it is contained in the list. + Otherwise, (-(insertion point) - 1) or ~(insertion point). + The insertion point is defined as the point at which the key would be + inserted into the array. */ +int xine_sarray_binary_search(xine_sarray_t *sarray, void *key) XINE_PROTECTED; + +#endif + diff --git a/include/xine/spu.h b/include/xine/spu.h new file mode 100644 index 000000000..daba7866b --- /dev/null +++ b/include/xine/spu.h @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2007 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#ifndef XINE_UTILS_SPU_H +#define XINE_UTILS_SPU_H + +#ifndef XINE_PROTECTED +#define XINE_PROTECTED +#endif + +typedef struct xine_spu_opacity_s xine_spu_opacity_t; + +struct xine_spu_opacity_s { + uint8_t black, colour; +}; + +void _x_spu_misc_init (xine_t *); + +void _x_spu_get_opacity (xine_t *, xine_spu_opacity_t *) XINE_PROTECTED; + +/* in: trans = 0..255, 0=opaque + * out: 0..255, 0=transparent + */ +int _x_spu_calculate_opacity (const clut_t *, uint8_t trans, const xine_spu_opacity_t *) XINE_PROTECTED; + +#endif diff --git a/include/xine/spu_decoder.h b/include/xine/spu_decoder.h new file mode 100644 index 000000000..dcf9107f7 --- /dev/null +++ b/include/xine/spu_decoder.h @@ -0,0 +1,151 @@ +/* + * spu_decoder_api.h + * + * Copyright (C) James Courtier-Dutton James@superbug.demon.co.uk - July 2001 + * + * This file is part of xine, a unix video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, + * + */ + +#ifndef HAVE_SPU_API_H +#define HAVE_SPU_API_H + +#ifdef XINE_COMPILE +# include +# include "buffer.h" +#else +# include +# include +#endif + +#define SPU_DECODER_IFACE_VERSION 17 + +/* + * generic xine spu decoder plugin interface + */ + +typedef struct spu_decoder_class_s spu_decoder_class_t; +typedef struct spu_decoder_s spu_decoder_t; + +struct spu_decoder_class_s { + + /* + * open a new instance of this plugin class + */ + spu_decoder_t* (*open_plugin) (spu_decoder_class_t *this, xine_stream_t *stream); + + /** + * @brief short human readable identifier for this plugin class + */ + const char *identifier; + + /** + * @brief human readable (verbose = 1 line) description for this plugin class + * + * The description is passed to gettext() to internationalise. + */ + const char *description; + + /** + * @brief Optional non-standard catalog to use with dgettext() for description. + */ + const char *textdomain; + + /* + * free all class-related resources + */ + void (*dispose) (spu_decoder_class_t *this); +}; + +#define default_spu_decoder_class_dispose (void (*) (spu_decoder_class_t *this))free + +struct spu_decoder_s { + + /* + * decode data from buf and feed the overlay to overlay manager + */ + void (*decode_data) (spu_decoder_t *this, buf_element_t *buf); + + /* + * reset decoder after engine flush (prepare for new + * SPU data not related to recently decoded data) + */ + void (*reset) (spu_decoder_t *this); + + /* + * inform decoder that a time reference discontinuity has happened. + * that is, it must forget any currently held pts value + */ + void (*discontinuity) (spu_decoder_t *this); + + /* + * close down, free all resources + */ + void (*dispose) (spu_decoder_t *this); + + /* + * When the SPU decoder also handles data used in user interaction, + * you can query the related information here. The typical example + * for this is DVD NAV packets which are handled by the SPU decoder + * and can be received readily parsed from here. + * The caller and the decoder must agree on the structure which is + * passed here. + * This function pointer may be NULL, if the plugin does not have + * such functionality. + */ + int (*get_interact_info) (spu_decoder_t *this, void *data); + + /* + * When the SPU decoder also handles menu overlays for user inter- + * action, you can set a menu button here. The typical example for + * this is DVD menus. + * This function pointer may be NULL, if the plugin does not have + * such functionality. + */ + void (*set_button) (spu_decoder_t *this_gen, int32_t button, int32_t mode); + + void *node; /* used by plugin loader */ +}; + + +/* SPU decoders differ from video and audio decoders in one significant + * way: unlike audio and video, SPU streams are not continuous; + * this results in another difference, programmers have to consider: + * while both audio and video decoders are automatically blocked in + * their get_buffer()/get_frame() methods when the output cannot take + * any more data, this does not work for SPU, because it could take + * minutes before the next free slot becomes available and we must not + * block the decoder thread for that long; + * therefore, we provide a convenience function for SPU decoders which + * implements a wait until a timestamp sufficiently close to the VPTS + * of the next SPU is reached, but the waiting will end before that, + * if some outside condition requires us to release the decoder thread + * to other tasks; + * if this functions returns with 1, noone needs the decoder thread and + * you may continue waiting; if it returns 0, finish whatever you are + * doing and return; + * the usual pattern for SPU decoders is this: + * + * do { + * spu = prepare_spu(); + * int thread_vacant = _x_spu_decoder_sleep(this->stream, spu->vpts); + * int success = process_spu(spu); + * } while (!success && thread_vacant); + */ +int _x_spu_decoder_sleep(xine_stream_t *, int64_t next_spu_vpts) XINE_PROTECTED; + +#endif /* HAVE_SPUDEC_H */ diff --git a/include/xine/video_decoder.h b/include/xine/video_decoder.h new file mode 100644 index 000000000..705efa3da --- /dev/null +++ b/include/xine/video_decoder.h @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2000-2004 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * xine video decoder plugin interface + */ + +#ifndef HAVE_VIDEO_DECODER_H +#define HAVE_VIDEO_DECODER_H + +#ifdef XINE_COMPILE +# include +# include "buffer.h" +#else +# include +# include +#endif + +#define VIDEO_DECODER_IFACE_VERSION 19 + + +/* + * generic xine video decoder plugin interface + */ + +typedef struct video_decoder_class_s video_decoder_class_t; +typedef struct video_decoder_s video_decoder_t; + +struct video_decoder_class_s { + + /* + * open a new instance of this plugin class + */ + video_decoder_t* (*open_plugin) (video_decoder_class_t *this, xine_stream_t *stream); + + /** + * @brief short human readable identifier for this plugin class + */ + const char *identifier; + + /** + * @brief human readable (verbose = 1 line) description for this plugin class + * + * The description is passed to gettext() to internationalise. + */ + const char *description; + + /** + * @brief Optional non-standard catalog to use with dgettext() for description. + */ + const char *textdomain; + + /* + * free all class-related resources + */ + void (*dispose) (video_decoder_class_t *this); +}; + +#define default_video_decoder_class_dispose (void (*) (video_decoder_class_t *this))free + +struct video_decoder_s { + + /* + * decode data from buf and feed decoded frames to + * video output + */ + void (*decode_data) (video_decoder_t *this, buf_element_t *buf); + + /* + * reset decoder after engine flush (prepare for new + * video data not related to recently decoded data) + */ + void (*reset) (video_decoder_t *this); + + /* + * inform decoder that a time reference discontinuity has happened. + * that is, it must forget any currently held pts value + */ + void (*discontinuity) (video_decoder_t *this); + + /* + * flush out any frames that are still stored in the decoder + */ + void (*flush) (video_decoder_t *this); + + /* + * close down, free all resources + */ + void (*dispose) (video_decoder_t *this); + + + void *node; /*used by plugin loader */ + +}; + +#endif diff --git a/include/xine/video_out.h b/include/xine/video_out.h new file mode 100644 index 000000000..8efdae9f6 --- /dev/null +++ b/include/xine/video_out.h @@ -0,0 +1,466 @@ +/* + * Copyright (C) 2000-2004 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + * xine version of video_out.h + * + * vo_frame : frame containing yuv data and timing info, + * transferred between video_decoder and video_output + * + * vo_driver : lowlevel, platform-specific video output code + * + * vo_port : generic frame_handling code, uses + * a vo_driver for output + */ + +#ifndef HAVE_VIDEO_OUT_H +#define HAVE_VIDEO_OUT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#ifdef XINE_COMPILE +# include "xine.h" +# include "buffer.h" +#else +# include +# include +#endif + + +typedef struct vo_frame_s vo_frame_t; +typedef struct vo_driver_s vo_driver_t; +typedef struct video_driver_class_s video_driver_class_t; +typedef struct vo_overlay_s vo_overlay_t; +typedef struct video_overlay_manager_s video_overlay_manager_t; + +/* public part, video drivers may add private fields + * + * Remember that adding new functions to this structure requires + * adaption of the post plugin decoration layer. Be sure to look into + * src/xine-engine/post.[ch]. + */ +struct vo_frame_s { + /* + * member functions + */ + + /* Duplicate picture data and acceleration specific data of a frame. */ + /* if the image format isn't already known by Xine. Currently this is needed */ + /* For all image formats except XINE_IMGFMT_YV12 and XINE_IMGFMT_YUY2 */ + void (*proc_duplicate_frame_data) (vo_frame_t *vo_img, vo_frame_t *src); + + /* tell video driver to copy/convert the whole of this frame, may be NULL */ + /* at least one of proc_frame() and proc_slice() MUST set the variable proc_called to 1 */ + void (*proc_frame) (vo_frame_t *vo_img); + + /* tell video driver to copy/convert a slice of this frame, may be NULL */ + /* at least one of proc_frame() and proc_slice() MUST set the variable proc_called to 1 */ + void (*proc_slice) (vo_frame_t *vo_img, uint8_t **src); + + /* tell video driver that the decoder starts a new field */ + void (*field) (vo_frame_t *vo_img, int which_field); + + /* append this frame to the display queue, + returns number of frames to skip if decoder is late */ + /* when the frame does not originate from a stream, it is legal to pass an anonymous stream */ + int (*draw) (vo_frame_t *vo_img, xine_stream_t *stream); + + /* lock frame as reference, must be paired with free. + * most decoders/drivers do not need to call this function since + * newly allocated frames are already locked once. + */ + void (*lock) (vo_frame_t *vo_img); + + /* this frame is no longer used by the decoder, video driver, etc */ + void (*free) (vo_frame_t *vo_img); + + /* free memory/resources for this frame */ + void (*dispose) (vo_frame_t *vo_img); + + /* + * public variables to decoders and vo drivers + * changing anything here will require recompiling them both + */ + int64_t pts; /* presentation time stamp (1/90000 sec) */ + int64_t vpts; /* virtual pts, generated by metronom */ + int bad_frame; /* e.g. frame skipped or based on skipped frame */ + int duration; /* frame length in time, in 1/90000 sec */ + + /* yv12 (planar) base[0]: y, base[1]: u, base[2]: v */ + /* yuy2 (interleaved) base[0]: yuyv..., base[1]: --, base[2]: -- */ + uint8_t *base[3]; + int pitches[3]; + + /* info that can be used for interlaced output (e.g. tv-out) */ + int top_field_first; + int repeat_first_field; + /* note: progressive_frame is set wrong on many mpeg2 streams. for + * that reason, this flag should be interpreted as a "hint". + */ + int progressive_frame; + int picture_coding_type; + + /* cropping to be done */ + int crop_left, crop_right, crop_top, crop_bottom; + + int lock_counter; + pthread_mutex_t mutex; /* protect access to lock_count */ + + /* extra info coming from input or demuxers */ + extra_info_t *extra_info; + + /* additional information to be able to duplicate frames: */ + int width, height; + double ratio; /* aspect ratio */ + int format; /* IMGFMT_YV12 or IMGFMT_YUY2 */ + + int drawn; /* used by decoder, frame has already been drawn */ + int flags; /* remember the frame flags */ + int proc_called; /* track use of proc_*() methods */ + + /* Used to carry private data for accelerated plugins.*/ + void *accel_data; + + /* "backward" references to where this frame originates from */ + xine_video_port_t *port; + vo_driver_t *driver; + xine_stream_t *stream; + + /* displacement for overlays */ + int overlay_offset_x, overlay_offset_y; + + /* + * that part is used only by video_out.c for frame management + * obs: changing anything here will require recompiling vo drivers + */ + struct vo_frame_s *next; + + int id; /* debugging - track this frame */ + int is_first; +}; + + +/* + * Remember that adding new functions to this structure requires + * adaption of the post plugin decoration layer. Be sure to look into + * src/xine-engine/post.[ch]. + */ +struct xine_video_port_s { + + uint32_t (*get_capabilities) (xine_video_port_t *self); /* for constants see below */ + + /* open display driver for video output */ + /* when you are not a full-blown stream, but still need to open the port + * (e.g. you are a post plugin) it is legal to pass an anonymous stream */ + void (*open) (xine_video_port_t *self, xine_stream_t *stream); + + /* + * get_frame - allocate an image buffer from display driver + * + * params : width == width of video to display. + * height == height of video to display. + * ratio == aspect ration information + * format == FOURCC descriptor of image format + * flags == field/prediction flags + */ + vo_frame_t* (*get_frame) (xine_video_port_t *self, uint32_t width, + uint32_t height, double ratio, + int format, int flags); + + /* retrieves the last displayed frame (useful for taking snapshots) */ + vo_frame_t* (*get_last_frame) (xine_video_port_t *self); + + /* overlay stuff */ + void (*enable_ovl) (xine_video_port_t *self, int ovl_enable); + + /* get overlay manager */ + video_overlay_manager_t* (*get_overlay_manager) (xine_video_port_t *self); + + /* flush video_out fifo */ + void (*flush) (xine_video_port_t *self); + + /* trigger immediate drawing */ + void (*trigger_drawing) (xine_video_port_t *self); + + /* Get/Set video property + * + * See VO_PROP_* bellow + */ + int (*get_property) (xine_video_port_t *self, int property); + int (*set_property) (xine_video_port_t *self, int property, int value); + + /* return true if port is opened for this stream, stream can be anonymous */ + int (*status) (xine_video_port_t *self, xine_stream_t *stream, + int *width, int *height, int64_t *img_duration); + + /* video driver is no longer used by decoder => close */ + /* when you are not a full-blown stream, but still need to close the port + * (e.g. you are a post plugin) it is legal to pass an anonymous stream */ + void (*close) (xine_video_port_t *self, xine_stream_t *stream); + + /* called on xine exit */ + void (*exit) (xine_video_port_t *self); + + /* the driver in use */ + vo_driver_t *driver; + +}; + +/* constants for the get/set property functions */ +#define VO_PROP_INTERLACED 0 +#define VO_PROP_ASPECT_RATIO 1 +#define VO_PROP_HUE 2 +#define VO_PROP_SATURATION 3 +#define VO_PROP_CONTRAST 4 +#define VO_PROP_BRIGHTNESS 5 +#define VO_PROP_COLORKEY 6 +#define VO_PROP_AUTOPAINT_COLORKEY 7 +#define VO_PROP_ZOOM_X 8 +#define VO_PROP_PAN_SCAN 9 +#define VO_PROP_TVMODE 10 +#define VO_PROP_MAX_NUM_FRAMES 11 +#define VO_PROP_ZOOM_Y 13 +#define VO_PROP_DISCARD_FRAMES 14 /* not used by drivers */ +#define VO_PROP_WINDOW_WIDTH 15 /* read-only */ +#define VO_PROP_WINDOW_HEIGHT 16 /* read-only */ +#define VO_PROP_BUFS_IN_FIFO 17 /* read-only */ +#define VO_PROP_NUM_STREAMS 18 /* read-only */ +#define VO_NUM_PROPERTIES 19 + +/* number of colors in the overlay palette. Currently limited to 256 + at most, because some alphablend functions use an 8-bit index into + the palette. This should probably be classified as a bug. */ +#define OVL_PALETTE_SIZE 256 + +#define OVL_MAX_OPACITY 0x0f + +/* number of recent frames to keep in memory + these frames are needed by some deinterlace algorithms + FIXME: we need a method to flush the recent frames (new stream) +*/ +#define VO_NUM_RECENT_FRAMES 2 + +/* get_frame flags */ +#define VO_TOP_FIELD 1 +#define VO_BOTTOM_FIELD 2 +#define VO_BOTH_FIELDS (VO_TOP_FIELD | VO_BOTTOM_FIELD) +#define VO_PAN_SCAN_FLAG 4 +#define VO_INTERLACED_FLAG 8 +#define VO_NEW_SEQUENCE_FLAG 16 /* set after MPEG2 Sequence Header Code (used by XvMC) */ + +/* video driver capabilities */ +#define VO_CAP_YV12 0x00000001 /* driver can handle YUV 4:2:0 pictures */ +#define VO_CAP_YUY2 0x00000002 /* driver can handle YUY2 pictures */ +#define VO_CAP_XVMC_MOCOMP 0x00000004 /* driver can use XvMC motion compensation */ +#define VO_CAP_XVMC_IDCT 0x00000008 /* driver can use XvMC idct acceleration */ +#define VO_CAP_UNSCALED_OVERLAY 0x00000010 /* driver can blend overlay at output resolution */ +#define VO_CAP_CROP 0x00000020 /* driver can crop */ +#define VO_CAP_XXMC 0x00000040 /* driver can use extended XvMC */ + + +/* + * vo_driver_s contains the functions every display driver + * has to implement. The vo_new_port function (see below) + * should then be used to construct a vo_port using this + * driver. Some of the function pointers will be copied + * directly into xine_video_port_s, others will be called + * from generic vo functions. + */ + +#define VIDEO_OUT_DRIVER_IFACE_VERSION 22 + +struct vo_driver_s { + + uint32_t (*get_capabilities) (vo_driver_t *self); /* for constants see above */ + + /* + * allocate an vo_frame_t struct, + * the driver must supply the copy, field and dispose functions + */ + vo_frame_t* (*alloc_frame) (vo_driver_t *self); + + /* + * check if the given image fullfills the format specified + * (re-)allocate memory if necessary + */ + void (*update_frame_format) (vo_driver_t *self, vo_frame_t *img, + uint32_t width, uint32_t height, + double ratio, int format, int flags); + + /* display a given frame */ + void (*display_frame) (vo_driver_t *self, vo_frame_t *vo_img); + + /* overlay_begin and overlay_end are used by drivers suporting + * persistent overlays. they can be optimized to update only when + * overlay image has changed. + * + * sequence of operation (pseudo-code): + * overlay_begin(this,img,true_if_something_changed_since_last_blend ); + * while(visible_overlays) + * overlay_blend(this,img,overlay[i]); + * overlay_end(this,img); + * + * any function pointer from this group may be set to NULL. + */ + void (*overlay_begin) (vo_driver_t *self, vo_frame_t *vo_img, int changed); + void (*overlay_blend) (vo_driver_t *self, vo_frame_t *vo_img, vo_overlay_t *overlay); + void (*overlay_end) (vo_driver_t *self, vo_frame_t *vo_img); + + /* + * these can be used by the gui directly: + */ + int (*get_property) (vo_driver_t *self, int property); + int (*set_property) (vo_driver_t *self, + int property, int value); + void (*get_property_min_max) (vo_driver_t *self, + int property, int *min, int *max); + + /* + * general purpose communication channel between gui and driver + * + * this should be used to propagate events, display data, window sizes + * etc. to the driver + */ + int (*gui_data_exchange) (vo_driver_t *self, int data_type, + void *data); + + /* check if a redraw is needed (due to resize) + * this is only used for still frames, normal video playback + * must call that inside display_frame() function. + */ + int (*redraw_needed) (vo_driver_t *self); + + /* + * free all resources, close driver + */ + void (*dispose) (vo_driver_t *self); + + void *node; /* needed by plugin_loader */ +}; + +struct video_driver_class_s { + + /* + * open a new instance of this plugin class + */ + vo_driver_t* (*open_plugin) (video_driver_class_t *self, const void *visual); + + /** + * @brief short human readable identifier for this plugin class + */ + const char *identifier; + + /** + * @brief human readable (verbose = 1 line) description for this plugin class + * + * The description is passed to gettext() to internationalise. + */ + const char *description; + + /** + * @brief Optional non-standard catalog to use with dgettext() for description. + */ + const char *textdomain; + + /* + * free all class-related resources + */ + void (*dispose) (video_driver_class_t *self); +}; + +#define default_video_driver_class_dispose (void (*) (video_driver_class_t *this))free + +typedef struct rle_elem_s { + uint16_t len; + uint16_t color; +} rle_elem_t; + +struct vo_overlay_s { + + rle_elem_t *rle; /* rle code buffer */ + int data_size; /* useful for deciding realloc */ + int num_rle; /* number of active rle codes */ + int x; /* x start of subpicture area */ + int y; /* y start of subpicture area */ + int width; /* width of subpicture area */ + int height; /* height of subpicture area */ + + uint32_t color[OVL_PALETTE_SIZE]; /* color lookup table */ + uint8_t trans[OVL_PALETTE_SIZE]; /* mixer key table */ + int rgb_clut; /* true if clut was converted to rgb */ + + /* define a highlight area with different colors */ + int hili_top; + int hili_bottom; + int hili_left; + int hili_right; + uint32_t hili_color[OVL_PALETTE_SIZE]; + uint8_t hili_trans[OVL_PALETTE_SIZE]; + int hili_rgb_clut; /* true if clut was converted to rgb */ + + int unscaled; /* true if it should be blended unscaled */ +}; + + +/* API to video_overlay manager + * + * Remember that adding new functions to this structure requires + * adaption of the post plugin decoration layer. Be sure to look into + * src/xine-engine/post.[ch]. + */ +struct video_overlay_manager_s { + void (*init) (video_overlay_manager_t *this_gen); + + void (*dispose) (video_overlay_manager_t *this_gen); + + int32_t (*get_handle) (video_overlay_manager_t *this_gen, int object_type ); + + void (*free_handle) (video_overlay_manager_t *this_gen, int32_t handle); + + int32_t (*add_event) (video_overlay_manager_t *this_gen, void *event); + + void (*flush_events) (video_overlay_manager_t *this_gen ); + + int (*redraw_needed) (video_overlay_manager_t *this_gen, int64_t vpts ); + + void (*multiple_overlay_blend) (video_overlay_manager_t *this_gen, int64_t vpts, + vo_driver_t *output, vo_frame_t *vo_img, int enabled); +}; + +/** + * @brief Build a video output port from a given video driver. + * + * @internal + */ +xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, int grabonly); + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/include/xine/video_overlay.h b/include/xine/video_overlay.h new file mode 100644 index 000000000..6bb529204 --- /dev/null +++ b/include/xine/video_overlay.h @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2000-2003 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + */ + +#ifndef HAVE_VIDEO_OVERLAY_H +#define HAVE_VIDEO_OVERLAY_H + +#ifdef XINE_COMPILE +# include "xine_internal.h" +#else +# include +#endif + +#ifdef __GNUC__ +#define CLUT_Y_CR_CB_INIT(_y,_cr,_cb) {y: (_y), cr: (_cr), cb: (_cb)} +#else +#define CLUT_Y_CR_CB_INIT(_y,_cr,_cb) { (_cb), (_cr), (_y) } +#endif + +#define MAX_OBJECTS 50 +#define MAX_EVENTS 50 +#define MAX_SHOWING (5 + 16) + +#define OVERLAY_EVENT_NULL 0 +#define OVERLAY_EVENT_SHOW 1 +#define OVERLAY_EVENT_HIDE 2 +#define OVERLAY_EVENT_MENU_BUTTON 3 +#define OVERLAY_EVENT_FREE_HANDLE 8 /* Frees a handle, previous allocated via get_handle */ + +typedef struct video_overlay_object_s { + int32_t handle; /* Used to match Show and Hide events. */ + uint32_t object_type; /* 0=Subtitle, 1=Menu */ + int64_t pts; /* Needed for Menu button compares */ + vo_overlay_t *overlay; /* The image data. */ + uint32_t *palette; /* If NULL, no palette contained in this event. */ + uint32_t palette_type; /* 1 Y'CrCB, 2 R'G'B' */ +} video_overlay_object_t; + +/* This will hold all details of an event item, needed for event queue to function */ +typedef struct video_overlay_event_s { + int64_t vpts; /* Time when event will action. 0 means action now */ +/* Once video_out blend_yuv etc. can take rle_elem_t with Colour, blend and length information. + * we can remove clut and blend from this structure. + * This will allow for many more colours for OSD. + */ + uint32_t event_type; /* Show SPU, Show OSD, Hide etc. */ + video_overlay_object_t object; /* The image data. */ +} video_overlay_event_t; + +video_overlay_manager_t *_x_video_overlay_new_manager(xine_t *) XINE_PROTECTED; + +#endif diff --git a/include/xine/vo_scale.h b/include/xine/vo_scale.h new file mode 100644 index 000000000..e502b2f62 --- /dev/null +++ b/include/xine/vo_scale.h @@ -0,0 +1,203 @@ +/* + * Copyright (C) 2000-2003 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * vo_scale.h + * + * keeps video scaling information + */ + +#ifndef HAVE_VO_SCALE_H +#define HAVE_VO_SCALE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifdef XINE_COMPILE +# include "configfile.h" +#else +# include +#endif + +typedef struct { + int x, y; + int w, h; +} vo_scale_rect_t; + +struct vo_scale_s { + + /* true if driver supports frame zooming */ + int support_zoom; + + /* forces direct mapping between frame pixels and screen pixels */ + int scaling_disabled; + + /* size / aspect ratio calculations */ + + /* + * "delivered" size: + * frame dimension / aspect as delivered by the decoder + * used (among other things) to detect frame size changes + * units: frame pixels + */ + int delivered_width; + int delivered_height; + double delivered_ratio; + + /* + * required cropping: + * units: frame pixels + */ + int crop_left; + int crop_right; + int crop_top; + int crop_bottom; + + /* + * displayed part of delivered images, + * taking zoom into account + * units: frame pixels + */ + int displayed_xoffset; + int displayed_yoffset; + int displayed_width; + int displayed_height; + double zoom_factor_x, zoom_factor_y; + + /* + * user's aspect selection + */ + int user_ratio; + + /* + * "gui" size / offset: + * what gui told us about where to display the video + * units: screen pixels + */ + int gui_x, gui_y; + int gui_width, gui_height; + int gui_win_x, gui_win_y; + + /* */ + int force_redraw; + + /* + * video + display pixel aspect + * One pixel of height 1 has this width + * This may be corrected by the driver in order to fit the video seamlessly + */ + double gui_pixel_aspect; + double video_pixel_aspect; + + /* + * "output" size: + * + * this is finally the ideal size "fitted" into the + * gui size while maintaining the aspect ratio + * units: screen pixels + */ + int output_width; + int output_height; + int output_xoffset; + int output_yoffset; + + + /* gui callbacks */ + + void *user_data; + void (*frame_output_cb) (void *user_data, + int video_width, int video_height, + double video_pixel_aspect, + int *dest_x, int *dest_y, + int *dest_width, int *dest_height, + double *dest_pixel_aspect, + int *win_x, int *win_y); + + void (*dest_size_cb) (void *user_data, + int video_width, int video_height, + double video_pixel_aspect, + int *dest_width, int *dest_height, + double *dest_pixel_aspect); + + /* borders */ + vo_scale_rect_t border[4]; + + /* + * border ratios to determine image position in the + * viewport; these are set by user config + */ + double output_horizontal_position; + double output_vertical_position; + +}; + +typedef struct vo_scale_s vo_scale_t; + + +/* + * convert delivered height/width to ideal width/height + * taking into account aspect ratio and zoom factor + */ + +void _x_vo_scale_compute_ideal_size (vo_scale_t *self) XINE_PROTECTED; + + +/* + * make ideal width/height "fit" into the gui + */ + +void _x_vo_scale_compute_output_size (vo_scale_t *self) XINE_PROTECTED; + +/* + * return true if a redraw is needed due resizing, zooming, + * aspect ratio changing, etc. + */ + +int _x_vo_scale_redraw_needed (vo_scale_t *self) XINE_PROTECTED; + +/* + * + */ + +void _x_vo_scale_translate_gui2video(vo_scale_t *self, + int x, int y, + int *vid_x, int *vid_y) XINE_PROTECTED; + +/* + * Returns description of a given ratio code + */ + +char *_x_vo_scale_aspect_ratio_name(int a) XINE_PROTECTED; + +/* + * initialize rescaling struct + */ + +void _x_vo_scale_init(vo_scale_t *self, int support_zoom, + int scaling_disabled, config_values_t *config ) XINE_PROTECTED; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/xine/xine_buffer.h b/include/xine/xine_buffer.h new file mode 100644 index 000000000..84511bd1b --- /dev/null +++ b/include/xine/xine_buffer.h @@ -0,0 +1,136 @@ +/* + * Copyright (C) 2000-2004 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * + * generic dynamic buffer functions. The goals + * of these functions are (in fact many of these points + * are todos): + * - dynamic allocation and reallocation depending + * on the size of data written to it. + * - fast and transparent access to the data. + * The user sees only the raw data chunk as it is + * returned by the well-known malloc function. + * This is necessary since not all data-accessing + * functions can be wrapped here. + * - some additional health checks are made during + * development (eg boundary checks after direct + * access to a buffer). This can be turned off in + * production state for higher performance. + * - A lot of convenient string and memory manipulation + * functions are implemented here, where the user + * do not have to care about memory chunk sizes. + * - Some garbage collention could be implemented as well; + * i think of a global structure containing infos + * about all allocated chunks. This must be implemented + * in a thread-save way... + * + * Here are some drawbacks (aka policies): + * - The user must not pass indexed buffers to xine_buffer_* + * functions. + * - The pointers passed to xine_buffer_* functions may change + * (eg during reallocation). The user must respect that. + */ + +#ifndef HAVE_XINE_BUFFER_H +#define HAVE_XINE_BUFFER_H + +#ifdef XINE_COMPILE +# include +#else +# include +#endif + +/* + * returns an initialized pointer to a buffer. + * The buffer will be allocated in blocks of + * chunk_size bytes. This will prevent permanent + * reallocation on slow growing buffers. + */ +void *xine_buffer_init(int chunk_size) XINE_PROTECTED; + +/* + * frees a buffer, the macro ensures, that a freed + * buffer pointer is set to NULL + */ +#define xine_buffer_free(buf) buf=_xine_buffer_free(buf) +void *_xine_buffer_free(void *buf) XINE_PROTECTED; + +/* + * duplicates a buffer + */ +void *xine_buffer_dup(const void *buf) XINE_PROTECTED; + +/* + * will copy len bytes of data into buf at position index. + */ +#define xine_buffer_copyin(buf,i,data,len) \ + buf=_xine_buffer_copyin(buf,i,data,len) +void *_xine_buffer_copyin(void *buf, int index, const void *data, int len) XINE_PROTECTED; + +/* + * will copy len bytes out of buf+index into data. + * no checks are made in data. It is treated as an ordinary + * user-malloced data chunk. + */ +void xine_buffer_copyout(const void *buf, int index, void *data, int len) XINE_PROTECTED; + +/* + * set len bytes in buf+index to b. + */ +#define xine_buffer_set(buf,i,b,len) \ + buf=_xine_buffer_set(buf,i,b,len) +void *_xine_buffer_set(void *buf, int index, uint8_t b, int len) XINE_PROTECTED; + +/* + * concatenates given buf (which should contain a null terminated string) + * with another string. + */ +#define xine_buffer_strcat(buf,data) \ + buf=_xine_buffer_strcat(buf,data) +void *_xine_buffer_strcat(void *buf, const char *data) XINE_PROTECTED; + +/* + * copies given string to buf+index + */ +#define xine_buffer_strcpy(buf,index,data) \ + buf=_xine_buffer_strcpy(buf,index,data) +void *_xine_buffer_strcpy(void *buf, int index, const char *data) XINE_PROTECTED; + +/* + * returns a pointer to the first occurence of ch. + * note, that the returned pointer cannot be used + * in any other xine_buffer_* functions. + */ +char *xine_buffer_strchr(const void *buf, int ch) XINE_PROTECTED; + +/* + * get allocated memory size + */ +int xine_buffer_get_size(const void *buf) XINE_PROTECTED; + +/* + * ensures a specified buffer size if the user want to + * write directly to the buffer. Normally the special + * access functions defined here should be used. + */ +#define xine_buffer_ensure_size(buf,data) \ + buf=_xine_buffer_ensure_size(buf,data) +void *_xine_buffer_ensure_size(void *buf, int size) XINE_PROTECTED; + +#endif diff --git a/include/xine/xine_internal.h b/include/xine/xine_internal.h new file mode 100644 index 000000000..13b003992 --- /dev/null +++ b/include/xine/xine_internal.h @@ -0,0 +1,546 @@ +/* + * Copyright (C) 2000-2005 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + */ + +#ifndef HAVE_XINE_INTERNAL_H +#define HAVE_XINE_INTERNAL_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * include public part of xine header + */ + +#ifdef XINE_COMPILE +# include "xine.h" +# include "refcounter.h" +# include "input/input_plugin.h" +# include "demuxers/demux.h" +# include "video_out.h" +# include "audio_out.h" +# include "metronom.h" +# include "osd.h" +# include "xineintl.h" +# include "plugin_catalog.h" +# include "video_decoder.h" +# include "audio_decoder.h" +# include "spu_decoder.h" +# include "scratch.h" +# include "broadcaster.h" +# include "io_helper.h" +# include "info_helper.h" +# include "alphablend.h" +#else +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +#endif + +#define XINE_MAX_EVENT_LISTENERS 50 +#define XINE_MAX_EVENT_TYPES 100 +#define XINE_MAX_TICKET_HOLDER_THREADS 64 + +/* used by plugin loader */ +#define XINE_VERSION_CODE XINE_MAJOR_VERSION*10000+XINE_MINOR_VERSION*100+XINE_SUB_VERSION + + +/* + * log constants + */ + +#define XINE_LOG_MSG 0 /* warnings, errors, ... */ +#define XINE_LOG_PLUGIN 1 +#define XINE_LOG_TRACE 2 +#define XINE_LOG_NUM 3 /* # of log buffers defined */ + +#define XINE_STREAM_INFO_MAX 99 + +typedef struct xine_ticket_s xine_ticket_t; + +/* + * the "big" xine struct, holding everything together + */ + +struct xine_s { + + config_values_t *config; + + plugin_catalog_t *plugin_catalog; + + int verbosity; + + int demux_strategy; + char *save_path; + + /* log output that may be presented to the user */ + scratch_buffer_t *log_buffers[XINE_LOG_NUM]; + + xine_list_t *streams; + pthread_mutex_t streams_lock; + + metronom_clock_t *clock; + + /** Handle for libxdg-basedir functions. It's actually an xdgHandle. */ + void * basedir_handle; + +#ifdef XINE_ENGINE_INTERNAL + xine_ticket_t *port_ticket; + pthread_mutex_t log_lock; +#endif +}; + +/* + * xine thread tickets + */ + +struct xine_ticket_s { + + /* the ticket owner must assure to check for ticket revocation in + * intervals of finite length; this means that you must release + * the ticket before any operation that might block + * + * you must never write to this member directly + */ + int ticket_revoked; + + /* apply for a ticket; between acquire and relese of an irrevocable + * ticket (be sure to pair them properly!), it is guaranteed that you + * will never be blocked by ticket revocation */ + void (*acquire)(xine_ticket_t *self, int irrevocable); + + /* give a ticket back */ + void (*release)(xine_ticket_t *self, int irrevocable); + + /* renew a ticket, when it has been revoked, see ticket_revoked above; + * irrevocable must be set to one, if your thread might have acquired + * irrevocable tickets you don't know of; set it to zero only when + * you know that this is impossible */ + void (*renew)(xine_ticket_t *self, int irrevocable); + +#ifdef XINE_ENGINE_INTERNAL + /* allow handing out new tickets */ + void (*issue)(xine_ticket_t *self, int atomic); + + /* revoke all tickets and deny new ones; + * a pair of atomic revoke and issue cannot be interrupted by another + * revocation or by other threads acquiring tickets */ + void (*revoke)(xine_ticket_t *self, int atomic); + + /* behaves like acquire() but doesn't block the calling thread; when + * the thread would have been blocked, 0 is returned otherwise 1 + * this function acquires a ticket even if ticket revocation is active */ + int (*acquire_nonblocking)(xine_ticket_t *self, int irrevocable); + + /* behaves like release() but doesn't block the calling thread; should + * be used in combination with acquire_nonblocking() */ + void (*release_nonblocking)(xine_ticket_t *self, int irrevocable); + + int (*lock_port_rewiring)(xine_ticket_t *self, int ms_timeout); + void (*unlock_port_rewiring)(xine_ticket_t *self); + + void (*dispose)(xine_ticket_t *self); + + pthread_mutex_t lock; + pthread_mutex_t revoke_lock; + pthread_cond_t issued; + pthread_cond_t revoked; + int tickets_granted; + int irrevocable_tickets; + int pending_revocations; + int atomic_revoke; + pthread_t atomic_revoker_thread; + pthread_mutex_t port_rewiring_lock; + struct { + int count; + pthread_t holder; + } *holder_threads; + unsigned holder_thread_count; +#endif +}; + +/* + * xine event queue + */ + +struct xine_event_queue_s { + xine_list_t *events; + pthread_mutex_t lock; + pthread_cond_t new_event; + pthread_cond_t events_processed; + xine_stream_t *stream; + pthread_t *listener_thread; + void *user_data; + xine_event_listener_cb_t callback; + int callback_running; +}; + +/* + * xine_stream - per-stream parts of the xine engine + */ + +struct xine_stream_s { + + /* reference to xine context */ + xine_t *xine; + + /* metronom instance used by current stream */ + metronom_t *metronom; + + /* demuxers use input_plugin to read data */ + input_plugin_t *input_plugin; + + /* used by video decoders */ + xine_video_port_t *video_out; + + /* demuxers send data to video decoders using this fifo */ + fifo_buffer_t *video_fifo; + + /* used by audio decoders */ + xine_audio_port_t *audio_out; + + /* demuxers send data to audio decoders using this fifo */ + fifo_buffer_t *audio_fifo; + + /* provide access to osd api */ + osd_renderer_t *osd_renderer; + + /* master/slave streams */ + xine_stream_t *master; /* usually a pointer to itself */ + xine_stream_t *slave; + + /* input_dvd uses this one. is it possible to add helper functions instead? */ + spu_decoder_t *spu_decoder_plugin; + + /* dxr3 use this one, should be possible to fix to use the port instead */ + vo_driver_t *video_driver; + + /* these definitely should be made private! */ + int audio_channel_auto; + int spu_decoder_streamtype; + int spu_channel_user; + int spu_channel_auto; + int spu_channel_letterbox; + int spu_channel; + + /* current content detection method, see METHOD_BY_xxx */ + int content_detection_method; + +#ifdef XINE_ENGINE_INTERNAL + /* these are private variables, plugins must not access them */ + + int status; + + /* lock controlling speed change access */ + pthread_mutex_t speed_change_lock; + uint32_t ignore_speed_change:1; /*< speed changes during stop can be disastrous */ + uint32_t video_thread_created:1; + uint32_t audio_thread_created:1; + uint32_t first_frame_flag:2; + uint32_t demux_action_pending:1; + uint32_t demux_thread_created:1; + uint32_t demux_thread_running:1; + uint32_t slave_is_subtitle:1; /*< ... and will be automaticaly disposed */ + uint32_t emergency_brake:1; /*< something went really wrong and this stream must be + * stopped. usually due some fatal error on output + * layers as they cannot call xine_stop. */ + uint32_t early_finish_event:1; /*< do not wait fifos get empty before sending event */ + uint32_t gapless_switch:1; /*< next stream switch will be gapless */ + + input_class_t *eject_class; + demux_plugin_t *demux_plugin; + +/* vo_driver_t *video_driver;*/ + pthread_t video_thread; + video_decoder_t *video_decoder_plugin; + extra_info_t *video_decoder_extra_info; + int video_decoder_streamtype; + int video_channel; + + uint32_t audio_track_map[50]; + int audio_track_map_entries; + + int audio_decoder_streamtype; + pthread_t audio_thread; + audio_decoder_t *audio_decoder_plugin; + extra_info_t *audio_decoder_extra_info; + + uint32_t audio_type; + /* *_user: -2 => off + -1 => auto (use *_auto value) + >=0 => respect the user's choice + */ + int audio_channel_user; +/* int audio_channel_auto; */ + +/* spu_decoder_t *spu_decoder_plugin; */ +/* int spu_decoder_streamtype; */ + uint32_t spu_track_map[50]; + int spu_track_map_entries; +/* int spu_channel_user; */ +/* int spu_channel_auto; */ +/* int spu_channel_letterbox; */ + int spu_channel_pan_scan; +/* int spu_channel; */ + + /* lock for public xine player functions */ + pthread_mutex_t frontend_lock; + + /* stream meta information */ + /* NEVER access directly, use helpers (see info_helper.c) */ + pthread_mutex_t info_mutex; + int stream_info_public[XINE_STREAM_INFO_MAX]; + int stream_info[XINE_STREAM_INFO_MAX]; + pthread_mutex_t meta_mutex; + char *meta_info_public[XINE_STREAM_INFO_MAX]; + char *meta_info[XINE_STREAM_INFO_MAX]; + + /* seeking slowdown */ + pthread_mutex_t first_frame_lock; + pthread_cond_t first_frame_reached; + + /* wait for headers sent / stream decoding finished */ + pthread_mutex_t counter_lock; + pthread_cond_t counter_changed; + int header_count_audio; + int header_count_video; + int finished_count_audio; + int finished_count_video; + + /* event mechanism */ + xine_list_t *event_queues; + pthread_mutex_t event_queues_lock; + + /* demux thread stuff */ + pthread_t demux_thread; + pthread_mutex_t demux_lock; + pthread_mutex_t demux_mutex; /* used in _x_demux_... functions to synchronize order of pairwise A/V buffer operations */ + + extra_info_t *current_extra_info; + pthread_mutex_t current_extra_info_lock; + int video_seek_count; + + int delay_finish_event; /* delay event in 1/10 sec units. 0=>no delay, -1=>forever */ + + int slave_affection; /* what operations need to be propagated down to the slave? */ + + int err; + + xine_post_out_t video_source; + xine_post_out_t audio_source; + + broadcaster_t *broadcaster; + + refcounter_t *refcounter; +#endif +}; + +/* when explicitly noted, some functions accept an anonymous stream, + * which is a valid stream that does not want to be addressed. */ +#define XINE_ANON_STREAM ((xine_stream_t *)-1) + + +/* + * private function prototypes: + */ + +int _x_query_buffer_usage(xine_stream_t *stream, int *num_video_buffers, int *num_audio_buffers, int *num_video_frames, int *num_audio_frames) XINE_PROTECTED; +int _x_lock_port_rewiring(xine_t *xine, int ms_to_time_out) XINE_PROTECTED; +void _x_unlock_port_rewiring(xine_t *xine) XINE_PROTECTED; +int _x_lock_frontend(xine_stream_t *stream, int ms_to_time_out) XINE_PROTECTED; +void _x_unlock_frontend(xine_stream_t *stream) XINE_PROTECTED; +int _x_query_unprocessed_osd_events(xine_stream_t *stream) XINE_PROTECTED; +int _x_demux_seek(xine_stream_t *stream, off_t start_pos, int start_time, int playing) XINE_PROTECTED; +int _x_continue_stream_processing(xine_stream_t *stream) XINE_PROTECTED; +void _x_trigger_relaxed_frame_drop_mode(xine_stream_t *stream) XINE_PROTECTED; +void _x_reset_relaxed_frame_drop_mode(xine_stream_t *stream) XINE_PROTECTED; + +void _x_handle_stream_end (xine_stream_t *stream, int non_user) XINE_PROTECTED; + +/* report message to UI. usually these are async errors */ + +int _x_message(xine_stream_t *stream, int type, ...) XINE_SENTINEL XINE_PROTECTED; + +/* flush the message queues */ + +void _x_flush_events_queues (xine_stream_t *stream) XINE_PROTECTED; + + +/* find and instantiate input and demux plugins */ + +input_plugin_t *_x_find_input_plugin (xine_stream_t *stream, const char *mrl) XINE_PROTECTED; +demux_plugin_t *_x_find_demux_plugin (xine_stream_t *stream, input_plugin_t *input) XINE_PROTECTED; +demux_plugin_t *_x_find_demux_plugin_by_name (xine_stream_t *stream, const char *name, input_plugin_t *input) XINE_PROTECTED; +demux_plugin_t *_x_find_demux_plugin_last_probe(xine_stream_t *stream, const char *last_demux_name, input_plugin_t *input) XINE_PROTECTED; +input_plugin_t *_x_rip_plugin_get_instance (xine_stream_t *stream, const char *filename) XINE_PROTECTED; +input_plugin_t *_x_cache_plugin_get_instance (xine_stream_t *stream, int readahead_size) XINE_PROTECTED; +void _x_free_input_plugin (xine_stream_t *stream, input_plugin_t *input) XINE_PROTECTED; +void _x_free_demux_plugin (xine_stream_t *stream, demux_plugin_t *demux) XINE_PROTECTED; + +/* create decoder fifos and threads */ + +int _x_video_decoder_init (xine_stream_t *stream) XINE_PROTECTED; +void _x_video_decoder_shutdown (xine_stream_t *stream) XINE_PROTECTED; + +int _x_audio_decoder_init (xine_stream_t *stream) XINE_PROTECTED; +void _x_audio_decoder_shutdown (xine_stream_t *stream) XINE_PROTECTED; + +/* extra_info operations */ +void _x_extra_info_reset( extra_info_t *extra_info ) XINE_PROTECTED; + +void _x_extra_info_merge( extra_info_t *dst, extra_info_t *src ) XINE_PROTECTED; + +void _x_get_current_info (xine_stream_t *stream, extra_info_t *extra_info, int size) XINE_PROTECTED; + + +/* demuxer helper functions from demux.c */ + +/* + * Flush audio and video buffers. It is called from demuxers on + * seek/stop, and may be useful when user input changes a stream and + * xine-lib has cached buffers that have yet to be played. + * + * warning: after clearing decoders fifos an absolute discontinuity + * indication must be sent. relative discontinuities are likely + * to cause "jumps" on metronom. + */ +void _x_demux_flush_engine (xine_stream_t *stream) XINE_PROTECTED; + +void _x_demux_control_nop (xine_stream_t *stream, uint32_t flags) XINE_PROTECTED; +void _x_demux_control_newpts (xine_stream_t *stream, int64_t pts, uint32_t flags) XINE_PROTECTED; +void _x_demux_control_headers_done (xine_stream_t *stream) XINE_PROTECTED; +void _x_demux_control_start (xine_stream_t *stream) XINE_PROTECTED; +void _x_demux_control_end (xine_stream_t *stream, uint32_t flags) XINE_PROTECTED; +int _x_demux_start_thread (xine_stream_t *stream) XINE_PROTECTED; +int _x_demux_stop_thread (xine_stream_t *stream) XINE_PROTECTED; +int _x_demux_read_header (input_plugin_t *input, void *buffer, off_t size) XINE_PROTECTED; +int _x_demux_check_extension (const char *mrl, const char *extensions); + +off_t _x_read_abort (xine_stream_t *stream, int fd, char *buf, off_t todo) XINE_PROTECTED; + +int _x_action_pending (xine_stream_t *stream) XINE_PROTECTED; + +void _x_demux_send_data(fifo_buffer_t *fifo, uint8_t *data, int size, + int64_t pts, uint32_t type, uint32_t decoder_flags, + int input_normpos, int input_time, int total_time, + uint32_t frame_number) XINE_PROTECTED; + +int _x_demux_read_send_data(fifo_buffer_t *fifo, input_plugin_t *input, + int size, int64_t pts, uint32_t type, + uint32_t decoder_flags, off_t input_normpos, + int input_time, int total_time, + uint32_t frame_number) XINE_PROTECTED; + +void _x_demux_send_mrl_reference (xine_stream_t *stream, int alternative, + const char *mrl, const char *title, + int start_time, int duration) XINE_PROTECTED; + +/* + * MRL escaped-character decoding (overwrites the source string) + */ +void _x_mrl_unescape(char *mrl) XINE_PROTECTED; + +/* + * plugin_loader functions + * + */ + +/* on-demand loading of audio/video/spu decoder plugins */ + +video_decoder_t *_x_get_video_decoder (xine_stream_t *stream, uint8_t stream_type) XINE_PROTECTED; +void _x_free_video_decoder (xine_stream_t *stream, video_decoder_t *decoder) XINE_PROTECTED; +audio_decoder_t *_x_get_audio_decoder (xine_stream_t *stream, uint8_t stream_type) XINE_PROTECTED; +void _x_free_audio_decoder (xine_stream_t *stream, audio_decoder_t *decoder) XINE_PROTECTED; +spu_decoder_t *_x_get_spu_decoder (xine_stream_t *stream, uint8_t stream_type) XINE_PROTECTED; +void _x_free_spu_decoder (xine_stream_t *stream, spu_decoder_t *decoder) XINE_PROTECTED; +/* check for decoder availability - but don't try to initialize it */ +int _x_decoder_available (xine_t *xine, uint32_t buftype) XINE_PROTECTED; + +/* + * load_video_output_plugin + * + * load a specific video output plugin + */ + +vo_driver_t *_x_load_video_output_plugin(xine_t *this, + char *id, int visual_type, void *visual) XINE_PROTECTED; + +/* + * audio output plugin dynamic loading stuff + */ + +/* + * load_audio_output_plugin + * + * load a specific audio output plugin + */ + +ao_driver_t *_x_load_audio_output_plugin (xine_t *self, const char *id) XINE_PROTECTED; + + +void _x_set_speed (xine_stream_t *stream, int speed) XINE_PROTECTED; + +int _x_get_speed (xine_stream_t *stream) XINE_PROTECTED; + +void _x_set_fine_speed (xine_stream_t *stream, int speed) XINE_PROTECTED; + +int _x_get_fine_speed (xine_stream_t *stream) XINE_PROTECTED; + +void _x_select_spu_channel (xine_stream_t *stream, int channel) XINE_PROTECTED; + +int _x_get_audio_channel (xine_stream_t *stream) XINE_PROTECTED; + +int _x_get_spu_channel (xine_stream_t *stream) XINE_PROTECTED; + +/* + * internal events + */ + +/* sent by dvb frontend to inform ts demuxer of new pids */ +#define XINE_EVENT_PIDS_CHANGE 0x80000000 + +/* + * pids change event - inform ts demuxer of new pids + */ +typedef struct { + int vpid; /* video program id */ + int apid; /* audio program id */ +} xine_pids_data_t; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/xine/xine_plugin.h b/include/xine/xine_plugin.h new file mode 100644 index 000000000..74e7523e9 --- /dev/null +++ b/include/xine/xine_plugin.h @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2000-2003 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * generic plugin definitions + */ + +#ifndef XINE_PLUGIN_H +#define XINE_PLUGIN_H + +#define PLUGIN_NONE 0 +#define PLUGIN_INPUT 1 +#define PLUGIN_DEMUX 2 +#define PLUGIN_AUDIO_DECODER 3 +#define PLUGIN_VIDEO_DECODER 4 +#define PLUGIN_SPU_DECODER 5 +#define PLUGIN_AUDIO_OUT 6 +#define PLUGIN_VIDEO_OUT 7 +#define PLUGIN_POST 8 + +#define PLUGIN_TYPE_MAX PLUGIN_POST + +/* this flag may be or'ed with type in order to force preloading the plugin. + * very useful to register config items on xine initialization. + */ +#define PLUGIN_MUST_PRELOAD (1 << 7) + +/* this flag may be or'ed with type to prevent the plugin loader from unloading + * the plugin + */ +#define PLUGIN_NO_UNLOAD (1 << 6) + +#define PLUGIN_TYPE_MASK ((1 << 6) - 1) + +typedef struct { + uint8_t type; /* one of the PLUGIN_* constants above */ + uint8_t API; /* API version supported by this plugin */ + char *id; /* a name that identifies this plugin */ + uint32_t version; /* version number, increased every release */ + const void *special_info; /* plugin-type specific, see structs below */ + void *(*init)(xine_t *, void *); /* init the plugin class */ +} plugin_info_t; + + +/* special_info for a video output plugin */ +typedef struct { + int priority; /* priority of this plugin for auto-probing */ + int visual_type; /* visual type supported by this plugin */ +} vo_info_t; + +/* special info for a audio output plugin */ +typedef struct { + int priority; +} ao_info_t; + +/* special_info for a decoder plugin */ +typedef struct { + uint32_t *supported_types; /* streamtypes this decoder can handle */ + int priority; +} decoder_info_t; + +/* special info for a post plugin */ +typedef struct { + uint32_t type; /* type of the post plugin, use one of XINE_POST_TYPE_* */ +} post_info_t; + +/* special info for a demuxer plugin */ +typedef struct { + int priority; +} demuxer_info_t; + +/* special info for an input plugin */ +typedef struct { + int priority; +} input_info_t; + + +/* register a list of statically linked plugins + * info is a list of plugin_info_t terminated by PLUGIN_NONE + * example: + * plugin_info_t acme_plugin_info[] = { + * { PLUGIN_VIDEO_OUT, 21, "acme", XINE_VERSION_CODE, &vo_info_acme, + * init_class_acme }, + * { PLUGIN_NONE, 0, "", 0, NULL, NULL } + * }; + * + */ +void xine_register_plugins(xine_t *self, plugin_info_t *info) XINE_PROTECTED; + +#endif diff --git a/include/xine/xineintl.h b/include/xine/xineintl.h new file mode 100644 index 000000000..113a033fa --- /dev/null +++ b/include/xine/xineintl.h @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2000-2005 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + */ + +#ifndef HAVE_XINEINTL_H +#define HAVE_XINEINTL_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#ifdef ENABLE_NLS +# include +# define _(String) dgettext (XINE_TEXTDOMAIN, String) +# ifdef gettext_noop +# define N_(String) gettext_noop (String) +# else +# define N_(String) (String) +# endif +#else +/* Stubs that do something close enough. */ +# define textdomain(String) (String) +# define gettext(String) (String) +# define dgettext(Domain,Message) (Message) +# define dcgettext(Domain,Message,Type) (Message) +# define ngettext(Singular, Plural, IsPlural) (Singular) +# define bindtextdomain(Domain,Directory) (Domain) +# define _(String) (String) +# define N_(String) (String) +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/xine/xineutils.h b/include/xine/xineutils.h new file mode 100644 index 000000000..4ff87e87c --- /dev/null +++ b/include/xine/xineutils.h @@ -0,0 +1,972 @@ +/* + * Copyright (C) 2000-2006 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + */ +#ifndef XINEUTILS_H +#define XINEUTILS_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include + +#ifdef XINE_COMPILE +# include +# include "attributes.h" +# include "compat.h" +# include "xmlparser.h" +# include "xine_buffer.h" +# include "configfile.h" +# include "list.h" +# include "array.h" +# include "sorted_array.h" +#else +# ifdef WIN32 +# include +# else +# include +# endif +# include +# include +# include +# include +# include +# include +# include +# include +# include +#endif + +#include +#include + +/* + * Mark exported data symbols for link engine library clients with older + * Win32 compilers + */ +#if defined(WIN32) && !defined(XINE_LIBRARY_COMPILE) +# define DL_IMPORT __declspec(dllimport) +# define extern DL_IMPORT extern +#endif + + /* + * debugable mutexes + */ + + typedef struct { + pthread_mutex_t mutex; + char id[80]; + char *locked_by; + } xine_mutex_t; + + int xine_mutex_init (xine_mutex_t *mutex, const pthread_mutexattr_t *mutexattr, + const char *id) XINE_PROTECTED; + + int xine_mutex_lock (xine_mutex_t *mutex, const char *who) XINE_PROTECTED; + int xine_mutex_unlock (xine_mutex_t *mutex, const char *who) XINE_PROTECTED; + int xine_mutex_destroy (xine_mutex_t *mutex) XINE_PROTECTED; + + + + /* CPU Acceleration */ + +/* + * The type of an value that fits in an MMX register (note that long + * long constant values MUST be suffixed by LL and unsigned long long + * values by ULL, lest they be truncated by the compiler) + */ + +/* generic accelerations */ +#define MM_ACCEL_MLIB 0x00000001 + +/* x86 accelerations */ +#define MM_ACCEL_X86_MMX 0x80000000 +#define MM_ACCEL_X86_3DNOW 0x40000000 +#define MM_ACCEL_X86_MMXEXT 0x20000000 +#define MM_ACCEL_X86_SSE 0x10000000 +#define MM_ACCEL_X86_SSE2 0x08000000 + +/* powerpc accelerations and features */ +#define MM_ACCEL_PPC_ALTIVEC 0x04000000 +#define MM_ACCEL_PPC_CACHE32 0x02000000 + +/* SPARC accelerations */ + +#define MM_ACCEL_SPARC_VIS 0x01000000 +#define MM_ACCEL_SPARC_VIS2 0x00800000 + +/* x86 compat defines */ +#define MM_MMX MM_ACCEL_X86_MMX +#define MM_3DNOW MM_ACCEL_X86_3DNOW +#define MM_MMXEXT MM_ACCEL_X86_MMXEXT +#define MM_SSE MM_ACCEL_X86_SSE +#define MM_SSE2 MM_ACCEL_X86_SSE2 + +uint32_t xine_mm_accel (void) XINE_PROTECTED; + +#if defined(ARCH_X86) || defined(ARCH_X86_64) + +typedef union { + int64_t q; /* Quadword (64-bit) value */ + uint64_t uq; /* Unsigned Quadword */ + int d[2]; /* 2 Doubleword (32-bit) values */ + unsigned int ud[2]; /* 2 Unsigned Doubleword */ + short w[4]; /* 4 Word (16-bit) values */ + unsigned short uw[4]; /* 4 Unsigned Word */ + char b[8]; /* 8 Byte (8-bit) values */ + unsigned char ub[8]; /* 8 Unsigned Byte */ + float s[2]; /* Single-precision (32-bit) value */ +} ATTR_ALIGN(8) mmx_t; /* On an 8-byte (64-bit) boundary */ + + + +#define mmx_i2r(op,imm,reg) \ + __asm__ __volatile__ (#op " %0, %%" #reg \ + : /* nothing */ \ + : "i" (imm) ) + +#define mmx_m2r(op,mem,reg) \ + __asm__ __volatile__ (#op " %0, %%" #reg \ + : /* nothing */ \ + : "m" (mem)) + +#define mmx_r2m(op,reg,mem) \ + __asm__ __volatile__ (#op " %%" #reg ", %0" \ + : "=m" (mem) \ + : /* nothing */ ) + +#define mmx_r2r(op,regs,regd) \ + __asm__ __volatile__ (#op " %" #regs ", %" #regd) + + +#define emms() __asm__ __volatile__ ("emms") + +#define movd_m2r(var,reg) mmx_m2r (movd, var, reg) +#define movd_r2m(reg,var) mmx_r2m (movd, reg, var) +#define movd_r2r(regs,regd) mmx_r2r (movd, regs, regd) + +#define movq_m2r(var,reg) mmx_m2r (movq, var, reg) +#define movq_r2m(reg,var) mmx_r2m (movq, reg, var) +#define movq_r2r(regs,regd) mmx_r2r (movq, regs, regd) + +#define packssdw_m2r(var,reg) mmx_m2r (packssdw, var, reg) +#define packssdw_r2r(regs,regd) mmx_r2r (packssdw, regs, regd) +#define packsswb_m2r(var,reg) mmx_m2r (packsswb, var, reg) +#define packsswb_r2r(regs,regd) mmx_r2r (packsswb, regs, regd) + +#define packuswb_m2r(var,reg) mmx_m2r (packuswb, var, reg) +#define packuswb_r2r(regs,regd) mmx_r2r (packuswb, regs, regd) + +#define paddb_m2r(var,reg) mmx_m2r (paddb, var, reg) +#define paddb_r2r(regs,regd) mmx_r2r (paddb, regs, regd) +#define paddd_m2r(var,reg) mmx_m2r (paddd, var, reg) +#define paddd_r2r(regs,regd) mmx_r2r (paddd, regs, regd) +#define paddw_m2r(var,reg) mmx_m2r (paddw, var, reg) +#define paddw_r2r(regs,regd) mmx_r2r (paddw, regs, regd) + +#define paddsb_m2r(var,reg) mmx_m2r (paddsb, var, reg) +#define paddsb_r2r(regs,regd) mmx_r2r (paddsb, regs, regd) +#define paddsw_m2r(var,reg) mmx_m2r (paddsw, var, reg) +#define paddsw_r2r(regs,regd) mmx_r2r (paddsw, regs, regd) + +#define paddusb_m2r(var,reg) mmx_m2r (paddusb, var, reg) +#define paddusb_r2r(regs,regd) mmx_r2r (paddusb, regs, regd) +#define paddusw_m2r(var,reg) mmx_m2r (paddusw, var, reg) +#define paddusw_r2r(regs,regd) mmx_r2r (paddusw, regs, regd) + +#define pand_m2r(var,reg) mmx_m2r (pand, var, reg) +#define pand_r2r(regs,regd) mmx_r2r (pand, regs, regd) + +#define pandn_m2r(var,reg) mmx_m2r (pandn, var, reg) +#define pandn_r2r(regs,regd) mmx_r2r (pandn, regs, regd) + +#define pcmpeqb_m2r(var,reg) mmx_m2r (pcmpeqb, var, reg) +#define pcmpeqb_r2r(regs,regd) mmx_r2r (pcmpeqb, regs, regd) +#define pcmpeqd_m2r(var,reg) mmx_m2r (pcmpeqd, var, reg) +#define pcmpeqd_r2r(regs,regd) mmx_r2r (pcmpeqd, regs, regd) +#define pcmpeqw_m2r(var,reg) mmx_m2r (pcmpeqw, var, reg) +#define pcmpeqw_r2r(regs,regd) mmx_r2r (pcmpeqw, regs, regd) + +#define pcmpgtb_m2r(var,reg) mmx_m2r (pcmpgtb, var, reg) +#define pcmpgtb_r2r(regs,regd) mmx_r2r (pcmpgtb, regs, regd) +#define pcmpgtd_m2r(var,reg) mmx_m2r (pcmpgtd, var, reg) +#define pcmpgtd_r2r(regs,regd) mmx_r2r (pcmpgtd, regs, regd) +#define pcmpgtw_m2r(var,reg) mmx_m2r (pcmpgtw, var, reg) +#define pcmpgtw_r2r(regs,regd) mmx_r2r (pcmpgtw, regs, regd) + +#define pmaddwd_m2r(var,reg) mmx_m2r (pmaddwd, var, reg) +#define pmaddwd_r2r(regs,regd) mmx_r2r (pmaddwd, regs, regd) + +#define pmulhw_m2r(var,reg) mmx_m2r (pmulhw, var, reg) +#define pmulhw_r2r(regs,regd) mmx_r2r (pmulhw, regs, regd) + +#define pmullw_m2r(var,reg) mmx_m2r (pmullw, var, reg) +#define pmullw_r2r(regs,regd) mmx_r2r (pmullw, regs, regd) + +#define por_m2r(var,reg) mmx_m2r (por, var, reg) +#define por_r2r(regs,regd) mmx_r2r (por, regs, regd) + +#define pslld_i2r(imm,reg) mmx_i2r (pslld, imm, reg) +#define pslld_m2r(var,reg) mmx_m2r (pslld, var, reg) +#define pslld_r2r(regs,regd) mmx_r2r (pslld, regs, regd) +#define psllq_i2r(imm,reg) mmx_i2r (psllq, imm, reg) +#define psllq_m2r(var,reg) mmx_m2r (psllq, var, reg) +#define psllq_r2r(regs,regd) mmx_r2r (psllq, regs, regd) +#define psllw_i2r(imm,reg) mmx_i2r (psllw, imm, reg) +#define psllw_m2r(var,reg) mmx_m2r (psllw, var, reg) +#define psllw_r2r(regs,regd) mmx_r2r (psllw, regs, regd) + +#define psrad_i2r(imm,reg) mmx_i2r (psrad, imm, reg) +#define psrad_m2r(var,reg) mmx_m2r (psrad, var, reg) +#define psrad_r2r(regs,regd) mmx_r2r (psrad, regs, regd) +#define psraw_i2r(imm,reg) mmx_i2r (psraw, imm, reg) +#define psraw_m2r(var,reg) mmx_m2r (psraw, var, reg) +#define psraw_r2r(regs,regd) mmx_r2r (psraw, regs, regd) + +#define psrld_i2r(imm,reg) mmx_i2r (psrld, imm, reg) +#define psrld_m2r(var,reg) mmx_m2r (psrld, var, reg) +#define psrld_r2r(regs,regd) mmx_r2r (psrld, regs, regd) +#define psrlq_i2r(imm,reg) mmx_i2r (psrlq, imm, reg) +#define psrlq_m2r(var,reg) mmx_m2r (psrlq, var, reg) +#define psrlq_r2r(regs,regd) mmx_r2r (psrlq, regs, regd) +#define psrlw_i2r(imm,reg) mmx_i2r (psrlw, imm, reg) +#define psrlw_m2r(var,reg) mmx_m2r (psrlw, var, reg) +#define psrlw_r2r(regs,regd) mmx_r2r (psrlw, regs, regd) + +#define psubb_m2r(var,reg) mmx_m2r (psubb, var, reg) +#define psubb_r2r(regs,regd) mmx_r2r (psubb, regs, regd) +#define psubd_m2r(var,reg) mmx_m2r (psubd, var, reg) +#define psubd_r2r(regs,regd) mmx_r2r (psubd, regs, regd) +#define psubw_m2r(var,reg) mmx_m2r (psubw, var, reg) +#define psubw_r2r(regs,regd) mmx_r2r (psubw, regs, regd) + +#define psubsb_m2r(var,reg) mmx_m2r (psubsb, var, reg) +#define psubsb_r2r(regs,regd) mmx_r2r (psubsb, regs, regd) +#define psubsw_m2r(var,reg) mmx_m2r (psubsw, var, reg) +#define psubsw_r2r(regs,regd) mmx_r2r (psubsw, regs, regd) + +#define psubusb_m2r(var,reg) mmx_m2r (psubusb, var, reg) +#define psubusb_r2r(regs,regd) mmx_r2r (psubusb, regs, regd) +#define psubusw_m2r(var,reg) mmx_m2r (psubusw, var, reg) +#define psubusw_r2r(regs,regd) mmx_r2r (psubusw, regs, regd) + +#define punpckhbw_m2r(var,reg) mmx_m2r (punpckhbw, var, reg) +#define punpckhbw_r2r(regs,regd) mmx_r2r (punpckhbw, regs, regd) +#define punpckhdq_m2r(var,reg) mmx_m2r (punpckhdq, var, reg) +#define punpckhdq_r2r(regs,regd) mmx_r2r (punpckhdq, regs, regd) +#define punpckhwd_m2r(var,reg) mmx_m2r (punpckhwd, var, reg) +#define punpckhwd_r2r(regs,regd) mmx_r2r (punpckhwd, regs, regd) + +#define punpcklbw_m2r(var,reg) mmx_m2r (punpcklbw, var, reg) +#define punpcklbw_r2r(regs,regd) mmx_r2r (punpcklbw, regs, regd) +#define punpckldq_m2r(var,reg) mmx_m2r (punpckldq, var, reg) +#define punpckldq_r2r(regs,regd) mmx_r2r (punpckldq, regs, regd) +#define punpcklwd_m2r(var,reg) mmx_m2r (punpcklwd, var, reg) +#define punpcklwd_r2r(regs,regd) mmx_r2r (punpcklwd, regs, regd) + +#define pxor_m2r(var,reg) mmx_m2r (pxor, var, reg) +#define pxor_r2r(regs,regd) mmx_r2r (pxor, regs, regd) + + +/* 3DNOW extensions */ + +#define pavgusb_m2r(var,reg) mmx_m2r (pavgusb, var, reg) +#define pavgusb_r2r(regs,regd) mmx_r2r (pavgusb, regs, regd) + + +/* AMD MMX extensions - also available in intel SSE */ + + +#define mmx_m2ri(op,mem,reg,imm) \ + __asm__ __volatile__ (#op " %1, %0, %%" #reg \ + : /* nothing */ \ + : "X" (mem), "X" (imm)) +#define mmx_r2ri(op,regs,regd,imm) \ + __asm__ __volatile__ (#op " %0, %%" #regs ", %%" #regd \ + : /* nothing */ \ + : "X" (imm) ) + +#define mmx_fetch(mem,hint) \ + __asm__ __volatile__ ("prefetch" #hint " %0" \ + : /* nothing */ \ + : "X" (mem)) + + +#define maskmovq(regs,maskreg) mmx_r2ri (maskmovq, regs, maskreg) + +#define movntq_r2m(mmreg,var) mmx_r2m (movntq, mmreg, var) + +#define pavgb_m2r(var,reg) mmx_m2r (pavgb, var, reg) +#define pavgb_r2r(regs,regd) mmx_r2r (pavgb, regs, regd) +#define pavgw_m2r(var,reg) mmx_m2r (pavgw, var, reg) +#define pavgw_r2r(regs,regd) mmx_r2r (pavgw, regs, regd) + +#define pextrw_r2r(mmreg,reg,imm) mmx_r2ri (pextrw, mmreg, reg, imm) + +#define pinsrw_r2r(reg,mmreg,imm) mmx_r2ri (pinsrw, reg, mmreg, imm) + +#define pmaxsw_m2r(var,reg) mmx_m2r (pmaxsw, var, reg) +#define pmaxsw_r2r(regs,regd) mmx_r2r (pmaxsw, regs, regd) + +#define pmaxub_m2r(var,reg) mmx_m2r (pmaxub, var, reg) +#define pmaxub_r2r(regs,regd) mmx_r2r (pmaxub, regs, regd) + +#define pminsw_m2r(var,reg) mmx_m2r (pminsw, var, reg) +#define pminsw_r2r(regs,regd) mmx_r2r (pminsw, regs, regd) + +#define pminub_m2r(var,reg) mmx_m2r (pminub, var, reg) +#define pminub_r2r(regs,regd) mmx_r2r (pminub, regs, regd) + +#define pmovmskb(mmreg,reg) \ + __asm__ __volatile__ ("movmskps %" #mmreg ", %" #reg) + +#define pmulhuw_m2r(var,reg) mmx_m2r (pmulhuw, var, reg) +#define pmulhuw_r2r(regs,regd) mmx_r2r (pmulhuw, regs, regd) + +#define prefetcht0(mem) mmx_fetch (mem, t0) +#define prefetcht1(mem) mmx_fetch (mem, t1) +#define prefetcht2(mem) mmx_fetch (mem, t2) +#define prefetchnta(mem) mmx_fetch (mem, nta) + +#define psadbw_m2r(var,reg) mmx_m2r (psadbw, var, reg) +#define psadbw_r2r(regs,regd) mmx_r2r (psadbw, regs, regd) + +#define pshufw_m2r(var,reg,imm) mmx_m2ri(pshufw, var, reg, imm) +#define pshufw_r2r(regs,regd,imm) mmx_r2ri(pshufw, regs, regd, imm) + +#define sfence() __asm__ __volatile__ ("sfence\n\t") + +typedef union { + float sf[4]; /* Single-precision (32-bit) value */ +} ATTR_ALIGN(16) sse_t; /* On a 16 byte (128-bit) boundary */ + + +#define sse_i2r(op, imm, reg) \ + __asm__ __volatile__ (#op " %0, %%" #reg \ + : /* nothing */ \ + : "X" (imm) ) + +#define sse_m2r(op, mem, reg) \ + __asm__ __volatile__ (#op " %0, %%" #reg \ + : /* nothing */ \ + : "X" (mem)) + +#define sse_r2m(op, reg, mem) \ + __asm__ __volatile__ (#op " %%" #reg ", %0" \ + : "=X" (mem) \ + : /* nothing */ ) + +#define sse_r2r(op, regs, regd) \ + __asm__ __volatile__ (#op " %" #regs ", %" #regd) + +#define sse_r2ri(op, regs, regd, imm) \ + __asm__ __volatile__ (#op " %0, %%" #regs ", %%" #regd \ + : /* nothing */ \ + : "X" (imm) ) + +#define sse_m2ri(op, mem, reg, subop) \ + __asm__ __volatile__ (#op " %0, %%" #reg ", " #subop \ + : /* nothing */ \ + : "X" (mem)) + + +#define movaps_m2r(var, reg) sse_m2r(movaps, var, reg) +#define movaps_r2m(reg, var) sse_r2m(movaps, reg, var) +#define movaps_r2r(regs, regd) sse_r2r(movaps, regs, regd) + +#define movntps_r2m(xmmreg, var) sse_r2m(movntps, xmmreg, var) + +#define movups_m2r(var, reg) sse_m2r(movups, var, reg) +#define movups_r2m(reg, var) sse_r2m(movups, reg, var) +#define movups_r2r(regs, regd) sse_r2r(movups, regs, regd) + +#define movhlps_r2r(regs, regd) sse_r2r(movhlps, regs, regd) + +#define movlhps_r2r(regs, regd) sse_r2r(movlhps, regs, regd) + +#define movhps_m2r(var, reg) sse_m2r(movhps, var, reg) +#define movhps_r2m(reg, var) sse_r2m(movhps, reg, var) + +#define movlps_m2r(var, reg) sse_m2r(movlps, var, reg) +#define movlps_r2m(reg, var) sse_r2m(movlps, reg, var) + +#define movss_m2r(var, reg) sse_m2r(movss, var, reg) +#define movss_r2m(reg, var) sse_r2m(movss, reg, var) +#define movss_r2r(regs, regd) sse_r2r(movss, regs, regd) + +#define shufps_m2r(var, reg, index) sse_m2ri(shufps, var, reg, index) +#define shufps_r2r(regs, regd, index) sse_r2ri(shufps, regs, regd, index) + +#define cvtpi2ps_m2r(var, xmmreg) sse_m2r(cvtpi2ps, var, xmmreg) +#define cvtpi2ps_r2r(mmreg, xmmreg) sse_r2r(cvtpi2ps, mmreg, xmmreg) + +#define cvtps2pi_m2r(var, mmreg) sse_m2r(cvtps2pi, var, mmreg) +#define cvtps2pi_r2r(xmmreg, mmreg) sse_r2r(cvtps2pi, mmreg, xmmreg) + +#define cvttps2pi_m2r(var, mmreg) sse_m2r(cvttps2pi, var, mmreg) +#define cvttps2pi_r2r(xmmreg, mmreg) sse_r2r(cvttps2pi, mmreg, xmmreg) + +#define cvtsi2ss_m2r(var, xmmreg) sse_m2r(cvtsi2ss, var, xmmreg) +#define cvtsi2ss_r2r(reg, xmmreg) sse_r2r(cvtsi2ss, reg, xmmreg) + +#define cvtss2si_m2r(var, reg) sse_m2r(cvtss2si, var, reg) +#define cvtss2si_r2r(xmmreg, reg) sse_r2r(cvtss2si, xmmreg, reg) + +#define cvttss2si_m2r(var, reg) sse_m2r(cvtss2si, var, reg) +#define cvttss2si_r2r(xmmreg, reg) sse_r2r(cvtss2si, xmmreg, reg) + +#define movmskps(xmmreg, reg) \ + __asm__ __volatile__ ("movmskps %" #xmmreg ", %" #reg) + +#define addps_m2r(var, reg) sse_m2r(addps, var, reg) +#define addps_r2r(regs, regd) sse_r2r(addps, regs, regd) + +#define addss_m2r(var, reg) sse_m2r(addss, var, reg) +#define addss_r2r(regs, regd) sse_r2r(addss, regs, regd) + +#define subps_m2r(var, reg) sse_m2r(subps, var, reg) +#define subps_r2r(regs, regd) sse_r2r(subps, regs, regd) + +#define subss_m2r(var, reg) sse_m2r(subss, var, reg) +#define subss_r2r(regs, regd) sse_r2r(subss, regs, regd) + +#define mulps_m2r(var, reg) sse_m2r(mulps, var, reg) +#define mulps_r2r(regs, regd) sse_r2r(mulps, regs, regd) + +#define mulss_m2r(var, reg) sse_m2r(mulss, var, reg) +#define mulss_r2r(regs, regd) sse_r2r(mulss, regs, regd) + +#define divps_m2r(var, reg) sse_m2r(divps, var, reg) +#define divps_r2r(regs, regd) sse_r2r(divps, regs, regd) + +#define divss_m2r(var, reg) sse_m2r(divss, var, reg) +#define divss_r2r(regs, regd) sse_r2r(divss, regs, regd) + +#define rcpps_m2r(var, reg) sse_m2r(rcpps, var, reg) +#define rcpps_r2r(regs, regd) sse_r2r(rcpps, regs, regd) + +#define rcpss_m2r(var, reg) sse_m2r(rcpss, var, reg) +#define rcpss_r2r(regs, regd) sse_r2r(rcpss, regs, regd) + +#define rsqrtps_m2r(var, reg) sse_m2r(rsqrtps, var, reg) +#define rsqrtps_r2r(regs, regd) sse_r2r(rsqrtps, regs, regd) + +#define rsqrtss_m2r(var, reg) sse_m2r(rsqrtss, var, reg) +#define rsqrtss_r2r(regs, regd) sse_r2r(rsqrtss, regs, regd) + +#define sqrtps_m2r(var, reg) sse_m2r(sqrtps, var, reg) +#define sqrtps_r2r(regs, regd) sse_r2r(sqrtps, regs, regd) + +#define sqrtss_m2r(var, reg) sse_m2r(sqrtss, var, reg) +#define sqrtss_r2r(regs, regd) sse_r2r(sqrtss, regs, regd) + +#define andps_m2r(var, reg) sse_m2r(andps, var, reg) +#define andps_r2r(regs, regd) sse_r2r(andps, regs, regd) + +#define andnps_m2r(var, reg) sse_m2r(andnps, var, reg) +#define andnps_r2r(regs, regd) sse_r2r(andnps, regs, regd) + +#define orps_m2r(var, reg) sse_m2r(orps, var, reg) +#define orps_r2r(regs, regd) sse_r2r(orps, regs, regd) + +#define xorps_m2r(var, reg) sse_m2r(xorps, var, reg) +#define xorps_r2r(regs, regd) sse_r2r(xorps, regs, regd) + +#define maxps_m2r(var, reg) sse_m2r(maxps, var, reg) +#define maxps_r2r(regs, regd) sse_r2r(maxps, regs, regd) + +#define maxss_m2r(var, reg) sse_m2r(maxss, var, reg) +#define maxss_r2r(regs, regd) sse_r2r(maxss, regs, regd) + +#define minps_m2r(var, reg) sse_m2r(minps, var, reg) +#define minps_r2r(regs, regd) sse_r2r(minps, regs, regd) + +#define minss_m2r(var, reg) sse_m2r(minss, var, reg) +#define minss_r2r(regs, regd) sse_r2r(minss, regs, regd) + +#define cmpps_m2r(var, reg, op) sse_m2ri(cmpps, var, reg, op) +#define cmpps_r2r(regs, regd, op) sse_r2ri(cmpps, regs, regd, op) + +#define cmpeqps_m2r(var, reg) sse_m2ri(cmpps, var, reg, 0) +#define cmpeqps_r2r(regs, regd) sse_r2ri(cmpps, regs, regd, 0) + +#define cmpltps_m2r(var, reg) sse_m2ri(cmpps, var, reg, 1) +#define cmpltps_r2r(regs, regd) sse_r2ri(cmpps, regs, regd, 1) + +#define cmpleps_m2r(var, reg) sse_m2ri(cmpps, var, reg, 2) +#define cmpleps_r2r(regs, regd) sse_r2ri(cmpps, regs, regd, 2) + +#define cmpunordps_m2r(var, reg) sse_m2ri(cmpps, var, reg, 3) +#define cmpunordps_r2r(regs, regd) sse_r2ri(cmpps, regs, regd, 3) + +#define cmpneqps_m2r(var, reg) sse_m2ri(cmpps, var, reg, 4) +#define cmpneqps_r2r(regs, regd) sse_r2ri(cmpps, regs, regd, 4) + +#define cmpnltps_m2r(var, reg) sse_m2ri(cmpps, var, reg, 5) +#define cmpnltps_r2r(regs, regd) sse_r2ri(cmpps, regs, regd, 5) + +#define cmpnleps_m2r(var, reg) sse_m2ri(cmpps, var, reg, 6) +#define cmpnleps_r2r(regs, regd) sse_r2ri(cmpps, regs, regd, 6) + +#define cmpordps_m2r(var, reg) sse_m2ri(cmpps, var, reg, 7) +#define cmpordps_r2r(regs, regd) sse_r2ri(cmpps, regs, regd, 7) + +#define cmpss_m2r(var, reg, op) sse_m2ri(cmpss, var, reg, op) +#define cmpss_r2r(regs, regd, op) sse_r2ri(cmpss, regs, regd, op) + +#define cmpeqss_m2r(var, reg) sse_m2ri(cmpss, var, reg, 0) +#define cmpeqss_r2r(regs, regd) sse_r2ri(cmpss, regs, regd, 0) + +#define cmpltss_m2r(var, reg) sse_m2ri(cmpss, var, reg, 1) +#define cmpltss_r2r(regs, regd) sse_r2ri(cmpss, regs, regd, 1) + +#define cmpless_m2r(var, reg) sse_m2ri(cmpss, var, reg, 2) +#define cmpless_r2r(regs, regd) sse_r2ri(cmpss, regs, regd, 2) + +#define cmpunordss_m2r(var, reg) sse_m2ri(cmpss, var, reg, 3) +#define cmpunordss_r2r(regs, regd) sse_r2ri(cmpss, regs, regd, 3) + +#define cmpneqss_m2r(var, reg) sse_m2ri(cmpss, var, reg, 4) +#define cmpneqss_r2r(regs, regd) sse_r2ri(cmpss, regs, regd, 4) + +#define cmpnltss_m2r(var, reg) sse_m2ri(cmpss, var, reg, 5) +#define cmpnltss_r2r(regs, regd) sse_r2ri(cmpss, regs, regd, 5) + +#define cmpnless_m2r(var, reg) sse_m2ri(cmpss, var, reg, 6) +#define cmpnless_r2r(regs, regd) sse_r2ri(cmpss, regs, regd, 6) + +#define cmpordss_m2r(var, reg) sse_m2ri(cmpss, var, reg, 7) +#define cmpordss_r2r(regs, regd) sse_r2ri(cmpss, regs, regd, 7) + +#define comiss_m2r(var, reg) sse_m2r(comiss, var, reg) +#define comiss_r2r(regs, regd) sse_r2r(comiss, regs, regd) + +#define ucomiss_m2r(var, reg) sse_m2r(ucomiss, var, reg) +#define ucomiss_r2r(regs, regd) sse_r2r(ucomiss, regs, regd) + +#define unpcklps_m2r(var, reg) sse_m2r(unpcklps, var, reg) +#define unpcklps_r2r(regs, regd) sse_r2r(unpcklps, regs, regd) + +#define unpckhps_m2r(var, reg) sse_m2r(unpckhps, var, reg) +#define unpckhps_r2r(regs, regd) sse_r2r(unpckhps, regs, regd) + +#define fxrstor(mem) \ + __asm__ __volatile__ ("fxrstor %0" \ + : /* nothing */ \ + : "X" (mem)) + +#define fxsave(mem) \ + __asm__ __volatile__ ("fxsave %0" \ + : /* nothing */ \ + : "X" (mem)) + +#define stmxcsr(mem) \ + __asm__ __volatile__ ("stmxcsr %0" \ + : /* nothing */ \ + : "X" (mem)) + +#define ldmxcsr(mem) \ + __asm__ __volatile__ ("ldmxcsr %0" \ + : /* nothing */ \ + : "X" (mem)) +#endif /*ARCH_X86 */ + + + /* Optimized/fast memcpy */ + +extern void *(* xine_fast_memcpy)(void *to, const void *from, size_t len) XINE_PROTECTED; + +#ifdef HAVE_XINE_INTERNAL_H +/* Benchmark available memcpy methods */ +void xine_probe_fast_memcpy(xine_t *xine) XINE_PROTECTED; +#endif + + +/* + * Debug stuff + */ +/* + * profiling (unworkable in non DEBUG isn't defined) + */ +void xine_profiler_init (void) XINE_PROTECTED; +int xine_profiler_allocate_slot (const char *label) XINE_PROTECTED; +void xine_profiler_start_count (int id) XINE_PROTECTED; +void xine_profiler_stop_count (int id) XINE_PROTECTED; +void xine_profiler_print_results (void) XINE_PROTECTED; + +/* + * Allocate and clean memory size_t 'size', then return the pointer + * to the allocated memory. + */ +void *xine_xmalloc(size_t size) XINE_MALLOC XINE_PROTECTED; + +void *xine_xcalloc(size_t nmemb, size_t size) XINE_MALLOC XINE_PROTECTED; + +/* + * Same as above, but memory is aligned to 'alignement'. + * **base is used to return pointer to un-aligned memory, use + * this to free the mem chunk + */ +void *xine_xmalloc_aligned(size_t alignment, size_t size, void **base) XINE_PROTECTED; + +/* + * Get user home directory. + */ +const char *xine_get_homedir(void) XINE_PROTECTED; + +#if defined(WIN32) || defined(__CYGWIN__) +/* + * Get other xine directories. + */ +const char *xine_get_plugindir(void) XINE_PROTECTED; +const char *xine_get_fontdir(void) XINE_PROTECTED; +const char *xine_get_localedir(void) XINE_PROTECTED; +#endif + +/* + * Clean a string (remove spaces and '=' at the begin, + * and '\n', '\r' and spaces at the end. + */ +char *xine_chomp (char *str) XINE_PROTECTED; + +/* + * A thread-safe usecond sleep + */ +void xine_usec_sleep(unsigned usec) XINE_PROTECTED; + +/* compatibility macros */ +#define xine_strpbrk(S, ACCEPT) strpbrk((S), (ACCEPT)) +#define xine_strsep(STRINGP, DELIM) strsep((STRINGP), (DELIM)) +#define xine_setenv(NAME, VAL, XX) setenv((NAME), (VAL), (XX)) + +/* + * Color Conversion Utility Functions + * The following data structures and functions facilitate the conversion + * of RGB images to packed YUV (YUY2) images. There are also functions to + * convert from YUV9 -> YV12. All of the meaty details are written in + * color.c. + */ + +typedef struct yuv_planes_s { + + unsigned char *y; + unsigned char *u; + unsigned char *v; + unsigned int row_width; /* frame width */ + unsigned int row_count; /* frame height */ + +} yuv_planes_t; + +void init_yuv_conversion(void) XINE_PROTECTED; +void init_yuv_planes(yuv_planes_t *yuv_planes, int width, int height) XINE_PROTECTED; +void free_yuv_planes(yuv_planes_t *yuv_planes) XINE_PROTECTED; + +extern void (*yuv444_to_yuy2) + (const yuv_planes_t *yuv_planes, unsigned char *yuy2_map, int pitch) XINE_PROTECTED; +extern void (*yuv9_to_yv12) + (const unsigned char *y_src, int y_src_pitch, unsigned char *y_dest, int y_dest_pitch, + const unsigned char *u_src, int u_src_pitch, unsigned char *u_dest, int u_dest_pitch, + const unsigned char *v_src, int v_src_pitch, unsigned char *v_dest, int v_dest_pitch, + int width, int height) XINE_PROTECTED; +extern void (*yuv411_to_yv12) + (const unsigned char *y_src, int y_src_pitch, unsigned char *y_dest, int y_dest_pitch, + const unsigned char *u_src, int u_src_pitch, unsigned char *u_dest, int u_dest_pitch, + const unsigned char *v_src, int v_src_pitch, unsigned char *v_dest, int v_dest_pitch, + int width, int height) XINE_PROTECTED; +extern void (*yv12_to_yuy2) + (const unsigned char *y_src, int y_src_pitch, + const unsigned char *u_src, int u_src_pitch, + const unsigned char *v_src, int v_src_pitch, + unsigned char *yuy2_map, int yuy2_pitch, + int width, int height, int progressive) XINE_PROTECTED; +extern void (*yuy2_to_yv12) + (const unsigned char *yuy2_map, int yuy2_pitch, + unsigned char *y_dst, int y_dst_pitch, + unsigned char *u_dst, int u_dst_pitch, + unsigned char *v_dst, int v_dst_pitch, + int width, int height) XINE_PROTECTED; + +#define SCALEFACTOR 65536 +#define CENTERSAMPLE 128 + +#define COMPUTE_Y(r, g, b) \ + (unsigned char) \ + ((y_r_table[r] + y_g_table[g] + y_b_table[b]) / SCALEFACTOR) +#define COMPUTE_U(r, g, b) \ + (unsigned char) \ + ((u_r_table[r] + u_g_table[g] + u_b_table[b]) / SCALEFACTOR + CENTERSAMPLE) +#define COMPUTE_V(r, g, b) \ + (unsigned char) \ + ((v_r_table[r] + v_g_table[g] + v_b_table[b]) / SCALEFACTOR + CENTERSAMPLE) + +#define UNPACK_BGR15(packed_pixel, r, g, b) \ + b = (packed_pixel & 0x7C00) >> 7; \ + g = (packed_pixel & 0x03E0) >> 2; \ + r = (packed_pixel & 0x001F) << 3; + +#define UNPACK_BGR16(packed_pixel, r, g, b) \ + b = (packed_pixel & 0xF800) >> 8; \ + g = (packed_pixel & 0x07E0) >> 3; \ + r = (packed_pixel & 0x001F) << 3; + +#define UNPACK_RGB15(packed_pixel, r, g, b) \ + r = (packed_pixel & 0x7C00) >> 7; \ + g = (packed_pixel & 0x03E0) >> 2; \ + b = (packed_pixel & 0x001F) << 3; + +#define UNPACK_RGB16(packed_pixel, r, g, b) \ + r = (packed_pixel & 0xF800) >> 8; \ + g = (packed_pixel & 0x07E0) >> 3; \ + b = (packed_pixel & 0x001F) << 3; + +extern int y_r_table[256] XINE_PROTECTED; +extern int y_g_table[256] XINE_PROTECTED; +extern int y_b_table[256] XINE_PROTECTED; + +extern int u_r_table[256] XINE_PROTECTED; +extern int u_g_table[256] XINE_PROTECTED; +extern int u_b_table[256] XINE_PROTECTED; + +extern int v_r_table[256] XINE_PROTECTED; +extern int v_g_table[256] XINE_PROTECTED; +extern int v_b_table[256] XINE_PROTECTED; + +/* frame copying functions */ +extern void yv12_to_yv12 + (const unsigned char *y_src, int y_src_pitch, unsigned char *y_dst, int y_dst_pitch, + const unsigned char *u_src, int u_src_pitch, unsigned char *u_dst, int u_dst_pitch, + const unsigned char *v_src, int v_src_pitch, unsigned char *v_dst, int v_dst_pitch, + int width, int height) XINE_PROTECTED; +extern void yuy2_to_yuy2 + (const unsigned char *src, int src_pitch, + unsigned char *dst, int dst_pitch, + int width, int height) XINE_PROTECTED; + +/* print a hexdump of the given data */ +void xine_hexdump (const void *buf, int length) XINE_PROTECTED; + +/* + * Optimization macros for conditions + * Taken from the FIASCO L4 microkernel sources + */ +#if !defined(__GNUC__) || __GNUC__ < 3 +# define EXPECT_TRUE(x) (x) +# define EXPECT_FALSE(x) (x) +#else +# define EXPECT_TRUE(x) __builtin_expect((x),1) +# define EXPECT_FALSE(x) __builtin_expect((x),0) +#endif + +#ifdef NDEBUG +#define _x_assert(exp) \ + do { \ + if (!(exp)) \ + fprintf(stderr, "assert: %s:%d: %s: Assertion `%s' failed.\n", \ + __FILE__, __LINE__, __XINE_FUNCTION__, #exp); \ + } while(0) +#else +#define _x_assert(exp) \ + do { \ + if (!(exp)) { \ + fprintf(stderr, "assert: %s:%d: %s: Assertion `%s' failed.\n", \ + __FILE__, __LINE__, __XINE_FUNCTION__, #exp); \ + abort(); \ + } \ + } while(0) +#endif + +#define _x_abort() \ + do { \ + fprintf(stderr, "abort: %s:%d: %s: Aborting.\n", \ + __FILE__, __LINE__, __XINE_FUNCTION__); \ + abort(); \ + } while(0) + + +/****** logging with xine **********************************/ + +#ifndef LOG_MODULE + #define LOG_MODULE __FILE__ +#endif /* LOG_MODULE */ + +#define LOG_MODULE_STRING printf("%s: ", LOG_MODULE ); + +#ifdef LOG_VERBOSE + #define LONG_LOG_MODULE_STRING \ + printf("%s: (%s:%d) ", LOG_MODULE, __XINE_FUNCTION__, __LINE__ ); +#else + #define LONG_LOG_MODULE_STRING LOG_MODULE_STRING +#endif /* LOG_VERBOSE */ + +#ifdef LOG + #ifdef __GNUC__ + #define lprintf(fmt, args...) \ + do { \ + LONG_LOG_MODULE_STRING \ + printf(fmt, ##args); \ + fflush(stdout); \ + } while(0) + #else /* __GNUC__ */ + #ifdef _MSC_VER + #define lprintf(fmtargs) \ + do { \ + LONG_LOG_MODULE_STRING \ + printf("%s", fmtargs); \ + fflush(stdout); \ + } while(0) + #else /* _MSC_VER */ + #define lprintf(...) \ + do { \ + LONG_LOG_MODULE_STRING \ + printf(__VA_ARGS__); \ + fflush(stdout); \ + } while(0) + #endif /* _MSC_VER */ + #endif /* __GNUC__ */ +#else /* LOG */ + #ifdef __GNUC__ + #define lprintf(fmt, args...) do {} while(0) + #else + #ifdef _MSC_VER +void __inline lprintf(const char * fmt, ...) {} + #else + #define lprintf(...) do {} while(0) + #endif /* _MSC_VER */ + #endif /* __GNUC__ */ +#endif /* LOG */ + +#ifdef __GNUC__ + #define llprintf(cat, fmt, args...) \ + do{ \ + if(cat){ \ + LONG_LOG_MODULE_STRING \ + printf( fmt, ##args ); \ + } \ + }while(0) +#else +#ifdef _MSC_VER + #define llprintf(cat, fmtargs) \ + do{ \ + if(cat){ \ + LONG_LOG_MODULE_STRING \ + printf( "%s", fmtargs ); \ + } \ + }while(0) +#else + #define llprintf(cat, ...) \ + do{ \ + if(cat){ \ + LONG_LOG_MODULE_STRING \ + printf( __VA_ARGS__ ); \ + } \ + }while(0) +#endif /* _MSC_VER */ +#endif /* __GNUC__ */ + +#ifdef __GNUC__ + #define xprintf(xine, verbose, fmt, args...) \ + do { \ + if((xine) && (xine)->verbosity >= verbose){ \ + xine_log(xine, XINE_LOG_TRACE, fmt, ##args); \ + } \ + } while(0) +#else +#ifdef _MSC_VER +void xine_xprintf(xine_t *xine, int verbose, const char *fmt, ...); + #define xprintf xine_xprintf +#else + #define xprintf(xine, verbose, ...) \ + do { \ + if((xine) && (xine)->verbosity >= verbose){ \ + xine_log(xine, XINE_LOG_TRACE, __VA_ARGS__); \ + } \ + } while(0) +#endif /* _MSC_VER */ +#endif /* __GNUC__ */ + +/* time measuring macros for profiling tasks */ + +#ifdef DEBUG +# define XINE_PROFILE(function) \ + do { \ + struct timeval current_time; \ + double dtime; \ + gettimeofday(¤t_time, NULL); \ + dtime = -(current_time.tv_sec + (current_time.tv_usec / 1000000.0)); \ + function; \ + gettimeofday(¤t_time, NULL); \ + dtime += current_time.tv_sec + (current_time.tv_usec / 1000000.0); \ + printf("%s: (%s:%d) took %lf seconds\n", \ + LOG_MODULE, __XINE_FUNCTION__, __LINE__, dtime); \ + } while(0) +# define XINE_PROFILE_ACCUMULATE(function) \ + do { \ + struct timeval current_time; \ + static double dtime = 0; \ + gettimeofday(¤t_time, NULL); \ + dtime -= current_time.tv_sec + (current_time.tv_usec / 1000000.0); \ + function; \ + gettimeofday(¤t_time, NULL); \ + dtime += current_time.tv_sec + (current_time.tv_usec / 1000000.0); \ + printf("%s: (%s:%d) took %lf seconds\n", \ + LOG_MODULE, __XINE_FUNCTION__, __LINE__, dtime); \ + } while(0) +#else +# define XINE_PROFILE(function) function +# define XINE_PROFILE_ACCUMULATE(function) function +#endif /* DEBUG */ + +/** + * get encoding of current locale + */ +char *xine_get_system_encoding(void) XINE_PROTECTED; + +/* + * guess default encoding for the subtitles + */ +const char *xine_guess_spu_encoding(void) XINE_PROTECTED; + +/* + * use the best clock reference (API compatible with gettimeofday) + * note: it will be a monotonic clock, if available. + */ +int xine_monotonic_clock(struct timeval *tv, struct timezone *tz) XINE_PROTECTED; + +/** + * CRC functions + */ +uint32_t _x_compute_crc32 (const uint8_t * data, int32_t length, uint32_t crc32) XINE_PROTECTED; + +/* don't harm following code */ +#ifdef extern +# undef extern +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/xine/xmllexer.h b/include/xine/xmllexer.h new file mode 100644 index 000000000..10bcc8676 --- /dev/null +++ b/include/xine/xmllexer.h @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2002-2003,2007 the xine project + * + * This file is part of xine, a free video player. + * + * The xine-lib XML parser is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * The xine-lib XML parser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with the Gnome Library; see the file COPYING.LIB. If not, + * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth + * Floor, Boston, MA 02110, USA + */ + +/* xml lexer */ +#ifndef XML_LEXER_H +#define XML_LEXER_H + +#ifndef XINE_PROTECTED +#define XINE_PROTECTED +#endif + +/* public constants */ +#define T_ERROR -1 /* lexer error */ +#define T_EOF 0 /* end of file */ +#define T_EOL 1 /* end of line */ +#define T_SEPAR 2 /* separator ' ' '/t' '\n' '\r' */ +#define T_M_START_1 3 /* markup start < */ +#define T_M_START_2 4 /* markup start */ +#define T_M_STOP_2 6 /* markup stop /> */ +#define T_EQUAL 7 /* = */ +#define T_QUOTE 8 /* \" or \' */ +#define T_STRING 9 /* "string" */ +#define T_IDENT 10 /* identifier */ +#define T_DATA 11 /* data */ +#define T_C_START 12 /* */ +#define T_TI_START 14 /* */ +#define T_DOCTYPE_START 16 /* */ +#define T_CDATA_START 18 /* */ + + +/* public functions */ +void lexer_init(const char * buf, int size) XINE_PROTECTED; +int lexer_get_token(char * tok, int tok_size) XINE_PROTECTED; +char *lexer_decode_entities (const char *tok) XINE_PROTECTED; + +#endif diff --git a/include/xine/xmlparser.h b/include/xine/xmlparser.h new file mode 100644 index 000000000..c89cb6dd3 --- /dev/null +++ b/include/xine/xmlparser.h @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2002-2003,2007 the xine project + * + * This file is part of xine, a free video player. + * + * The xine-lib XML parser is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * The xine-lib XML parser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with the Gnome Library; see the file COPYING.LIB. If not, + * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth + * Floor, Boston, MA 02110, USA + */ + +#ifndef XML_PARSER_H +#define XML_PARSER_H + +#ifndef XINE_PROTECTED +#define XINE_PROTECTED +#endif + +/* parser modes */ +#define XML_PARSER_CASE_INSENSITIVE 0 +#define XML_PARSER_CASE_SENSITIVE 1 + +/* return codes */ +#define XML_PARSER_OK 0 +#define XML_PARSER_ERROR 1 + +/* xml_parser_build_tree_with_options flag bits */ +#define XML_PARSER_RELAXED 1 +#define XML_PARSER_MULTI_TEXT 2 + +/* node name for extra text chunks */ +#define CDATA_MARKER "[CDATA]" + +/* xml property */ +typedef struct xml_property_s { + char *name; + char *value; + struct xml_property_s *next; +} xml_property_t; + +/* xml node */ +/* .data contains any text which precedes any subtree elements; + * subtree elements may also contain only text; if so, name is "[CDATA]". + * e.g. bd + * node1: .name="a" .data="b" .child=node2 .next=NULL + * node2: .name="c" .data=NULL .child=NULL .next=node3 + * node3: .name="[CDATA]" .data="d" .child=NULL .next=NULL + * Adjacent text items are merged. + */ +typedef struct xml_node_s { + char *name; + char *data; + struct xml_property_s *props; + struct xml_node_s *child; + struct xml_node_s *next; +} xml_node_t; + +void xml_parser_init(const char * buf, int size, int mode) XINE_PROTECTED; + +int xml_parser_build_tree(xml_node_t **root_node) XINE_PROTECTED; +int xml_parser_build_tree_with_options(xml_node_t **root_node, int flags) XINE_PROTECTED; + +void xml_parser_free_tree(xml_node_t *root_node) XINE_PROTECTED; + +const char *xml_parser_get_property (const xml_node_t *node, const char *name) XINE_PROTECTED; +int xml_parser_get_property_int (const xml_node_t *node, const char *name, + int def_value) XINE_PROTECTED; +int xml_parser_get_property_bool (const xml_node_t *node, const char *name, + int def_value) XINE_PROTECTED; + +/* for output: + * returns an escaped string (free() it when done) + * input must be in ASCII or UTF-8 + */ + +typedef enum { + XML_ESCAPE_NO_QUOTE, + XML_ESCAPE_SINGLE_QUOTE, + XML_ESCAPE_DOUBLE_QUOTE +} xml_escape_quote_t; +char *xml_escape_string (const char *s, xml_escape_quote_t quote_type) XINE_PROTECTED; + +/* for debugging purposes: dump read-in xml tree in a nicely + * indented fashion + */ + +void xml_parser_dump_tree (const xml_node_t *node) XINE_PROTECTED; + +#endif diff --git a/src/demuxers/Makefile.am b/src/demuxers/Makefile.am index ba3041d5d..276505521 100644 --- a/src/demuxers/Makefile.am +++ b/src/demuxers/Makefile.am @@ -8,8 +8,6 @@ AM_LDFLAGS = $(xineplug_ldflags) # --------- # All of xine demuxer plugins should be named like the scheme "xineplug_dmx_" -xineinclude_HEADERS = demux.h - noinst_HEADERS = asfheader.h qtpalette.h group_games.h group_audio.h id3.h ebml.h matroska.h iff.h flacutils.h if ENABLE_ASF diff --git a/src/demuxers/demux.h b/src/demuxers/demux.h deleted file mode 100644 index ee5ca42f0..000000000 --- a/src/demuxers/demux.h +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright (C) 2000-2003 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - */ - -#ifndef HAVE_DEMUX_H -#define HAVE_DEMUX_H - -#ifdef XINE_COMPILE -# include "input/input_plugin.h" -# include "buffer.h" -# include "xine_internal.h" -#else -# include -# include -# include -#endif - -#define DEMUXER_PLUGIN_IFACE_VERSION 27 - -#define DEMUX_OK 0 -#define DEMUX_FINISHED 1 - -#define DEMUX_CANNOT_HANDLE 0 -#define DEMUX_CAN_HANDLE 1 - -#define METHOD_BY_CONTENT 1 -#define METHOD_BY_MRL 2 -#define METHOD_EXPLICIT 3 - -typedef struct demux_class_s demux_class_t ; -typedef struct demux_plugin_s demux_plugin_t; - -struct demux_class_s { - - /* - * open a new instance of this plugin class - */ - demux_plugin_t* (*open_plugin) (demux_class_t *this, xine_stream_t *stream, input_plugin_t *input); - - /** - * @brief short human readable identifier for this plugin class - */ - const char *identifier; - - /** - * @brief human readable (verbose = 1 line) description for this plugin class - * - * The description is passed to gettext() to internationalise. - */ - const char *description; - - /** - * @brief Optional non-standard catalog to use with dgettext() for description. - */ - const char *textdomain; - - /** - * @brief MIME types supported for this plugin - */ - - const char* mimetypes; - - /** - * @brief space separated list of file extensions this demuxer is - * likely to handle - * - * (will be used to filter media files in file selection dialogs) - */ - const char* extensions; - - /* - * close down, free all resources - */ - void (*dispose) (demux_class_t *this); -}; - -#define default_demux_class_dispose (void (*) (demux_class_t *this))free - -/* - * any demux plugin must implement these functions - */ - -struct demux_plugin_s { - - /* - * send headers, followed by BUF_CONTROL_HEADERS_DONE down the - * fifos, then return. do not start demux thread (yet) - */ - - void (*send_headers) (demux_plugin_t *this); - - /* - * ask demux to seek - * - * for seekable streams, a start position can be specified - * - * start_pos : position in input source (0..65535) - * this is defined as most convenient to demuxer, can be - * either time or offset based. - * start_time : position measured in miliseconds from stream start - * playing : true if this is a new seek within an already playing stream - * false if playback of this stream has not started yet - * - * if both parameters are !=0 start_pos will be used - * for non-seekable streams both values will be ignored - * - * returns the demux status (like get_status, but immediately after - * starting the demuxer) - */ - - int (*seek) (demux_plugin_t *this, - off_t start_pos, int start_time, int playing ); - - /* - * send a chunk of data down to decoder fifos - * - * the meaning of "chunk" is specific to every demux, usually - * it involves parsing one unit of data from stream. - * - * this function will be called from demux loop and should return - * the demux current status - */ - - int (*send_chunk) (demux_plugin_t *this); - - /* - * free resources - */ - - void (*dispose) (demux_plugin_t *this) ; - - /* - * returns DEMUX_OK or DEMUX_FINISHED - */ - - int (*get_status) (demux_plugin_t *this) ; - - /* - * gets stream length in miliseconds (might be estimated) - * may return 0 for non-seekable streams - */ - - int (*get_stream_length) (demux_plugin_t *this); - - /* - * return capabilities of demuxed stream - */ - - uint32_t (*get_capabilities) (demux_plugin_t *this); - - /* - * request optional data from input plugin. - */ - int (*get_optional_data) (demux_plugin_t *this, void *data, int data_type); - - /* - * "backwards" link to plugin class - */ - - demux_class_t *demux_class; - - void *node; /* used by plugin loader */ - -} ; - -#define default_demux_plugin_dispose (void (*) (demux_plugin_t *this))free - -/* - * possible capabilites a demux plugin can have: - */ -#define DEMUX_CAP_NOCAP 0x00000000 - -/* - * DEMUX_CAP_AUDIOLANG: - * DEMUX_CAP_SPULANG: - * demux plugin knows something about audio/spu languages, - * e.g. knows that audio stream #0 is english, - * audio stream #1 is german, ... Same bits as INPUT - * capabilities . - */ - -#define DEMUX_CAP_AUDIOLANG 0x00000008 -#define DEMUX_CAP_SPULANG 0x00000010 - -/* - * DEMUX_CAP_CHAPTERS: - * The media streams provided by this plugin have an internal - * structure dividing it into segments usable for navigation. - * For those plugins, the behaviour of the skip button in UIs - * should be changed from "next MRL" to "next chapter" by - * sending XINE_EVENT_INPUT_NEXT. - * Same bits as INPUT capabilities. - */ - -#define DEMUX_CAP_CHAPTERS 0x00000080 - - -#define DEMUX_OPTIONAL_UNSUPPORTED 0 -#define DEMUX_OPTIONAL_SUCCESS 1 - -#define DEMUX_OPTIONAL_DATA_AUDIOLANG 2 -#define DEMUX_OPTIONAL_DATA_SPULANG 3 - -#endif diff --git a/src/input/input_plugin.h b/src/input/input_plugin.h deleted file mode 100644 index 2917721c9..000000000 --- a/src/input/input_plugin.h +++ /dev/null @@ -1,420 +0,0 @@ -/* - * Copyright (C) 2000-2004 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - */ - -#ifndef HAVE_INPUT_PLUGIN_H -#define HAVE_INPUT_PLUGIN_H - -#include - -#ifdef XINE_COMPILE -# include -# include "xineutils.h" -# include "buffer.h" -# include "configfile.h" -#else -# include -# include -# include -# include -#endif - -#define INPUT_PLUGIN_IFACE_VERSION 18 - -typedef struct input_class_s input_class_t ; -typedef struct input_plugin_s input_plugin_t; - -struct input_class_s { - - /* - * create a new instance of this plugin class - * return NULL if the plugin does'nt handle the given mrl - */ - input_plugin_t* (*get_instance) (input_class_t *this, xine_stream_t *stream, const char *mrl); - - /** - * @brief short human readable identifier for this plugin class - */ - const char *identifier; - - /** - * @brief human readable (verbose = 1 line) description for this plugin class - * - * The description is passed to gettext() to internationalise. - */ - const char *description; - - /** - * @brief Optional non-standard catalog to use with dgettext() for description. - */ - const char *textdomain; - - /* - * ls function, optional: may be NULL - * return value: NULL => filename is a file, **char=> filename is a dir - */ - xine_mrl_t ** (*get_dir) (input_class_t *this, const char *filename, int *nFiles); - - /* - * generate autoplay list, optional: may be NULL - * return value: list of MRLs - */ - char ** (*get_autoplay_list) (input_class_t *this, int *num_files); - - /* - * close down, free all resources - */ - void (*dispose) (input_class_t *this); - - /* - * eject/load the media (if possible), optional: may be NULL - * - * returns 0 for temporary failures - */ - int (*eject_media) (input_class_t *this); -}; - -#define default_input_class_dispose (void (*) (input_class_t *this))free - -struct input_plugin_s { - - /* - * open the stream - * return 0 if an error occured - */ - int (*open) (input_plugin_t *this); - - /* - * return capabilities of the current playable entity. See - * get_current_pos below for a description of a "playable entity" - * Capabilities a created by "OR"ing a mask of constants listed - * below which start "INPUT_CAP". - * - * depending on the values set, some of the functions below - * will or will not get called or should (not) be able to - * do certain tasks. - * - * for example if INPUT_CAP_SEEKABLE is set, - * the seek() function is expected to work fully at any time. - * however, if the flag is not set, the seek() function should - * make a best-effort attempt to seek, e.g. at least - * relative forward seeking should work. - */ - uint32_t (*get_capabilities) (input_plugin_t *this); - - /* - * read nlen bytes, return number of bytes read - * Should block until some bytes available for read; - * a return value of 0 indicates no data available - */ - off_t (*read) (input_plugin_t *this, void *buf, off_t nlen); - - - /* - * read one block, return newly allocated block (or NULL on failure) - * for blocked input sources len must be == blocksize - * the fifo parameter is only used to get access to the buffer_pool_alloc function - */ - buf_element_t *(*read_block)(input_plugin_t *this, fifo_buffer_t *fifo, off_t len); - - - /* - * seek position, return new position - * - * if seeking failed, -1 is returned - */ - off_t (*seek) (input_plugin_t *this, off_t offset, int origin); - - - /* - * seek to time position, return new position - * time_offset is given in miliseconds - * - * if seeking failed, -1 is returned - * - * note: only SEEK_SET (0) is currently supported as origin - * note: may be NULL is not supported - */ - off_t (*seek_time) (input_plugin_t *this, int time_offset, int origin); - - - /* - * get current position in stream. - * - */ - off_t (*get_current_pos) (input_plugin_t *this); - - - /* - * get current time position in stream in miliseconds. - * - * note: may be NULL is not supported - */ - int (*get_current_time) (input_plugin_t *this); - - - /* - * return number of bytes in the next playable entity or -1 if the - * input is unlimited, as would be the case in a network stream. - * - * A "playable entity" tends to be the entities listed in a playback - * list or the units on which playback control generally works on. - * It might be the number of bytes in a VCD "segment" or "track" (if - * the track has no "entry" subdivisions), or the number of bytes in - * a PS (Program Segment or "Chapter") of a DVD. If there are no - * subdivisions of the input medium and it is considered one - * indivisible entity, it would be the byte count of that entity; - * for example, the length in bytes of an MPEG file. - - * This length information is used, for example when in setting the - * absolute or relative play position or possibly calculating the - * bit rate. - */ - off_t (*get_length) (input_plugin_t *this); - - - /* - * return block size in bytes of next complete playable entity (if - * supported, 0 otherwise). See the description above under - * get_length for a description of a "complete playable entity". - * - * this block size is only used for mpeg streams stored on - * a block oriented storage media, e.g. DVDs and VCDs, to speed - * up the demuxing process. only set this (and the INPUT_CAP_BLOCK - * flag) if this is the case for your input plugin. - * - * make this function simply return 0 if unsure. - */ - - uint32_t (*get_blocksize) (input_plugin_t *this); - - - /* - * return current MRL - */ - const char * (*get_mrl) (input_plugin_t *this); - - - /* - * request optional data from input plugin. - */ - int (*get_optional_data) (input_plugin_t *this, void *data, int data_type); - - - /* - * close stream, free instance resources - */ - void (*dispose) (input_plugin_t *this); - - /* - * "backward" link to input plugin class struct - */ - - input_class_t *input_class; - - void *node; /* used by plugin loader */ - -}; - -/* - * possible capabilites an input plugin can have: - */ -#define INPUT_CAP_NOCAP 0x00000000 - -/* - * INPUT_CAP_SEEKABLE: - * seek () works reliably. - * even for plugins that do not have this flag set - * it is a good idea to implement the seek() function - * in a "best effort" style anyway, so at least - * throw away data for network streams when seeking forward - */ - -#define INPUT_CAP_SEEKABLE 0x00000001 - -/* - * INPUT_CAP_BLOCK: - * means more or less that a block device sits behind - * this input plugin. get_blocksize must be implemented. - * will be used for fast and efficient demuxing of - * mpeg streams (demux_mpeg_block). - */ - -#define INPUT_CAP_BLOCK 0x00000002 - -/* - * INPUT_CAP_AUDIOLANG: - * INPUT_CAP_SPULANG: - * input plugin knows something about audio/spu languages, - * e.g. knows that audio stream #0 is english, - * audio stream #1 is german, ... - * *((int *)data) will provide the requested channel number - * and awaits the language back in (char *)data - */ - -#define INPUT_CAP_AUDIOLANG 0x00000008 -#define INPUT_CAP_SPULANG 0x00000010 - -/* - * INPUT_CAP_PREVIEW: - * get_optional_data can handle INPUT_OPTIONAL_DATA_PREVIEW - * so a non-seekable stream plugin can povide the first - * few bytes for demuxers to look at them and decide wheter - * they can handle the stream or not. the preview data must - * be buffered and delivered again through subsequent - * read() calls. - * caller must provide a buffer allocated with at least - * MAX_PREVIEW_SIZE bytes. - */ - -#define INPUT_CAP_PREVIEW 0x00000040 - -/* - * INPUT_CAP_CHAPTERS: - * The media streams provided by this plugin have an internal - * structure dividing it into segments usable for navigation. - * For those plugins, the behaviour of the skip button in UIs - * should be changed from "next MRL" to "next chapter" by - * sending XINE_EVENT_INPUT_NEXT. - */ - -#define INPUT_CAP_CHAPTERS 0x00000080 - -/* - * INPUT_CAP_RIP_FORBIDDEN: - * means that rip/disk saving must not be used. - * (probably at author's request) - */ - -#define INPUT_CAP_RIP_FORBIDDEN 0x00000100 - - -#define INPUT_IS_SEEKABLE(input) (((input)->get_capabilities(input) & INPUT_CAP_SEEKABLE) != 0) - -#define INPUT_OPTIONAL_UNSUPPORTED 0 -#define INPUT_OPTIONAL_SUCCESS 1 - -#define INPUT_OPTIONAL_DATA_AUDIOLANG 2 -#define INPUT_OPTIONAL_DATA_SPULANG 3 -#define INPUT_OPTIONAL_DATA_PREVIEW 7 - -#define MAX_MRL_ENTRIES 255 -#define MAX_PREVIEW_SIZE 4096 - -/* Types of mrls returned by get_dir() */ -#define mrl_unknown (0 << 0) -#define mrl_dvd (1 << 0) -#define mrl_vcd (1 << 1) -#define mrl_net (1 << 2) -#define mrl_rtp (1 << 3) -#define mrl_stdin (1 << 4) -#define mrl_cda (1 << 5) -#define mrl_file (1 << 6) -#define mrl_file_fifo (1 << 7) -#define mrl_file_chardev (1 << 8) -#define mrl_file_directory (1 << 9) -#define mrl_file_blockdev (1 << 10) -#define mrl_file_normal (1 << 11) -#define mrl_file_symlink (1 << 12) -#define mrl_file_sock (1 << 13) -#define mrl_file_exec (1 << 14) -#define mrl_file_backup (1 << 15) -#define mrl_file_hidden (1 << 16) - -/* - * Freeing/zeroing all of entries of given mrl. - */ -#define MRL_ZERO(m) { \ - if((m)) { \ - if((m)->origin) \ - free((m)->origin); \ - if((m)->mrl) \ - free((m)->mrl); \ - if((m)->link) \ - free((m)->link); \ - (m)->origin = NULL; \ - (m)->mrl = NULL; \ - (m)->link = NULL; \ - (m)->type = 0; \ - (m)->size = (off_t) 0; \ - } \ -} - -/* - * Duplicate two mrls entries (s = source, d = destination). - */ -#define MRL_DUPLICATE(s, d) { \ - _x_assert((s) != NULL); \ - _x_assert((d) != NULL); \ - \ - if((s)->origin) { \ - if((d)->origin) { \ - (d)->origin = (char *) realloc((d)->origin, strlen((s)->origin) + 1); \ - sprintf((d)->origin, "%s", (s)->origin); \ - } \ - else \ - (d)->origin = strdup((s)->origin); \ - } \ - else \ - (d)->origin = NULL; \ - \ - if((s)->mrl) { \ - if((d)->mrl) { \ - (d)->mrl = (char *) realloc((d)->mrl, strlen((s)->mrl) + 1); \ - sprintf((d)->mrl, "%s", (s)->mrl); \ - } \ - else \ - (d)->mrl = strdup((s)->mrl); \ - } \ - else \ - (d)->mrl = NULL; \ - \ - if((s)->link) { \ - if((d)->link) { \ - (d)->link = (char *) realloc((d)->link, strlen((s)->link) + 1); \ - sprintf((d)->link, "%s", (s)->link); \ - } \ - else \ - (d)->link = strdup((s)->link); \ - } \ - else \ - (d)->link = NULL; \ - \ - (d)->type = (s)->type; \ - (d)->size = (s)->size; \ -} - -/* - * Duplicate two arrays of mrls (s = source, d = destination). - */ -#define MRLS_DUPLICATE(s, d) { \ - int i = 0; \ - \ - _x_assert((s) != NULL); \ - _x_assert((d) != NULL); \ - \ - while((s) != NULL) { \ - d[i] = (xine_mrl_t *) malloc(sizeof(xine_mrl_t)); \ - MRL_DUPLICATE(s[i], d[i]); \ - i++; \ - } \ -} - - -#endif diff --git a/src/vdr/Makefile.am b/src/vdr/Makefile.am index fcdf6cae4..e4912176a 100644 --- a/src/vdr/Makefile.am +++ b/src/vdr/Makefile.am @@ -3,8 +3,6 @@ include $(top_srcdir)/misc/Makefile.common AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG) AM_LDFLAGS = $(xineplug_ldflags) -xineinclude_HEADERS = input_vdr.h - if ENABLE_DVB xineplug_LTLIBRARIES = xineplug_inp_vdr.la xinepost_LTLIBRARIES = xineplug_post_vdr.la diff --git a/src/xine-engine/Makefile.am b/src/xine-engine/Makefile.am index b90bd0ee9..c509b62af 100644 --- a/src/xine-engine/Makefile.am +++ b/src/xine-engine/Makefile.am @@ -16,12 +16,6 @@ endif noinst_HEADERS = bswap.h ffmpeg_bswap.h -xineinclude_HEADERS = buffer.h metronom.h configfile.h vo_scale.h \ - audio_out.h resample.h video_out.h xine_internal.h spu_decoder.h \ - video_overlay.h osd.h spu.h scratch.h xine_plugin.h xineintl.h \ - plugin_catalog.h audio_decoder.h video_decoder.h post.h \ - io_helper.h broadcaster.h info_helper.h refcounter.h alphablend.h - lib_LTLIBRARIES = libxine.la libxine_la_SOURCES = xine.c metronom.c configfile.c buffer.c \ diff --git a/src/xine-engine/alphablend.h b/src/xine-engine/alphablend.h deleted file mode 100644 index f8c9ad540..000000000 --- a/src/xine-engine/alphablend.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * - * Copyright (C) 2000 Thomas Mirlacher - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA. - * - * The author may be reached as - * - *------------------------------------------------------------ - * - */ - -#ifndef __ALPHABLEND_H__ -#define __ALPHABLEND_H__ - -#include "video_out.h" - -typedef struct { - void *buffer; - int buffer_size; - - int disable_exact_blending; - - int offset_x, offset_y; -} alphablend_t; - -void _x_alphablend_init(alphablend_t *extra_data, xine_t *xine) XINE_PROTECTED; -void _x_alphablend_free(alphablend_t *extra_data) XINE_PROTECTED; - -typedef struct { /* CLUT == Color LookUp Table */ - uint8_t cb; - uint8_t cr; - uint8_t y; - uint8_t foo; -} XINE_PACKED clut_t; - - -#define XX44_PALETTE_SIZE 32 - -typedef struct { - unsigned size; - unsigned max_used; - uint32_t cluts[XX44_PALETTE_SIZE]; - /* cache palette entries for both colors and hili_colors */ - int lookup_cache[OVL_PALETTE_SIZE*2]; -} xx44_palette_t; - - -void _x_blend_rgb16 (uint8_t * img, vo_overlay_t * img_overl, - int img_width, int img_height, - int dst_width, int dst_height, - alphablend_t *extra_data) XINE_PROTECTED; - -void _x_blend_rgb24 (uint8_t * img, vo_overlay_t * img_overl, - int img_width, int img_height, - int dst_width, int dst_height, - alphablend_t *extra_data) XINE_PROTECTED; - -void _x_blend_rgb32 (uint8_t * img, vo_overlay_t * img_overl, - int img_width, int img_height, - int dst_width, int dst_height, - alphablend_t *extra_data) XINE_PROTECTED; - -void _x_blend_yuv (uint8_t *dst_base[3], vo_overlay_t * img_overl, - int dst_width, int dst_height, int dst_pitches[3], - alphablend_t *extra_data) XINE_PROTECTED; - -void _x_blend_yuy2 (uint8_t * dst_img, vo_overlay_t * img_overl, - int dst_width, int dst_height, int dst_pitch, - alphablend_t *extra_data) XINE_PROTECTED; - -/* - * This function isn't too smart about blending. We want to avoid creating new - * colors in the palette as a result from two non-zero colors needed to be - * blended. Instead we choose the color with the highest alpha value to be - * visible. Some parts of the code taken from the "VeXP" project. - */ - -void _x_blend_xx44 (uint8_t *dst_img, vo_overlay_t *img_overl, - int dst_width, int dst_height, int dst_pitch, - alphablend_t *extra_data, - xx44_palette_t *palette,int ia44) XINE_PROTECTED; - -/* - * Functions to handle the xine-specific palette. - */ - -void _x_clear_xx44_palette(xx44_palette_t *p) XINE_PROTECTED; -void _x_init_xx44_palette(xx44_palette_t *p, unsigned num_entries) XINE_PROTECTED; -void _x_dispose_xx44_palette(xx44_palette_t *p) XINE_PROTECTED; - -/* - * Convert the xine-specific palette to something useful. - */ - -void _x_xx44_to_xvmc_palette(const xx44_palette_t *p,unsigned char *xvmc_palette, - unsigned first_xx44_entry, unsigned num_xx44_entries, - unsigned num_xvmc_components, char *xvmc_components) XINE_PROTECTED; - - -#endif diff --git a/src/xine-engine/audio_decoder.h b/src/xine-engine/audio_decoder.h deleted file mode 100644 index 307692b81..000000000 --- a/src/xine-engine/audio_decoder.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 2000-2004 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * xine audio decoder plugin interface - */ - -#ifndef HAVE_AUDIO_DECODER_H -#define HAVE_AUDIO_DECODER_H - -#ifdef XINE_COMPILE -# include -# include "buffer.h" -#else -# include -# include -#endif - -#define AUDIO_DECODER_IFACE_VERSION 16 - -/* - * generic xine audio decoder plugin interface - */ - -typedef struct audio_decoder_class_s audio_decoder_class_t; -typedef struct audio_decoder_s audio_decoder_t; - -struct audio_decoder_class_s { - - /* - * open a new instance of this plugin class - */ - audio_decoder_t* (*open_plugin) (audio_decoder_class_t *this, xine_stream_t *stream); - - /** - * @brief short human readable identifier for this plugin class - */ - const char *identifier; - - /** - * @brief human readable (verbose = 1 line) description for this plugin class - * - * The description is passed to gettext() to internationalise. - */ - const char *description; - - /** - * @brief Optional non-standard catalog to use with dgettext() for description. - */ - const char *textdomain; - - /* - * free all class-related resources - */ - - void (*dispose) (audio_decoder_class_t *this); -}; - -#define default_audio_decoder_class_dispose (void (*) (audio_decoder_class_t *this))free - -struct audio_decoder_s { - - /* - * decode data from buf and feed decoded samples to - * audio output - */ - void (*decode_data) (audio_decoder_t *this, buf_element_t *buf); - - /* - * reset decoder after engine flush (prepare for new - * audio data not related to recently decoded data) - */ - void (*reset) (audio_decoder_t *this); - - /* - * inform decoder that a time reference discontinuity has happened. - * that is, it must forget any currently held pts value - */ - void (*discontinuity) (audio_decoder_t *this); - - /* - * close down, free all resources - */ - void (*dispose) (audio_decoder_t *this); - - void *node; /* used by plugin loader */ - -}; - -#endif diff --git a/src/xine-engine/audio_out.h b/src/xine-engine/audio_out.h deleted file mode 100644 index bd1b910df..000000000 --- a/src/xine-engine/audio_out.h +++ /dev/null @@ -1,352 +0,0 @@ -/* - * Copyright (C) 2000-2004 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - */ -#ifndef HAVE_AUDIO_OUT_H -#define HAVE_AUDIO_OUT_H - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(XINE_COMPILE) -#include -#include "metronom.h" -#include "configfile.h" -#include "xineutils.h" -#else -#include -#include -#include -#include -#endif - - -#define AUDIO_OUT_IFACE_VERSION 9 - -/* - * ao_driver_s contains the driver every audio output - * driver plugin has to implement. - */ - -typedef struct ao_driver_s ao_driver_t; - -struct ao_driver_s { - - /* - * - * find out what output modes + capatilities are supported by - * this plugin (constants for the bit vector to return see above) - * - * See AO_CAP_* bellow. - */ - uint32_t (*get_capabilities) (ao_driver_t *); - - /* - * open the driver and make it ready to receive audio data - * buffers may be flushed(!) - * - * return value: 0 : failure, >0 : output sample rate - */ - int (*open)(ao_driver_t *, uint32_t bits, uint32_t rate, int mode); - - /* return the number of audio channels - */ - int (*num_channels)(ao_driver_t *self_gen); - - /* return the number of bytes per frame. - * A frame is equivalent to one sample being output on every audio channel. - */ - int (*bytes_per_frame)(ao_driver_t *self_gen); - - /* return the delay is frames measured by - * looking at pending samples in the audio output device - */ - int (*delay)(ao_driver_t *self_gen); - - /* - * return gap tolerance (in pts) needed for this driver - */ - int (*get_gap_tolerance) (ao_driver_t *self_gen); - - /* - * write audio data to audio output device - * return value: - * >0 => audio samples were processed ok - * 0 => audio samples were not yet processed, - * call write_audio_data with the _same_ samples again - */ - int (*write)(ao_driver_t *, - int16_t* audio_data, uint32_t num_samples); - - /* - * this is called when the decoder no longer uses the audio - * output driver - the driver should get ready to get opened() again - */ - void (*close)(ao_driver_t *); - - /* - * shut down this audio output driver plugin and - * free all resources allocated - */ - void (*exit) (ao_driver_t *); - - /* - * Get, Set a property of audio driver. - * - * get_property() return 1 in success, 0 on failure. - * set_property() return value on success, ~value on failure. - * - * See AO_PROP_* below for available properties. - */ - int (*get_property) (ao_driver_t *, int property); - - int (*set_property) (ao_driver_t *, int property, int value); - - - /* - * misc control operations on the audio device. - * - * See AO_CTRL_* below. - */ - int (*control) (ao_driver_t *, int cmd, /* arg */ ...); - - void *node; -}; - -typedef struct ao_format_s ao_format_t; - -struct ao_format_s { - uint32_t bits; - uint32_t rate; - int mode; -}; - -typedef struct audio_fifo_s audio_fifo_t; - -typedef struct audio_buffer_s audio_buffer_t; - -struct audio_buffer_s { - - audio_buffer_t *next; - - int16_t *mem; - int mem_size; - int num_frames; - - int64_t vpts; - uint32_t frame_header_count; - uint32_t first_access_unit; - - /* extra info coming from input or demuxers */ - extra_info_t *extra_info; - - xine_stream_t *stream; /* stream that send that buffer */ - - ao_format_t format; /* let each buffer carry it's own format info */ -}; - -/* - * xine_audio_port_s contains the port every audio decoder talks to - * - * Remember that adding new functions to this structure requires - * adaption of the post plugin decoration layer. Be sure to look into - * src/xine-engine/post.[ch]. - */ - -struct xine_audio_port_s { - uint32_t (*get_capabilities) (xine_audio_port_t *); /* for constants see below */ - - /* * Get/Set audio property - * - * See AO_PROP_* bellow - */ - int (*get_property) (xine_audio_port_t *, int property); - int (*set_property) (xine_audio_port_t *, int property, int value); - - /* open audio driver for audio output - * return value: 0:failure, >0:output sample rate - */ - /* when you are not a full-blown stream, but still need to open the port - * (e.g. you are a post plugin) it is legal to pass an anonymous stream */ - int (*open) (xine_audio_port_t *, xine_stream_t *stream, - uint32_t bits, uint32_t rate, int mode); - - /* - * get a piece of memory for audio data - */ - audio_buffer_t * (*get_buffer) (xine_audio_port_t *); - - /* - * append a buffer filled with audio data to the audio fifo - * for output - */ - /* when the frame does not originate from a stream, it is legal to pass an anonymous stream */ - void (*put_buffer) (xine_audio_port_t *, audio_buffer_t *buf, xine_stream_t *stream); - - /* audio driver is no longer used by decoder => close */ - /* when you are not a full-blown stream, but still need to close the port - * (e.g. you are a post plugin) it is legal to pass an anonymous stream */ - void (*close) (xine_audio_port_t *self, xine_stream_t *stream); - - /* called on xine exit */ - void (*exit) (xine_audio_port_t *); - - /* - * misc control operations on the audio device. - * - * See AO_CTRL_* below. - */ - int (*control) (xine_audio_port_t *, int cmd, /* arg */ ...); - - /* - * Flush audio_out fifo. - */ - void (*flush) (xine_audio_port_t *); - - /* - * Check if port is opened for this stream and get parameters. - * The stream can be anonymous. - */ - int (*status) (xine_audio_port_t *, xine_stream_t *stream, - uint32_t *bits, uint32_t *rate, int *mode); - -}; - -typedef struct audio_driver_class_s audio_driver_class_t; - -struct audio_driver_class_s { - - /* - * open a new instance of this plugin class - */ - ao_driver_t* (*open_plugin) (audio_driver_class_t *, const void *data); - - /** - * @brief short human readable identifier for this plugin class - */ - const char *identifier; - - /** - * @brief human readable (verbose = 1 line) description for this plugin class - * - * The description is passed to gettext() to internationalise. - */ - const char *description; - - /** - * @brief Optional non-standard catalog to use with dgettext() for description. - */ - const char *textdomain; - - /* - * free all class-related resources - */ - - void (*dispose) (audio_driver_class_t *); -}; - -#define default_audio_driver_class_dispose (void (*) (audio_driver_class_t *this))free - -/** - * @brief Initialise the audio_out sync routines - * - * @internal - */ -xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver, int grab_only); - -/* - * audio output modes + capabilities - */ - -#define AO_CAP_NOCAP 0x00000000 /* driver has no capabilities */ -#define AO_CAP_MODE_A52 0x00000001 /* driver supports A/52 output */ -#define AO_CAP_MODE_AC5 0x00000002 /* driver supports AC5 output */ -/* 1 sample == 2 bytes (C) */ -#define AO_CAP_MODE_MONO 0x00000004 /* driver supports mono output */ -/* 1 sample == 4 bytes (L,R) */ -#define AO_CAP_MODE_STEREO 0x00000008 /* driver supports stereo output */ -/* 1 sample == 8 bytes (L,R,LR,RR) */ -#define AO_CAP_MODE_4CHANNEL 0x00000010 /* driver supports 4 channels */ -/* - * Sound cards generally support, 1,2,4,6 channels, but rarely 5. - * So xine will take 4.1, 5 and 6 channel a52 streams and - * down or upmix it correctly to fill the 6 output channels. - * Are there any requests for 2.1 out there? - */ -/* 1 sample == 12 bytes (L,R,LR,RR,Null,LFE) */ -#define AO_CAP_MODE_4_1CHANNEL 0x00000020 /* driver supports 4.1 channels */ -/* 1 sample == 12 bytes (L,R,LR,RR,C, Null) */ -#define AO_CAP_MODE_5CHANNEL 0x00000040 /* driver supports 5 channels */ -/* 1 sample == 12 bytes (L,R,LR,RR,C,LFE) */ -#define AO_CAP_MODE_5_1CHANNEL 0x00000080 /* driver supports 5.1 channels */ - -/* - * converts the audio output mode into the number of channels - */ -int _x_ao_mode2channels( int mode ) XINE_PROTECTED; -/* - * converts the number of channels into the audio output mode - */ -int _x_ao_channels2mode( int channels ) XINE_PROTECTED; - -#define AO_CAP_MIXER_VOL 0x00000100 /* driver supports mixer control */ -#define AO_CAP_PCM_VOL 0x00000200 /* driver supports pcm control */ -#define AO_CAP_MUTE_VOL 0x00000400 /* driver can mute volume */ -#define AO_CAP_8BITS 0x00000800 /* driver support 8-bit samples */ -#define AO_CAP_16BITS 0x00001000 /* driver support 16-bit samples */ -#define AO_CAP_24BITS 0x00002000 /* driver support 24-bit samples */ -#define AO_CAP_FLOAT32 0x00004000 /* driver support 32-bit samples. i.e. Floats */ - -/* properties supported by get/set_property() */ -#define AO_PROP_MIXER_VOL 0 -#define AO_PROP_PCM_VOL 1 -#define AO_PROP_MUTE_VOL 2 -#define AO_PROP_COMPRESSOR 3 -#define AO_PROP_DISCARD_BUFFERS 4 -#define AO_PROP_BUFS_IN_FIFO 5 /* read-only */ -#define AO_PROP_AMP 6 /* amplifier */ -#define AO_PROP_EQ_30HZ 7 /* equalizer */ -#define AO_PROP_EQ_60HZ 8 /* equalizer */ -#define AO_PROP_EQ_125HZ 9 /* equalizer */ -#define AO_PROP_EQ_250HZ 10 /* equalizer */ -#define AO_PROP_EQ_500HZ 11 /* equalizer */ -#define AO_PROP_EQ_1000HZ 12 /* equalizer */ -#define AO_PROP_EQ_2000HZ 13 /* equalizer */ -#define AO_PROP_EQ_4000HZ 14 /* equalizer */ -#define AO_PROP_EQ_8000HZ 15 /* equalizer */ -#define AO_PROP_EQ_16000HZ 16 /* equalizer */ -#define AO_PROP_CLOSE_DEVICE 17 /* force closing audio device */ -#define AO_PROP_AMP_MUTE 18 /* amplifier mute */ -#define AO_PROP_NUM_STREAMS 19 /* read-only */ -#define AO_PROP_CLOCK_SPEED 20 /* inform audio_out that speed has changed */ -#define AO_NUM_PROPERTIES 21 - -/* audio device control ops */ -#define AO_CTRL_PLAY_PAUSE 0 -#define AO_CTRL_PLAY_RESUME 1 -#define AO_CTRL_FLUSH_BUFFERS 2 - -/* above that value audio frames are discarded */ -#define AO_MAX_GAP 15000 - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/xine-engine/broadcaster.h b/src/xine-engine/broadcaster.h deleted file mode 100644 index 093fb4af0..000000000 --- a/src/xine-engine/broadcaster.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2000-2003 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * broadcaster.h - */ - -#ifndef HAVE_BROADCASTER_H -#define HAVE_BROADCASTER_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -typedef struct broadcaster_s broadcaster_t; - -broadcaster_t *_x_init_broadcaster(xine_stream_t *stream, int port) XINE_PROTECTED; -void _x_close_broadcaster(broadcaster_t *this) XINE_PROTECTED; -int _x_get_broadcaster_port(broadcaster_t *this) XINE_PROTECTED; - - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/src/xine-engine/buffer.h b/src/xine-engine/buffer.h deleted file mode 100644 index ce209c9da..000000000 --- a/src/xine-engine/buffer.h +++ /dev/null @@ -1,718 +0,0 @@ -/* - * Copyright (C) 2000-2004 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * - * contents: - * - * buffer_entry structure - serves as a transport encapsulation - * of the mpeg audio/video data through xine - * - * free buffer pool management routines - * - * FIFO buffer structures/routines - */ - -#ifndef HAVE_BUFFER_H -#define HAVE_BUFFER_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#ifdef XINE_COMPILE -# include -# include "attributes.h" -#else -# include -# include -#endif - -#define BUF_MAX_CALLBACKS 5 - -/** - * @defgroup buffer_types Buffer Types - * - * a buffer type ID describes the contents of a buffer - * it consists of three fields: - * - * buf_type = 0xMMDDCCCC - * - * MM : major buffer type (CONTROL, VIDEO, AUDIO, SPU) - * DD : decoder selection (e.g. MPEG, OPENDIVX ... for VIDEO) - * CCCC : channel number or other subtype information for the decoder - */ -/*@{*/ - -#define BUF_MAJOR_MASK 0xFF000000 -#define BUF_DECODER_MASK 0x00FF0000 - -/** - * @defgroup buffer_ctrl Control buffer types - */ -/*@{*/ -#define BUF_CONTROL_BASE 0x01000000 -#define BUF_CONTROL_START 0x01000000 -#define BUF_CONTROL_END 0x01010000 -#define BUF_CONTROL_QUIT 0x01020000 -#define BUF_CONTROL_DISCONTINUITY 0x01030000 /**< former AVSYNC_RESET */ -#define BUF_CONTROL_NOP 0x01040000 -#define BUF_CONTROL_AUDIO_CHANNEL 0x01050000 -#define BUF_CONTROL_SPU_CHANNEL 0x01060000 -#define BUF_CONTROL_NEWPTS 0x01070000 -#define BUF_CONTROL_RESET_DECODER 0x01080000 -#define BUF_CONTROL_HEADERS_DONE 0x01090000 -#define BUF_CONTROL_FLUSH_DECODER 0x010a0000 -#define BUF_CONTROL_RESET_TRACK_MAP 0x010b0000 -/*@}*/ - -/** - * @defgroup buffer_video Video buffer types - * @note (please keep in sync with buffer_types.c) - */ -/*@{*/ -#define BUF_VIDEO_BASE 0x02000000 -#define BUF_VIDEO_UNKNOWN 0x02ff0000 /**< no decoder should handle this one */ -#define BUF_VIDEO_MPEG 0x02000000 -#define BUF_VIDEO_MPEG4 0x02010000 -#define BUF_VIDEO_CINEPAK 0x02020000 -#define BUF_VIDEO_SORENSON_V1 0x02030000 -#define BUF_VIDEO_MSMPEG4_V2 0x02040000 -#define BUF_VIDEO_MSMPEG4_V3 0x02050000 -#define BUF_VIDEO_MJPEG 0x02060000 -#define BUF_VIDEO_IV50 0x02070000 -#define BUF_VIDEO_IV41 0x02080000 -#define BUF_VIDEO_IV32 0x02090000 -#define BUF_VIDEO_IV31 0x020a0000 -#define BUF_VIDEO_ATIVCR1 0x020b0000 -#define BUF_VIDEO_ATIVCR2 0x020c0000 -#define BUF_VIDEO_I263 0x020d0000 -#define BUF_VIDEO_RV10 0x020e0000 -#define BUF_VIDEO_RGB 0x02100000 -#define BUF_VIDEO_YUY2 0x02110000 -#define BUF_VIDEO_JPEG 0x02120000 -#define BUF_VIDEO_WMV7 0x02130000 -#define BUF_VIDEO_WMV8 0x02140000 -#define BUF_VIDEO_MSVC 0x02150000 -#define BUF_VIDEO_DV 0x02160000 -#define BUF_VIDEO_REAL 0x02170000 -#define BUF_VIDEO_VP31 0x02180000 -#define BUF_VIDEO_H263 0x02190000 -#define BUF_VIDEO_3IVX 0x021A0000 -#define BUF_VIDEO_CYUV 0x021B0000 -#define BUF_VIDEO_DIVX5 0x021C0000 -#define BUF_VIDEO_XVID 0x021D0000 -#define BUF_VIDEO_SMC 0x021E0000 -#define BUF_VIDEO_RPZA 0x021F0000 -#define BUF_VIDEO_QTRLE 0x02200000 -#define BUF_VIDEO_MSRLE 0x02210000 -#define BUF_VIDEO_DUCKTM1 0x02220000 -#define BUF_VIDEO_FLI 0x02230000 -#define BUF_VIDEO_ROQ 0x02240000 -#define BUF_VIDEO_SORENSON_V3 0x02250000 -#define BUF_VIDEO_MSMPEG4_V1 0x02260000 -#define BUF_VIDEO_MSS1 0x02270000 -#define BUF_VIDEO_IDCIN 0x02280000 -#define BUF_VIDEO_PGVV 0x02290000 -#define BUF_VIDEO_ZYGO 0x022A0000 -#define BUF_VIDEO_TSCC 0x022B0000 -#define BUF_VIDEO_YVU9 0x022C0000 -#define BUF_VIDEO_VQA 0x022D0000 -#define BUF_VIDEO_GREY 0x022E0000 -#define BUF_VIDEO_XXAN 0x022F0000 -#define BUF_VIDEO_WC3 0x02300000 -#define BUF_VIDEO_YV12 0x02310000 -#define BUF_VIDEO_SEGA 0x02320000 -#define BUF_VIDEO_RV20 0x02330000 -#define BUF_VIDEO_RV30 0x02340000 -#define BUF_VIDEO_MVI2 0x02350000 -#define BUF_VIDEO_UCOD 0x02360000 -#define BUF_VIDEO_WMV9 0x02370000 -#define BUF_VIDEO_INTERPLAY 0x02380000 -#define BUF_VIDEO_RV40 0x02390000 -#define BUF_VIDEO_PSX_MDEC 0x023A0000 -#define BUF_VIDEO_YUV_FRAMES 0x023B0000 /**< uncompressed YUV, delivered by v4l input plugin */ -#define BUF_VIDEO_HUFFYUV 0x023C0000 -#define BUF_VIDEO_IMAGE 0x023D0000 -#define BUF_VIDEO_THEORA 0x023E0000 -#define BUF_VIDEO_4XM 0x023F0000 -#define BUF_VIDEO_I420 0x02400000 -#define BUF_VIDEO_VP4 0x02410000 -#define BUF_VIDEO_VP5 0x02420000 -#define BUF_VIDEO_VP6 0x02430000 -#define BUF_VIDEO_VMD 0x02440000 -#define BUF_VIDEO_MSZH 0x02450000 -#define BUF_VIDEO_ZLIB 0x02460000 -#define BUF_VIDEO_8BPS 0x02470000 -#define BUF_VIDEO_ASV1 0x02480000 -#define BUF_VIDEO_ASV2 0x02490000 -#define BUF_VIDEO_BITPLANE 0x024A0000 /**< Amiga typical picture and animation format */ -#define BUF_VIDEO_BITPLANE_BR1 0x024B0000 /**< the same with Bytrun compression 1 */ -#define BUF_VIDEO_FLV1 0x024C0000 -#define BUF_VIDEO_H264 0x024D0000 -#define BUF_VIDEO_MJPEG_B 0x024E0000 -#define BUF_VIDEO_H261 0x024F0000 -#define BUF_VIDEO_AASC 0x02500000 -#define BUF_VIDEO_LOCO 0x02510000 -#define BUF_VIDEO_QDRW 0x02520000 -#define BUF_VIDEO_QPEG 0x02530000 -#define BUF_VIDEO_ULTI 0x02540000 -#define BUF_VIDEO_WNV1 0x02550000 -#define BUF_VIDEO_XL 0x02560000 -#define BUF_VIDEO_RT21 0x02570000 -#define BUF_VIDEO_FPS1 0x02580000 -#define BUF_VIDEO_DUCKTM2 0x02590000 -#define BUF_VIDEO_CSCD 0x025A0000 -#define BUF_VIDEO_ALGMM 0x025B0000 -#define BUF_VIDEO_ZMBV 0x025C0000 -#define BUF_VIDEO_AVS 0x025D0000 -#define BUF_VIDEO_SMACKER 0x025E0000 -#define BUF_VIDEO_NUV 0x025F0000 -#define BUF_VIDEO_KMVC 0x02600000 -#define BUF_VIDEO_FLASHSV 0x02610000 -#define BUF_VIDEO_CAVS 0x02620000 -#define BUF_VIDEO_VP6F 0x02630000 -#define BUF_VIDEO_THEORA_RAW 0x02640000 -#define BUF_VIDEO_VC1 0x02650000 -/*@}*/ - -/** - * @defgroup buffer_audio Audio buffer types - * @note (please keep in sync with buffer_types.c) - */ -/*@{*/ -#define BUF_AUDIO_BASE 0x03000000 -#define BUF_AUDIO_UNKNOWN 0x03ff0000 /**< no decoder should handle this one */ -#define BUF_AUDIO_A52 0x03000000 -#define BUF_AUDIO_MPEG 0x03010000 -#define BUF_AUDIO_LPCM_BE 0x03020000 -#define BUF_AUDIO_LPCM_LE 0x03030000 -#define BUF_AUDIO_WMAV1 0x03040000 -#define BUF_AUDIO_DTS 0x03050000 -#define BUF_AUDIO_MSADPCM 0x03060000 -#define BUF_AUDIO_MSIMAADPCM 0x03070000 -#define BUF_AUDIO_MSGSM 0x03080000 -#define BUF_AUDIO_VORBIS 0x03090000 -#define BUF_AUDIO_IMC 0x030a0000 -#define BUF_AUDIO_LH 0x030b0000 -#define BUF_AUDIO_VOXWARE 0x030c0000 -#define BUF_AUDIO_ACELPNET 0x030d0000 -#define BUF_AUDIO_AAC 0x030e0000 -#define BUF_AUDIO_DNET 0x030f0000 -#define BUF_AUDIO_VIVOG723 0x03100000 -#define BUF_AUDIO_DK3ADPCM 0x03110000 -#define BUF_AUDIO_DK4ADPCM 0x03120000 -#define BUF_AUDIO_ROQ 0x03130000 -#define BUF_AUDIO_QTIMAADPCM 0x03140000 -#define BUF_AUDIO_MAC3 0x03150000 -#define BUF_AUDIO_MAC6 0x03160000 -#define BUF_AUDIO_QDESIGN1 0x03170000 -#define BUF_AUDIO_QDESIGN2 0x03180000 -#define BUF_AUDIO_QCLP 0x03190000 -#define BUF_AUDIO_SMJPEG_IMA 0x031A0000 -#define BUF_AUDIO_VQA_IMA 0x031B0000 -#define BUF_AUDIO_MULAW 0x031C0000 -#define BUF_AUDIO_ALAW 0x031D0000 -#define BUF_AUDIO_GSM610 0x031E0000 -#define BUF_AUDIO_EA_ADPCM 0x031F0000 -#define BUF_AUDIO_WMAV2 0x03200000 -#define BUF_AUDIO_COOK 0x03210000 -#define BUF_AUDIO_ATRK 0x03220000 -#define BUF_AUDIO_14_4 0x03230000 -#define BUF_AUDIO_28_8 0x03240000 -#define BUF_AUDIO_SIPRO 0x03250000 -#define BUF_AUDIO_WMAV3 0x03260000 -#define BUF_AUDIO_INTERPLAY 0x03270000 -#define BUF_AUDIO_XA_ADPCM 0x03280000 -#define BUF_AUDIO_WESTWOOD 0x03290000 -#define BUF_AUDIO_DIALOGIC_IMA 0x032A0000 -#define BUF_AUDIO_NSF 0x032B0000 -#define BUF_AUDIO_FLAC 0x032C0000 -#define BUF_AUDIO_DV 0x032D0000 -#define BUF_AUDIO_WMAV 0x032E0000 -#define BUF_AUDIO_SPEEX 0x032F0000 -#define BUF_AUDIO_RAWPCM 0x03300000 -#define BUF_AUDIO_4X_ADPCM 0x03310000 -#define BUF_AUDIO_VMD 0x03320000 -#define BUF_AUDIO_XAN_DPCM 0x03330000 -#define BUF_AUDIO_ALAC 0x03340000 -#define BUF_AUDIO_MPC 0x03350000 -#define BUF_AUDIO_SHORTEN 0x03360000 -#define BUF_AUDIO_WESTWOOD_SND1 0x03370000 -#define BUF_AUDIO_WMALL 0x03380000 -#define BUF_AUDIO_TRUESPEECH 0x03390000 -#define BUF_AUDIO_TTA 0x033A0000 -#define BUF_AUDIO_SMACKER 0x033B0000 -#define BUF_AUDIO_FLVADPCM 0x033C0000 -#define BUF_AUDIO_WAVPACK 0x033D0000 -/*@}*/ - -/** - * @defgroup buffer_spu SPU buffer types - */ -/*@{*/ -#define BUF_SPU_BASE 0x04000000 -#define BUF_SPU_DVD 0x04000000 -#define BUF_SPU_TEXT 0x04010000 -#define BUF_SPU_CC 0x04020000 -#define BUF_SPU_DVB 0x04030000 -#define BUF_SPU_SVCD 0x04040000 -#define BUF_SPU_CVD 0x04050000 -#define BUF_SPU_OGM 0x04060000 -#define BUF_SPU_CMML 0x04070000 -/*@}*/ - -/** - * @defgroup buffer_demux Demuxer block types - */ -/*@{*/ -#define BUF_DEMUX_BLOCK 0x05000000 -/*@}*/ - -/*@}*/ - -typedef struct extra_info_s extra_info_t; - -/** - * @brief Structure to pass information from input or demuxer plugins - * to output frames (past decoder). - * - * New data must be added after the existing fields to not break ABI - * (backward compatibility). - */ - -struct extra_info_s { - - int input_normpos; /**< remember where this buf came from in - * the input source (0..65535). can be - * either time or offset based. */ - int input_time; /**< time offset in miliseconds from - * beginning of stream */ - uint32_t frame_number; /**< number of current frame if known */ - - int seek_count; /**< internal engine use */ - int64_t vpts; /**< set on output layers only */ - - int invalid; /**< do not use this extra info to update anything */ - int total_time; /**< duration in miliseconds of the stream */ -}; - - -#define BUF_NUM_DEC_INFO 5 - -typedef struct buf_element_s buf_element_t; -struct buf_element_s { - buf_element_t *next; - - unsigned char *mem; - unsigned char *content; /**< start of raw content in mem (without header etc) */ - - int32_t size ; /**< size of _content_ */ - int32_t max_size; /**< size of pre-allocated memory pointed to by "mem" */ - int64_t pts; /**< presentation time stamp, used for a/v sync */ - int64_t disc_off; /**< discontinuity offset */ - - extra_info_t *extra_info; /**< extra info will be passed to frames */ - - uint32_t decoder_flags; /**< stuff like keyframe, is_header ... see below */ - - /** additional decoder flags and other dec-spec. stuff */ - uint32_t decoder_info[BUF_NUM_DEC_INFO]; - /** pointers to dec-spec. stuff */ - void *decoder_info_ptr[BUF_NUM_DEC_INFO]; - - void (*free_buffer) (buf_element_t *buf); - - void *source; /**< pointer to source of this buffer for - * free_buffer */ - - uint32_t type; -} ; - -/** keyframe should be set whenever possible (that is, when demuxer - * knows about frames and keyframes). */ -#define BUF_FLAG_KEYFRAME 0x0001 - -/** frame start/end. BUF_FLAG_FRAME_END is sent on last buf of a frame */ -#define BUF_FLAG_FRAME_START 0x0002 -#define BUF_FLAG_FRAME_END 0x0004 - -/** any out-of-band data needed to initialize decoder must have - * this flag set. */ -#define BUF_FLAG_HEADER 0x0008 - -/** preview buffers are normal data buffers that must not produce any - * output in decoders (may be used to sneak details about the stream - * to come). */ -#define BUF_FLAG_PREVIEW 0x0010 - -/** set when user stop the playback */ -#define BUF_FLAG_END_USER 0x0020 - -/** set when stream finished naturaly */ -#define BUF_FLAG_END_STREAM 0x0040 - -/** decoder_info[0] carries the frame step (1/90000). */ -#define BUF_FLAG_FRAMERATE 0x0080 - -/** hint to metronom that seeking has occurred */ -#define BUF_FLAG_SEEK 0x0100 - -/** special information inside, see below. */ -#define BUF_FLAG_SPECIAL 0x0200 - -/** header use standard xine_bmiheader or xine_waveformatex structs. - * xine_waveformatex is actually optional since the most important - * information for audio init is available from decoder_info[]. - * note: BUF_FLAG_HEADER must also be set. */ -#define BUF_FLAG_STDHEADER 0x0400 - -/** decoder_info[1] carries numerator for display aspect ratio - * decoder_info[2] carries denominator for display aspect ratio */ -#define BUF_FLAG_ASPECT 0x0800 - - -/** - * \defgroup buffer_special Special buffer types: - * Sometimes there is a need to relay special information from a demuxer - * to a video decoder. For example, some file types store palette data in - * the file header independant of the video data. The special buffer type - * offers a way to communicate this or any other custom, format-specific - * data to the decoder. - * - * The interface was designed in a way that did not require an API - * version bump. To send a special buffer type, set a buffer's flags field - * to BUF_FLAG_SPECIAL. Set the buffer's decoder_info[1] field to a - * number according to one of the special buffer subtypes defined below. - * The second and third decoder_info[] fields are defined according to - * your buffer type's requirements. - * - * Finally, remember to set the buffer's size to 0. This way, if a special - * buffer is sent to a decode that does not know how to handle it, the - * buffer will fall through to the case where the buffer's data content - * is accumulated and no harm will be done. - */ -/*@{*/ - -/** - * In a BUF_SPECIAL_PALETTE buffer: - * decoder_info[1] = BUF_SPECIAL_PALETTE - * decoder_info[2] = number of entries in palette table - * decoder_info_ptr[2] = pointer to palette table - * This buffer type is used to provide a file- and decoder-independent - * facility to transport RGB color palettes from demuxers to decoders. - * A palette table is an array of palette_entry_t structures. A decoder - * should not count on this array to exist for the duration of the - * program's execution and should copy, manipulate, and store the palette - * data privately if it needs the palette information. - */ -#define BUF_SPECIAL_PALETTE 1 - - -/* special buffer type 2 used to be defined but is now available for use */ - - -/** - * In a BUF_SPECIAL_ASPECT buffer: - * decoder_info[1] = BUF_SPECIAL_ASPECT - * decoder_info[2] = MPEG2 aspect ratio code - * decoder_info[3] = stream scale prohibitions - * This buffer is used to force mpeg decoders to use a certain aspect. - * Currently xine-dvdnav uses this, because it has more accurate information - * about the aspect from the dvd ifo-data. - * The stream scale prohibitions are also delivered, with bit 0 meaning - * "deny letterboxing" and bit 1 meaning "deny pan&scan" - */ -#define BUF_SPECIAL_ASPECT 3 - -/** - * In a BUF_SPECIAL_DECODER_CONFIG buffer: - * decoder_info[1] = BUF_SPECIAL_DECODER_CONFIG - * decoder_info[2] = data size - * decoder_info_ptr[2] = pointer to data - * This buffer is used to pass config information from .mp4 files - * (atom esds) to decoders. both mpeg4 and aac streams use that. - */ -#define BUF_SPECIAL_DECODER_CONFIG 4 - -/** - * In a BUF_SPECIAL_STSD_ATOM buffer: - * decoder_info[1] = BUF_SPECIAL_STSD_ATOM - * decoder_info[2] = size of the ImageDescription atom, minus the - * four length bytes at the beginning - * decoder_info_ptr[2] = pointer to ImageDescription atom, starting with - * the codec fourcc - * Some Quicktime decoders need information contained within the - * ImageDescription atom inside a Quicktime file's stsd atom. This - * special buffer carries the ImageDescription atom from the QT demuxer - * to an A/V decoder. - */ -#define BUF_SPECIAL_STSD_ATOM 5 - -/** - * In a BUF_SPECIAL_LPCM_CONFIG buffer: - * decoder_info[1] = BUF_SPECIAL_LPCM_CONFIG - * decoder_info[2] = config data - * lpcm data encoded into mpeg2 streams have a format configuration - * byte in every frame. this is used to detect the sample rate, - * number of bits and channels. - */ -#define BUF_SPECIAL_LPCM_CONFIG 6 - -/** - * In a BUF_SPECIAL_CHARSET_ENCODING buffer: - * decoder_info[1] = BUF_SPECIAL_CHARSET_ENCODING - * decoder_info[2] = size of charset encoding string - * decoder_info_ptr[2] = pointer to charset encoding string - * This is used mostly with subtitle buffers when encoding is - * known at demuxer level (take precedence over xine config - * settings such as subtitles.separate.src_encoding) - */ -#define BUF_SPECIAL_CHARSET_ENCODING 7 - - -/** - * In a BUF_SPECIAL_SPU_DVD_SUBTYPE: - * decoder_info[1] = BUF_SPECIAL_SPU_DVD_SUBTYPE - * decoder_info[2] = subtype - * decoder_info[3] = - * This buffer is pass SPU subtypes from DVDs - */ -#define BUF_SPECIAL_SPU_DVD_SUBTYPE 8 - - -#define SPU_DVD_SUBTYPE_CLUT 1 -#define SPU_DVD_SUBTYPE_PACKAGE 2 -#define SPU_DVD_SUBTYPE_VOBSUB_PACKAGE 3 -#define SPU_DVD_SUBTYPE_NAV 4 - -/** - * In a BUF_SPECIAL_SPU_DVB_DESCRIPTOR - * decoder_info[1] = BUF_SPECIAL_SPU_DVB_DESCRIPTOR - * decoder_info[2] = size of spu_dvb_descriptor_t - * decoder_info_ptr[2] = pointer to spu_dvb_descriptor_t, or NULL - * decoder_info[3] = - * - * This buffer is used to tell a DVBSUB decoder when the stream - * changes. For more information on how to write a DVBSUB decoder, - * see the comment at the top of src/demuxers/demux_ts.c - **/ -#define BUF_SPECIAL_SPU_DVB_DESCRIPTOR 9 - -/** - * In a BUF_SPECIAL_RV_CHUNK_TABLE: - * decoder_info[1] = BUF_SPECIAL_RV_CHUNK_TABLE - * decoder_info[2] = number of entries in chunk table - * decoder_info_ptr[2] = pointer to the chunk table - * - * This buffer transports the chunk table associated to each RealVideo frame. - */ -#define BUF_SPECIAL_RV_CHUNK_TABLE 10 -/*@}*/ - -typedef struct spu_dvb_descriptor_s spu_dvb_descriptor_t; -struct spu_dvb_descriptor_s -{ - char lang[4]; - long comp_page_id; - long aux_page_id; -} ; - -typedef struct palette_entry_s palette_entry_t; -struct palette_entry_s -{ - unsigned char r, g, b; -} ; - -typedef struct fifo_buffer_s fifo_buffer_t; -struct fifo_buffer_s -{ - buf_element_t *first, *last; - - int fifo_size; - uint32_t fifo_data_size; - void *fifo_empty_cb_data; - - pthread_mutex_t mutex; - pthread_cond_t not_empty; - - /* - * functions to access this fifo: - */ - - void (*put) (fifo_buffer_t *fifo, buf_element_t *buf); - - buf_element_t *(*get) (fifo_buffer_t *fifo); - - void (*clear) (fifo_buffer_t *fifo) ; - - int (*size) (fifo_buffer_t *fifo); - - int (*num_free) (fifo_buffer_t *fifo); - - uint32_t (*data_size) (fifo_buffer_t *fifo); - - void (*dispose) (fifo_buffer_t *fifo); - - /* - * alloc buffer for this fifo from global buf pool - * you don't have to use this function to allocate a buffer, - * an input plugin can decide to implement it's own - * buffer allocation functions - */ - - buf_element_t *(*buffer_pool_alloc) (fifo_buffer_t *self); - - - /* - * special functions, not used by demuxers - */ - - /* the same as buffer_pool_alloc but may fail if none is available */ - buf_element_t *(*buffer_pool_try_alloc) (fifo_buffer_t *self); - - /* the same as put but insert at the head of the fifo */ - void (*insert) (fifo_buffer_t *fifo, buf_element_t *buf); - - /* callbacks */ - void (*register_alloc_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, void *), void *cb_data); - void (*register_put_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, buf_element_t *buf, void *), void *cb_data); - void (*register_get_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, buf_element_t *buf, void *), void *cb_data); - void (*unregister_alloc_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, void *)); - void (*unregister_put_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, buf_element_t *buf, void *)); - void (*unregister_get_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, buf_element_t *buf, void *)); - - /* - * private variables for buffer pool management - */ - buf_element_t *buffer_pool_top; /* a stack actually */ - pthread_mutex_t buffer_pool_mutex; - pthread_cond_t buffer_pool_cond_not_empty; - int buffer_pool_num_free; - int buffer_pool_capacity; - int buffer_pool_buf_size; - void *buffer_pool_base; /*used to free mem chunk */ - void (*alloc_cb[BUF_MAX_CALLBACKS])(fifo_buffer_t *fifo, void *data_cb); - void (*put_cb[BUF_MAX_CALLBACKS])(fifo_buffer_t *fifo, buf_element_t *buf, void *data_cb); - void (*get_cb[BUF_MAX_CALLBACKS])(fifo_buffer_t *fifo, buf_element_t *buf, void *data_cb); - void *alloc_cb_data[BUF_MAX_CALLBACKS]; - void *put_cb_data[BUF_MAX_CALLBACKS]; - void *get_cb_data[BUF_MAX_CALLBACKS]; -} ; - -/** - * @brief Allocate and initialise new (empty) FIFO buffers. - * @param num_buffer Number of buffers to allocate. - * @param buf_size Size of each buffer. - * @internal Only used by video and audio decoder loops. - */ -fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size); - -/** - * @brief Allocate and initialise new dummy FIFO buffers. - * @param num_buffer Number of dummy buffers to allocate. - * @param buf_size Size of each buffer. - * @internal Only used by video and audio decoder loops. - */ -fifo_buffer_t *_x_dummy_fifo_buffer_new (int num_buffers, uint32_t buf_size); - - -/** - * @brief Returns the \ref buffer_video "BUF_VIDEO_xxx" for the given fourcc. - * @param fourcc_int 32-bit FOURCC value in machine endianness - * @sa _x_formattag_to_buf_audio - * - * example: fourcc_int = *(uint32_t *)fourcc_char; - */ -uint32_t _x_fourcc_to_buf_video( uint32_t fourcc_int ) XINE_PROTECTED; - -/** - * @brief Returns video codec name given the buffer type. - * @param buf_type One of the \ref buffer_video "BUF_VIDEO_xxx" values. - * @sa _x_buf_audio_name - */ -const char *_x_buf_video_name( uint32_t buf_type ) XINE_PROTECTED; - -/** - * @brief Returns the \ref buffer_audio "BUF_AUDIO_xxx" for the given formattag. - * @param formattagg 32-bit format tag value in machine endianness - * @sa _x_fourcc_to_buf_video - */ -uint32_t _x_formattag_to_buf_audio( uint32_t formattag ) XINE_PROTECTED; - -/** - * @brief Returns audio codec name given the buffer type. - * @param buf_type One of the \ref buffer_audio "BUF_AUDIO_xxx" values. - * @sa _x_buf_video_name - */ -const char *_x_buf_audio_name( uint32_t buf_type ) XINE_PROTECTED; - - -/** - * @brief xine version of BITMAPINFOHEADER. - * @note Should be safe to compile on 64bits machines. - * @note Will always use machine endian format, so demuxers reading - * stuff from win32 formats must use the function below. - */ -typedef struct XINE_PACKED { - int32_t biSize; - int32_t biWidth; - int32_t biHeight; - int16_t biPlanes; - int16_t biBitCount; - uint32_t biCompression; - int32_t biSizeImage; - int32_t biXPelsPerMeter; - int32_t biYPelsPerMeter; - int32_t biClrUsed; - int32_t biClrImportant; -} xine_bmiheader; - -/** - * @brief xine version of WAVEFORMATEX. - * @note The same comments from xine_bmiheader applies. - */ -typedef struct XINE_PACKED { - int16_t wFormatTag; - int16_t nChannels; - int32_t nSamplesPerSec; - int32_t nAvgBytesPerSec; - int16_t nBlockAlign; - int16_t wBitsPerSample; - int16_t cbSize; -} xine_waveformatex; - -/** Convert xine_bmiheader struct from little endian */ -void _x_bmiheader_le2me( xine_bmiheader *bih ) XINE_PROTECTED; - -/** Convert xine_waveformatex struct from little endian */ -void _x_waveformatex_le2me( xine_waveformatex *wavex ) XINE_PROTECTED; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/xine-engine/configfile.h b/src/xine-engine/configfile.h deleted file mode 100644 index 22a544c00..000000000 --- a/src/xine-engine/configfile.h +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright (C) 2000-2004 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * config file management - */ - -#ifndef HAVE_CONFIGFILE_H -#define HAVE_CONFIGFILE_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#ifdef XINE_COMPILE -# include "xine.h" -#else -# include -#endif - -#define CONFIG_FILE_VERSION 2 - -/** - * config entries above this experience - * level must never be changed from MRL - */ -#define XINE_CONFIG_SECURITY 30 - - -typedef struct cfg_entry_s cfg_entry_t; -typedef struct config_values_s config_values_t; - -struct cfg_entry_s { - cfg_entry_t *next; - config_values_t *config; - - char *key; - int type; - - /** user experience level */ - int exp_level; - - /** type unknown */ - char *unknown_value; - - /** type string */ - char *str_value; - char *str_default; - - /** common to range, enum, num, bool: */ - int num_value; - int num_default; - - /** type range specific: */ - int range_min; - int range_max; - - /** type enum specific: */ - char **enum_values; - - /** help info for the user */ - char *description; - char *help; - - /** callback function and data for live changeable values */ - xine_config_cb_t callback; - void *callback_data; -}; - -struct config_values_s { - - /* - * register config values - * - * these functions return the current value of the - * registered item, i.e. the default value if it was - * not found in the config file or the current value - * from the config file otherwise - */ - - char* (*register_string) (config_values_t *self, - const char *key, - const char *def_value, - const char *description, - const char *help, - int exp_level, - xine_config_cb_t changed_cb, - void *cb_data); - - char* (*register_filename) (config_values_t *self, - const char *key, - const char *def_value, - int req_type, - const char *description, - const char *help, - int exp_level, - xine_config_cb_t changed_cb, - void *cb_data); - - int (*register_range) (config_values_t *self, - const char *key, - int def_value, - int min, int max, - const char *description, - const char *help, - int exp_level, - xine_config_cb_t changed_cb, - void *cb_data); - - int (*register_enum) (config_values_t *self, - const char *key, - int def_value, - char **values, - const char *description, - const char *help, - int exp_level, - xine_config_cb_t changed_cb, - void *cb_data); - - int (*register_num) (config_values_t *self, - const char *key, - int def_value, - const char *description, - const char *help, - int exp_level, - xine_config_cb_t changed_cb, - void *cb_data); - - int (*register_bool) (config_values_t *self, - const char *key, - int def_value, - const char *description, - const char *help, - int exp_level, - xine_config_cb_t changed_cb, - void *cb_data); - - /** convenience function to update range, enum, num and bool values */ - void (*update_num) (config_values_t *self, const char *key, int value); - - /** convenience function to update string values */ - void (*update_string) (config_values_t *self, const char *key, const char *value); - - /** small utility function for enum handling */ - int (*parse_enum) (const char *str, const char **values); - - /** - * @brief lookup config entries - * - * remember to call the changed_cb if it exists - * and you changed the value of this item - */ - - cfg_entry_t* (*lookup_entry) (config_values_t *self, const char *key); - - /** - * unregister callback function - */ - void (*unregister_callback) (config_values_t *self, const char *key); - - /** - * dispose of all config entries in memory - */ - void (*dispose) (config_values_t *self); - - /* - * config values are stored here: - */ - cfg_entry_t *first, *last, *cur; - - /** - * mutex for modification to the config - */ - pthread_mutex_t config_lock; - - /** - * current config file's version number - */ - int current_version; -}; - -/** - * @brief allocate and init a new xine config object - * @internal - */ -config_values_t *_x_config_init (void); - -/** - * @brief interpret stream_setup part of mrls for config value changes - * @internal - */ - -int _x_config_change_opt(config_values_t *config, const char *opt); - - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/src/xine-engine/info_helper.h b/src/xine-engine/info_helper.h deleted file mode 100644 index d4123ba2b..000000000 --- a/src/xine-engine/info_helper.h +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Copyright (C) 2000-2003 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * stream metainfo helper functions - * hide some xine engine details from demuxers and reduce code duplication - * - * $id$ - */ - -#ifndef INFO_HELPER_H -#define INFO_HELPER_H - -#include -#include "xine_internal.h" - -/* - * set a stream info - * - * params: - * *stream the xine stream - * info stream info id (see xine.h, XINE_STREAM_INFO_*) - * value the value to assign - * - */ -void _x_stream_info_set(xine_stream_t *stream, int info, int value) XINE_PROTECTED; - -/* - * reset a stream info (internal ones only) - * - * params : - * *stream the xine stream - * info meta info id (see xine.h, XINE_STREAM_INFO_*) - * - */ -void _x_stream_info_reset(xine_stream_t *stream, int info) XINE_PROTECTED; - -/* - * reset a stream info (public ones only) - * - * params : - * *stream the xine stream - * info meta info id (see xine.h, XINE_STREAM_INFO_*) - * - */ -void _x_stream_info_public_reset(xine_stream_t *stream, int info) XINE_PROTECTED; - -/* - * retrieve stream info (internal ones only) - * - * params : - * *stream the xine stream - * info meta info id (see xine.h, XINE_STREAM_INFO_*) - * - */ -uint32_t _x_stream_info_get(xine_stream_t *stream, int info) XINE_PROTECTED; - -/* - * retrieve stream info (public ones only) - * - * params : - * *stream the xine stream - * info meta info id (see xine.h, XINE_STREAM_INFO_*) - * - */ -uint32_t _x_stream_info_get_public(xine_stream_t *stream, int info) XINE_PROTECTED; - -/* - * set a stream meta info - * - * params: - * *stream the xine stream - * info meta info id (see xine.h, XINE_META_INFO_*) - * *str null-terminated string (using current locale) - * - */ -void _x_meta_info_set(xine_stream_t *stream, int info, const char *str) XINE_PROTECTED; - -/* - * set a stream meta info - * - * params: - * *stream the xine stream - * info meta info id (see xine.h, XINE_META_INFO_*) - * *str null-terminated string (using utf8) - * - */ -void _x_meta_info_set_utf8(xine_stream_t *stream, int info, const char *str) XINE_PROTECTED; - -/* - * set a stream meta info - * - * params: - * *stream the xine stream - * info meta info id (see xine.h, XINE_META_INFO_*) - * *str null-terminated string (using encoding below) - * *enc charset encoding of the string - * - */ -void _x_meta_info_set_generic(xine_stream_t *stream, int info, const char *str, const char *enc) XINE_PROTECTED; - -/* - * set a stream meta multiple info - * - * params: - * *stream the xine stream - * info meta info id (see xine.h, XINE_META_INFO_*) - * ... one or more meta info, followed by a NULL pointer - * - */ -void _x_meta_info_set_multi(xine_stream_t *stream, int info, ...) XINE_SENTINEL XINE_PROTECTED; - -/* - * set a stream meta info - * - * params: - * *stream the xine stream - * info meta info id (see xine.h, XINE_META_INFO_*) - * *buf char buffer (not a null-terminated string) - * len length of the metainfo - * - */ -void _x_meta_info_n_set(xine_stream_t *stream, int info, const char *buf, int len) XINE_PROTECTED; - -/* - * reset a stream meta info (internal ones only) - * - * params : - * *stream the xine stream - * info meta info id (see xine.h, XINE_META_INFO_*) - * - */ -void _x_meta_info_reset(xine_stream_t *stream, int info) XINE_PROTECTED; - -/* - * reset a stream meta info (public ones only) - * - * params : - * *stream the xine stream - * info meta info id (see xine.h, XINE_META_INFO_*) - * - */ -void _x_meta_info_public_reset(xine_stream_t *stream, int info) XINE_PROTECTED; - -/* - * retrieve stream meta info (internal ones only) - * - * params : - * *stream the xine stream - * info meta info id (see xine.h, XINE_META_INFO_*) - * - */ -const char *_x_meta_info_get(xine_stream_t *stream, int info) XINE_PROTECTED; - -/* - * retrieve stream meta info (public ones only) - * - * params : - * *stream the xine stream - * info meta info id (see xine.h, XINE_META_INFO_*) - * - */ -const char *_x_meta_info_get_public(xine_stream_t *stream, int info) XINE_PROTECTED; - -#endif /* INFO_HELPER_H */ diff --git a/src/xine-engine/io_helper.h b/src/xine-engine/io_helper.h deleted file mode 100644 index 0aac8fcfc..000000000 --- a/src/xine-engine/io_helper.h +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (C) 2000-2003 the xine project, - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * abortable i/o helper functions - */ - -#ifndef IO_HELPER_H -#define IO_HELPER_H - -#include "xine_internal.h" - - -/* select states */ -#define XIO_READ_READY 1 -#define XIO_WRITE_READY 2 - -/* xine select return codes */ -#define XIO_READY 0 -#define XIO_ERROR 1 -#define XIO_ABORTED 2 -#define XIO_TIMEOUT 3 - - -/* - * Waits for a file descriptor/socket to change status. - * - * network input plugins should use this function in order to - * not freeze the engine. - * - * params : - * stream needed for aborting and reporting errors but may be NULL - * fd file/socket descriptor - * state XIO_READ_READY, XIO_WRITE_READY - * timeout_sec timeout in seconds - * - * An other thread can abort this function if stream != NULL by setting - * stream->demux_action_pending. - * - * return value : - * XIO_READY the file descriptor is ready for cmd - * XIO_ERROR an i/o error occured - * XIO_ABORTED command aborted by an other thread - * XIO_TIMEOUT the file descriptor is not ready after timeout_msec milliseconds - */ -int _x_io_select (xine_stream_t *stream, int fd, int state, int timeout_msec) XINE_PROTECTED; - - -/* - * open a tcp connection - * - * params : - * stream needed for reporting errors but may be NULL - * host address of target - * port port on target - * - * returns a socket descriptor or -1 if an error occured - */ -int _x_io_tcp_connect(xine_stream_t *stream, const char *host, int port) XINE_PROTECTED; - -/* - * wait for finish connection - * - * params : - * stream needed for aborting and reporting errors but may be NULL - * fd socket descriptor - * timeout_msec timeout in milliseconds - * - * return value: - * XIO_READY host respond, the socket is ready for cmd - * XIO_ERROR an i/o error occured - * XIO_ABORTED command aborted by an other thread - * XIO_TIMEOUT the file descriptor is not ready after timeout - */ -int _x_io_tcp_connect_finish(xine_stream_t *stream, int fd, int timeout_msec) XINE_PROTECTED; - -/* - * read from tcp socket checking demux_action_pending - * - * network input plugins should use this function in order to - * not freeze the engine. - * - * aborts with zero if no data is available and *abort is set - */ -off_t _x_io_tcp_read (xine_stream_t *stream, int s, void *buf, off_t todo) XINE_PROTECTED; - - -/* - * write to a tcp socket checking demux_action_pending - * - * network input plugins should use this function in order to - * not freeze the engine. - * - * aborts with zero if no data is available and *abort is set - */ -off_t _x_io_tcp_write (xine_stream_t *stream, int s, void *buf, off_t todo) XINE_PROTECTED; - -/* - * read from a file descriptor checking demux_action_pending - * - * the fifo input plugin should use this function in order to - * not freeze the engine. - * - * aborts with zero if no data is available and *abort is set - */ -off_t _x_io_file_read (xine_stream_t *stream, int fd, void *buf, off_t todo) XINE_PROTECTED; - - -/* - * write to a file descriptor checking demux_action_pending - * - * the fifo input plugin should use this function in order to - * not freeze the engine. - * - * aborts with zero if *abort is set - */ -off_t _x_io_file_write (xine_stream_t *stream, int fd, void *buf, off_t todo) XINE_PROTECTED; - -/* - * read a string from socket, return string length (same as strlen) - * the string is always '\0' terminated but given buffer size is never exceeded - * that is, _x_io_tcp_read_line(,,,X) <= (X-1) ; X > 0 - */ -int _x_io_tcp_read_line(xine_stream_t *stream, int sock, char *str, int size) XINE_PROTECTED; - -#endif diff --git a/src/xine-engine/metronom.h b/src/xine-engine/metronom.h deleted file mode 100644 index 77919f16e..000000000 --- a/src/xine-engine/metronom.h +++ /dev/null @@ -1,364 +0,0 @@ -/* - * Copyright (C) 2000-2004 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * metronom: general pts => virtual calculation/assoc - * - * virtual pts: unit 1/90000 sec, always increasing - * can be used for synchronization - * video/audio frame with same pts also have same vpts - * but pts is likely to differ from vpts - * - * the basic idea is: - * video_pts + video_wrap_offset = video_vpts - * audio_pts + audio_wrap_offset = audio_vpts - * - * - video_wrap_offset should be equal to audio_wrap_offset as to have - * perfect audio and video sync. They will differ on brief periods due - * discontinuity correction. - * - metronom should also interpolate vpts values most of the time as - * video_pts and audio_vpts are not given for every frame. - * - corrections to the frame rate may be needed to cope with bad - * encoded streams. - */ - -#ifndef HAVE_METRONOM_H -#define HAVE_METRONOM_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#ifdef XINE_COMPILE -# include "video_out.h" -# include "xine.h" -#else -# include -# include -#endif - -typedef struct metronom_s metronom_t ; -typedef struct metronom_clock_s metronom_clock_t; -typedef struct scr_plugin_s scr_plugin_t; - -/* metronom prebuffer can be adjusted with XINE_PARAM_METRONOM_PREBUFFER. - * it sets how much the first video/audio frame should be delayed to - * have some prebuffering at the output layers. reducing this value (about - * 1/8 sec) may result in faster seeking (good to simulate play backwards, - * for example). - */ -#define PREBUFFER_PTS_OFFSET 12000 - - /* see below */ -#define DISC_STREAMSTART 0 -#define DISC_RELATIVE 1 -#define DISC_ABSOLUTE 2 -#define DISC_STREAMSEEK 3 - -struct metronom_s { - - /* - * called by audio output driver to inform metronom about current audio - * samplerate - * - * parameter pts_per_smpls : 1/90000 sec per 65536 samples - */ - void (*set_audio_rate) (metronom_t *self, int64_t pts_per_smpls); - - /* - * called by video output driver for *every* frame - * - * parameter frame containing pts, scr, ... information - * - * will set vpts field in frame - * - * this function will also update video_wrap_offset if a discontinuity - * is detected (read the comentaries below about discontinuities). - * - */ - - void (*got_video_frame) (metronom_t *self, vo_frame_t *frame); - - /* - * called by audio output driver whenever audio samples are delivered to it - * - * parameter pts : pts for audio data if known, 0 otherwise - * nsamples : number of samples delivered - * - * return value: virtual pts for audio data - * - * this function will also update audio_wrap_offset if a discontinuity - * is detected (read the comentaries below about discontinuities). - * - */ - - int64_t (*got_audio_samples) (metronom_t *self, int64_t pts, - int nsamples); - - /* - * called by SPU decoder whenever a packet is delivered to it - * - * parameter pts : pts for SPU packet if known, 0 otherwise - * - * return value: virtual pts for SPU packet - * (this is the only pts to vpts function that cannot update the wrap_offset - * due to the lack of regularity on spu packets) - */ - - int64_t (*got_spu_packet) (metronom_t *self, int64_t pts); - - /* - * tell metronom about discontinuities. - * - * these functions are called due to a discontinuity detected at - * demux stage. - * - * there are different types of discontinuities: - * - * DISC_STREAMSTART : new stream starts, expect pts values to start - * from zero immediately - * DISC_RELATIVE : typically a wrap-around, expect pts with - * a specified offset from the former ones soon - * DISC_ABSOLUTE : typically a new menu stream (nav packets) - * pts will start from given value soon - * DISC_STREAMSEEK : used by video and audio decoder loop, - * when a buffer with BUF_FLAG_SEEK set is encountered; - * applies the necessary vpts offset for the seek in - * metronom, but keeps the vpts difference between - * audio and video, so that metronom doesn't cough - */ - void (*handle_audio_discontinuity) (metronom_t *self, int type, int64_t disc_off); - void (*handle_video_discontinuity) (metronom_t *self, int type, int64_t disc_off); - - /* - * set/get options for metronom, constants see below - */ - void (*set_option) (metronom_t *self, int option, int64_t value); - int64_t (*get_option) (metronom_t *self, int option); - - /* - * set a master metronom - * this is currently useful to sync independently generated streams - * (e.g. by post plugins) to the discontinuity domain of another - * metronom - */ - void (*set_master) (metronom_t *self, metronom_t *master); - - void (*exit) (metronom_t *self); - -#ifdef METRONOM_INTERNAL - /* - * metronom internal stuff - */ - xine_t *xine; - - metronom_t *master; - - int64_t pts_per_smpls; - - int64_t video_vpts; - int64_t spu_vpts; - int64_t audio_vpts; - int64_t audio_vpts_rmndr; /* the remainder for integer division */ - - int64_t vpts_offset; - - int64_t video_drift; - int64_t video_drift_step; - - int audio_samples; - int64_t audio_drift_step; - - int64_t prebuffer; - int64_t av_offset; - int64_t spu_offset; - - pthread_mutex_t lock; - - int have_video; - int have_audio; - int video_discontinuity_count; - int audio_discontinuity_count; - int discontinuity_handled_count; - pthread_cond_t video_discontinuity_reached; - pthread_cond_t audio_discontinuity_reached; - - int force_video_jump; - int force_audio_jump; - - int64_t img_duration; - int img_cpt; - int64_t last_video_pts; - int64_t last_audio_pts; - - int video_mode; -#endif -}; - -/* - * metronom options - */ - -#define METRONOM_AV_OFFSET 2 -#define METRONOM_ADJ_VPTS_OFFSET 3 -#define METRONOM_FRAME_DURATION 4 -#define METRONOM_SPU_OFFSET 5 -#define METRONOM_VPTS_OFFSET 6 -#define METRONOM_PREBUFFER 7 - -metronom_t *_x_metronom_init (int have_video, int have_audio, xine_t *xine) XINE_PROTECTED; - -/* FIXME: reorder this structure on the next cleanup to remove the dummies */ -struct metronom_clock_s { - - /* - * set/get options for clock, constants see below - */ - void (*set_option) (metronom_clock_t *self, int option, int64_t value); - int64_t (*get_option) (metronom_clock_t *self, int option); - - /* - * system clock reference (SCR) functions - */ - -#ifdef METRONOM_CLOCK_INTERNAL - /* - * start clock (no clock reset) - * at given pts - */ - void (*start_clock) (metronom_clock_t *self, int64_t pts); - - - /* - * stop metronom clock - */ - void (*stop_clock) (metronom_clock_t *self); - - - /* - * resume clock from where it was stopped - */ - void (*resume_clock) (metronom_clock_t *self); -#else - void *dummy1; - void *dummy2; - void *dummy3; -#endif - - - /* - * get current clock value in vpts - */ - int64_t (*get_current_time) (metronom_clock_t *self); - - - /* - * adjust master clock to external timer (e.g. audio hardware) - */ - void (*adjust_clock) (metronom_clock_t *self, int64_t desired_pts); - -#ifdef METRONOM_CLOCK_INTERNAL - /* - * set clock speed - * for constants see xine_internal.h - */ - - int (*set_fine_speed) (metronom_clock_t *self, int speed); -#else - void *dummy4; -#endif - - /* - * (un)register a System Clock Reference provider at the metronom - */ - int (*register_scr) (metronom_clock_t *self, scr_plugin_t *scr); - void (*unregister_scr) (metronom_clock_t *self, scr_plugin_t *scr); - -#ifdef METRONOM_CLOCK_INTERNAL - void (*exit) (metronom_clock_t *self); - - xine_t *xine; - - scr_plugin_t *scr_master; - scr_plugin_t **scr_list; - pthread_t sync_thread; - int thread_running; - int scr_adjustable; -#else - void *dummy5; - void *dummy6; - void *dummy7; - void *dummy8; - pthread_t dummy9; - int dummy10; - int dummy11; -#endif - - int speed; - -#ifdef METRONOM_CLOCK_INTERNAL - pthread_mutex_t lock; - pthread_cond_t cancel; -#endif -}; - -metronom_clock_t *_x_metronom_clock_init(xine_t *xine) XINE_PROTECTED; - -/* - * clock options - */ - -#define CLOCK_SCR_ADJUSTABLE 1 - -/* - * SCR (system clock reference) plugins - */ - -struct scr_plugin_s -{ - int (*get_priority) (scr_plugin_t *self); - - /* - * set/get clock speed - * - * for speed constants see xine_internal.h - * returns actual speed - */ - - int (*set_fine_speed) (scr_plugin_t *self, int speed); - - void (*adjust) (scr_plugin_t *self, int64_t vpts); - - void (*start) (scr_plugin_t *self, int64_t start_vpts); - - int64_t (*get_current) (scr_plugin_t *self); - - void (*exit) (scr_plugin_t *self); - - metronom_clock_t *clock; - - int interface_version; -}; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/xine-engine/osd.h b/src/xine-engine/osd.h deleted file mode 100644 index 7b04c0a17..000000000 --- a/src/xine-engine/osd.h +++ /dev/null @@ -1,365 +0,0 @@ -/* - * Copyright (C) 2000-2003 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * OSD stuff (text and graphic primitives) - */ - -#ifndef HAVE_OSD_H -#define HAVE_OSD_H - -#ifdef HAVE_ICONV -# include -#endif - -#ifdef XINE_COMPILE -# include "video_overlay.h" -# ifdef __OSD_C__ -# include "alphablend.h" -# endif -#else -# include -#endif - -typedef struct osd_object_s osd_object_t; -typedef struct osd_renderer_s osd_renderer_t; -typedef struct osd_font_s osd_font_t; -typedef struct osd_ft2context_s osd_ft2context_t; - -struct osd_object_s { - osd_object_t *next; - osd_renderer_t *renderer; - - int width, height; /* work area dimentions */ - uint8_t *area; /* work area */ - int display_x,display_y; /* where to display it in screen */ - - /* clipping box inside work area */ - int x1, y1; - int x2, y2; - - uint32_t color[OVL_PALETTE_SIZE]; /* color lookup table */ - uint8_t trans[OVL_PALETTE_SIZE]; /* mixer key table */ - -#ifdef HAVE_ICONV - iconv_t cd; /* iconv handle of encoding */ - char *encoding; /* name of encoding */ -#endif - - osd_font_t *font; - osd_ft2context_t *ft2; - - int32_t handle; -}; - -/* this one is public */ -struct xine_osd_s { - osd_object_t osd; -}; - -struct osd_renderer_s { - - xine_stream_t *stream; - - /* - * open a new osd object. this will allocated an empty (all zero) drawing - * area where graphic primitives may be used. - * It is ok to specify big width and height values. The render will keep - * track of the smallest changed area to not generate too big overlays. - * A default palette is initialized (i sugest keeping color 0 as transparent - * for the sake of simplicity) - */ - osd_object_t* (*new_object) (osd_renderer_t *this, int width, int height); - - /* - * free osd object - */ - void (*free_object) (osd_object_t *osd_to_close); - - - /* - * send the osd to be displayed at given pts (0=now) - * the object is not changed. there may be subsequent drawing on it. - */ - int (*show) (osd_object_t *osd, int64_t vpts ); - - /* - * send event to hide osd at given pts (0=now) - * the object is not changed. there may be subsequent drawing on it. - */ - int (*hide) (osd_object_t *osd, int64_t vpts ); - - /* - * draw point. - */ - void (*point) (osd_object_t *osd, int x, int y, int color); - - /* - * Bresenham line implementation on osd object - */ - void (*line) (osd_object_t *osd, - int x1, int y1, int x2, int y2, int color ); - - /* - * filled rectangle - */ - void (*filled_rect) (osd_object_t *osd, - int x1, int y1, int x2, int y2, int color ); - - /* - * set palette (color and transparency) - */ - void (*set_palette) (osd_object_t *osd, const uint32_t *color, const uint8_t *trans ); - - /* - * set on existing text palette - * (-1 to set used specified palette) - * - * color_base specifies the first color index to use for this text - * palette. The OSD palette is then modified starting at this - * color index, up to the size of the text palette. - * - * Use OSD_TEXT1, OSD_TEXT2, ... for some preasssigned color indices. - */ - void (*set_text_palette) (osd_object_t *osd, int palette_number, - int color_base ); - - /* - * get palette (color and transparency) - */ - void (*get_palette) (osd_object_t *osd, uint32_t *color, - uint8_t *trans); - - /* - * set position were overlay will be blended - */ - void (*set_position) (osd_object_t *osd, int x, int y); - - /* - * set the font of osd object - */ - - int (*set_font) (osd_object_t *osd, const char *fontname, int size); - - /* - * set encoding of text - * - * NULL ... no conversion (iso-8859-1) - * "" ... locale encoding - */ - int (*set_encoding) (osd_object_t *osd, const char *encoding); - - /* - * render text in current encoding on x,y position - * no \n yet - * - * The text is assigned the colors starting at the index specified by - * color_base up to the size of the text palette. - * - * Use OSD_TEXT1, OSD_TEXT2, ... for some preasssigned color indices. - */ - int (*render_text) (osd_object_t *osd, int x1, int y1, - const char *text, int color_base); - - /* - * get width and height of how text will be renderized - */ - int (*get_text_size) (osd_object_t *osd, const char *text, - int *width, int *height); - - /* - * close osd rendering engine - * loaded fonts are unloaded - * osd objects are closed - */ - void (*close) (osd_renderer_t *this); - - /* - * clear an osd object (empty drawing area) - */ - void (*clear) (osd_object_t *osd ); - - /* - * paste a bitmap with optional palette mapping - */ - void (*draw_bitmap) (osd_object_t *osd, uint8_t *bitmap, - int x1, int y1, int width, int height, - uint8_t *palette_map); - - /* - * send the osd to be displayed (unscaled) at given pts (0=now) - * the object is not changed. there may be subsequent drawing on it. - * overlay is blended at output (screen) resolution. - */ - int (*show_unscaled) (osd_object_t *osd, int64_t vpts ); - - /* - * see xine.h for defined XINE_OSD_CAP_ values. - */ - uint32_t (*get_capabilities) (osd_object_t *osd); - - /* private stuff */ - - pthread_mutex_t osd_mutex; - video_overlay_event_t event; - osd_object_t *osds; /* instances of osd */ - osd_font_t *fonts; /* loaded fonts */ - int textpalette; /* default textpalette */ - -}; - -/* - * initialize the osd rendering engine - */ -osd_renderer_t *_x_osd_renderer_init( xine_stream_t *stream ); - - -/* - * The size of a text palette - */ - -#define TEXT_PALETTE_SIZE 11 - -/* - * Preassigned color indices for rendering text - * (more can be added, not exceeding OVL_PALETTE_SIZE) - */ - -#define OSD_TEXT1 (0 * TEXT_PALETTE_SIZE) -#define OSD_TEXT2 (1 * TEXT_PALETTE_SIZE) -#define OSD_TEXT3 (2 * TEXT_PALETTE_SIZE) -#define OSD_TEXT4 (3 * TEXT_PALETTE_SIZE) -#define OSD_TEXT5 (4 * TEXT_PALETTE_SIZE) -#define OSD_TEXT6 (5 * TEXT_PALETTE_SIZE) -#define OSD_TEXT7 (6 * TEXT_PALETTE_SIZE) -#define OSD_TEXT8 (7 * TEXT_PALETTE_SIZE) -#define OSD_TEXT9 (8 * TEXT_PALETTE_SIZE) -#define OSD_TEXT10 (9 * TEXT_PALETTE_SIZE) - -/* - * Defined palettes for rendering osd text - * (more can be added later) - */ - -#define NUMBER_OF_TEXT_PALETTES 4 -#define TEXTPALETTE_WHITE_BLACK_TRANSPARENT 0 -#define TEXTPALETTE_WHITE_NONE_TRANSPARENT 1 -#define TEXTPALETTE_WHITE_NONE_TRANSLUCID 2 -#define TEXTPALETTE_YELLOW_BLACK_TRANSPARENT 3 - -#ifdef __OSD_C__ - -/* This text descriptions are used for config screen */ -static const char *textpalettes_str[NUMBER_OF_TEXT_PALETTES+1] = { - "white-black-transparent", - "white-none-transparent", - "white-none-translucid", - "yellow-black-transparent", - NULL}; - - -/* - Palette entries as used by osd fonts: - - 0: not used by font, always transparent - 1: font background, usually transparent, may be used to implement - translucid boxes where the font will be printed. - 2-5: transition between background and border (usually only alpha - value changes). - 6: font border. if the font is to be displayed without border this - will probably be adjusted to font background or near. - 7-9: transition between border and foreground - 10: font color (foreground) -*/ - -/* - The palettes below were made by hand, ie, i just throw - values that seemed to do the transitions i wanted. - This can surelly be improved a lot. [Miguel] -*/ - -static const clut_t textpalettes_color[NUMBER_OF_TEXT_PALETTES][TEXT_PALETTE_SIZE] = { -/* white, black border, transparent */ - { - CLUT_Y_CR_CB_INIT(0x00, 0x00, 0x00), /*0*/ - CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*1*/ - CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*2*/ - CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*3*/ - CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*4*/ - CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*5*/ - CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*6*/ - CLUT_Y_CR_CB_INIT(0x40, 0x80, 0x80), /*7*/ - CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*8*/ - CLUT_Y_CR_CB_INIT(0xc0, 0x80, 0x80), /*9*/ - CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*10*/ - }, - /* white, no border, transparent */ - { - CLUT_Y_CR_CB_INIT(0x00, 0x00, 0x00), /*0*/ - CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*1*/ - CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*2*/ - CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*3*/ - CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*4*/ - CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*5*/ - CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*6*/ - CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*7*/ - CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*8*/ - CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*9*/ - CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*10*/ - }, - /* white, no border, translucid */ - { - CLUT_Y_CR_CB_INIT(0x00, 0x00, 0x00), /*0*/ - CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*1*/ - CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*2*/ - CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*3*/ - CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*4*/ - CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*5*/ - CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*6*/ - CLUT_Y_CR_CB_INIT(0xa0, 0x80, 0x80), /*7*/ - CLUT_Y_CR_CB_INIT(0xc0, 0x80, 0x80), /*8*/ - CLUT_Y_CR_CB_INIT(0xe0, 0x80, 0x80), /*9*/ - CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*10*/ - }, - /* yellow, black border, transparent */ - { - CLUT_Y_CR_CB_INIT(0x00, 0x00, 0x00), /*0*/ - CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*1*/ - CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*2*/ - CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*3*/ - CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*4*/ - CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*5*/ - CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*6*/ - CLUT_Y_CR_CB_INIT(0x40, 0x84, 0x60), /*7*/ - CLUT_Y_CR_CB_INIT(0x70, 0x88, 0x40), /*8*/ - CLUT_Y_CR_CB_INIT(0xb0, 0x8a, 0x20), /*9*/ - CLUT_Y_CR_CB_INIT(0xff, 0x90, 0x00), /*10*/ - }, -}; - -static const uint8_t textpalettes_trans[NUMBER_OF_TEXT_PALETTES][TEXT_PALETTE_SIZE] = { - {0, 0, 3, 6, 8, 10, 12, 14, 15, 15, 15 }, - {0, 0, 0, 0, 0, 0, 2, 6, 9, 12, 15 }, - {0, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15 }, - {0, 0, 3, 6, 8, 10, 12, 14, 15, 15, 15 }, -}; - -#endif /* __OSD_C__ */ - -#endif - diff --git a/src/xine-engine/plugin_catalog.h b/src/xine-engine/plugin_catalog.h deleted file mode 100644 index fd9afb959..000000000 --- a/src/xine-engine/plugin_catalog.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (C) 2000-2003 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * xine-internal header: Definitions for plugin lists - */ - -#ifndef _PLUGIN_CATALOG_H -#define _PLUGIN_CATALOG_H - -#ifdef XINE_COMPILE -# include "xine_plugin.h" -# include "xineutils.h" -#else -# include -# include -#endif - -#define DECODER_MAX 128 -#define PLUGIN_MAX 256 - -/* the engine takes this many plugins for one stream type */ -#define PLUGINS_PER_TYPE 10 - -typedef struct { - char *filename; - off_t filesize; - time_t filemtime; - void *lib_handle; - int ref; /* count number of classes */ - int no_unload; /* set if the file can't be unloaded */ -} plugin_file_t ; - -typedef struct { - plugin_file_t *file; - plugin_info_t *info; - void *plugin_class; - int ref; /* count intances of plugins */ - int priority; -} plugin_node_t ; - -struct plugin_catalog_s { - xine_sarray_t *plugin_lists[PLUGIN_TYPE_MAX]; - - xine_sarray_t *cache_list; - xine_list_t *file_list; - - plugin_node_t *audio_decoder_map[DECODER_MAX][PLUGINS_PER_TYPE]; - plugin_node_t *video_decoder_map[DECODER_MAX][PLUGINS_PER_TYPE]; - plugin_node_t *spu_decoder_map[DECODER_MAX][PLUGINS_PER_TYPE]; - - const char *ids[PLUGIN_MAX]; - - /* memory block for the decoder priority config entry descriptions */ - char *prio_desc[DECODER_MAX]; - - pthread_mutex_t lock; - - int plugin_count; - int decoder_count; -}; -typedef struct plugin_catalog_s plugin_catalog_t; - -/* - * load plugins into catalog - * - * all input+demux plugins will be fully loaded+initialized - * decoder plugins are loaded on demand - * video/audio output plugins have special load/probe functions - */ -void _x_scan_plugins (xine_t *this) XINE_PROTECTED; - - -/* - * dispose all currently loaded plugins (shutdown) - */ - -void _x_dispose_plugins (xine_t *this) XINE_PROTECTED; - -#endif diff --git a/src/xine-engine/post.h b/src/xine-engine/post.h deleted file mode 100644 index 1995ca82f..000000000 --- a/src/xine-engine/post.h +++ /dev/null @@ -1,405 +0,0 @@ -/* - * Copyright (C) 2000-2004 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * post plugin definitions - */ - -#ifndef XINE_POST_H -#define XINE_POST_H - -#ifdef XINE_COMPILE -# include "xine.h" -# include "video_out.h" -# include "audio_out.h" -# include "xine_internal.h" -# include "xineutils.h" -#else -# include -# include -# include -# include -# include -#endif - -#define POST_PLUGIN_IFACE_VERSION 9 - - -typedef struct post_class_s post_class_t; -typedef struct post_plugin_s post_plugin_t; -typedef struct post_in_s post_in_t; -typedef struct post_out_s post_out_t; - -struct post_class_s { - - /* - * open a new instance of this plugin class - */ - post_plugin_t* (*open_plugin) (post_class_t *this, int inputs, - xine_audio_port_t **audio_target, - xine_video_port_t **video_target); - - /** - * @brief short human readable identifier for this plugin class - */ - const char *identifier; - - /** - * @brief human readable (verbose = 1 line) description for this plugin class - * - * The description is passed to gettext() to internationalise. - */ - const char *description; - - /** - * @brief Optional non-standard catalog to use with dgettext() for description. - */ - const char *textdomain; - - /* - * free all class-related resources - */ - - void (*dispose) (post_class_t *this); -}; - -#define default_post_class_dispose (void (*) (post_class_t *this))free - -struct post_plugin_s { - - /* public part of the plugin */ - xine_post_t xine_post; - - /* - * the connections announced by the plugin - * the plugin must fill these with xine_post_{in,out}_t on init - */ - xine_list_t *input; - xine_list_t *output; - - /* - * close down, free all resources - */ - void (*dispose) (post_plugin_t *this); - - /* plugins don't have to init the stuff below */ - - /* - * the running ticket - * - * the plugin must assure to check for ticket revocation in - * intervals of finite length; this means that you must release - * the ticket before any operation that might block; - * note that all port functions are safe in this respect - * - * the running ticket is assigned to you by the engine - */ - xine_ticket_t *running_ticket; - - /* this is needed by the engine to decrement the reference counter - * on disposal of the plugin, but since this is useful, we expose it */ - xine_t *xine; - - /* used when the user requests a list of all inputs/outputs */ - const char **input_ids; - const char **output_ids; - - /* used by plugin loader */ - void *node; - - /* has dispose been called */ - int dispose_pending; -}; - -/* helper function to initialize a post_plugin_t */ -void _x_post_init(post_plugin_t *post, int num_audio_inputs, int num_video_inputs) XINE_PROTECTED; - -struct post_in_s { - - /* public part of the input */ - xine_post_in_t xine_in; - - /* backward reference so that you have access to the post plugin */ - post_plugin_t *post; - - /* you can fill this to your liking */ - void *user_data; -}; - -struct post_out_s { - - /* public part of the output */ - xine_post_out_t xine_out; - - /* backward reference so that you have access to the post plugin */ - post_plugin_t *post; - - /* you can fill this to your liking */ - void *user_data; -}; - - -/* Post plugins work by intercepting calls to video or audio ports - * in the sense of the decorator design pattern. They reuse the - * functions of a given target port, but add own functionality in - * front of that port by creating a new port structure and filling in - * the function pointers with pointers to own functions that - * would do something and then call the original port function. - * - * Much the same is done with video frames which have their own - * set of functions attached that you might need to decorate. - */ - - -/* helper structure for intercepting video port calls */ -typedef struct post_video_port_s post_video_port_t; -struct post_video_port_s { - - /* the new public port with replaced function pointers */ - xine_video_port_t new_port; - - /* the original port to call its functions from inside yours */ - xine_video_port_t *original_port; - - /* if you want to decide yourself, whether a given frame should - * be intercepted, fill in this function; get_frame() acts as - * a template method and asks your function; return a boolean; - * the default is to intercept all frames */ - int (*intercept_frame)(post_video_port_t *self, vo_frame_t *frame); - - /* the new frame function pointers */ - vo_frame_t *new_frame; - - /* if you want to decide yourself, whether the preprocessing functions - * should still be routed when draw is intercepted, fill in this - * function; _x_post_intercept_video_frame() acts as a template method - * and asks your function; return a boolean; the default is _not_ to - * route preprocessing functions when draw is intercepted */ - int (*route_preprocessing_procs)(post_video_port_t *self, vo_frame_t *frame); - - /* if you want to decide yourself, whether the overlay manager should - * be intercepted, fill in this function; get_overlay_manager() acts as - * a template method and asks your function; return a boolean; - * the default is _not_ to intercept the overlay manager */ - int (*intercept_ovl)(post_video_port_t *self); - - /* the new public overlay manager with replaced function pointers */ - video_overlay_manager_t *new_manager; - - /* the original manager to call its functions from inside yours */ - video_overlay_manager_t *original_manager; - - /* usage counter: how many objects are floating around that need - * these pointers to exist */ - int usage_count; - pthread_mutex_t usage_lock; - - /* the stream we are being fed by; NULL means no stream is connected; - * this may be an anonymous stream */ - xine_stream_t *stream; - - /* point to a mutex here, if you need some synchronization */ - pthread_mutex_t *port_lock; - pthread_mutex_t *frame_lock; - pthread_mutex_t *manager_lock; - - /* backward reference so that you have access to the post plugin - * when the call only gives you the port */ - post_plugin_t *post; - - /* you can fill this to your liking */ - void *user_data; - -#ifdef POST_INTERNAL - /* some of the above members are to be directly included here, but - * adding the structures would mean that post_video_port_t becomes - * depended of the sizes of these structs; solution: we add pointers - * above and have them point into the memory provided here; - * note that the overlay manager needs to be first so that we can - * reconstruct the post_video_port_t* from overlay manager calls */ - - /* any change here requires a change in _x_post_ovl_manager_to_port() - * below! */ - - video_overlay_manager_t manager_storage; - vo_frame_t frame_storage; - - /* this is used to keep a linked list of free vo_frame_t's */ - vo_frame_t *free_frame_slots; - pthread_mutex_t free_frames_lock; -#endif -}; - -/* use this to create a new decorated video port in which - * port functions will be replaced with own implementations; - * for convenience, this can also create a related post_in_t and post_out_t */ -post_video_port_t *_x_post_intercept_video_port(post_plugin_t *post, xine_video_port_t *port, - post_in_t **input, post_out_t **output) XINE_PROTECTED; - -/* use this to decorate and to undecorate a frame so that its functions - * can be replaced with own implementations, decoration is usually done in - * get_frame(), undecoration in frame->free() */ -vo_frame_t *_x_post_intercept_video_frame(vo_frame_t *frame, post_video_port_t *port) XINE_PROTECTED; -vo_frame_t *_x_post_restore_video_frame(vo_frame_t *frame, post_video_port_t *port) XINE_PROTECTED; - -/* when you want to pass a frame call on to the original issuer of the frame, - * you need to propagate potential changes up and down the pipe, so the usual - * procedure for this situation would be: - * - * _x_post_frame_copy_down(frame, frame->next); - * frame->next->function(frame->next); - * _x_post_frame_copy_up(frame, frame->next); - */ -void _x_post_frame_copy_down(vo_frame_t *from, vo_frame_t *to) XINE_PROTECTED; -void _x_post_frame_copy_up(vo_frame_t *to, vo_frame_t *from) XINE_PROTECTED; - -/* when you shortcut a frames usual draw() travel so that it will never reach - * the draw() function of the original issuer, you still have to do some - * housekeeping on the frame, before returning control up the pipe */ -void _x_post_frame_u_turn(vo_frame_t *frame, xine_stream_t *stream) XINE_PROTECTED; - -/* use this to create a new, trivially decorated overlay manager in which - * port functions can be replaced with own implementations */ -void _x_post_intercept_overlay_manager(video_overlay_manager_t *manager, post_video_port_t *port) XINE_PROTECTED; - -/* pointer retrieval functions */ -static inline post_video_port_t *_x_post_video_frame_to_port(vo_frame_t *frame) { - return (post_video_port_t *)frame->port; -} - -static inline post_video_port_t *_x_post_ovl_manager_to_port(video_overlay_manager_t *manager) { -#ifdef POST_INTERNAL - return (post_video_port_t *)( (uint8_t *)manager - - (unsigned)&(((post_video_port_t *)NULL)->manager_storage) ); -#else - return (post_video_port_t *)( (uint8_t *)manager - sizeof(post_video_port_t) ); -#endif -} - - -/* helper structure for intercepting audio port calls */ -typedef struct post_audio_port_s post_audio_port_t; -struct post_audio_port_s { - - /* the new public port with replaced function pointers */ - xine_audio_port_t new_port; - - /* the original port to call its functions from inside yours */ - xine_audio_port_t *original_port; - - /* the stream we are being fed by; NULL means no stream is connected; - * this may be an anonymous stream */ - xine_stream_t *stream; - - pthread_mutex_t usage_lock; - /* usage counter: how many objects are floating around that need - * these pointers to exist */ - int usage_count; - - /* some values remembered by (port->open) () */ - uint32_t bits; - uint32_t rate; - uint32_t mode; - - /* point to a mutex here, if you need some synchronization */ - pthread_mutex_t *port_lock; - - /* backward reference so that you have access to the post plugin - * when the call only gives you the port */ - post_plugin_t *post; - - /* you can fill this to your liking */ - void *user_data; -}; - -/* use this to create a new decorated audio port in which - * port functions will be replaced with own implementations */ -post_audio_port_t *_x_post_intercept_audio_port(post_plugin_t *post, xine_audio_port_t *port, - post_in_t **input, post_out_t **output) XINE_PROTECTED; - - -/* this will allow pending rewire operations, calling this at the beginning - * of decoder-called functions like get_buffer() and open() is a good idea - * (if you do not intercept get_buffer() or open(), this will be done automatically) */ -static inline void _x_post_rewire(post_plugin_t *post) { - if (post->running_ticket->ticket_revoked) - post->running_ticket->renew(post->running_ticket, 1); -} - -/* with these functions you can switch interruptions like rewiring or engine pausing - * off for a block of code; use this only when really necessary */ -static inline void _x_post_lock(post_plugin_t *post) { - post->running_ticket->acquire(post->running_ticket, 1); -} -static inline void _x_post_unlock(post_plugin_t *post) { - post->running_ticket->release(post->running_ticket, 1); - _x_post_rewire(post); -} - -/* the standard disposal operation; returns 1 if the plugin is really - * disposed and you should free everything you malloc()ed yourself */ -int _x_post_dispose(post_plugin_t *post) XINE_PROTECTED; - - -/* macros to handle usage counter */ - -/* WARNING! - * note that _x_post_dec_usage() can call dispose, so be sure to - * not use any potentially already freed memory after this */ - -#define _x_post_inc_usage(port) \ -do { \ - pthread_mutex_lock(&(port)->usage_lock); \ - (port)->usage_count++; \ - pthread_mutex_unlock(&(port)->usage_lock); \ -} while(0) - -#define _x_post_dec_usage(port) \ -do { \ - pthread_mutex_lock(&(port)->usage_lock); \ - (port)->usage_count--; \ - if ((port)->usage_count == 0) { \ - if ((port)->post->dispose_pending) { \ - pthread_mutex_unlock(&(port)->usage_lock); \ - (port)->post->dispose((port)->post); \ - } else \ - pthread_mutex_unlock(&(port)->usage_lock); \ - } else \ - pthread_mutex_unlock(&(port)->usage_lock); \ -} while(0) - - -/* macros to create parameter descriptors */ - -#define START_PARAM_DESCR( param_t ) \ -static param_t temp_s; \ -static xine_post_api_parameter_t temp_p[] = { - -#define PARAM_ITEM( param_type, var, enumv, min, max, readonly, descr ) \ -{ param_type, #var, sizeof(temp_s.var), \ - (char*)&temp_s.var-(char*)&temp_s, enumv, min, max, readonly, descr }, - -#define END_PARAM_DESCR( name ) \ - { POST_PARAM_TYPE_LAST, NULL, 0, 0, NULL, 0, 0, 1, NULL } \ -}; \ -static xine_post_api_descr_t name = { \ - sizeof( temp_s ), \ - temp_p \ -}; - -#endif diff --git a/src/xine-engine/refcounter.h b/src/xine-engine/refcounter.h deleted file mode 100644 index a662a974e..000000000 --- a/src/xine-engine/refcounter.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2000-2004 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - */ -#ifndef HAVE_REFCOUNTER_H -#define HAVE_REFCOUNTER_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -typedef struct { - pthread_mutex_t lock; - void* object; /* referenced object */ - void (*destructor)(void *); /* object destructor */ - int count; -} refcounter_t; - -typedef void (*refcounter_destructor)(void*); - -refcounter_t* _x_new_refcounter(void *object, refcounter_destructor destructor) XINE_PROTECTED; - -int _x_refcounter_inc(refcounter_t *refcounter) XINE_PROTECTED; - -int _x_refcounter_dec(refcounter_t *refcounter) XINE_PROTECTED; - -void _x_refcounter_dispose(refcounter_t *refcounter) XINE_PROTECTED; - -#endif /* HAVE_REFCOUNTER_H */ diff --git a/src/xine-engine/resample.h b/src/xine-engine/resample.h deleted file mode 100644 index 40b4de486..000000000 --- a/src/xine-engine/resample.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2000-2003 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * utilitiy functions for audio drivers - * - * FIXME: not all of them are implemented yet - */ - -#ifndef HAVE_RESAMPLE_H -#define HAVE_RESAMPLE_H - -#define RESAMPLE_MAX_CHANNELS 6 - -void _x_audio_out_resample_stereo(int16_t* last_sample, - int16_t* input_samples, uint32_t in_samples, - int16_t* output_samples, uint32_t out_samples) XINE_PROTECTED; - -void _x_audio_out_resample_mono(int16_t* last_sample, - int16_t* input_samples, uint32_t in_samples, - int16_t* output_samples, uint32_t out_samples) XINE_PROTECTED; - -void _x_audio_out_resample_4channel(int16_t* last_sample, - int16_t* input_samples, uint32_t in_samples, - int16_t* output_samples, uint32_t out_samples) XINE_PROTECTED; - -void _x_audio_out_resample_5channel(int16_t* last_sample, - int16_t* input_samples, uint32_t in_samples, - int16_t* output_samples, uint32_t out_samples) XINE_PROTECTED; - -void _x_audio_out_resample_6channel(int16_t* last_sample, - int16_t* input_samples, uint32_t in_samples, - int16_t* output_samples, uint32_t out_samples) XINE_PROTECTED; - -void _x_audio_out_resample_8to16(int8_t* input_samples, - int16_t* output_samples, uint32_t samples) XINE_PROTECTED; - -void _x_audio_out_resample_16to8(int16_t* input_samples, - int8_t* output_samples, uint32_t samples) XINE_PROTECTED; - -void _x_audio_out_resample_monotostereo(int16_t* input_samples, - int16_t* output_samples, uint32_t frames) XINE_PROTECTED; - -void _x_audio_out_resample_stereotomono(int16_t* input_samples, - int16_t* output_samples, uint32_t frames) XINE_PROTECTED; - -#endif diff --git a/src/xine-engine/scratch.h b/src/xine-engine/scratch.h deleted file mode 100644 index c0e591d31..000000000 --- a/src/xine-engine/scratch.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2000-2006 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * scratch buffer for log output - */ - -#ifndef HAVE_SCRATCH_H -#define HAVE_SCRATCH_H - -#include -#include - -typedef struct scratch_buffer_s scratch_buffer_t; - -#define SCRATCH_LINE_LEN_MAX 1024 - -struct scratch_buffer_s { - - void -#if __GNUC__ >= 3 - __attribute__((__format__(__printf__, 2, 0))) -#endif - (*scratch_printf) (scratch_buffer_t *this, const char *format, va_list ap); - - char **(*get_content) (scratch_buffer_t *this); - - void (*dispose) (scratch_buffer_t *this); - - char **lines; - char **ordered; - - int num_lines; - int cur; - - pthread_mutex_t lock; -}; - -scratch_buffer_t *_x_new_scratch_buffer (int num_lines) XINE_PROTECTED; - -#endif diff --git a/src/xine-engine/spu.h b/src/xine-engine/spu.h deleted file mode 100644 index daba7866b..000000000 --- a/src/xine-engine/spu.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2007 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - */ - -#ifndef XINE_UTILS_SPU_H -#define XINE_UTILS_SPU_H - -#ifndef XINE_PROTECTED -#define XINE_PROTECTED -#endif - -typedef struct xine_spu_opacity_s xine_spu_opacity_t; - -struct xine_spu_opacity_s { - uint8_t black, colour; -}; - -void _x_spu_misc_init (xine_t *); - -void _x_spu_get_opacity (xine_t *, xine_spu_opacity_t *) XINE_PROTECTED; - -/* in: trans = 0..255, 0=opaque - * out: 0..255, 0=transparent - */ -int _x_spu_calculate_opacity (const clut_t *, uint8_t trans, const xine_spu_opacity_t *) XINE_PROTECTED; - -#endif diff --git a/src/xine-engine/spu_decoder.h b/src/xine-engine/spu_decoder.h deleted file mode 100644 index dcf9107f7..000000000 --- a/src/xine-engine/spu_decoder.h +++ /dev/null @@ -1,151 +0,0 @@ -/* - * spu_decoder_api.h - * - * Copyright (C) James Courtier-Dutton James@superbug.demon.co.uk - July 2001 - * - * This file is part of xine, a unix video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, - * - */ - -#ifndef HAVE_SPU_API_H -#define HAVE_SPU_API_H - -#ifdef XINE_COMPILE -# include -# include "buffer.h" -#else -# include -# include -#endif - -#define SPU_DECODER_IFACE_VERSION 17 - -/* - * generic xine spu decoder plugin interface - */ - -typedef struct spu_decoder_class_s spu_decoder_class_t; -typedef struct spu_decoder_s spu_decoder_t; - -struct spu_decoder_class_s { - - /* - * open a new instance of this plugin class - */ - spu_decoder_t* (*open_plugin) (spu_decoder_class_t *this, xine_stream_t *stream); - - /** - * @brief short human readable identifier for this plugin class - */ - const char *identifier; - - /** - * @brief human readable (verbose = 1 line) description for this plugin class - * - * The description is passed to gettext() to internationalise. - */ - const char *description; - - /** - * @brief Optional non-standard catalog to use with dgettext() for description. - */ - const char *textdomain; - - /* - * free all class-related resources - */ - void (*dispose) (spu_decoder_class_t *this); -}; - -#define default_spu_decoder_class_dispose (void (*) (spu_decoder_class_t *this))free - -struct spu_decoder_s { - - /* - * decode data from buf and feed the overlay to overlay manager - */ - void (*decode_data) (spu_decoder_t *this, buf_element_t *buf); - - /* - * reset decoder after engine flush (prepare for new - * SPU data not related to recently decoded data) - */ - void (*reset) (spu_decoder_t *this); - - /* - * inform decoder that a time reference discontinuity has happened. - * that is, it must forget any currently held pts value - */ - void (*discontinuity) (spu_decoder_t *this); - - /* - * close down, free all resources - */ - void (*dispose) (spu_decoder_t *this); - - /* - * When the SPU decoder also handles data used in user interaction, - * you can query the related information here. The typical example - * for this is DVD NAV packets which are handled by the SPU decoder - * and can be received readily parsed from here. - * The caller and the decoder must agree on the structure which is - * passed here. - * This function pointer may be NULL, if the plugin does not have - * such functionality. - */ - int (*get_interact_info) (spu_decoder_t *this, void *data); - - /* - * When the SPU decoder also handles menu overlays for user inter- - * action, you can set a menu button here. The typical example for - * this is DVD menus. - * This function pointer may be NULL, if the plugin does not have - * such functionality. - */ - void (*set_button) (spu_decoder_t *this_gen, int32_t button, int32_t mode); - - void *node; /* used by plugin loader */ -}; - - -/* SPU decoders differ from video and audio decoders in one significant - * way: unlike audio and video, SPU streams are not continuous; - * this results in another difference, programmers have to consider: - * while both audio and video decoders are automatically blocked in - * their get_buffer()/get_frame() methods when the output cannot take - * any more data, this does not work for SPU, because it could take - * minutes before the next free slot becomes available and we must not - * block the decoder thread for that long; - * therefore, we provide a convenience function for SPU decoders which - * implements a wait until a timestamp sufficiently close to the VPTS - * of the next SPU is reached, but the waiting will end before that, - * if some outside condition requires us to release the decoder thread - * to other tasks; - * if this functions returns with 1, noone needs the decoder thread and - * you may continue waiting; if it returns 0, finish whatever you are - * doing and return; - * the usual pattern for SPU decoders is this: - * - * do { - * spu = prepare_spu(); - * int thread_vacant = _x_spu_decoder_sleep(this->stream, spu->vpts); - * int success = process_spu(spu); - * } while (!success && thread_vacant); - */ -int _x_spu_decoder_sleep(xine_stream_t *, int64_t next_spu_vpts) XINE_PROTECTED; - -#endif /* HAVE_SPUDEC_H */ diff --git a/src/xine-engine/video_decoder.h b/src/xine-engine/video_decoder.h deleted file mode 100644 index 705efa3da..000000000 --- a/src/xine-engine/video_decoder.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (C) 2000-2004 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * xine video decoder plugin interface - */ - -#ifndef HAVE_VIDEO_DECODER_H -#define HAVE_VIDEO_DECODER_H - -#ifdef XINE_COMPILE -# include -# include "buffer.h" -#else -# include -# include -#endif - -#define VIDEO_DECODER_IFACE_VERSION 19 - - -/* - * generic xine video decoder plugin interface - */ - -typedef struct video_decoder_class_s video_decoder_class_t; -typedef struct video_decoder_s video_decoder_t; - -struct video_decoder_class_s { - - /* - * open a new instance of this plugin class - */ - video_decoder_t* (*open_plugin) (video_decoder_class_t *this, xine_stream_t *stream); - - /** - * @brief short human readable identifier for this plugin class - */ - const char *identifier; - - /** - * @brief human readable (verbose = 1 line) description for this plugin class - * - * The description is passed to gettext() to internationalise. - */ - const char *description; - - /** - * @brief Optional non-standard catalog to use with dgettext() for description. - */ - const char *textdomain; - - /* - * free all class-related resources - */ - void (*dispose) (video_decoder_class_t *this); -}; - -#define default_video_decoder_class_dispose (void (*) (video_decoder_class_t *this))free - -struct video_decoder_s { - - /* - * decode data from buf and feed decoded frames to - * video output - */ - void (*decode_data) (video_decoder_t *this, buf_element_t *buf); - - /* - * reset decoder after engine flush (prepare for new - * video data not related to recently decoded data) - */ - void (*reset) (video_decoder_t *this); - - /* - * inform decoder that a time reference discontinuity has happened. - * that is, it must forget any currently held pts value - */ - void (*discontinuity) (video_decoder_t *this); - - /* - * flush out any frames that are still stored in the decoder - */ - void (*flush) (video_decoder_t *this); - - /* - * close down, free all resources - */ - void (*dispose) (video_decoder_t *this); - - - void *node; /*used by plugin loader */ - -}; - -#endif diff --git a/src/xine-engine/video_out.h b/src/xine-engine/video_out.h deleted file mode 100644 index 8efdae9f6..000000000 --- a/src/xine-engine/video_out.h +++ /dev/null @@ -1,466 +0,0 @@ -/* - * Copyright (C) 2000-2004 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * - * xine version of video_out.h - * - * vo_frame : frame containing yuv data and timing info, - * transferred between video_decoder and video_output - * - * vo_driver : lowlevel, platform-specific video output code - * - * vo_port : generic frame_handling code, uses - * a vo_driver for output - */ - -#ifndef HAVE_VIDEO_OUT_H -#define HAVE_VIDEO_OUT_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#ifdef XINE_COMPILE -# include "xine.h" -# include "buffer.h" -#else -# include -# include -#endif - - -typedef struct vo_frame_s vo_frame_t; -typedef struct vo_driver_s vo_driver_t; -typedef struct video_driver_class_s video_driver_class_t; -typedef struct vo_overlay_s vo_overlay_t; -typedef struct video_overlay_manager_s video_overlay_manager_t; - -/* public part, video drivers may add private fields - * - * Remember that adding new functions to this structure requires - * adaption of the post plugin decoration layer. Be sure to look into - * src/xine-engine/post.[ch]. - */ -struct vo_frame_s { - /* - * member functions - */ - - /* Duplicate picture data and acceleration specific data of a frame. */ - /* if the image format isn't already known by Xine. Currently this is needed */ - /* For all image formats except XINE_IMGFMT_YV12 and XINE_IMGFMT_YUY2 */ - void (*proc_duplicate_frame_data) (vo_frame_t *vo_img, vo_frame_t *src); - - /* tell video driver to copy/convert the whole of this frame, may be NULL */ - /* at least one of proc_frame() and proc_slice() MUST set the variable proc_called to 1 */ - void (*proc_frame) (vo_frame_t *vo_img); - - /* tell video driver to copy/convert a slice of this frame, may be NULL */ - /* at least one of proc_frame() and proc_slice() MUST set the variable proc_called to 1 */ - void (*proc_slice) (vo_frame_t *vo_img, uint8_t **src); - - /* tell video driver that the decoder starts a new field */ - void (*field) (vo_frame_t *vo_img, int which_field); - - /* append this frame to the display queue, - returns number of frames to skip if decoder is late */ - /* when the frame does not originate from a stream, it is legal to pass an anonymous stream */ - int (*draw) (vo_frame_t *vo_img, xine_stream_t *stream); - - /* lock frame as reference, must be paired with free. - * most decoders/drivers do not need to call this function since - * newly allocated frames are already locked once. - */ - void (*lock) (vo_frame_t *vo_img); - - /* this frame is no longer used by the decoder, video driver, etc */ - void (*free) (vo_frame_t *vo_img); - - /* free memory/resources for this frame */ - void (*dispose) (vo_frame_t *vo_img); - - /* - * public variables to decoders and vo drivers - * changing anything here will require recompiling them both - */ - int64_t pts; /* presentation time stamp (1/90000 sec) */ - int64_t vpts; /* virtual pts, generated by metronom */ - int bad_frame; /* e.g. frame skipped or based on skipped frame */ - int duration; /* frame length in time, in 1/90000 sec */ - - /* yv12 (planar) base[0]: y, base[1]: u, base[2]: v */ - /* yuy2 (interleaved) base[0]: yuyv..., base[1]: --, base[2]: -- */ - uint8_t *base[3]; - int pitches[3]; - - /* info that can be used for interlaced output (e.g. tv-out) */ - int top_field_first; - int repeat_first_field; - /* note: progressive_frame is set wrong on many mpeg2 streams. for - * that reason, this flag should be interpreted as a "hint". - */ - int progressive_frame; - int picture_coding_type; - - /* cropping to be done */ - int crop_left, crop_right, crop_top, crop_bottom; - - int lock_counter; - pthread_mutex_t mutex; /* protect access to lock_count */ - - /* extra info coming from input or demuxers */ - extra_info_t *extra_info; - - /* additional information to be able to duplicate frames: */ - int width, height; - double ratio; /* aspect ratio */ - int format; /* IMGFMT_YV12 or IMGFMT_YUY2 */ - - int drawn; /* used by decoder, frame has already been drawn */ - int flags; /* remember the frame flags */ - int proc_called; /* track use of proc_*() methods */ - - /* Used to carry private data for accelerated plugins.*/ - void *accel_data; - - /* "backward" references to where this frame originates from */ - xine_video_port_t *port; - vo_driver_t *driver; - xine_stream_t *stream; - - /* displacement for overlays */ - int overlay_offset_x, overlay_offset_y; - - /* - * that part is used only by video_out.c for frame management - * obs: changing anything here will require recompiling vo drivers - */ - struct vo_frame_s *next; - - int id; /* debugging - track this frame */ - int is_first; -}; - - -/* - * Remember that adding new functions to this structure requires - * adaption of the post plugin decoration layer. Be sure to look into - * src/xine-engine/post.[ch]. - */ -struct xine_video_port_s { - - uint32_t (*get_capabilities) (xine_video_port_t *self); /* for constants see below */ - - /* open display driver for video output */ - /* when you are not a full-blown stream, but still need to open the port - * (e.g. you are a post plugin) it is legal to pass an anonymous stream */ - void (*open) (xine_video_port_t *self, xine_stream_t *stream); - - /* - * get_frame - allocate an image buffer from display driver - * - * params : width == width of video to display. - * height == height of video to display. - * ratio == aspect ration information - * format == FOURCC descriptor of image format - * flags == field/prediction flags - */ - vo_frame_t* (*get_frame) (xine_video_port_t *self, uint32_t width, - uint32_t height, double ratio, - int format, int flags); - - /* retrieves the last displayed frame (useful for taking snapshots) */ - vo_frame_t* (*get_last_frame) (xine_video_port_t *self); - - /* overlay stuff */ - void (*enable_ovl) (xine_video_port_t *self, int ovl_enable); - - /* get overlay manager */ - video_overlay_manager_t* (*get_overlay_manager) (xine_video_port_t *self); - - /* flush video_out fifo */ - void (*flush) (xine_video_port_t *self); - - /* trigger immediate drawing */ - void (*trigger_drawing) (xine_video_port_t *self); - - /* Get/Set video property - * - * See VO_PROP_* bellow - */ - int (*get_property) (xine_video_port_t *self, int property); - int (*set_property) (xine_video_port_t *self, int property, int value); - - /* return true if port is opened for this stream, stream can be anonymous */ - int (*status) (xine_video_port_t *self, xine_stream_t *stream, - int *width, int *height, int64_t *img_duration); - - /* video driver is no longer used by decoder => close */ - /* when you are not a full-blown stream, but still need to close the port - * (e.g. you are a post plugin) it is legal to pass an anonymous stream */ - void (*close) (xine_video_port_t *self, xine_stream_t *stream); - - /* called on xine exit */ - void (*exit) (xine_video_port_t *self); - - /* the driver in use */ - vo_driver_t *driver; - -}; - -/* constants for the get/set property functions */ -#define VO_PROP_INTERLACED 0 -#define VO_PROP_ASPECT_RATIO 1 -#define VO_PROP_HUE 2 -#define VO_PROP_SATURATION 3 -#define VO_PROP_CONTRAST 4 -#define VO_PROP_BRIGHTNESS 5 -#define VO_PROP_COLORKEY 6 -#define VO_PROP_AUTOPAINT_COLORKEY 7 -#define VO_PROP_ZOOM_X 8 -#define VO_PROP_PAN_SCAN 9 -#define VO_PROP_TVMODE 10 -#define VO_PROP_MAX_NUM_FRAMES 11 -#define VO_PROP_ZOOM_Y 13 -#define VO_PROP_DISCARD_FRAMES 14 /* not used by drivers */ -#define VO_PROP_WINDOW_WIDTH 15 /* read-only */ -#define VO_PROP_WINDOW_HEIGHT 16 /* read-only */ -#define VO_PROP_BUFS_IN_FIFO 17 /* read-only */ -#define VO_PROP_NUM_STREAMS 18 /* read-only */ -#define VO_NUM_PROPERTIES 19 - -/* number of colors in the overlay palette. Currently limited to 256 - at most, because some alphablend functions use an 8-bit index into - the palette. This should probably be classified as a bug. */ -#define OVL_PALETTE_SIZE 256 - -#define OVL_MAX_OPACITY 0x0f - -/* number of recent frames to keep in memory - these frames are needed by some deinterlace algorithms - FIXME: we need a method to flush the recent frames (new stream) -*/ -#define VO_NUM_RECENT_FRAMES 2 - -/* get_frame flags */ -#define VO_TOP_FIELD 1 -#define VO_BOTTOM_FIELD 2 -#define VO_BOTH_FIELDS (VO_TOP_FIELD | VO_BOTTOM_FIELD) -#define VO_PAN_SCAN_FLAG 4 -#define VO_INTERLACED_FLAG 8 -#define VO_NEW_SEQUENCE_FLAG 16 /* set after MPEG2 Sequence Header Code (used by XvMC) */ - -/* video driver capabilities */ -#define VO_CAP_YV12 0x00000001 /* driver can handle YUV 4:2:0 pictures */ -#define VO_CAP_YUY2 0x00000002 /* driver can handle YUY2 pictures */ -#define VO_CAP_XVMC_MOCOMP 0x00000004 /* driver can use XvMC motion compensation */ -#define VO_CAP_XVMC_IDCT 0x00000008 /* driver can use XvMC idct acceleration */ -#define VO_CAP_UNSCALED_OVERLAY 0x00000010 /* driver can blend overlay at output resolution */ -#define VO_CAP_CROP 0x00000020 /* driver can crop */ -#define VO_CAP_XXMC 0x00000040 /* driver can use extended XvMC */ - - -/* - * vo_driver_s contains the functions every display driver - * has to implement. The vo_new_port function (see below) - * should then be used to construct a vo_port using this - * driver. Some of the function pointers will be copied - * directly into xine_video_port_s, others will be called - * from generic vo functions. - */ - -#define VIDEO_OUT_DRIVER_IFACE_VERSION 22 - -struct vo_driver_s { - - uint32_t (*get_capabilities) (vo_driver_t *self); /* for constants see above */ - - /* - * allocate an vo_frame_t struct, - * the driver must supply the copy, field and dispose functions - */ - vo_frame_t* (*alloc_frame) (vo_driver_t *self); - - /* - * check if the given image fullfills the format specified - * (re-)allocate memory if necessary - */ - void (*update_frame_format) (vo_driver_t *self, vo_frame_t *img, - uint32_t width, uint32_t height, - double ratio, int format, int flags); - - /* display a given frame */ - void (*display_frame) (vo_driver_t *self, vo_frame_t *vo_img); - - /* overlay_begin and overlay_end are used by drivers suporting - * persistent overlays. they can be optimized to update only when - * overlay image has changed. - * - * sequence of operation (pseudo-code): - * overlay_begin(this,img,true_if_something_changed_since_last_blend ); - * while(visible_overlays) - * overlay_blend(this,img,overlay[i]); - * overlay_end(this,img); - * - * any function pointer from this group may be set to NULL. - */ - void (*overlay_begin) (vo_driver_t *self, vo_frame_t *vo_img, int changed); - void (*overlay_blend) (vo_driver_t *self, vo_frame_t *vo_img, vo_overlay_t *overlay); - void (*overlay_end) (vo_driver_t *self, vo_frame_t *vo_img); - - /* - * these can be used by the gui directly: - */ - int (*get_property) (vo_driver_t *self, int property); - int (*set_property) (vo_driver_t *self, - int property, int value); - void (*get_property_min_max) (vo_driver_t *self, - int property, int *min, int *max); - - /* - * general purpose communication channel between gui and driver - * - * this should be used to propagate events, display data, window sizes - * etc. to the driver - */ - int (*gui_data_exchange) (vo_driver_t *self, int data_type, - void *data); - - /* check if a redraw is needed (due to resize) - * this is only used for still frames, normal video playback - * must call that inside display_frame() function. - */ - int (*redraw_needed) (vo_driver_t *self); - - /* - * free all resources, close driver - */ - void (*dispose) (vo_driver_t *self); - - void *node; /* needed by plugin_loader */ -}; - -struct video_driver_class_s { - - /* - * open a new instance of this plugin class - */ - vo_driver_t* (*open_plugin) (video_driver_class_t *self, const void *visual); - - /** - * @brief short human readable identifier for this plugin class - */ - const char *identifier; - - /** - * @brief human readable (verbose = 1 line) description for this plugin class - * - * The description is passed to gettext() to internationalise. - */ - const char *description; - - /** - * @brief Optional non-standard catalog to use with dgettext() for description. - */ - const char *textdomain; - - /* - * free all class-related resources - */ - void (*dispose) (video_driver_class_t *self); -}; - -#define default_video_driver_class_dispose (void (*) (video_driver_class_t *this))free - -typedef struct rle_elem_s { - uint16_t len; - uint16_t color; -} rle_elem_t; - -struct vo_overlay_s { - - rle_elem_t *rle; /* rle code buffer */ - int data_size; /* useful for deciding realloc */ - int num_rle; /* number of active rle codes */ - int x; /* x start of subpicture area */ - int y; /* y start of subpicture area */ - int width; /* width of subpicture area */ - int height; /* height of subpicture area */ - - uint32_t color[OVL_PALETTE_SIZE]; /* color lookup table */ - uint8_t trans[OVL_PALETTE_SIZE]; /* mixer key table */ - int rgb_clut; /* true if clut was converted to rgb */ - - /* define a highlight area with different colors */ - int hili_top; - int hili_bottom; - int hili_left; - int hili_right; - uint32_t hili_color[OVL_PALETTE_SIZE]; - uint8_t hili_trans[OVL_PALETTE_SIZE]; - int hili_rgb_clut; /* true if clut was converted to rgb */ - - int unscaled; /* true if it should be blended unscaled */ -}; - - -/* API to video_overlay manager - * - * Remember that adding new functions to this structure requires - * adaption of the post plugin decoration layer. Be sure to look into - * src/xine-engine/post.[ch]. - */ -struct video_overlay_manager_s { - void (*init) (video_overlay_manager_t *this_gen); - - void (*dispose) (video_overlay_manager_t *this_gen); - - int32_t (*get_handle) (video_overlay_manager_t *this_gen, int object_type ); - - void (*free_handle) (video_overlay_manager_t *this_gen, int32_t handle); - - int32_t (*add_event) (video_overlay_manager_t *this_gen, void *event); - - void (*flush_events) (video_overlay_manager_t *this_gen ); - - int (*redraw_needed) (video_overlay_manager_t *this_gen, int64_t vpts ); - - void (*multiple_overlay_blend) (video_overlay_manager_t *this_gen, int64_t vpts, - vo_driver_t *output, vo_frame_t *vo_img, int enabled); -}; - -/** - * @brief Build a video output port from a given video driver. - * - * @internal - */ -xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, int grabonly); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/src/xine-engine/video_overlay.h b/src/xine-engine/video_overlay.h deleted file mode 100644 index 6bb529204..000000000 --- a/src/xine-engine/video_overlay.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2000-2003 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - */ - -#ifndef HAVE_VIDEO_OVERLAY_H -#define HAVE_VIDEO_OVERLAY_H - -#ifdef XINE_COMPILE -# include "xine_internal.h" -#else -# include -#endif - -#ifdef __GNUC__ -#define CLUT_Y_CR_CB_INIT(_y,_cr,_cb) {y: (_y), cr: (_cr), cb: (_cb)} -#else -#define CLUT_Y_CR_CB_INIT(_y,_cr,_cb) { (_cb), (_cr), (_y) } -#endif - -#define MAX_OBJECTS 50 -#define MAX_EVENTS 50 -#define MAX_SHOWING (5 + 16) - -#define OVERLAY_EVENT_NULL 0 -#define OVERLAY_EVENT_SHOW 1 -#define OVERLAY_EVENT_HIDE 2 -#define OVERLAY_EVENT_MENU_BUTTON 3 -#define OVERLAY_EVENT_FREE_HANDLE 8 /* Frees a handle, previous allocated via get_handle */ - -typedef struct video_overlay_object_s { - int32_t handle; /* Used to match Show and Hide events. */ - uint32_t object_type; /* 0=Subtitle, 1=Menu */ - int64_t pts; /* Needed for Menu button compares */ - vo_overlay_t *overlay; /* The image data. */ - uint32_t *palette; /* If NULL, no palette contained in this event. */ - uint32_t palette_type; /* 1 Y'CrCB, 2 R'G'B' */ -} video_overlay_object_t; - -/* This will hold all details of an event item, needed for event queue to function */ -typedef struct video_overlay_event_s { - int64_t vpts; /* Time when event will action. 0 means action now */ -/* Once video_out blend_yuv etc. can take rle_elem_t with Colour, blend and length information. - * we can remove clut and blend from this structure. - * This will allow for many more colours for OSD. - */ - uint32_t event_type; /* Show SPU, Show OSD, Hide etc. */ - video_overlay_object_t object; /* The image data. */ -} video_overlay_event_t; - -video_overlay_manager_t *_x_video_overlay_new_manager(xine_t *) XINE_PROTECTED; - -#endif diff --git a/src/xine-engine/vo_scale.h b/src/xine-engine/vo_scale.h deleted file mode 100644 index e502b2f62..000000000 --- a/src/xine-engine/vo_scale.h +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright (C) 2000-2003 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * vo_scale.h - * - * keeps video scaling information - */ - -#ifndef HAVE_VO_SCALE_H -#define HAVE_VO_SCALE_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef XINE_COMPILE -# include "configfile.h" -#else -# include -#endif - -typedef struct { - int x, y; - int w, h; -} vo_scale_rect_t; - -struct vo_scale_s { - - /* true if driver supports frame zooming */ - int support_zoom; - - /* forces direct mapping between frame pixels and screen pixels */ - int scaling_disabled; - - /* size / aspect ratio calculations */ - - /* - * "delivered" size: - * frame dimension / aspect as delivered by the decoder - * used (among other things) to detect frame size changes - * units: frame pixels - */ - int delivered_width; - int delivered_height; - double delivered_ratio; - - /* - * required cropping: - * units: frame pixels - */ - int crop_left; - int crop_right; - int crop_top; - int crop_bottom; - - /* - * displayed part of delivered images, - * taking zoom into account - * units: frame pixels - */ - int displayed_xoffset; - int displayed_yoffset; - int displayed_width; - int displayed_height; - double zoom_factor_x, zoom_factor_y; - - /* - * user's aspect selection - */ - int user_ratio; - - /* - * "gui" size / offset: - * what gui told us about where to display the video - * units: screen pixels - */ - int gui_x, gui_y; - int gui_width, gui_height; - int gui_win_x, gui_win_y; - - /* */ - int force_redraw; - - /* - * video + display pixel aspect - * One pixel of height 1 has this width - * This may be corrected by the driver in order to fit the video seamlessly - */ - double gui_pixel_aspect; - double video_pixel_aspect; - - /* - * "output" size: - * - * this is finally the ideal size "fitted" into the - * gui size while maintaining the aspect ratio - * units: screen pixels - */ - int output_width; - int output_height; - int output_xoffset; - int output_yoffset; - - - /* gui callbacks */ - - void *user_data; - void (*frame_output_cb) (void *user_data, - int video_width, int video_height, - double video_pixel_aspect, - int *dest_x, int *dest_y, - int *dest_width, int *dest_height, - double *dest_pixel_aspect, - int *win_x, int *win_y); - - void (*dest_size_cb) (void *user_data, - int video_width, int video_height, - double video_pixel_aspect, - int *dest_width, int *dest_height, - double *dest_pixel_aspect); - - /* borders */ - vo_scale_rect_t border[4]; - - /* - * border ratios to determine image position in the - * viewport; these are set by user config - */ - double output_horizontal_position; - double output_vertical_position; - -}; - -typedef struct vo_scale_s vo_scale_t; - - -/* - * convert delivered height/width to ideal width/height - * taking into account aspect ratio and zoom factor - */ - -void _x_vo_scale_compute_ideal_size (vo_scale_t *self) XINE_PROTECTED; - - -/* - * make ideal width/height "fit" into the gui - */ - -void _x_vo_scale_compute_output_size (vo_scale_t *self) XINE_PROTECTED; - -/* - * return true if a redraw is needed due resizing, zooming, - * aspect ratio changing, etc. - */ - -int _x_vo_scale_redraw_needed (vo_scale_t *self) XINE_PROTECTED; - -/* - * - */ - -void _x_vo_scale_translate_gui2video(vo_scale_t *self, - int x, int y, - int *vid_x, int *vid_y) XINE_PROTECTED; - -/* - * Returns description of a given ratio code - */ - -char *_x_vo_scale_aspect_ratio_name(int a) XINE_PROTECTED; - -/* - * initialize rescaling struct - */ - -void _x_vo_scale_init(vo_scale_t *self, int support_zoom, - int scaling_disabled, config_values_t *config ) XINE_PROTECTED; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h deleted file mode 100644 index 13b003992..000000000 --- a/src/xine-engine/xine_internal.h +++ /dev/null @@ -1,546 +0,0 @@ -/* - * Copyright (C) 2000-2005 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - */ - -#ifndef HAVE_XINE_INTERNAL_H -#define HAVE_XINE_INTERNAL_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * include public part of xine header - */ - -#ifdef XINE_COMPILE -# include "xine.h" -# include "refcounter.h" -# include "input/input_plugin.h" -# include "demuxers/demux.h" -# include "video_out.h" -# include "audio_out.h" -# include "metronom.h" -# include "osd.h" -# include "xineintl.h" -# include "plugin_catalog.h" -# include "video_decoder.h" -# include "audio_decoder.h" -# include "spu_decoder.h" -# include "scratch.h" -# include "broadcaster.h" -# include "io_helper.h" -# include "info_helper.h" -# include "alphablend.h" -#else -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -#endif - -#define XINE_MAX_EVENT_LISTENERS 50 -#define XINE_MAX_EVENT_TYPES 100 -#define XINE_MAX_TICKET_HOLDER_THREADS 64 - -/* used by plugin loader */ -#define XINE_VERSION_CODE XINE_MAJOR_VERSION*10000+XINE_MINOR_VERSION*100+XINE_SUB_VERSION - - -/* - * log constants - */ - -#define XINE_LOG_MSG 0 /* warnings, errors, ... */ -#define XINE_LOG_PLUGIN 1 -#define XINE_LOG_TRACE 2 -#define XINE_LOG_NUM 3 /* # of log buffers defined */ - -#define XINE_STREAM_INFO_MAX 99 - -typedef struct xine_ticket_s xine_ticket_t; - -/* - * the "big" xine struct, holding everything together - */ - -struct xine_s { - - config_values_t *config; - - plugin_catalog_t *plugin_catalog; - - int verbosity; - - int demux_strategy; - char *save_path; - - /* log output that may be presented to the user */ - scratch_buffer_t *log_buffers[XINE_LOG_NUM]; - - xine_list_t *streams; - pthread_mutex_t streams_lock; - - metronom_clock_t *clock; - - /** Handle for libxdg-basedir functions. It's actually an xdgHandle. */ - void * basedir_handle; - -#ifdef XINE_ENGINE_INTERNAL - xine_ticket_t *port_ticket; - pthread_mutex_t log_lock; -#endif -}; - -/* - * xine thread tickets - */ - -struct xine_ticket_s { - - /* the ticket owner must assure to check for ticket revocation in - * intervals of finite length; this means that you must release - * the ticket before any operation that might block - * - * you must never write to this member directly - */ - int ticket_revoked; - - /* apply for a ticket; between acquire and relese of an irrevocable - * ticket (be sure to pair them properly!), it is guaranteed that you - * will never be blocked by ticket revocation */ - void (*acquire)(xine_ticket_t *self, int irrevocable); - - /* give a ticket back */ - void (*release)(xine_ticket_t *self, int irrevocable); - - /* renew a ticket, when it has been revoked, see ticket_revoked above; - * irrevocable must be set to one, if your thread might have acquired - * irrevocable tickets you don't know of; set it to zero only when - * you know that this is impossible */ - void (*renew)(xine_ticket_t *self, int irrevocable); - -#ifdef XINE_ENGINE_INTERNAL - /* allow handing out new tickets */ - void (*issue)(xine_ticket_t *self, int atomic); - - /* revoke all tickets and deny new ones; - * a pair of atomic revoke and issue cannot be interrupted by another - * revocation or by other threads acquiring tickets */ - void (*revoke)(xine_ticket_t *self, int atomic); - - /* behaves like acquire() but doesn't block the calling thread; when - * the thread would have been blocked, 0 is returned otherwise 1 - * this function acquires a ticket even if ticket revocation is active */ - int (*acquire_nonblocking)(xine_ticket_t *self, int irrevocable); - - /* behaves like release() but doesn't block the calling thread; should - * be used in combination with acquire_nonblocking() */ - void (*release_nonblocking)(xine_ticket_t *self, int irrevocable); - - int (*lock_port_rewiring)(xine_ticket_t *self, int ms_timeout); - void (*unlock_port_rewiring)(xine_ticket_t *self); - - void (*dispose)(xine_ticket_t *self); - - pthread_mutex_t lock; - pthread_mutex_t revoke_lock; - pthread_cond_t issued; - pthread_cond_t revoked; - int tickets_granted; - int irrevocable_tickets; - int pending_revocations; - int atomic_revoke; - pthread_t atomic_revoker_thread; - pthread_mutex_t port_rewiring_lock; - struct { - int count; - pthread_t holder; - } *holder_threads; - unsigned holder_thread_count; -#endif -}; - -/* - * xine event queue - */ - -struct xine_event_queue_s { - xine_list_t *events; - pthread_mutex_t lock; - pthread_cond_t new_event; - pthread_cond_t events_processed; - xine_stream_t *stream; - pthread_t *listener_thread; - void *user_data; - xine_event_listener_cb_t callback; - int callback_running; -}; - -/* - * xine_stream - per-stream parts of the xine engine - */ - -struct xine_stream_s { - - /* reference to xine context */ - xine_t *xine; - - /* metronom instance used by current stream */ - metronom_t *metronom; - - /* demuxers use input_plugin to read data */ - input_plugin_t *input_plugin; - - /* used by video decoders */ - xine_video_port_t *video_out; - - /* demuxers send data to video decoders using this fifo */ - fifo_buffer_t *video_fifo; - - /* used by audio decoders */ - xine_audio_port_t *audio_out; - - /* demuxers send data to audio decoders using this fifo */ - fifo_buffer_t *audio_fifo; - - /* provide access to osd api */ - osd_renderer_t *osd_renderer; - - /* master/slave streams */ - xine_stream_t *master; /* usually a pointer to itself */ - xine_stream_t *slave; - - /* input_dvd uses this one. is it possible to add helper functions instead? */ - spu_decoder_t *spu_decoder_plugin; - - /* dxr3 use this one, should be possible to fix to use the port instead */ - vo_driver_t *video_driver; - - /* these definitely should be made private! */ - int audio_channel_auto; - int spu_decoder_streamtype; - int spu_channel_user; - int spu_channel_auto; - int spu_channel_letterbox; - int spu_channel; - - /* current content detection method, see METHOD_BY_xxx */ - int content_detection_method; - -#ifdef XINE_ENGINE_INTERNAL - /* these are private variables, plugins must not access them */ - - int status; - - /* lock controlling speed change access */ - pthread_mutex_t speed_change_lock; - uint32_t ignore_speed_change:1; /*< speed changes during stop can be disastrous */ - uint32_t video_thread_created:1; - uint32_t audio_thread_created:1; - uint32_t first_frame_flag:2; - uint32_t demux_action_pending:1; - uint32_t demux_thread_created:1; - uint32_t demux_thread_running:1; - uint32_t slave_is_subtitle:1; /*< ... and will be automaticaly disposed */ - uint32_t emergency_brake:1; /*< something went really wrong and this stream must be - * stopped. usually due some fatal error on output - * layers as they cannot call xine_stop. */ - uint32_t early_finish_event:1; /*< do not wait fifos get empty before sending event */ - uint32_t gapless_switch:1; /*< next stream switch will be gapless */ - - input_class_t *eject_class; - demux_plugin_t *demux_plugin; - -/* vo_driver_t *video_driver;*/ - pthread_t video_thread; - video_decoder_t *video_decoder_plugin; - extra_info_t *video_decoder_extra_info; - int video_decoder_streamtype; - int video_channel; - - uint32_t audio_track_map[50]; - int audio_track_map_entries; - - int audio_decoder_streamtype; - pthread_t audio_thread; - audio_decoder_t *audio_decoder_plugin; - extra_info_t *audio_decoder_extra_info; - - uint32_t audio_type; - /* *_user: -2 => off - -1 => auto (use *_auto value) - >=0 => respect the user's choice - */ - int audio_channel_user; -/* int audio_channel_auto; */ - -/* spu_decoder_t *spu_decoder_plugin; */ -/* int spu_decoder_streamtype; */ - uint32_t spu_track_map[50]; - int spu_track_map_entries; -/* int spu_channel_user; */ -/* int spu_channel_auto; */ -/* int spu_channel_letterbox; */ - int spu_channel_pan_scan; -/* int spu_channel; */ - - /* lock for public xine player functions */ - pthread_mutex_t frontend_lock; - - /* stream meta information */ - /* NEVER access directly, use helpers (see info_helper.c) */ - pthread_mutex_t info_mutex; - int stream_info_public[XINE_STREAM_INFO_MAX]; - int stream_info[XINE_STREAM_INFO_MAX]; - pthread_mutex_t meta_mutex; - char *meta_info_public[XINE_STREAM_INFO_MAX]; - char *meta_info[XINE_STREAM_INFO_MAX]; - - /* seeking slowdown */ - pthread_mutex_t first_frame_lock; - pthread_cond_t first_frame_reached; - - /* wait for headers sent / stream decoding finished */ - pthread_mutex_t counter_lock; - pthread_cond_t counter_changed; - int header_count_audio; - int header_count_video; - int finished_count_audio; - int finished_count_video; - - /* event mechanism */ - xine_list_t *event_queues; - pthread_mutex_t event_queues_lock; - - /* demux thread stuff */ - pthread_t demux_thread; - pthread_mutex_t demux_lock; - pthread_mutex_t demux_mutex; /* used in _x_demux_... functions to synchronize order of pairwise A/V buffer operations */ - - extra_info_t *current_extra_info; - pthread_mutex_t current_extra_info_lock; - int video_seek_count; - - int delay_finish_event; /* delay event in 1/10 sec units. 0=>no delay, -1=>forever */ - - int slave_affection; /* what operations need to be propagated down to the slave? */ - - int err; - - xine_post_out_t video_source; - xine_post_out_t audio_source; - - broadcaster_t *broadcaster; - - refcounter_t *refcounter; -#endif -}; - -/* when explicitly noted, some functions accept an anonymous stream, - * which is a valid stream that does not want to be addressed. */ -#define XINE_ANON_STREAM ((xine_stream_t *)-1) - - -/* - * private function prototypes: - */ - -int _x_query_buffer_usage(xine_stream_t *stream, int *num_video_buffers, int *num_audio_buffers, int *num_video_frames, int *num_audio_frames) XINE_PROTECTED; -int _x_lock_port_rewiring(xine_t *xine, int ms_to_time_out) XINE_PROTECTED; -void _x_unlock_port_rewiring(xine_t *xine) XINE_PROTECTED; -int _x_lock_frontend(xine_stream_t *stream, int ms_to_time_out) XINE_PROTECTED; -void _x_unlock_frontend(xine_stream_t *stream) XINE_PROTECTED; -int _x_query_unprocessed_osd_events(xine_stream_t *stream) XINE_PROTECTED; -int _x_demux_seek(xine_stream_t *stream, off_t start_pos, int start_time, int playing) XINE_PROTECTED; -int _x_continue_stream_processing(xine_stream_t *stream) XINE_PROTECTED; -void _x_trigger_relaxed_frame_drop_mode(xine_stream_t *stream) XINE_PROTECTED; -void _x_reset_relaxed_frame_drop_mode(xine_stream_t *stream) XINE_PROTECTED; - -void _x_handle_stream_end (xine_stream_t *stream, int non_user) XINE_PROTECTED; - -/* report message to UI. usually these are async errors */ - -int _x_message(xine_stream_t *stream, int type, ...) XINE_SENTINEL XINE_PROTECTED; - -/* flush the message queues */ - -void _x_flush_events_queues (xine_stream_t *stream) XINE_PROTECTED; - - -/* find and instantiate input and demux plugins */ - -input_plugin_t *_x_find_input_plugin (xine_stream_t *stream, const char *mrl) XINE_PROTECTED; -demux_plugin_t *_x_find_demux_plugin (xine_stream_t *stream, input_plugin_t *input) XINE_PROTECTED; -demux_plugin_t *_x_find_demux_plugin_by_name (xine_stream_t *stream, const char *name, input_plugin_t *input) XINE_PROTECTED; -demux_plugin_t *_x_find_demux_plugin_last_probe(xine_stream_t *stream, const char *last_demux_name, input_plugin_t *input) XINE_PROTECTED; -input_plugin_t *_x_rip_plugin_get_instance (xine_stream_t *stream, const char *filename) XINE_PROTECTED; -input_plugin_t *_x_cache_plugin_get_instance (xine_stream_t *stream, int readahead_size) XINE_PROTECTED; -void _x_free_input_plugin (xine_stream_t *stream, input_plugin_t *input) XINE_PROTECTED; -void _x_free_demux_plugin (xine_stream_t *stream, demux_plugin_t *demux) XINE_PROTECTED; - -/* create decoder fifos and threads */ - -int _x_video_decoder_init (xine_stream_t *stream) XINE_PROTECTED; -void _x_video_decoder_shutdown (xine_stream_t *stream) XINE_PROTECTED; - -int _x_audio_decoder_init (xine_stream_t *stream) XINE_PROTECTED; -void _x_audio_decoder_shutdown (xine_stream_t *stream) XINE_PROTECTED; - -/* extra_info operations */ -void _x_extra_info_reset( extra_info_t *extra_info ) XINE_PROTECTED; - -void _x_extra_info_merge( extra_info_t *dst, extra_info_t *src ) XINE_PROTECTED; - -void _x_get_current_info (xine_stream_t *stream, extra_info_t *extra_info, int size) XINE_PROTECTED; - - -/* demuxer helper functions from demux.c */ - -/* - * Flush audio and video buffers. It is called from demuxers on - * seek/stop, and may be useful when user input changes a stream and - * xine-lib has cached buffers that have yet to be played. - * - * warning: after clearing decoders fifos an absolute discontinuity - * indication must be sent. relative discontinuities are likely - * to cause "jumps" on metronom. - */ -void _x_demux_flush_engine (xine_stream_t *stream) XINE_PROTECTED; - -void _x_demux_control_nop (xine_stream_t *stream, uint32_t flags) XINE_PROTECTED; -void _x_demux_control_newpts (xine_stream_t *stream, int64_t pts, uint32_t flags) XINE_PROTECTED; -void _x_demux_control_headers_done (xine_stream_t *stream) XINE_PROTECTED; -void _x_demux_control_start (xine_stream_t *stream) XINE_PROTECTED; -void _x_demux_control_end (xine_stream_t *stream, uint32_t flags) XINE_PROTECTED; -int _x_demux_start_thread (xine_stream_t *stream) XINE_PROTECTED; -int _x_demux_stop_thread (xine_stream_t *stream) XINE_PROTECTED; -int _x_demux_read_header (input_plugin_t *input, void *buffer, off_t size) XINE_PROTECTED; -int _x_demux_check_extension (const char *mrl, const char *extensions); - -off_t _x_read_abort (xine_stream_t *stream, int fd, char *buf, off_t todo) XINE_PROTECTED; - -int _x_action_pending (xine_stream_t *stream) XINE_PROTECTED; - -void _x_demux_send_data(fifo_buffer_t *fifo, uint8_t *data, int size, - int64_t pts, uint32_t type, uint32_t decoder_flags, - int input_normpos, int input_time, int total_time, - uint32_t frame_number) XINE_PROTECTED; - -int _x_demux_read_send_data(fifo_buffer_t *fifo, input_plugin_t *input, - int size, int64_t pts, uint32_t type, - uint32_t decoder_flags, off_t input_normpos, - int input_time, int total_time, - uint32_t frame_number) XINE_PROTECTED; - -void _x_demux_send_mrl_reference (xine_stream_t *stream, int alternative, - const char *mrl, const char *title, - int start_time, int duration) XINE_PROTECTED; - -/* - * MRL escaped-character decoding (overwrites the source string) - */ -void _x_mrl_unescape(char *mrl) XINE_PROTECTED; - -/* - * plugin_loader functions - * - */ - -/* on-demand loading of audio/video/spu decoder plugins */ - -video_decoder_t *_x_get_video_decoder (xine_stream_t *stream, uint8_t stream_type) XINE_PROTECTED; -void _x_free_video_decoder (xine_stream_t *stream, video_decoder_t *decoder) XINE_PROTECTED; -audio_decoder_t *_x_get_audio_decoder (xine_stream_t *stream, uint8_t stream_type) XINE_PROTECTED; -void _x_free_audio_decoder (xine_stream_t *stream, audio_decoder_t *decoder) XINE_PROTECTED; -spu_decoder_t *_x_get_spu_decoder (xine_stream_t *stream, uint8_t stream_type) XINE_PROTECTED; -void _x_free_spu_decoder (xine_stream_t *stream, spu_decoder_t *decoder) XINE_PROTECTED; -/* check for decoder availability - but don't try to initialize it */ -int _x_decoder_available (xine_t *xine, uint32_t buftype) XINE_PROTECTED; - -/* - * load_video_output_plugin - * - * load a specific video output plugin - */ - -vo_driver_t *_x_load_video_output_plugin(xine_t *this, - char *id, int visual_type, void *visual) XINE_PROTECTED; - -/* - * audio output plugin dynamic loading stuff - */ - -/* - * load_audio_output_plugin - * - * load a specific audio output plugin - */ - -ao_driver_t *_x_load_audio_output_plugin (xine_t *self, const char *id) XINE_PROTECTED; - - -void _x_set_speed (xine_stream_t *stream, int speed) XINE_PROTECTED; - -int _x_get_speed (xine_stream_t *stream) XINE_PROTECTED; - -void _x_set_fine_speed (xine_stream_t *stream, int speed) XINE_PROTECTED; - -int _x_get_fine_speed (xine_stream_t *stream) XINE_PROTECTED; - -void _x_select_spu_channel (xine_stream_t *stream, int channel) XINE_PROTECTED; - -int _x_get_audio_channel (xine_stream_t *stream) XINE_PROTECTED; - -int _x_get_spu_channel (xine_stream_t *stream) XINE_PROTECTED; - -/* - * internal events - */ - -/* sent by dvb frontend to inform ts demuxer of new pids */ -#define XINE_EVENT_PIDS_CHANGE 0x80000000 - -/* - * pids change event - inform ts demuxer of new pids - */ -typedef struct { - int vpid; /* video program id */ - int apid; /* audio program id */ -} xine_pids_data_t; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/xine-engine/xine_plugin.h b/src/xine-engine/xine_plugin.h deleted file mode 100644 index 74e7523e9..000000000 --- a/src/xine-engine/xine_plugin.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 2000-2003 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * generic plugin definitions - */ - -#ifndef XINE_PLUGIN_H -#define XINE_PLUGIN_H - -#define PLUGIN_NONE 0 -#define PLUGIN_INPUT 1 -#define PLUGIN_DEMUX 2 -#define PLUGIN_AUDIO_DECODER 3 -#define PLUGIN_VIDEO_DECODER 4 -#define PLUGIN_SPU_DECODER 5 -#define PLUGIN_AUDIO_OUT 6 -#define PLUGIN_VIDEO_OUT 7 -#define PLUGIN_POST 8 - -#define PLUGIN_TYPE_MAX PLUGIN_POST - -/* this flag may be or'ed with type in order to force preloading the plugin. - * very useful to register config items on xine initialization. - */ -#define PLUGIN_MUST_PRELOAD (1 << 7) - -/* this flag may be or'ed with type to prevent the plugin loader from unloading - * the plugin - */ -#define PLUGIN_NO_UNLOAD (1 << 6) - -#define PLUGIN_TYPE_MASK ((1 << 6) - 1) - -typedef struct { - uint8_t type; /* one of the PLUGIN_* constants above */ - uint8_t API; /* API version supported by this plugin */ - char *id; /* a name that identifies this plugin */ - uint32_t version; /* version number, increased every release */ - const void *special_info; /* plugin-type specific, see structs below */ - void *(*init)(xine_t *, void *); /* init the plugin class */ -} plugin_info_t; - - -/* special_info for a video output plugin */ -typedef struct { - int priority; /* priority of this plugin for auto-probing */ - int visual_type; /* visual type supported by this plugin */ -} vo_info_t; - -/* special info for a audio output plugin */ -typedef struct { - int priority; -} ao_info_t; - -/* special_info for a decoder plugin */ -typedef struct { - uint32_t *supported_types; /* streamtypes this decoder can handle */ - int priority; -} decoder_info_t; - -/* special info for a post plugin */ -typedef struct { - uint32_t type; /* type of the post plugin, use one of XINE_POST_TYPE_* */ -} post_info_t; - -/* special info for a demuxer plugin */ -typedef struct { - int priority; -} demuxer_info_t; - -/* special info for an input plugin */ -typedef struct { - int priority; -} input_info_t; - - -/* register a list of statically linked plugins - * info is a list of plugin_info_t terminated by PLUGIN_NONE - * example: - * plugin_info_t acme_plugin_info[] = { - * { PLUGIN_VIDEO_OUT, 21, "acme", XINE_VERSION_CODE, &vo_info_acme, - * init_class_acme }, - * { PLUGIN_NONE, 0, "", 0, NULL, NULL } - * }; - * - */ -void xine_register_plugins(xine_t *self, plugin_info_t *info) XINE_PROTECTED; - -#endif diff --git a/src/xine-engine/xineintl.h b/src/xine-engine/xineintl.h deleted file mode 100644 index 113a033fa..000000000 --- a/src/xine-engine/xineintl.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2000-2005 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - */ - -#ifndef HAVE_XINEINTL_H -#define HAVE_XINEINTL_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#ifdef ENABLE_NLS -# include -# define _(String) dgettext (XINE_TEXTDOMAIN, String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -/* Stubs that do something close enough. */ -# define textdomain(String) (String) -# define gettext(String) (String) -# define dgettext(Domain,Message) (Message) -# define dcgettext(Domain,Message,Type) (Message) -# define ngettext(Singular, Plural, IsPlural) (Singular) -# define bindtextdomain(Domain,Directory) (Domain) -# define _(String) (String) -# define N_(String) (String) -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/xine-utils/Makefile.am b/src/xine-utils/Makefile.am index bacb2720f..30040e318 100644 --- a/src/xine-utils/Makefile.am +++ b/src/xine-utils/Makefile.am @@ -7,19 +7,6 @@ EXTRA_DIST = ppcasm_string.S ppc_asm.tmpl noinst_HEADERS = ppcasm_string.h xine_check.h -xineinclude_HEADERS = \ - attributes.h \ - compat.h \ - xine_buffer.h \ - xineutils.h \ - xmllexer.h \ - xmlparser.h \ - list.h \ - array.h \ - sorted_array.h \ - pool.h \ - ring_buffer.h - noinst_LTLIBRARIES = libxineutils.la if ARCH_PPC diff --git a/src/xine-utils/array.h b/src/xine-utils/array.h deleted file mode 100644 index ae2093823..000000000 --- a/src/xine-utils/array.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2000-2006 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * Array that can grow automatically when you add elements. - * Inserting an element in the middle of the array implies memory moves. - */ -#ifndef XINE_ARRAY_H -#define XINE_ARRAY_H - -/* Array type */ -typedef struct xine_array_s xine_array_t; - -/* Constructor */ -xine_array_t *xine_array_new(size_t initial_size) XINE_PROTECTED; - -/* Destructor */ -void xine_array_delete(xine_array_t *array) XINE_PROTECTED; - -/* Returns the number of element stored in the array */ -size_t xine_array_size(const xine_array_t *array) XINE_PROTECTED; - -/* Removes all elements from an array */ -void xine_array_clear(xine_array_t *array) XINE_PROTECTED; - -/* Adds the element at the end of the array */ -void xine_array_add(xine_array_t *array, void *value) XINE_PROTECTED; - -/* Inserts an element into an array at the position specified */ -void xine_array_insert(xine_array_t *array, unsigned int position, void *value) XINE_PROTECTED; - -/* Removes one element from an array at the position specified */ -void xine_array_remove(xine_array_t *array, unsigned int position) XINE_PROTECTED; - -/* Get the element at the position specified */ -void *xine_array_get(const xine_array_t *array, unsigned int position) XINE_PROTECTED; - -/* Set the element at the position specified */ -void xine_array_set(xine_array_t *array, unsigned int position, void *value) XINE_PROTECTED; - -#endif - diff --git a/src/xine-utils/attributes.h b/src/xine-utils/attributes.h deleted file mode 100644 index b25c76572..000000000 --- a/src/xine-utils/attributes.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * attributes.h - * Copyright (C) 1999-2000 Aaron Holtzman - * Copyright (C) 2001-2007 xine developers - * - * This file was originally part of mpeg2dec, a free MPEG-2 video stream - * decoder. - * - * mpeg2dec is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * mpeg2dec is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - */ - -/* use gcc attribs to align critical data structures */ - -#ifndef ATTRIBUTE_H_ -#define ATTRIBUTE_H_ - -#ifdef ATTRIBUTE_ALIGNED_MAX -#define ATTR_ALIGN(align) __attribute__ ((__aligned__ ((ATTRIBUTE_ALIGNED_MAX < align) ? ATTRIBUTE_ALIGNED_MAX : align))) -#else -#define ATTR_ALIGN(align) -#endif - -#ifdef XINE_COMPILE -# include "configure.h" -#endif - -/* Export protected only for libxine functions */ -#if defined(XINE_LIBRARY_COMPILE) && defined(SUPPORT_ATTRIBUTE_VISIBILITY_PROTECTED) -# define XINE_PROTECTED __attribute__((__visibility__("protected"))) -#elif defined(XINE_LIBRARY_COMPILE) && defined(SUPPORT_ATTRIBUTE_VISIBILITY_DEFAULT) -# define XINE_PROTECTED __attribute__((__visibility__("default"))) -#else -# define XINE_PROTECTED -#endif - -#ifdef SUPPORT_ATTRIBUTE_SENTINEL -# define XINE_SENTINEL __attribute__((__sentinel__)) -#else -# define XINE_SENTINEL -#endif - -#ifndef __attr_unused -# ifdef SUPPORT_ATTRIBUTE_UNUSED -# define __attr_unused __attribute__((__unused__)) -# else -# define __attr_unused -# endif -#endif - -/* Format attributes */ -#ifdef SUPPORT_ATTRIBUTE_FORMAT -# define XINE_FORMAT_PRINTF(fmt,var) __attribute__((__format__(__printf__, fmt, var))) -#else -# define XINE_FORMAT_PRINTF(fmt,var) -#endif -#ifdef SUPPORT_ATTRIBUTE_FORMAT_ARG -# define XINE_FORMAT_PRINTF_ARG(fmt) __attribute__((__format_arg__(fmt))) -#else -# define XINE_FORMAT_PRINTF_ARG(fmt) -#endif - -#ifdef SUPPORT_ATTRIBUTE_PACKED -# define XINE_PACKED __attribute__((packed)) -#else -# define XINE_PACKED -#endif - -#ifdef SUPPORT_ATTRIBUTE_MALLOC -# define XINE_MALLOC __attribute__((__malloc__)) -#else -# define XINE_MALLOC -#endif - -#endif /* ATTRIBUTE_H_ */ diff --git a/src/xine-utils/compat.h b/src/xine-utils/compat.h deleted file mode 100644 index d4b95aeb3..000000000 --- a/src/xine-utils/compat.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2000-2001 the xine project - * - * This file is part of xine, a unix video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - */ - -#ifndef XINE_COMPAT_H -#define XINE_COMPAT_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined _MSC_VER -#define __XINE_FUNCTION__ __FILE__ -#elif defined __GNUC__ -#define __XINE_FUNCTION__ __FUNCTION__ -#else -#define __XINE_FUNCTION__ __func__ -#endif - -#ifndef NAME_MAX -#define XINE_NAME_MAX 256 -#else -#define XINE_NAME_MAX NAME_MAX -#endif - -#ifndef PATH_MAX -#define XINE_PATH_MAX 768 -#else -#define XINE_PATH_MAX PATH_MAX -#endif - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/xine-utils/list.h b/src/xine-utils/list.h deleted file mode 100644 index e00e30d6c..000000000 --- a/src/xine-utils/list.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (C) 2000-2006 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * Doubly-linked linked list. - * - * Exemples: - * - * Create a list: - * xine_list_t *list = xine_list_new(); - * - * Delete a list: - * xine_list_delete(list); - * - * Walk thru a list: - * xine_list_iterator_t ite = xine_list_front(list); - * while (ite) { - * _useful code here_ - * ite = xine_list_next(list, ite); - * } - * - * The list elements are managed using memory chunks and a free list. The first - * chunk contains 32 elements, each following chunk is two time as big as the - * previous one, with a limit of 64K elements. - */ -#ifndef XINE_LIST_H -#define XINE_LIST_H - -/* Doubly-linked list type */ -typedef struct xine_list_s xine_list_t; - -/* List iterator */ -typedef void* xine_list_iterator_t; - -/* Constructor */ -xine_list_t *xine_list_new(void) XINE_PROTECTED; - -/* Destructor */ -void xine_list_delete(xine_list_t *list) XINE_PROTECTED; - -/* Returns the number of element stored in the list */ -unsigned int xine_list_size(xine_list_t *list) XINE_PROTECTED; - -/* Returns true if the number of elements is zero, false otherwise */ -unsigned int xine_list_empty(xine_list_t *list) XINE_PROTECTED; - -/* Adds the element at the beginning of the list */ -void xine_list_push_front(xine_list_t *list, void *value) XINE_PROTECTED; - -/* Adds the element at the end of the list */ -void xine_list_push_back(xine_list_t *list, void *value) XINE_PROTECTED; - -/* Remove all elements from a list */ -void xine_list_clear(xine_list_t *list) XINE_PROTECTED; - -/* Insert the element elem into the list at the position specified by the - iterator (before the element, if any, that was previously at the iterator's - position). The return value is an iterator that specifies the position of - the inserted element. */ -xine_list_iterator_t xine_list_insert(xine_list_t *list, - xine_list_iterator_t position, - void *value) XINE_PROTECTED; - -/* Remove one element from a list.*/ -void xine_list_remove(xine_list_t *list, xine_list_iterator_t position) XINE_PROTECTED; - -/* Returns an iterator that references the first element of the list */ -xine_list_iterator_t xine_list_front(xine_list_t *list) XINE_PROTECTED; - -/* Returns an iterator that references the last element of the list */ -xine_list_iterator_t xine_list_back(xine_list_t *list) XINE_PROTECTED; - -/* Perform a linear search of a given value, and returns an iterator that - references this value or NULL if not found */ -xine_list_iterator_t xine_list_find(xine_list_t *list, void *value) XINE_PROTECTED; - -/* Increments the iterator's value, so it specifies the next element in the list - or NULL at the end of the list */ -xine_list_iterator_t xine_list_next(xine_list_t *list, xine_list_iterator_t ite) XINE_PROTECTED; - -/* Increments the iterator's value, so it specifies the previous element in the list - or NULL at the beginning of the list */ -xine_list_iterator_t xine_list_prev(xine_list_t *list, xine_list_iterator_t ite) XINE_PROTECTED; - -/* Returns the value at the position specified by the iterator */ -void *xine_list_get_value(xine_list_t *list, xine_list_iterator_t ite) XINE_PROTECTED; - -#endif - diff --git a/src/xine-utils/pool.h b/src/xine-utils/pool.h deleted file mode 100644 index 918da82a2..000000000 --- a/src/xine-utils/pool.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2000-2006 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * Object Pool - */ - -#include -#include - -typedef struct xine_pool_s xine_pool_t; - -/* Creates a new pool - * object_size: sizeof(your struct) - * create_object: function called to create an object (can be NULL) - * prepare_object: function called to prepare an object to returned to the client (can be NULL) - * return_object: function called to prepare an object to returned to the pool (can be NULL) - * delete_object: function called to delete an object (can be NULL) - */ -xine_pool_t *xine_pool_new(size_t object_size, - void (create_object)(void *object), - void (prepare_object)(void *object), - void (return_object)(void *object), - void (delete_object)(void *object)) XINE_PROTECTED; - -/* Deletes a pool */ -void xine_pool_delete(xine_pool_t *pool) XINE_PROTECTED; - -/* Get an object from the pool */ -void *xine_pool_get(xine_pool_t *pool) XINE_PROTECTED; - -/* Returns an object to the pool */ -void xine_pool_put(xine_pool_t *pool, void *object) XINE_PROTECTED; diff --git a/src/xine-utils/ring_buffer.h b/src/xine-utils/ring_buffer.h deleted file mode 100644 index efcffd3b7..000000000 --- a/src/xine-utils/ring_buffer.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2000-2006 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * Fifo + Ring Buffer - */ -typedef struct xine_ring_buffer_s xine_ring_buffer_t; - -/* Creates a new ring buffer */ -xine_ring_buffer_t *xine_ring_buffer_new(size_t size) XINE_PROTECTED; - -/* Deletes a ring buffer */ -void xine_ring_buffer_delete(xine_ring_buffer_t *ring_buffer) XINE_PROTECTED; - -/* Returns a new chunk of the specified size */ -/* Might block if the ring buffer is full */ -void *xine_ring_buffer_alloc(xine_ring_buffer_t *ring_buffer, size_t size) XINE_PROTECTED; - -/* Put a chunk into the ring */ -void xine_ring_buffer_put(xine_ring_buffer_t *ring_buffer, void *chunk) XINE_PROTECTED; - -/* Get a chunk of a specified size from the ring buffer - * Might block if the ring buffer is empty - * param size: the desired size - * param rsize: the size of the chunk returned - * rsize is not equal to size at the end of stream, the caller MUST check - * rsize value. - */ -void *xine_ring_buffer_get(xine_ring_buffer_t *ring_buffer, size_t size, size_t *rsize) XINE_PROTECTED; - -/* Releases the chunk, makes memory available for the alloc function */ -void xine_ring_buffer_release(xine_ring_buffer_t *ring_buffer, void *chunk) XINE_PROTECTED; - -/* Closes the ring buffer - * The writer uses this function to signal the end of stream to the reader. - * The reader MUST check the rsize value returned by the get function. - */ -void xine_ring_buffer_close(xine_ring_buffer_t *ring_buffer) XINE_PROTECTED; - - diff --git a/src/xine-utils/sorted_array.h b/src/xine-utils/sorted_array.h deleted file mode 100644 index a1894eca3..000000000 --- a/src/xine-utils/sorted_array.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2000-2006 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * Sorted array which grows automatically when you add elements. - * A binary search is used to find the position of a new element. - * - * Example: - * Let's create de comparison method for integers: - * - * int int_comparator(void *a, void *b) { - * if ((int)a < (int)b) { - * return -1; - * } else if ((int)a == (int)b) { - * return 0; - * } else { - * return 1; - * } - * } - * - * Create a sorted array for integers: - * xine_sarray_t *sarray = xine_sarray_new(10, int_comparator); - * - * Add elements: - * xine_sarray_add(sarray, (void*)4); - * xine_sarray_add(sarray, (void*)28); - * xine_sarray_add(sarray, (void*)7); - * - * Find an element: - * int pos = xine_sarray_binary_search(sarray, (void*)7); - * if (pos >= 0) - * FOUND - * else - * NOT FOUND - * - * Delete the array: - * xine_sarray_delete(sarray); - */ -#ifndef XINE_SORTED_ARRAY_H -#define XINE_SORTED_ARRAY_H - -#include "array.h" - -/* Array type */ -typedef struct xine_sarray_s xine_sarray_t; - -/* Array element comparator */ -typedef int (*xine_sarray_comparator_t)(void*, void*); - -/* Constructor */ -xine_sarray_t *xine_sarray_new(size_t initial_size, xine_sarray_comparator_t comparator) XINE_PROTECTED; - -/* Destructor */ -void xine_sarray_delete(xine_sarray_t *sarray) XINE_PROTECTED; - -/* Returns the number of element stored in the array */ -size_t xine_sarray_size(const xine_sarray_t *sarray) XINE_PROTECTED; - -/* Removes all elements from an array */ -void xine_sarray_clear(xine_sarray_t *sarray) XINE_PROTECTED; - -/* Adds the element into the array - Returns the insertion position */ -int xine_sarray_add(xine_sarray_t *sarray, void *value) XINE_PROTECTED; - -/* Removes one element from an array at the position specified */ -void xine_sarray_remove(xine_sarray_t *sarray, unsigned int position) XINE_PROTECTED; - -/* Get the element at the position specified */ -void *xine_sarray_get(xine_sarray_t *sarray, unsigned int position) XINE_PROTECTED; - -/* Returns the index of the search key, if it is contained in the list. - Otherwise, (-(insertion point) - 1) or ~(insertion point). - The insertion point is defined as the point at which the key would be - inserted into the array. */ -int xine_sarray_binary_search(xine_sarray_t *sarray, void *key) XINE_PROTECTED; - -#endif - diff --git a/src/xine-utils/xine_buffer.h b/src/xine-utils/xine_buffer.h deleted file mode 100644 index 84511bd1b..000000000 --- a/src/xine-utils/xine_buffer.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (C) 2000-2004 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * - * generic dynamic buffer functions. The goals - * of these functions are (in fact many of these points - * are todos): - * - dynamic allocation and reallocation depending - * on the size of data written to it. - * - fast and transparent access to the data. - * The user sees only the raw data chunk as it is - * returned by the well-known malloc function. - * This is necessary since not all data-accessing - * functions can be wrapped here. - * - some additional health checks are made during - * development (eg boundary checks after direct - * access to a buffer). This can be turned off in - * production state for higher performance. - * - A lot of convenient string and memory manipulation - * functions are implemented here, where the user - * do not have to care about memory chunk sizes. - * - Some garbage collention could be implemented as well; - * i think of a global structure containing infos - * about all allocated chunks. This must be implemented - * in a thread-save way... - * - * Here are some drawbacks (aka policies): - * - The user must not pass indexed buffers to xine_buffer_* - * functions. - * - The pointers passed to xine_buffer_* functions may change - * (eg during reallocation). The user must respect that. - */ - -#ifndef HAVE_XINE_BUFFER_H -#define HAVE_XINE_BUFFER_H - -#ifdef XINE_COMPILE -# include -#else -# include -#endif - -/* - * returns an initialized pointer to a buffer. - * The buffer will be allocated in blocks of - * chunk_size bytes. This will prevent permanent - * reallocation on slow growing buffers. - */ -void *xine_buffer_init(int chunk_size) XINE_PROTECTED; - -/* - * frees a buffer, the macro ensures, that a freed - * buffer pointer is set to NULL - */ -#define xine_buffer_free(buf) buf=_xine_buffer_free(buf) -void *_xine_buffer_free(void *buf) XINE_PROTECTED; - -/* - * duplicates a buffer - */ -void *xine_buffer_dup(const void *buf) XINE_PROTECTED; - -/* - * will copy len bytes of data into buf at position index. - */ -#define xine_buffer_copyin(buf,i,data,len) \ - buf=_xine_buffer_copyin(buf,i,data,len) -void *_xine_buffer_copyin(void *buf, int index, const void *data, int len) XINE_PROTECTED; - -/* - * will copy len bytes out of buf+index into data. - * no checks are made in data. It is treated as an ordinary - * user-malloced data chunk. - */ -void xine_buffer_copyout(const void *buf, int index, void *data, int len) XINE_PROTECTED; - -/* - * set len bytes in buf+index to b. - */ -#define xine_buffer_set(buf,i,b,len) \ - buf=_xine_buffer_set(buf,i,b,len) -void *_xine_buffer_set(void *buf, int index, uint8_t b, int len) XINE_PROTECTED; - -/* - * concatenates given buf (which should contain a null terminated string) - * with another string. - */ -#define xine_buffer_strcat(buf,data) \ - buf=_xine_buffer_strcat(buf,data) -void *_xine_buffer_strcat(void *buf, const char *data) XINE_PROTECTED; - -/* - * copies given string to buf+index - */ -#define xine_buffer_strcpy(buf,index,data) \ - buf=_xine_buffer_strcpy(buf,index,data) -void *_xine_buffer_strcpy(void *buf, int index, const char *data) XINE_PROTECTED; - -/* - * returns a pointer to the first occurence of ch. - * note, that the returned pointer cannot be used - * in any other xine_buffer_* functions. - */ -char *xine_buffer_strchr(const void *buf, int ch) XINE_PROTECTED; - -/* - * get allocated memory size - */ -int xine_buffer_get_size(const void *buf) XINE_PROTECTED; - -/* - * ensures a specified buffer size if the user want to - * write directly to the buffer. Normally the special - * access functions defined here should be used. - */ -#define xine_buffer_ensure_size(buf,data) \ - buf=_xine_buffer_ensure_size(buf,data) -void *_xine_buffer_ensure_size(void *buf, int size) XINE_PROTECTED; - -#endif diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h deleted file mode 100644 index 4ff87e87c..000000000 --- a/src/xine-utils/xineutils.h +++ /dev/null @@ -1,972 +0,0 @@ -/* - * Copyright (C) 2000-2006 the xine project - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - */ -#ifndef XINEUTILS_H -#define XINEUTILS_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -#ifdef XINE_COMPILE -# include -# include "attributes.h" -# include "compat.h" -# include "xmlparser.h" -# include "xine_buffer.h" -# include "configfile.h" -# include "list.h" -# include "array.h" -# include "sorted_array.h" -#else -# ifdef WIN32 -# include -# else -# include -# endif -# include -# include -# include -# include -# include -# include -# include -# include -# include -#endif - -#include -#include - -/* - * Mark exported data symbols for link engine library clients with older - * Win32 compilers - */ -#if defined(WIN32) && !defined(XINE_LIBRARY_COMPILE) -# define DL_IMPORT __declspec(dllimport) -# define extern DL_IMPORT extern -#endif - - /* - * debugable mutexes - */ - - typedef struct { - pthread_mutex_t mutex; - char id[80]; - char *locked_by; - } xine_mutex_t; - - int xine_mutex_init (xine_mutex_t *mutex, const pthread_mutexattr_t *mutexattr, - const char *id) XINE_PROTECTED; - - int xine_mutex_lock (xine_mutex_t *mutex, const char *who) XINE_PROTECTED; - int xine_mutex_unlock (xine_mutex_t *mutex, const char *who) XINE_PROTECTED; - int xine_mutex_destroy (xine_mutex_t *mutex) XINE_PROTECTED; - - - - /* CPU Acceleration */ - -/* - * The type of an value that fits in an MMX register (note that long - * long constant values MUST be suffixed by LL and unsigned long long - * values by ULL, lest they be truncated by the compiler) - */ - -/* generic accelerations */ -#define MM_ACCEL_MLIB 0x00000001 - -/* x86 accelerations */ -#define MM_ACCEL_X86_MMX 0x80000000 -#define MM_ACCEL_X86_3DNOW 0x40000000 -#define MM_ACCEL_X86_MMXEXT 0x20000000 -#define MM_ACCEL_X86_SSE 0x10000000 -#define MM_ACCEL_X86_SSE2 0x08000000 - -/* powerpc accelerations and features */ -#define MM_ACCEL_PPC_ALTIVEC 0x04000000 -#define MM_ACCEL_PPC_CACHE32 0x02000000 - -/* SPARC accelerations */ - -#define MM_ACCEL_SPARC_VIS 0x01000000 -#define MM_ACCEL_SPARC_VIS2 0x00800000 - -/* x86 compat defines */ -#define MM_MMX MM_ACCEL_X86_MMX -#define MM_3DNOW MM_ACCEL_X86_3DNOW -#define MM_MMXEXT MM_ACCEL_X86_MMXEXT -#define MM_SSE MM_ACCEL_X86_SSE -#define MM_SSE2 MM_ACCEL_X86_SSE2 - -uint32_t xine_mm_accel (void) XINE_PROTECTED; - -#if defined(ARCH_X86) || defined(ARCH_X86_64) - -typedef union { - int64_t q; /* Quadword (64-bit) value */ - uint64_t uq; /* Unsigned Quadword */ - int d[2]; /* 2 Doubleword (32-bit) values */ - unsigned int ud[2]; /* 2 Unsigned Doubleword */ - short w[4]; /* 4 Word (16-bit) values */ - unsigned short uw[4]; /* 4 Unsigned Word */ - char b[8]; /* 8 Byte (8-bit) values */ - unsigned char ub[8]; /* 8 Unsigned Byte */ - float s[2]; /* Single-precision (32-bit) value */ -} ATTR_ALIGN(8) mmx_t; /* On an 8-byte (64-bit) boundary */ - - - -#define mmx_i2r(op,imm,reg) \ - __asm__ __volatile__ (#op " %0, %%" #reg \ - : /* nothing */ \ - : "i" (imm) ) - -#define mmx_m2r(op,mem,reg) \ - __asm__ __volatile__ (#op " %0, %%" #reg \ - : /* nothing */ \ - : "m" (mem)) - -#define mmx_r2m(op,reg,mem) \ - __asm__ __volatile__ (#op " %%" #reg ", %0" \ - : "=m" (mem) \ - : /* nothing */ ) - -#define mmx_r2r(op,regs,regd) \ - __asm__ __volatile__ (#op " %" #regs ", %" #regd) - - -#define emms() __asm__ __volatile__ ("emms") - -#define movd_m2r(var,reg) mmx_m2r (movd, var, reg) -#define movd_r2m(reg,var) mmx_r2m (movd, reg, var) -#define movd_r2r(regs,regd) mmx_r2r (movd, regs, regd) - -#define movq_m2r(var,reg) mmx_m2r (movq, var, reg) -#define movq_r2m(reg,var) mmx_r2m (movq, reg, var) -#define movq_r2r(regs,regd) mmx_r2r (movq, regs, regd) - -#define packssdw_m2r(var,reg) mmx_m2r (packssdw, var, reg) -#define packssdw_r2r(regs,regd) mmx_r2r (packssdw, regs, regd) -#define packsswb_m2r(var,reg) mmx_m2r (packsswb, var, reg) -#define packsswb_r2r(regs,regd) mmx_r2r (packsswb, regs, regd) - -#define packuswb_m2r(var,reg) mmx_m2r (packuswb, var, reg) -#define packuswb_r2r(regs,regd) mmx_r2r (packuswb, regs, regd) - -#define paddb_m2r(var,reg) mmx_m2r (paddb, var, reg) -#define paddb_r2r(regs,regd) mmx_r2r (paddb, regs, regd) -#define paddd_m2r(var,reg) mmx_m2r (paddd, var, reg) -#define paddd_r2r(regs,regd) mmx_r2r (paddd, regs, regd) -#define paddw_m2r(var,reg) mmx_m2r (paddw, var, reg) -#define paddw_r2r(regs,regd) mmx_r2r (paddw, regs, regd) - -#define paddsb_m2r(var,reg) mmx_m2r (paddsb, var, reg) -#define paddsb_r2r(regs,regd) mmx_r2r (paddsb, regs, regd) -#define paddsw_m2r(var,reg) mmx_m2r (paddsw, var, reg) -#define paddsw_r2r(regs,regd) mmx_r2r (paddsw, regs, regd) - -#define paddusb_m2r(var,reg) mmx_m2r (paddusb, var, reg) -#define paddusb_r2r(regs,regd) mmx_r2r (paddusb, regs, regd) -#define paddusw_m2r(var,reg) mmx_m2r (paddusw, var, reg) -#define paddusw_r2r(regs,regd) mmx_r2r (paddusw, regs, regd) - -#define pand_m2r(var,reg) mmx_m2r (pand, var, reg) -#define pand_r2r(regs,regd) mmx_r2r (pand, regs, regd) - -#define pandn_m2r(var,reg) mmx_m2r (pandn, var, reg) -#define pandn_r2r(regs,regd) mmx_r2r (pandn, regs, regd) - -#define pcmpeqb_m2r(var,reg) mmx_m2r (pcmpeqb, var, reg) -#define pcmpeqb_r2r(regs,regd) mmx_r2r (pcmpeqb, regs, regd) -#define pcmpeqd_m2r(var,reg) mmx_m2r (pcmpeqd, var, reg) -#define pcmpeqd_r2r(regs,regd) mmx_r2r (pcmpeqd, regs, regd) -#define pcmpeqw_m2r(var,reg) mmx_m2r (pcmpeqw, var, reg) -#define pcmpeqw_r2r(regs,regd) mmx_r2r (pcmpeqw, regs, regd) - -#define pcmpgtb_m2r(var,reg) mmx_m2r (pcmpgtb, var, reg) -#define pcmpgtb_r2r(regs,regd) mmx_r2r (pcmpgtb, regs, regd) -#define pcmpgtd_m2r(var,reg) mmx_m2r (pcmpgtd, var, reg) -#define pcmpgtd_r2r(regs,regd) mmx_r2r (pcmpgtd, regs, regd) -#define pcmpgtw_m2r(var,reg) mmx_m2r (pcmpgtw, var, reg) -#define pcmpgtw_r2r(regs,regd) mmx_r2r (pcmpgtw, regs, regd) - -#define pmaddwd_m2r(var,reg) mmx_m2r (pmaddwd, var, reg) -#define pmaddwd_r2r(regs,regd) mmx_r2r (pmaddwd, regs, regd) - -#define pmulhw_m2r(var,reg) mmx_m2r (pmulhw, var, reg) -#define pmulhw_r2r(regs,regd) mmx_r2r (pmulhw, regs, regd) - -#define pmullw_m2r(var,reg) mmx_m2r (pmullw, var, reg) -#define pmullw_r2r(regs,regd) mmx_r2r (pmullw, regs, regd) - -#define por_m2r(var,reg) mmx_m2r (por, var, reg) -#define por_r2r(regs,regd) mmx_r2r (por, regs, regd) - -#define pslld_i2r(imm,reg) mmx_i2r (pslld, imm, reg) -#define pslld_m2r(var,reg) mmx_m2r (pslld, var, reg) -#define pslld_r2r(regs,regd) mmx_r2r (pslld, regs, regd) -#define psllq_i2r(imm,reg) mmx_i2r (psllq, imm, reg) -#define psllq_m2r(var,reg) mmx_m2r (psllq, var, reg) -#define psllq_r2r(regs,regd) mmx_r2r (psllq, regs, regd) -#define psllw_i2r(imm,reg) mmx_i2r (psllw, imm, reg) -#define psllw_m2r(var,reg) mmx_m2r (psllw, var, reg) -#define psllw_r2r(regs,regd) mmx_r2r (psllw, regs, regd) - -#define psrad_i2r(imm,reg) mmx_i2r (psrad, imm, reg) -#define psrad_m2r(var,reg) mmx_m2r (psrad, var, reg) -#define psrad_r2r(regs,regd) mmx_r2r (psrad, regs, regd) -#define psraw_i2r(imm,reg) mmx_i2r (psraw, imm, reg) -#define psraw_m2r(var,reg) mmx_m2r (psraw, var, reg) -#define psraw_r2r(regs,regd) mmx_r2r (psraw, regs, regd) - -#define psrld_i2r(imm,reg) mmx_i2r (psrld, imm, reg) -#define psrld_m2r(var,reg) mmx_m2r (psrld, var, reg) -#define psrld_r2r(regs,regd) mmx_r2r (psrld, regs, regd) -#define psrlq_i2r(imm,reg) mmx_i2r (psrlq, imm, reg) -#define psrlq_m2r(var,reg) mmx_m2r (psrlq, var, reg) -#define psrlq_r2r(regs,regd) mmx_r2r (psrlq, regs, regd) -#define psrlw_i2r(imm,reg) mmx_i2r (psrlw, imm, reg) -#define psrlw_m2r(var,reg) mmx_m2r (psrlw, var, reg) -#define psrlw_r2r(regs,regd) mmx_r2r (psrlw, regs, regd) - -#define psubb_m2r(var,reg) mmx_m2r (psubb, var, reg) -#define psubb_r2r(regs,regd) mmx_r2r (psubb, regs, regd) -#define psubd_m2r(var,reg) mmx_m2r (psubd, var, reg) -#define psubd_r2r(regs,regd) mmx_r2r (psubd, regs, regd) -#define psubw_m2r(var,reg) mmx_m2r (psubw, var, reg) -#define psubw_r2r(regs,regd) mmx_r2r (psubw, regs, regd) - -#define psubsb_m2r(var,reg) mmx_m2r (psubsb, var, reg) -#define psubsb_r2r(regs,regd) mmx_r2r (psubsb, regs, regd) -#define psubsw_m2r(var,reg) mmx_m2r (psubsw, var, reg) -#define psubsw_r2r(regs,regd) mmx_r2r (psubsw, regs, regd) - -#define psubusb_m2r(var,reg) mmx_m2r (psubusb, var, reg) -#define psubusb_r2r(regs,regd) mmx_r2r (psubusb, regs, regd) -#define psubusw_m2r(var,reg) mmx_m2r (psubusw, var, reg) -#define psubusw_r2r(regs,regd) mmx_r2r (psubusw, regs, regd) - -#define punpckhbw_m2r(var,reg) mmx_m2r (punpckhbw, var, reg) -#define punpckhbw_r2r(regs,regd) mmx_r2r (punpckhbw, regs, regd) -#define punpckhdq_m2r(var,reg) mmx_m2r (punpckhdq, var, reg) -#define punpckhdq_r2r(regs,regd) mmx_r2r (punpckhdq, regs, regd) -#define punpckhwd_m2r(var,reg) mmx_m2r (punpckhwd, var, reg) -#define punpckhwd_r2r(regs,regd) mmx_r2r (punpckhwd, regs, regd) - -#define punpcklbw_m2r(var,reg) mmx_m2r (punpcklbw, var, reg) -#define punpcklbw_r2r(regs,regd) mmx_r2r (punpcklbw, regs, regd) -#define punpckldq_m2r(var,reg) mmx_m2r (punpckldq, var, reg) -#define punpckldq_r2r(regs,regd) mmx_r2r (punpckldq, regs, regd) -#define punpcklwd_m2r(var,reg) mmx_m2r (punpcklwd, var, reg) -#define punpcklwd_r2r(regs,regd) mmx_r2r (punpcklwd, regs, regd) - -#define pxor_m2r(var,reg) mmx_m2r (pxor, var, reg) -#define pxor_r2r(regs,regd) mmx_r2r (pxor, regs, regd) - - -/* 3DNOW extensions */ - -#define pavgusb_m2r(var,reg) mmx_m2r (pavgusb, var, reg) -#define pavgusb_r2r(regs,regd) mmx_r2r (pavgusb, regs, regd) - - -/* AMD MMX extensions - also available in intel SSE */ - - -#define mmx_m2ri(op,mem,reg,imm) \ - __asm__ __volatile__ (#op " %1, %0, %%" #reg \ - : /* nothing */ \ - : "X" (mem), "X" (imm)) -#define mmx_r2ri(op,regs,regd,imm) \ - __asm__ __volatile__ (#op " %0, %%" #regs ", %%" #regd \ - : /* nothing */ \ - : "X" (imm) ) - -#define mmx_fetch(mem,hint) \ - __asm__ __volatile__ ("prefetch" #hint " %0" \ - : /* nothing */ \ - : "X" (mem)) - - -#define maskmovq(regs,maskreg) mmx_r2ri (maskmovq, regs, maskreg) - -#define movntq_r2m(mmreg,var) mmx_r2m (movntq, mmreg, var) - -#define pavgb_m2r(var,reg) mmx_m2r (pavgb, var, reg) -#define pavgb_r2r(regs,regd) mmx_r2r (pavgb, regs, regd) -#define pavgw_m2r(var,reg) mmx_m2r (pavgw, var, reg) -#define pavgw_r2r(regs,regd) mmx_r2r (pavgw, regs, regd) - -#define pextrw_r2r(mmreg,reg,imm) mmx_r2ri (pextrw, mmreg, reg, imm) - -#define pinsrw_r2r(reg,mmreg,imm) mmx_r2ri (pinsrw, reg, mmreg, imm) - -#define pmaxsw_m2r(var,reg) mmx_m2r (pmaxsw, var, reg) -#define pmaxsw_r2r(regs,regd) mmx_r2r (pmaxsw, regs, regd) - -#define pmaxub_m2r(var,reg) mmx_m2r (pmaxub, var, reg) -#define pmaxub_r2r(regs,regd) mmx_r2r (pmaxub, regs, regd) - -#define pminsw_m2r(var,reg) mmx_m2r (pminsw, var, reg) -#define pminsw_r2r(regs,regd) mmx_r2r (pminsw, regs, regd) - -#define pminub_m2r(var,reg) mmx_m2r (pminub, var, reg) -#define pminub_r2r(regs,regd) mmx_r2r (pminub, regs, regd) - -#define pmovmskb(mmreg,reg) \ - __asm__ __volatile__ ("movmskps %" #mmreg ", %" #reg) - -#define pmulhuw_m2r(var,reg) mmx_m2r (pmulhuw, var, reg) -#define pmulhuw_r2r(regs,regd) mmx_r2r (pmulhuw, regs, regd) - -#define prefetcht0(mem) mmx_fetch (mem, t0) -#define prefetcht1(mem) mmx_fetch (mem, t1) -#define prefetcht2(mem) mmx_fetch (mem, t2) -#define prefetchnta(mem) mmx_fetch (mem, nta) - -#define psadbw_m2r(var,reg) mmx_m2r (psadbw, var, reg) -#define psadbw_r2r(regs,regd) mmx_r2r (psadbw, regs, regd) - -#define pshufw_m2r(var,reg,imm) mmx_m2ri(pshufw, var, reg, imm) -#define pshufw_r2r(regs,regd,imm) mmx_r2ri(pshufw, regs, regd, imm) - -#define sfence() __asm__ __volatile__ ("sfence\n\t") - -typedef union { - float sf[4]; /* Single-precision (32-bit) value */ -} ATTR_ALIGN(16) sse_t; /* On a 16 byte (128-bit) boundary */ - - -#define sse_i2r(op, imm, reg) \ - __asm__ __volatile__ (#op " %0, %%" #reg \ - : /* nothing */ \ - : "X" (imm) ) - -#define sse_m2r(op, mem, reg) \ - __asm__ __volatile__ (#op " %0, %%" #reg \ - : /* nothing */ \ - : "X" (mem)) - -#define sse_r2m(op, reg, mem) \ - __asm__ __volatile__ (#op " %%" #reg ", %0" \ - : "=X" (mem) \ - : /* nothing */ ) - -#define sse_r2r(op, regs, regd) \ - __asm__ __volatile__ (#op " %" #regs ", %" #regd) - -#define sse_r2ri(op, regs, regd, imm) \ - __asm__ __volatile__ (#op " %0, %%" #regs ", %%" #regd \ - : /* nothing */ \ - : "X" (imm) ) - -#define sse_m2ri(op, mem, reg, subop) \ - __asm__ __volatile__ (#op " %0, %%" #reg ", " #subop \ - : /* nothing */ \ - : "X" (mem)) - - -#define movaps_m2r(var, reg) sse_m2r(movaps, var, reg) -#define movaps_r2m(reg, var) sse_r2m(movaps, reg, var) -#define movaps_r2r(regs, regd) sse_r2r(movaps, regs, regd) - -#define movntps_r2m(xmmreg, var) sse_r2m(movntps, xmmreg, var) - -#define movups_m2r(var, reg) sse_m2r(movups, var, reg) -#define movups_r2m(reg, var) sse_r2m(movups, reg, var) -#define movups_r2r(regs, regd) sse_r2r(movups, regs, regd) - -#define movhlps_r2r(regs, regd) sse_r2r(movhlps, regs, regd) - -#define movlhps_r2r(regs, regd) sse_r2r(movlhps, regs, regd) - -#define movhps_m2r(var, reg) sse_m2r(movhps, var, reg) -#define movhps_r2m(reg, var) sse_r2m(movhps, reg, var) - -#define movlps_m2r(var, reg) sse_m2r(movlps, var, reg) -#define movlps_r2m(reg, var) sse_r2m(movlps, reg, var) - -#define movss_m2r(var, reg) sse_m2r(movss, var, reg) -#define movss_r2m(reg, var) sse_r2m(movss, reg, var) -#define movss_r2r(regs, regd) sse_r2r(movss, regs, regd) - -#define shufps_m2r(var, reg, index) sse_m2ri(shufps, var, reg, index) -#define shufps_r2r(regs, regd, index) sse_r2ri(shufps, regs, regd, index) - -#define cvtpi2ps_m2r(var, xmmreg) sse_m2r(cvtpi2ps, var, xmmreg) -#define cvtpi2ps_r2r(mmreg, xmmreg) sse_r2r(cvtpi2ps, mmreg, xmmreg) - -#define cvtps2pi_m2r(var, mmreg) sse_m2r(cvtps2pi, var, mmreg) -#define cvtps2pi_r2r(xmmreg, mmreg) sse_r2r(cvtps2pi, mmreg, xmmreg) - -#define cvttps2pi_m2r(var, mmreg) sse_m2r(cvttps2pi, var, mmreg) -#define cvttps2pi_r2r(xmmreg, mmreg) sse_r2r(cvttps2pi, mmreg, xmmreg) - -#define cvtsi2ss_m2r(var, xmmreg) sse_m2r(cvtsi2ss, var, xmmreg) -#define cvtsi2ss_r2r(reg, xmmreg) sse_r2r(cvtsi2ss, reg, xmmreg) - -#define cvtss2si_m2r(var, reg) sse_m2r(cvtss2si, var, reg) -#define cvtss2si_r2r(xmmreg, reg) sse_r2r(cvtss2si, xmmreg, reg) - -#define cvttss2si_m2r(var, reg) sse_m2r(cvtss2si, var, reg) -#define cvttss2si_r2r(xmmreg, reg) sse_r2r(cvtss2si, xmmreg, reg) - -#define movmskps(xmmreg, reg) \ - __asm__ __volatile__ ("movmskps %" #xmmreg ", %" #reg) - -#define addps_m2r(var, reg) sse_m2r(addps, var, reg) -#define addps_r2r(regs, regd) sse_r2r(addps, regs, regd) - -#define addss_m2r(var, reg) sse_m2r(addss, var, reg) -#define addss_r2r(regs, regd) sse_r2r(addss, regs, regd) - -#define subps_m2r(var, reg) sse_m2r(subps, var, reg) -#define subps_r2r(regs, regd) sse_r2r(subps, regs, regd) - -#define subss_m2r(var, reg) sse_m2r(subss, var, reg) -#define subss_r2r(regs, regd) sse_r2r(subss, regs, regd) - -#define mulps_m2r(var, reg) sse_m2r(mulps, var, reg) -#define mulps_r2r(regs, regd) sse_r2r(mulps, regs, regd) - -#define mulss_m2r(var, reg) sse_m2r(mulss, var, reg) -#define mulss_r2r(regs, regd) sse_r2r(mulss, regs, regd) - -#define divps_m2r(var, reg) sse_m2r(divps, var, reg) -#define divps_r2r(regs, regd) sse_r2r(divps, regs, regd) - -#define divss_m2r(var, reg) sse_m2r(divss, var, reg) -#define divss_r2r(regs, regd) sse_r2r(divss, regs, regd) - -#define rcpps_m2r(var, reg) sse_m2r(rcpps, var, reg) -#define rcpps_r2r(regs, regd) sse_r2r(rcpps, regs, regd) - -#define rcpss_m2r(var, reg) sse_m2r(rcpss, var, reg) -#define rcpss_r2r(regs, regd) sse_r2r(rcpss, regs, regd) - -#define rsqrtps_m2r(var, reg) sse_m2r(rsqrtps, var, reg) -#define rsqrtps_r2r(regs, regd) sse_r2r(rsqrtps, regs, regd) - -#define rsqrtss_m2r(var, reg) sse_m2r(rsqrtss, var, reg) -#define rsqrtss_r2r(regs, regd) sse_r2r(rsqrtss, regs, regd) - -#define sqrtps_m2r(var, reg) sse_m2r(sqrtps, var, reg) -#define sqrtps_r2r(regs, regd) sse_r2r(sqrtps, regs, regd) - -#define sqrtss_m2r(var, reg) sse_m2r(sqrtss, var, reg) -#define sqrtss_r2r(regs, regd) sse_r2r(sqrtss, regs, regd) - -#define andps_m2r(var, reg) sse_m2r(andps, var, reg) -#define andps_r2r(regs, regd) sse_r2r(andps, regs, regd) - -#define andnps_m2r(var, reg) sse_m2r(andnps, var, reg) -#define andnps_r2r(regs, regd) sse_r2r(andnps, regs, regd) - -#define orps_m2r(var, reg) sse_m2r(orps, var, reg) -#define orps_r2r(regs, regd) sse_r2r(orps, regs, regd) - -#define xorps_m2r(var, reg) sse_m2r(xorps, var, reg) -#define xorps_r2r(regs, regd) sse_r2r(xorps, regs, regd) - -#define maxps_m2r(var, reg) sse_m2r(maxps, var, reg) -#define maxps_r2r(regs, regd) sse_r2r(maxps, regs, regd) - -#define maxss_m2r(var, reg) sse_m2r(maxss, var, reg) -#define maxss_r2r(regs, regd) sse_r2r(maxss, regs, regd) - -#define minps_m2r(var, reg) sse_m2r(minps, var, reg) -#define minps_r2r(regs, regd) sse_r2r(minps, regs, regd) - -#define minss_m2r(var, reg) sse_m2r(minss, var, reg) -#define minss_r2r(regs, regd) sse_r2r(minss, regs, regd) - -#define cmpps_m2r(var, reg, op) sse_m2ri(cmpps, var, reg, op) -#define cmpps_r2r(regs, regd, op) sse_r2ri(cmpps, regs, regd, op) - -#define cmpeqps_m2r(var, reg) sse_m2ri(cmpps, var, reg, 0) -#define cmpeqps_r2r(regs, regd) sse_r2ri(cmpps, regs, regd, 0) - -#define cmpltps_m2r(var, reg) sse_m2ri(cmpps, var, reg, 1) -#define cmpltps_r2r(regs, regd) sse_r2ri(cmpps, regs, regd, 1) - -#define cmpleps_m2r(var, reg) sse_m2ri(cmpps, var, reg, 2) -#define cmpleps_r2r(regs, regd) sse_r2ri(cmpps, regs, regd, 2) - -#define cmpunordps_m2r(var, reg) sse_m2ri(cmpps, var, reg, 3) -#define cmpunordps_r2r(regs, regd) sse_r2ri(cmpps, regs, regd, 3) - -#define cmpneqps_m2r(var, reg) sse_m2ri(cmpps, var, reg, 4) -#define cmpneqps_r2r(regs, regd) sse_r2ri(cmpps, regs, regd, 4) - -#define cmpnltps_m2r(var, reg) sse_m2ri(cmpps, var, reg, 5) -#define cmpnltps_r2r(regs, regd) sse_r2ri(cmpps, regs, regd, 5) - -#define cmpnleps_m2r(var, reg) sse_m2ri(cmpps, var, reg, 6) -#define cmpnleps_r2r(regs, regd) sse_r2ri(cmpps, regs, regd, 6) - -#define cmpordps_m2r(var, reg) sse_m2ri(cmpps, var, reg, 7) -#define cmpordps_r2r(regs, regd) sse_r2ri(cmpps, regs, regd, 7) - -#define cmpss_m2r(var, reg, op) sse_m2ri(cmpss, var, reg, op) -#define cmpss_r2r(regs, regd, op) sse_r2ri(cmpss, regs, regd, op) - -#define cmpeqss_m2r(var, reg) sse_m2ri(cmpss, var, reg, 0) -#define cmpeqss_r2r(regs, regd) sse_r2ri(cmpss, regs, regd, 0) - -#define cmpltss_m2r(var, reg) sse_m2ri(cmpss, var, reg, 1) -#define cmpltss_r2r(regs, regd) sse_r2ri(cmpss, regs, regd, 1) - -#define cmpless_m2r(var, reg) sse_m2ri(cmpss, var, reg, 2) -#define cmpless_r2r(regs, regd) sse_r2ri(cmpss, regs, regd, 2) - -#define cmpunordss_m2r(var, reg) sse_m2ri(cmpss, var, reg, 3) -#define cmpunordss_r2r(regs, regd) sse_r2ri(cmpss, regs, regd, 3) - -#define cmpneqss_m2r(var, reg) sse_m2ri(cmpss, var, reg, 4) -#define cmpneqss_r2r(regs, regd) sse_r2ri(cmpss, regs, regd, 4) - -#define cmpnltss_m2r(var, reg) sse_m2ri(cmpss, var, reg, 5) -#define cmpnltss_r2r(regs, regd) sse_r2ri(cmpss, regs, regd, 5) - -#define cmpnless_m2r(var, reg) sse_m2ri(cmpss, var, reg, 6) -#define cmpnless_r2r(regs, regd) sse_r2ri(cmpss, regs, regd, 6) - -#define cmpordss_m2r(var, reg) sse_m2ri(cmpss, var, reg, 7) -#define cmpordss_r2r(regs, regd) sse_r2ri(cmpss, regs, regd, 7) - -#define comiss_m2r(var, reg) sse_m2r(comiss, var, reg) -#define comiss_r2r(regs, regd) sse_r2r(comiss, regs, regd) - -#define ucomiss_m2r(var, reg) sse_m2r(ucomiss, var, reg) -#define ucomiss_r2r(regs, regd) sse_r2r(ucomiss, regs, regd) - -#define unpcklps_m2r(var, reg) sse_m2r(unpcklps, var, reg) -#define unpcklps_r2r(regs, regd) sse_r2r(unpcklps, regs, regd) - -#define unpckhps_m2r(var, reg) sse_m2r(unpckhps, var, reg) -#define unpckhps_r2r(regs, regd) sse_r2r(unpckhps, regs, regd) - -#define fxrstor(mem) \ - __asm__ __volatile__ ("fxrstor %0" \ - : /* nothing */ \ - : "X" (mem)) - -#define fxsave(mem) \ - __asm__ __volatile__ ("fxsave %0" \ - : /* nothing */ \ - : "X" (mem)) - -#define stmxcsr(mem) \ - __asm__ __volatile__ ("stmxcsr %0" \ - : /* nothing */ \ - : "X" (mem)) - -#define ldmxcsr(mem) \ - __asm__ __volatile__ ("ldmxcsr %0" \ - : /* nothing */ \ - : "X" (mem)) -#endif /*ARCH_X86 */ - - - /* Optimized/fast memcpy */ - -extern void *(* xine_fast_memcpy)(void *to, const void *from, size_t len) XINE_PROTECTED; - -#ifdef HAVE_XINE_INTERNAL_H -/* Benchmark available memcpy methods */ -void xine_probe_fast_memcpy(xine_t *xine) XINE_PROTECTED; -#endif - - -/* - * Debug stuff - */ -/* - * profiling (unworkable in non DEBUG isn't defined) - */ -void xine_profiler_init (void) XINE_PROTECTED; -int xine_profiler_allocate_slot (const char *label) XINE_PROTECTED; -void xine_profiler_start_count (int id) XINE_PROTECTED; -void xine_profiler_stop_count (int id) XINE_PROTECTED; -void xine_profiler_print_results (void) XINE_PROTECTED; - -/* - * Allocate and clean memory size_t 'size', then return the pointer - * to the allocated memory. - */ -void *xine_xmalloc(size_t size) XINE_MALLOC XINE_PROTECTED; - -void *xine_xcalloc(size_t nmemb, size_t size) XINE_MALLOC XINE_PROTECTED; - -/* - * Same as above, but memory is aligned to 'alignement'. - * **base is used to return pointer to un-aligned memory, use - * this to free the mem chunk - */ -void *xine_xmalloc_aligned(size_t alignment, size_t size, void **base) XINE_PROTECTED; - -/* - * Get user home directory. - */ -const char *xine_get_homedir(void) XINE_PROTECTED; - -#if defined(WIN32) || defined(__CYGWIN__) -/* - * Get other xine directories. - */ -const char *xine_get_plugindir(void) XINE_PROTECTED; -const char *xine_get_fontdir(void) XINE_PROTECTED; -const char *xine_get_localedir(void) XINE_PROTECTED; -#endif - -/* - * Clean a string (remove spaces and '=' at the begin, - * and '\n', '\r' and spaces at the end. - */ -char *xine_chomp (char *str) XINE_PROTECTED; - -/* - * A thread-safe usecond sleep - */ -void xine_usec_sleep(unsigned usec) XINE_PROTECTED; - -/* compatibility macros */ -#define xine_strpbrk(S, ACCEPT) strpbrk((S), (ACCEPT)) -#define xine_strsep(STRINGP, DELIM) strsep((STRINGP), (DELIM)) -#define xine_setenv(NAME, VAL, XX) setenv((NAME), (VAL), (XX)) - -/* - * Color Conversion Utility Functions - * The following data structures and functions facilitate the conversion - * of RGB images to packed YUV (YUY2) images. There are also functions to - * convert from YUV9 -> YV12. All of the meaty details are written in - * color.c. - */ - -typedef struct yuv_planes_s { - - unsigned char *y; - unsigned char *u; - unsigned char *v; - unsigned int row_width; /* frame width */ - unsigned int row_count; /* frame height */ - -} yuv_planes_t; - -void init_yuv_conversion(void) XINE_PROTECTED; -void init_yuv_planes(yuv_planes_t *yuv_planes, int width, int height) XINE_PROTECTED; -void free_yuv_planes(yuv_planes_t *yuv_planes) XINE_PROTECTED; - -extern void (*yuv444_to_yuy2) - (const yuv_planes_t *yuv_planes, unsigned char *yuy2_map, int pitch) XINE_PROTECTED; -extern void (*yuv9_to_yv12) - (const unsigned char *y_src, int y_src_pitch, unsigned char *y_dest, int y_dest_pitch, - const unsigned char *u_src, int u_src_pitch, unsigned char *u_dest, int u_dest_pitch, - const unsigned char *v_src, int v_src_pitch, unsigned char *v_dest, int v_dest_pitch, - int width, int height) XINE_PROTECTED; -extern void (*yuv411_to_yv12) - (const unsigned char *y_src, int y_src_pitch, unsigned char *y_dest, int y_dest_pitch, - const unsigned char *u_src, int u_src_pitch, unsigned char *u_dest, int u_dest_pitch, - const unsigned char *v_src, int v_src_pitch, unsigned char *v_dest, int v_dest_pitch, - int width, int height) XINE_PROTECTED; -extern void (*yv12_to_yuy2) - (const unsigned char *y_src, int y_src_pitch, - const unsigned char *u_src, int u_src_pitch, - const unsigned char *v_src, int v_src_pitch, - unsigned char *yuy2_map, int yuy2_pitch, - int width, int height, int progressive) XINE_PROTECTED; -extern void (*yuy2_to_yv12) - (const unsigned char *yuy2_map, int yuy2_pitch, - unsigned char *y_dst, int y_dst_pitch, - unsigned char *u_dst, int u_dst_pitch, - unsigned char *v_dst, int v_dst_pitch, - int width, int height) XINE_PROTECTED; - -#define SCALEFACTOR 65536 -#define CENTERSAMPLE 128 - -#define COMPUTE_Y(r, g, b) \ - (unsigned char) \ - ((y_r_table[r] + y_g_table[g] + y_b_table[b]) / SCALEFACTOR) -#define COMPUTE_U(r, g, b) \ - (unsigned char) \ - ((u_r_table[r] + u_g_table[g] + u_b_table[b]) / SCALEFACTOR + CENTERSAMPLE) -#define COMPUTE_V(r, g, b) \ - (unsigned char) \ - ((v_r_table[r] + v_g_table[g] + v_b_table[b]) / SCALEFACTOR + CENTERSAMPLE) - -#define UNPACK_BGR15(packed_pixel, r, g, b) \ - b = (packed_pixel & 0x7C00) >> 7; \ - g = (packed_pixel & 0x03E0) >> 2; \ - r = (packed_pixel & 0x001F) << 3; - -#define UNPACK_BGR16(packed_pixel, r, g, b) \ - b = (packed_pixel & 0xF800) >> 8; \ - g = (packed_pixel & 0x07E0) >> 3; \ - r = (packed_pixel & 0x001F) << 3; - -#define UNPACK_RGB15(packed_pixel, r, g, b) \ - r = (packed_pixel & 0x7C00) >> 7; \ - g = (packed_pixel & 0x03E0) >> 2; \ - b = (packed_pixel & 0x001F) << 3; - -#define UNPACK_RGB16(packed_pixel, r, g, b) \ - r = (packed_pixel & 0xF800) >> 8; \ - g = (packed_pixel & 0x07E0) >> 3; \ - b = (packed_pixel & 0x001F) << 3; - -extern int y_r_table[256] XINE_PROTECTED; -extern int y_g_table[256] XINE_PROTECTED; -extern int y_b_table[256] XINE_PROTECTED; - -extern int u_r_table[256] XINE_PROTECTED; -extern int u_g_table[256] XINE_PROTECTED; -extern int u_b_table[256] XINE_PROTECTED; - -extern int v_r_table[256] XINE_PROTECTED; -extern int v_g_table[256] XINE_PROTECTED; -extern int v_b_table[256] XINE_PROTECTED; - -/* frame copying functions */ -extern void yv12_to_yv12 - (const unsigned char *y_src, int y_src_pitch, unsigned char *y_dst, int y_dst_pitch, - const unsigned char *u_src, int u_src_pitch, unsigned char *u_dst, int u_dst_pitch, - const unsigned char *v_src, int v_src_pitch, unsigned char *v_dst, int v_dst_pitch, - int width, int height) XINE_PROTECTED; -extern void yuy2_to_yuy2 - (const unsigned char *src, int src_pitch, - unsigned char *dst, int dst_pitch, - int width, int height) XINE_PROTECTED; - -/* print a hexdump of the given data */ -void xine_hexdump (const void *buf, int length) XINE_PROTECTED; - -/* - * Optimization macros for conditions - * Taken from the FIASCO L4 microkernel sources - */ -#if !defined(__GNUC__) || __GNUC__ < 3 -# define EXPECT_TRUE(x) (x) -# define EXPECT_FALSE(x) (x) -#else -# define EXPECT_TRUE(x) __builtin_expect((x),1) -# define EXPECT_FALSE(x) __builtin_expect((x),0) -#endif - -#ifdef NDEBUG -#define _x_assert(exp) \ - do { \ - if (!(exp)) \ - fprintf(stderr, "assert: %s:%d: %s: Assertion `%s' failed.\n", \ - __FILE__, __LINE__, __XINE_FUNCTION__, #exp); \ - } while(0) -#else -#define _x_assert(exp) \ - do { \ - if (!(exp)) { \ - fprintf(stderr, "assert: %s:%d: %s: Assertion `%s' failed.\n", \ - __FILE__, __LINE__, __XINE_FUNCTION__, #exp); \ - abort(); \ - } \ - } while(0) -#endif - -#define _x_abort() \ - do { \ - fprintf(stderr, "abort: %s:%d: %s: Aborting.\n", \ - __FILE__, __LINE__, __XINE_FUNCTION__); \ - abort(); \ - } while(0) - - -/****** logging with xine **********************************/ - -#ifndef LOG_MODULE - #define LOG_MODULE __FILE__ -#endif /* LOG_MODULE */ - -#define LOG_MODULE_STRING printf("%s: ", LOG_MODULE ); - -#ifdef LOG_VERBOSE - #define LONG_LOG_MODULE_STRING \ - printf("%s: (%s:%d) ", LOG_MODULE, __XINE_FUNCTION__, __LINE__ ); -#else - #define LONG_LOG_MODULE_STRING LOG_MODULE_STRING -#endif /* LOG_VERBOSE */ - -#ifdef LOG - #ifdef __GNUC__ - #define lprintf(fmt, args...) \ - do { \ - LONG_LOG_MODULE_STRING \ - printf(fmt, ##args); \ - fflush(stdout); \ - } while(0) - #else /* __GNUC__ */ - #ifdef _MSC_VER - #define lprintf(fmtargs) \ - do { \ - LONG_LOG_MODULE_STRING \ - printf("%s", fmtargs); \ - fflush(stdout); \ - } while(0) - #else /* _MSC_VER */ - #define lprintf(...) \ - do { \ - LONG_LOG_MODULE_STRING \ - printf(__VA_ARGS__); \ - fflush(stdout); \ - } while(0) - #endif /* _MSC_VER */ - #endif /* __GNUC__ */ -#else /* LOG */ - #ifdef __GNUC__ - #define lprintf(fmt, args...) do {} while(0) - #else - #ifdef _MSC_VER -void __inline lprintf(const char * fmt, ...) {} - #else - #define lprintf(...) do {} while(0) - #endif /* _MSC_VER */ - #endif /* __GNUC__ */ -#endif /* LOG */ - -#ifdef __GNUC__ - #define llprintf(cat, fmt, args...) \ - do{ \ - if(cat){ \ - LONG_LOG_MODULE_STRING \ - printf( fmt, ##args ); \ - } \ - }while(0) -#else -#ifdef _MSC_VER - #define llprintf(cat, fmtargs) \ - do{ \ - if(cat){ \ - LONG_LOG_MODULE_STRING \ - printf( "%s", fmtargs ); \ - } \ - }while(0) -#else - #define llprintf(cat, ...) \ - do{ \ - if(cat){ \ - LONG_LOG_MODULE_STRING \ - printf( __VA_ARGS__ ); \ - } \ - }while(0) -#endif /* _MSC_VER */ -#endif /* __GNUC__ */ - -#ifdef __GNUC__ - #define xprintf(xine, verbose, fmt, args...) \ - do { \ - if((xine) && (xine)->verbosity >= verbose){ \ - xine_log(xine, XINE_LOG_TRACE, fmt, ##args); \ - } \ - } while(0) -#else -#ifdef _MSC_VER -void xine_xprintf(xine_t *xine, int verbose, const char *fmt, ...); - #define xprintf xine_xprintf -#else - #define xprintf(xine, verbose, ...) \ - do { \ - if((xine) && (xine)->verbosity >= verbose){ \ - xine_log(xine, XINE_LOG_TRACE, __VA_ARGS__); \ - } \ - } while(0) -#endif /* _MSC_VER */ -#endif /* __GNUC__ */ - -/* time measuring macros for profiling tasks */ - -#ifdef DEBUG -# define XINE_PROFILE(function) \ - do { \ - struct timeval current_time; \ - double dtime; \ - gettimeofday(¤t_time, NULL); \ - dtime = -(current_time.tv_sec + (current_time.tv_usec / 1000000.0)); \ - function; \ - gettimeofday(¤t_time, NULL); \ - dtime += current_time.tv_sec + (current_time.tv_usec / 1000000.0); \ - printf("%s: (%s:%d) took %lf seconds\n", \ - LOG_MODULE, __XINE_FUNCTION__, __LINE__, dtime); \ - } while(0) -# define XINE_PROFILE_ACCUMULATE(function) \ - do { \ - struct timeval current_time; \ - static double dtime = 0; \ - gettimeofday(¤t_time, NULL); \ - dtime -= current_time.tv_sec + (current_time.tv_usec / 1000000.0); \ - function; \ - gettimeofday(¤t_time, NULL); \ - dtime += current_time.tv_sec + (current_time.tv_usec / 1000000.0); \ - printf("%s: (%s:%d) took %lf seconds\n", \ - LOG_MODULE, __XINE_FUNCTION__, __LINE__, dtime); \ - } while(0) -#else -# define XINE_PROFILE(function) function -# define XINE_PROFILE_ACCUMULATE(function) function -#endif /* DEBUG */ - -/** - * get encoding of current locale - */ -char *xine_get_system_encoding(void) XINE_PROTECTED; - -/* - * guess default encoding for the subtitles - */ -const char *xine_guess_spu_encoding(void) XINE_PROTECTED; - -/* - * use the best clock reference (API compatible with gettimeofday) - * note: it will be a monotonic clock, if available. - */ -int xine_monotonic_clock(struct timeval *tv, struct timezone *tz) XINE_PROTECTED; - -/** - * CRC functions - */ -uint32_t _x_compute_crc32 (const uint8_t * data, int32_t length, uint32_t crc32) XINE_PROTECTED; - -/* don't harm following code */ -#ifdef extern -# undef extern -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/xine-utils/xmllexer.h b/src/xine-utils/xmllexer.h deleted file mode 100644 index 10bcc8676..000000000 --- a/src/xine-utils/xmllexer.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2002-2003,2007 the xine project - * - * This file is part of xine, a free video player. - * - * The xine-lib XML parser is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * The xine-lib XML parser is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with the Gnome Library; see the file COPYING.LIB. If not, - * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110, USA - */ - -/* xml lexer */ -#ifndef XML_LEXER_H -#define XML_LEXER_H - -#ifndef XINE_PROTECTED -#define XINE_PROTECTED -#endif - -/* public constants */ -#define T_ERROR -1 /* lexer error */ -#define T_EOF 0 /* end of file */ -#define T_EOL 1 /* end of line */ -#define T_SEPAR 2 /* separator ' ' '/t' '\n' '\r' */ -#define T_M_START_1 3 /* markup start < */ -#define T_M_START_2 4 /* markup start */ -#define T_M_STOP_2 6 /* markup stop /> */ -#define T_EQUAL 7 /* = */ -#define T_QUOTE 8 /* \" or \' */ -#define T_STRING 9 /* "string" */ -#define T_IDENT 10 /* identifier */ -#define T_DATA 11 /* data */ -#define T_C_START 12 /* */ -#define T_TI_START 14 /* */ -#define T_DOCTYPE_START 16 /* */ -#define T_CDATA_START 18 /* */ - - -/* public functions */ -void lexer_init(const char * buf, int size) XINE_PROTECTED; -int lexer_get_token(char * tok, int tok_size) XINE_PROTECTED; -char *lexer_decode_entities (const char *tok) XINE_PROTECTED; - -#endif diff --git a/src/xine-utils/xmlparser.h b/src/xine-utils/xmlparser.h deleted file mode 100644 index c89cb6dd3..000000000 --- a/src/xine-utils/xmlparser.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (C) 2002-2003,2007 the xine project - * - * This file is part of xine, a free video player. - * - * The xine-lib XML parser is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * The xine-lib XML parser is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with the Gnome Library; see the file COPYING.LIB. If not, - * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110, USA - */ - -#ifndef XML_PARSER_H -#define XML_PARSER_H - -#ifndef XINE_PROTECTED -#define XINE_PROTECTED -#endif - -/* parser modes */ -#define XML_PARSER_CASE_INSENSITIVE 0 -#define XML_PARSER_CASE_SENSITIVE 1 - -/* return codes */ -#define XML_PARSER_OK 0 -#define XML_PARSER_ERROR 1 - -/* xml_parser_build_tree_with_options flag bits */ -#define XML_PARSER_RELAXED 1 -#define XML_PARSER_MULTI_TEXT 2 - -/* node name for extra text chunks */ -#define CDATA_MARKER "[CDATA]" - -/* xml property */ -typedef struct xml_property_s { - char *name; - char *value; - struct xml_property_s *next; -} xml_property_t; - -/* xml node */ -/* .data contains any text which precedes any subtree elements; - * subtree elements may also contain only text; if so, name is "[CDATA]". - * e.g. bd - * node1: .name="a" .data="b" .child=node2 .next=NULL - * node2: .name="c" .data=NULL .child=NULL .next=node3 - * node3: .name="[CDATA]" .data="d" .child=NULL .next=NULL - * Adjacent text items are merged. - */ -typedef struct xml_node_s { - char *name; - char *data; - struct xml_property_s *props; - struct xml_node_s *child; - struct xml_node_s *next; -} xml_node_t; - -void xml_parser_init(const char * buf, int size, int mode) XINE_PROTECTED; - -int xml_parser_build_tree(xml_node_t **root_node) XINE_PROTECTED; -int xml_parser_build_tree_with_options(xml_node_t **root_node, int flags) XINE_PROTECTED; - -void xml_parser_free_tree(xml_node_t *root_node) XINE_PROTECTED; - -const char *xml_parser_get_property (const xml_node_t *node, const char *name) XINE_PROTECTED; -int xml_parser_get_property_int (const xml_node_t *node, const char *name, - int def_value) XINE_PROTECTED; -int xml_parser_get_property_bool (const xml_node_t *node, const char *name, - int def_value) XINE_PROTECTED; - -/* for output: - * returns an escaped string (free() it when done) - * input must be in ASCII or UTF-8 - */ - -typedef enum { - XML_ESCAPE_NO_QUOTE, - XML_ESCAPE_SINGLE_QUOTE, - XML_ESCAPE_DOUBLE_QUOTE -} xml_escape_quote_t; -char *xml_escape_string (const char *s, xml_escape_quote_t quote_type) XINE_PROTECTED; - -/* for debugging purposes: dump read-in xml tree in a nicely - * indented fashion - */ - -void xml_parser_dump_tree (const xml_node_t *node) XINE_PROTECTED; - -#endif -- cgit v1.2.3 From 9da4e2dde0da695c240cf48390217ac97cb10c1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Wed, 19 Dec 2007 02:59:06 +0100 Subject: Update all the code to the new headers layout. --- contrib/gsm610/long_term.c | 2 +- contrib/gsm610/lpc.c | 2 +- contrib/gsm610/rpe.c | 2 +- contrib/gsm610/short_term.c | 2 +- contrib/nosefart/log.h | 2 +- include/xine.h | 4 +- include/xine/demux.h | 12 ++---- include/xine/xine_internal.h | 57 ++++++++----------------- lib/os_internal.h | 2 +- src/audio_out/audio_alsa_out.c | 8 ++-- src/audio_out/audio_coreaudio_out.c | 6 +-- src/audio_out/audio_directx2_out.c | 4 +- src/audio_out/audio_directx_out.c | 4 +- src/audio_out/audio_esd_out.c | 8 ++-- src/audio_out/audio_file_out.c | 6 +-- src/audio_out/audio_fusionsound_out.c | 6 +-- src/audio_out/audio_irixal_out.c | 8 ++-- src/audio_out/audio_jack_out.c | 6 +-- src/audio_out/audio_none_out.c | 6 +-- src/audio_out/audio_oss_out.c | 8 ++-- src/audio_out/audio_pulse_out.c | 6 +-- src/audio_out/audio_sun_out.c | 6 +-- src/combined/flac_decoder.c | 6 +-- src/combined/flac_demuxer.c | 4 +- src/combined/nsf_combined.c | 2 +- src/combined/nsf_decoder.c | 8 ++-- src/combined/nsf_demuxer.c | 8 ++-- src/combined/wavpack_combined.c | 2 +- src/combined/wavpack_decoder.c | 4 +- src/combined/wavpack_demuxer.c | 8 ++-- src/combined/xine_ogg_demuxer.c | 6 +-- src/combined/xine_speex_decoder.c | 6 +-- src/combined/xine_theora_decoder.c | 10 ++--- src/combined/xine_vorbis_decoder.c | 6 +-- src/demuxers/asfheader.c | 2 +- src/demuxers/demux_4xm.c | 8 ++-- src/demuxers/demux_aac.c | 8 ++-- src/demuxers/demux_ac3.c | 8 ++-- src/demuxers/demux_aiff.c | 8 ++-- src/demuxers/demux_asf.c | 8 ++-- src/demuxers/demux_aud.c | 8 ++-- src/demuxers/demux_avi.c | 6 +-- src/demuxers/demux_cdda.c | 8 ++-- src/demuxers/demux_dts.c | 8 ++-- src/demuxers/demux_eawve.c | 6 +-- src/demuxers/demux_elem.c | 8 ++-- src/demuxers/demux_film.c | 8 ++-- src/demuxers/demux_flac.c | 8 ++-- src/demuxers/demux_fli.c | 8 ++-- src/demuxers/demux_flv.c | 8 ++-- src/demuxers/demux_idcin.c | 8 ++-- src/demuxers/demux_iff.c | 8 ++-- src/demuxers/demux_image.c | 6 +-- src/demuxers/demux_ipmovie.c | 8 ++-- src/demuxers/demux_matroska.c | 8 ++-- src/demuxers/demux_mng.c | 6 +-- src/demuxers/demux_mod.c | 8 ++-- src/demuxers/demux_mpc.c | 8 ++-- src/demuxers/demux_mpeg.c | 6 +-- src/demuxers/demux_mpeg_block.c | 6 +-- src/demuxers/demux_mpeg_pes.c | 6 +-- src/demuxers/demux_mpgaudio.c | 8 ++-- src/demuxers/demux_nsv.c | 10 ++--- src/demuxers/demux_playlist.c | 6 +-- src/demuxers/demux_pva.c | 8 ++-- src/demuxers/demux_qt.c | 8 ++-- src/demuxers/demux_rawdv.c | 8 ++-- src/demuxers/demux_real.c | 8 ++-- src/demuxers/demux_realaudio.c | 8 ++-- src/demuxers/demux_roq.c | 8 ++-- src/demuxers/demux_shn.c | 8 ++-- src/demuxers/demux_slave.c | 8 ++-- src/demuxers/demux_smjpeg.c | 8 ++-- src/demuxers/demux_snd.c | 8 ++-- src/demuxers/demux_str.c | 8 ++-- src/demuxers/demux_ts.c | 6 +-- src/demuxers/demux_tta.c | 10 ++--- src/demuxers/demux_vmd.c | 8 ++-- src/demuxers/demux_voc.c | 8 ++-- src/demuxers/demux_vox.c | 8 ++-- src/demuxers/demux_vqa.c | 8 ++-- src/demuxers/demux_wav.c | 8 ++-- src/demuxers/demux_wc3movie.c | 8 ++-- src/demuxers/demux_yuv4mpeg2.c | 8 ++-- src/demuxers/demux_yuv_frames.c | 6 +-- src/demuxers/ebml.c | 4 +- src/demuxers/group_audio.c | 4 +- src/demuxers/group_audio.h | 2 +- src/demuxers/group_games.c | 4 +- src/demuxers/group_games.h | 2 +- src/demuxers/id3.c | 4 +- src/demuxers/id3.h | 4 +- src/demuxers/matroska.h | 6 +-- src/dxr3/dxr3.h | 2 +- src/dxr3/dxr3_decode_spu.c | 6 +-- src/dxr3/dxr3_decode_video.c | 4 +- src/dxr3/dxr3_mpeg_encoders.c | 2 +- src/dxr3/dxr3_scr.h | 2 +- src/dxr3/video_out_dxr3.c | 6 +-- src/dxr3/video_out_dxr3.h | 2 +- src/input/Makefile.am | 1 - src/input/http_helper.c | 2 +- src/input/input_cdda.c | 6 +-- src/input/input_dvb.c | 6 +-- src/input/input_dvd.c | 6 +-- src/input/input_file.c | 8 ++-- src/input/input_gnome_vfs.c | 6 +-- src/input/input_http.c | 6 +-- src/input/input_mms.c | 6 +-- src/input/input_net.c | 6 +-- src/input/input_pnm.c | 6 +-- src/input/input_pvr.c | 8 ++-- src/input/input_rtp.c | 6 +-- src/input/input_rtsp.c | 6 +-- src/input/input_smb.c | 8 ++-- src/input/input_stdin_fifo.c | 6 +-- src/input/input_v4l.c | 6 +-- src/input/input_vcd.c | 6 +-- src/input/libdvdnav/dvd_reader.c | 2 +- src/input/libreal/asmrp.c | 2 +- src/input/libreal/real.c | 4 +- src/input/libreal/rmff.c | 2 +- src/input/libreal/sdpplin.c | 2 +- src/input/librtsp/rtsp.c | 4 +- src/input/librtsp/rtsp.h | 2 +- src/input/librtsp/rtsp_session.c | 2 +- src/input/media_helper.h | 2 +- src/input/mms.c | 4 +- src/input/mms.h | 2 +- src/input/mmsh.c | 4 +- src/input/mmsh.h | 2 +- src/input/net_buf_ctrl.h | 2 +- src/input/pnm.c | 6 +-- src/input/pnm.h | 2 +- src/input/vcd/xine-extra.h | 4 +- src/input/vcd/xineplug_inp_vcd.c | 4 +- src/libffmpeg/ff_audio_decoder.c | 6 +-- src/libffmpeg/ff_dvaudio_decoder.c | 6 +-- src/libffmpeg/ff_mpeg_parser.h | 2 +- src/libffmpeg/ff_video_decoder.c | 6 +-- src/libffmpeg/ffmpeg_decoder.c | 2 +- src/libmpeg2/cpu_state.c | 2 +- src/libmpeg2/decode.c | 6 +-- src/libmpeg2/header.c | 2 +- src/libmpeg2/idct.c | 2 +- src/libmpeg2/idct_altivec.c | 2 +- src/libmpeg2/idct_mmx.c | 2 +- src/libmpeg2/libmpeg2_accel.c | 2 +- src/libmpeg2/motion_comp.c | 2 +- src/libmpeg2/motion_comp_mmx.c | 2 +- src/libmpeg2/mpeg2_internal.h | 2 +- src/libmpeg2/slice.c | 6 +-- src/libmpeg2/slice_xvmc.c | 8 ++-- src/libmpeg2/slice_xvmc_vld.c | 4 +- src/libmpeg2/xine_mpeg2_decoder.c | 6 +-- src/libmpeg2new/libmpeg2/idct_alpha.c | 2 +- src/libmpeg2new/libmpeg2/idct_altivec.c | 2 +- src/libmpeg2new/libmpeg2/motion_comp_alpha.c | 2 +- src/libmpeg2new/libmpeg2/motion_comp_altivec.c | 2 +- src/libmpeg2new/libmpeg2/motion_comp_vis.c | 2 +- src/libmpeg2new/libmpeg2/rgb.c | 2 +- src/libmpeg2new/libmpeg2/rgb_mmx.c | 2 +- src/libmpeg2new/libmpeg2/rgb_vis.c | 2 +- src/libmpeg2new/xine_mpeg2new_decoder.c | 6 +-- src/libreal/real_common.h | 2 +- src/libreal/xine_real_audio_decoder.c | 8 ++-- src/libreal/xine_real_video_decoder.c | 8 ++-- src/libspucc/cc_decoder.c | 10 ++--- src/libspucc/xine_cc_decoder.c | 6 +-- src/libspucmml/xine_cmml_decoder.c | 2 +- src/libspudec/spu.c | 6 +-- src/libspudec/spu.h | 4 +- src/libspudec/xine_spu_decoder.c | 6 +-- src/libspudvb/xine_spudvb_decoder.c | 6 +-- src/libsputext/demux_sputext.c | 6 +-- src/libsputext/xine_sputext_decoder.c | 8 ++-- src/libw32dll/qt_decoder.c | 6 +-- src/libw32dll/w32codec.c | 10 ++--- src/libw32dll/wine/registry.c | 2 +- src/libw32dll/wine/win32.c | 2 +- src/libxineadec/fooaudio.c | 8 ++-- src/libxineadec/gsm610.c | 8 ++-- src/libxineadec/xine_a52_decoder.c | 8 ++-- src/libxineadec/xine_dts_decoder.c | 8 ++-- src/libxineadec/xine_faad_decoder.c | 8 ++-- src/libxineadec/xine_lpcm_decoder.c | 6 +-- src/libxineadec/xine_mad_decoder.c | 8 ++-- src/libxineadec/xine_musepack_decoder.c | 8 ++-- src/libxinevdec/bitplane.c | 8 ++-- src/libxinevdec/foovideo.c | 8 ++-- src/libxinevdec/gdkpixbuf.c | 8 ++-- src/libxinevdec/image.c | 8 ++-- src/libxinevdec/rgb.c | 8 ++-- src/libxinevdec/yuv.c | 8 ++-- src/post/audio/audio_filters.c | 6 +-- src/post/audio/audio_filters.h | 2 +- src/post/audio/stretch.c | 8 ++-- src/post/audio/upmix.c | 6 +-- src/post/audio/upmix_mono.c | 4 +- src/post/audio/volnorm.c | 6 +-- src/post/deinterlace/deinterlace.c | 2 +- src/post/deinterlace/plugins/greedy.c | 4 +- src/post/deinterlace/plugins/greedy2frame.c | 4 +- src/post/deinterlace/plugins/kdetv_greedyh.c | 4 +- src/post/deinterlace/plugins/kdetv_tomsmocomp.c | 4 +- src/post/deinterlace/plugins/linearblend.c | 4 +- src/post/deinterlace/plugins/vfir.c | 4 +- src/post/deinterlace/speedy.c | 4 +- src/post/deinterlace/xine_plugin.c | 8 ++-- src/post/goom/goom_core.c | 2 +- src/post/goom/mmx.h | 2 +- src/post/goom/xine_goom.c | 6 +-- src/post/mosaico/mosaico.c | 4 +- src/post/mosaico/switch.c | 4 +- src/post/planar/boxblur.c | 6 +-- src/post/planar/denoise3d.c | 6 +-- src/post/planar/eq.c | 6 +-- src/post/planar/eq2.c | 6 +-- src/post/planar/expand.c | 4 +- src/post/planar/fill.c | 4 +- src/post/planar/invert.c | 4 +- src/post/planar/noise.c | 6 +-- src/post/planar/planar.c | 6 +-- src/post/planar/pp.c | 6 +-- src/post/planar/unsharp.c | 6 +-- src/post/visualizations/fftgraph.c | 6 +-- src/post/visualizations/fftscope.c | 6 +-- src/post/visualizations/fooviz.c | 6 +-- src/post/visualizations/oscope.c | 6 +-- src/post/visualizations/visualizations.c | 4 +- src/post/visualizations/visualizations.h | 2 +- src/vdr/input_vdr.c | 6 +-- src/vdr/post_vdr.c | 4 +- src/vdr/post_vdr_audio.c | 4 +- src/vdr/post_vdr_video.c | 4 +- src/video_out/macosx/XineOpenGLView.m | 6 +-- src/video_out/video_out_aa.c | 6 +-- src/video_out/video_out_caca.c | 6 +-- src/video_out/video_out_directfb.c | 8 ++-- src/video_out/video_out_directx.c | 6 +-- src/video_out/video_out_fb.c | 8 ++-- src/video_out/video_out_none.c | 8 ++-- src/video_out/video_out_opengl.c | 6 +-- src/video_out/video_out_pgx32.c | 6 +-- src/video_out/video_out_pgx64.c | 6 +-- src/video_out/video_out_sdl.c | 8 ++-- src/video_out/video_out_stk.c | 8 ++-- src/video_out/video_out_syncfb.c | 8 ++-- src/video_out/video_out_vidix.c | 8 ++-- src/video_out/video_out_xcbshm.c | 8 ++-- src/video_out/video_out_xcbxv.c | 8 ++-- src/video_out/video_out_xshm.c | 8 ++-- src/video_out/video_out_xv.c | 8 ++-- src/video_out/video_out_xvmc.c | 8 ++-- src/video_out/x11osd.c | 2 +- src/video_out/x11osd.h | 2 +- src/video_out/xcbosd.c | 2 +- src/video_out/xcbosd.h | 2 +- src/video_out/xxmc.h | 6 +-- src/video_out/yuv2rgb.c | 2 +- src/video_out/yuv2rgb_mlib.c | 4 +- src/video_out/yuv2rgb_mmx.c | 2 +- src/xine-engine/alphablend.c | 6 +-- src/xine-engine/audio_decoder.c | 4 +- src/xine-engine/audio_out.c | 10 ++--- src/xine-engine/broadcaster.c | 6 +-- src/xine-engine/buffer.c | 6 +-- src/xine-engine/buffer_types.c | 2 +- src/xine-engine/configfile.c | 6 +-- src/xine-engine/demux.c | 6 +-- src/xine-engine/events.c | 2 +- src/xine-engine/info_helper.c | 2 +- src/xine-engine/input_cache.c | 2 +- src/xine-engine/input_rip.c | 2 +- src/xine-engine/io_helper.c | 2 +- src/xine-engine/load_plugins.c | 22 +++++----- src/xine-engine/lrb.c | 2 +- src/xine-engine/lrb.h | 6 +-- src/xine-engine/metronom.c | 6 +-- src/xine-engine/osd.c | 8 ++-- src/xine-engine/post.c | 2 +- src/xine-engine/refcounter.c | 4 +- src/xine-engine/resample.c | 4 +- src/xine-engine/scratch.c | 4 +- src/xine-engine/spu.c | 4 +- src/xine-engine/video_decoder.c | 4 +- src/xine-engine/video_out.c | 8 ++-- src/xine-engine/video_overlay.c | 8 ++-- src/xine-engine/vo_scale.c | 4 +- src/xine-engine/xine.c | 30 ++++++------- src/xine-engine/xine_interface.c | 10 ++--- src/xine-utils/array.c | 4 +- src/xine-utils/color.c | 2 +- src/xine-utils/copy.c | 2 +- src/xine-utils/cpu_accel.c | 2 +- src/xine-utils/crc.c | 2 +- src/xine-utils/list.c | 4 +- src/xine-utils/memcpy.c | 2 +- src/xine-utils/monitor.c | 2 +- src/xine-utils/pool.c | 6 +-- src/xine-utils/ring_buffer.c | 8 ++-- src/xine-utils/sorted_array.c | 4 +- src/xine-utils/utils.c | 6 +-- src/xine-utils/xine_buffer.c | 2 +- src/xine-utils/xine_check.c | 2 +- src/xine-utils/xine_check.h | 6 +-- src/xine-utils/xine_mutex.c | 2 +- src/xine-utils/xmllexer.c | 4 +- src/xine-utils/xmlparser.c | 6 +-- 309 files changed, 846 insertions(+), 886 deletions(-) diff --git a/contrib/gsm610/long_term.c b/contrib/gsm610/long_term.c index 625662e1f..671d98cc1 100644 --- a/contrib/gsm610/long_term.c +++ b/contrib/gsm610/long_term.c @@ -7,7 +7,7 @@ /* $Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/long_term.c,v 1.3 2003/12/07 15:34:30 f1rmb Exp $ */ #include -#include "xineutils.h" +#include #include "private.h" diff --git a/contrib/gsm610/lpc.c b/contrib/gsm610/lpc.c index 0f51fa55f..d85f56111 100644 --- a/contrib/gsm610/lpc.c +++ b/contrib/gsm610/lpc.c @@ -7,7 +7,7 @@ /* $Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/lpc.c,v 1.3 2003/12/07 15:34:30 f1rmb Exp $ */ #include -#include "xineutils.h" +#include #include "private.h" diff --git a/contrib/gsm610/rpe.c b/contrib/gsm610/rpe.c index 67d94d30e..68d495b3b 100644 --- a/contrib/gsm610/rpe.c +++ b/contrib/gsm610/rpe.c @@ -7,7 +7,7 @@ /* $Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/rpe.c,v 1.3 2003/12/07 15:34:30 f1rmb Exp $ */ #include -#include "xineutils.h" +#include #include "private.h" #include "gsm.h" diff --git a/contrib/gsm610/short_term.c b/contrib/gsm610/short_term.c index 8222b2caa..34a9e7734 100644 --- a/contrib/gsm610/short_term.c +++ b/contrib/gsm610/short_term.c @@ -7,7 +7,7 @@ /* $Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/short_term.c,v 1.3 2003/12/07 15:34:30 f1rmb Exp $ */ #include -#include "xineutils.h" +#include #include "private.h" #include "gsm.h" diff --git a/contrib/nosefart/log.h b/contrib/nosefart/log.h index a12deff0a..da2548c80 100644 --- a/contrib/nosefart/log.h +++ b/contrib/nosefart/log.h @@ -27,7 +27,7 @@ #define _LOG_H_ #include -#include "attributes.h" +#include extern int log_init(void); extern void log_shutdown(void); diff --git a/include/xine.h b/include/xine.h index 4eaccf96c..da1d394a3 100644 --- a/include/xine.h +++ b/include/xine.h @@ -57,11 +57,11 @@ extern "C" { #ifdef XINE_COMPILE #include -#include "attributes.h" #else #include -#include #endif + +#include #include /* This enables some experimental features. These are not part of the diff --git a/include/xine/demux.h b/include/xine/demux.h index ee5ca42f0..476c80b8e 100644 --- a/include/xine/demux.h +++ b/include/xine/demux.h @@ -21,15 +21,9 @@ #ifndef HAVE_DEMUX_H #define HAVE_DEMUX_H -#ifdef XINE_COMPILE -# include "input/input_plugin.h" -# include "buffer.h" -# include "xine_internal.h" -#else -# include -# include -# include -#endif +#include +#include +#include #define DEMUXER_PLUGIN_IFACE_VERSION 27 diff --git a/include/xine/xine_internal.h b/include/xine/xine_internal.h index 13b003992..20bf6a9c8 100644 --- a/include/xine/xine_internal.h +++ b/include/xine/xine_internal.h @@ -29,45 +29,24 @@ extern "C" { * include public part of xine header */ -#ifdef XINE_COMPILE -# include "xine.h" -# include "refcounter.h" -# include "input/input_plugin.h" -# include "demuxers/demux.h" -# include "video_out.h" -# include "audio_out.h" -# include "metronom.h" -# include "osd.h" -# include "xineintl.h" -# include "plugin_catalog.h" -# include "video_decoder.h" -# include "audio_decoder.h" -# include "spu_decoder.h" -# include "scratch.h" -# include "broadcaster.h" -# include "io_helper.h" -# include "info_helper.h" -# include "alphablend.h" -#else -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define XINE_MAX_EVENT_LISTENERS 50 #define XINE_MAX_EVENT_TYPES 100 diff --git a/lib/os_internal.h b/lib/os_internal.h index f84bb1e62..873c4c3b7 100644 --- a/lib/os_internal.h +++ b/lib/os_internal.h @@ -81,7 +81,7 @@ #include #include -#include "../src/xine-utils/attributes.h" +#include #if defined(WIN32) || defined(__CYGWIN__) diff --git a/src/audio_out/audio_alsa_out.c b/src/audio_out/audio_alsa_out.c index 40dc7ffed..a6f81cb35 100644 --- a/src/audio_out/audio_alsa_out.c +++ b/src/audio_out/audio_alsa_out.c @@ -50,10 +50,10 @@ #include #include -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "audio_out.h" +#include +#include +#include +#include /* #define ALSA_LOG diff --git a/src/audio_out/audio_coreaudio_out.c b/src/audio_out/audio_coreaudio_out.c index 551810e3e..001d873fa 100644 --- a/src/audio_out/audio_coreaudio_out.c +++ b/src/audio_out/audio_coreaudio_out.c @@ -41,9 +41,9 @@ #include #include -#include "xine_internal.h" -#include "xineutils.h" -#include "audio_out.h" +#include +#include +#include #include #include diff --git a/src/audio_out/audio_directx2_out.c b/src/audio_out/audio_directx2_out.c index 9bcc52233..309edf961 100644 --- a/src/audio_out/audio_directx2_out.c +++ b/src/audio_out/audio_directx2_out.c @@ -58,8 +58,8 @@ #define LOG */ -#include "xine_internal.h" -#include "audio_out.h" +#include +#include #define AO_OUT_DIRECTX2_IFACE_VERSION 9 diff --git a/src/audio_out/audio_directx_out.c b/src/audio_out/audio_directx_out.c index c7dea4e04..5d16698b2 100644 --- a/src/audio_out/audio_directx_out.c +++ b/src/audio_out/audio_directx_out.c @@ -38,8 +38,8 @@ typedef unsigned char boolean; #define LOG */ -#include "audio_out.h" -#include "xine_internal.h" +#include +#include #define MAX_CHANNELS 6 diff --git a/src/audio_out/audio_esd_out.c b/src/audio_out/audio_esd_out.c index 9aec15c7a..81017f1ca 100644 --- a/src/audio_out/audio_esd_out.c +++ b/src/audio_out/audio_esd_out.c @@ -33,10 +33,10 @@ #include #include -#include "xine_internal.h" -#include "xineutils.h" -#include "audio_out.h" -#include "metronom.h" +#include +#include +#include +#include #define AO_OUT_ESD_IFACE_VERSION 9 diff --git a/src/audio_out/audio_file_out.c b/src/audio_out/audio_file_out.c index fda5ec7df..b75e6777b 100644 --- a/src/audio_out/audio_file_out.c +++ b/src/audio_out/audio_file_out.c @@ -31,9 +31,9 @@ #include #include -#include "xine_internal.h" -#include "xineutils.h" -#include "audio_out.h" +#include +#include +#include #include "bswap.h" #define AO_OUT_FILE_IFACE_VERSION 9 diff --git a/src/audio_out/audio_fusionsound_out.c b/src/audio_out/audio_fusionsound_out.c index ceda0a293..a79d21213 100644 --- a/src/audio_out/audio_fusionsound_out.c +++ b/src/audio_out/audio_fusionsound_out.c @@ -34,9 +34,9 @@ #define LOG_VERBOSE #include "xine.h" -#include "xine_internal.h" -#include "audio_out.h" -#include "xineutils.h" +#include +#include +#include #include diff --git a/src/audio_out/audio_irixal_out.c b/src/audio_out/audio_irixal_out.c index 1654cc1a7..e86b78e76 100644 --- a/src/audio_out/audio_irixal_out.c +++ b/src/audio_out/audio_irixal_out.c @@ -37,10 +37,10 @@ #include -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "audio_out.h" +#include +#include +#include +#include //#ifndef AFMT_S16_NE //# if defined(sparc) || defined(__sparc__) || defined(PPC) diff --git a/src/audio_out/audio_jack_out.c b/src/audio_out/audio_jack_out.c index b3b2d4a19..7b8bb3eb3 100644 --- a/src/audio_out/audio_jack_out.c +++ b/src/audio_out/audio_jack_out.c @@ -8,9 +8,9 @@ #include #include -#include "xine_internal.h" -#include "xineutils.h" -#include "audio_out.h" +#include +#include +#include #include diff --git a/src/audio_out/audio_none_out.c b/src/audio_out/audio_none_out.c index 0e5cf1864..fa6547880 100644 --- a/src/audio_out/audio_none_out.c +++ b/src/audio_out/audio_none_out.c @@ -31,9 +31,9 @@ #include #include -#include "xine_internal.h" -#include "xineutils.h" -#include "audio_out.h" +#include +#include +#include #define AO_OUT_NONE_IFACE_VERSION 9 diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c index 5b4faada5..8e0e52fd7 100644 --- a/src/audio_out/audio_oss_out.c +++ b/src/audio_out/audio_oss_out.c @@ -64,10 +64,10 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "audio_out.h" +#include +#include +#include +#include #include diff --git a/src/audio_out/audio_pulse_out.c b/src/audio_out/audio_pulse_out.c index 6054e137e..b4ec0b156 100644 --- a/src/audio_out/audio_pulse_out.c +++ b/src/audio_out/audio_pulse_out.c @@ -41,9 +41,9 @@ #include -#include "xine_internal.h" -#include "xineutils.h" -#include "audio_out.h" +#include +#include +#include #include "bswap.h" #define GAP_TOLERANCE AO_MAX_GAP diff --git a/src/audio_out/audio_sun_out.c b/src/audio_out/audio_sun_out.c index c37397639..921e5fd15 100644 --- a/src/audio_out/audio_sun_out.c +++ b/src/audio_out/audio_sun_out.c @@ -45,9 +45,9 @@ typedef unsigned uint_t; #endif -#include "xine_internal.h" -#include "xineutils.h" -#include "audio_out.h" +#include +#include +#include #ifdef __svr4__ #define CS4231_WORKAROUND 1 /* enable workaround for audiocs play.samples bug */ diff --git a/src/combined/flac_decoder.c b/src/combined/flac_decoder.c index 9ec024d71..40c5fa6a3 100644 --- a/src/combined/flac_decoder.c +++ b/src/combined/flac_decoder.c @@ -44,9 +44,9 @@ #define LOG */ -#include "xine_internal.h" -#include "audio_out.h" -#include "buffer.h" +#include +#include +#include typedef struct { audio_decoder_class_t decoder_class; diff --git a/src/combined/flac_demuxer.c b/src/combined/flac_demuxer.c index bee98d2a3..1f390a86f 100644 --- a/src/combined/flac_demuxer.c +++ b/src/combined/flac_demuxer.c @@ -51,8 +51,8 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" +#include +#include #include "../demuxers/demux.h" #ifndef LEGACY_FLAC diff --git a/src/combined/nsf_combined.c b/src/combined/nsf_combined.c index 085467937..18ab05863 100644 --- a/src/combined/nsf_combined.c +++ b/src/combined/nsf_combined.c @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA */ -#include "xine_internal.h" +#include #include "nsf_combined.h" static const demuxer_info_t demux_info_nsf = { diff --git a/src/combined/nsf_decoder.c b/src/combined/nsf_decoder.c index b2694e789..cb3b6e7b0 100644 --- a/src/combined/nsf_decoder.c +++ b/src/combined/nsf_decoder.c @@ -27,10 +27,10 @@ #include #include -#include "xine_internal.h" -#include "audio_out.h" -#include "buffer.h" -#include "xineutils.h" +#include +#include +#include +#include #include "bswap.h" /* Nosefart includes */ diff --git a/src/combined/nsf_demuxer.c b/src/combined/nsf_demuxer.c index cce7c8983..451e6e938 100644 --- a/src/combined/nsf_demuxer.c +++ b/src/combined/nsf_demuxer.c @@ -46,10 +46,10 @@ /* #define LOG_VERBOSE */ /* #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "demux.h" +#include +#include +#include +#include #include "bswap.h" #include "nsf_combined.h" diff --git a/src/combined/wavpack_combined.c b/src/combined/wavpack_combined.c index 9c5dade03..edf4bec01 100644 --- a/src/combined/wavpack_combined.c +++ b/src/combined/wavpack_combined.c @@ -20,7 +20,7 @@ * xine interface to libwavpack by Diego Pettenò */ -#include "xine_internal.h" +#include #include "wavpack_combined.h" static const demuxer_info_t demux_info_wv = { diff --git a/src/combined/wavpack_decoder.c b/src/combined/wavpack_decoder.c index 8eb041664..80a14e678 100644 --- a/src/combined/wavpack_decoder.c +++ b/src/combined/wavpack_decoder.c @@ -27,8 +27,8 @@ #define LOG_MODULE "decode_wavpack" #define LOG_VERBOSE -#include "xine_internal.h" -#include "attributes.h" +#include +#include #include "bswap.h" #include diff --git a/src/combined/wavpack_demuxer.c b/src/combined/wavpack_demuxer.c index 310f4cecb..9c0831cfa 100644 --- a/src/combined/wavpack_demuxer.c +++ b/src/combined/wavpack_demuxer.c @@ -28,11 +28,11 @@ #define LOG_VERBOSE #define LOG -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" +#include +#include +#include #include "bswap.h" -#include "attributes.h" +#include #include #include "wavpack_combined.h" diff --git a/src/combined/xine_ogg_demuxer.c b/src/combined/xine_ogg_demuxer.c index ea03b5eec..8c722f84f 100644 --- a/src/combined/xine_ogg_demuxer.c +++ b/src/combined/xine_ogg_demuxer.c @@ -65,9 +65,9 @@ #define DEBUG_PTS 0 #define DEBUG_VIDEO_PACKETS 0 -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" +#include +#include +#include #include "bswap.h" #include "flacutils.h" diff --git a/src/combined/xine_speex_decoder.c b/src/combined/xine_speex_decoder.c index e4fc44eec..a94ab0c0e 100644 --- a/src/combined/xine_speex_decoder.c +++ b/src/combined/xine_speex_decoder.c @@ -34,9 +34,9 @@ */ #define LOG_BUFFERS 0 -#include "xine_internal.h" -#include "audio_out.h" -#include "buffer.h" +#include +#include +#include #include diff --git a/src/combined/xine_theora_decoder.c b/src/combined/xine_theora_decoder.c index 8d06a5510..262cb5414 100644 --- a/src/combined/xine_theora_decoder.c +++ b/src/combined/xine_theora_decoder.c @@ -39,11 +39,11 @@ #define LOG */ -#include "xine_internal.h" -#include "video_out.h" -#include "buffer.h" -#include "metronom.h" -#include "xineutils.h" +#include +#include +#include +#include +#include typedef struct theora_class_s { video_decoder_class_t decoder_class; diff --git a/src/combined/xine_vorbis_decoder.c b/src/combined/xine_vorbis_decoder.c index aa3546e2e..143c761c4 100644 --- a/src/combined/xine_vorbis_decoder.c +++ b/src/combined/xine_vorbis_decoder.c @@ -33,9 +33,9 @@ #define LOG */ -#include "xine_internal.h" -#include "audio_out.h" -#include "buffer.h" +#include +#include +#include #include #include diff --git a/src/demuxers/asfheader.c b/src/demuxers/asfheader.c index 23692574e..97537c337 100644 --- a/src/demuxers/asfheader.c +++ b/src/demuxers/asfheader.c @@ -17,7 +17,7 @@ #define LOG */ -#include "xineutils.h" +#include #include "bswap.h" #include "asfheader.h" diff --git a/src/demuxers/demux_4xm.c b/src/demuxers/demux_4xm.c index 5ad5d5938..6256cb042 100644 --- a/src/demuxers/demux_4xm.c +++ b/src/demuxers/demux_4xm.c @@ -40,10 +40,10 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "demux.h" +#include +#include +#include +#include #include "bswap.h" #include "group_games.h" diff --git a/src/demuxers/demux_aac.c b/src/demuxers/demux_aac.c index 3edd0bca4..0b02f1d99 100644 --- a/src/demuxers/demux_aac.c +++ b/src/demuxers/demux_aac.c @@ -39,10 +39,10 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" -#include "buffer.h" +#include +#include +#include +#include #include "bswap.h" #include "group_audio.h" diff --git a/src/demuxers/demux_ac3.c b/src/demuxers/demux_ac3.c index e48416803..2ccd5217e 100644 --- a/src/demuxers/demux_ac3.c +++ b/src/demuxers/demux_ac3.c @@ -44,10 +44,10 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" -#include "buffer.h" +#include +#include +#include +#include #include "bswap.h" #include "group_audio.h" diff --git a/src/demuxers/demux_aiff.c b/src/demuxers/demux_aiff.c index f873f5d4f..d3b19701a 100644 --- a/src/demuxers/demux_aiff.c +++ b/src/demuxers/demux_aiff.c @@ -33,10 +33,10 @@ #include #include -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" -#include "buffer.h" +#include +#include +#include +#include #include "bswap.h" #include "group_audio.h" diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c index f5091035b..156a78d6c 100644 --- a/src/demuxers/demux_asf.c +++ b/src/demuxers/demux_asf.c @@ -45,12 +45,12 @@ /* #define LOG */ -#include "xine_internal.h" -#include "demux.h" -#include "xineutils.h" +#include +#include +#include #include "bswap.h" #include "asfheader.h" -#include "xmlparser.h" +#include #define CODEC_TYPE_AUDIO 0 #define CODEC_TYPE_VIDEO 1 diff --git a/src/demuxers/demux_aud.c b/src/demuxers/demux_aud.c index 2aa83d162..c58500ab2 100644 --- a/src/demuxers/demux_aud.c +++ b/src/demuxers/demux_aud.c @@ -45,10 +45,10 @@ #include #include -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "demux.h" +#include +#include +#include +#include #include "bswap.h" #include "group_audio.h" diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index d2e0c0412..ecc71b649 100644 --- a/src/demuxers/demux_avi.c +++ b/src/demuxers/demux_avi.c @@ -70,9 +70,9 @@ #define DEBUG_ODML #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" +#include +#include +#include #include "bswap.h" /* diff --git a/src/demuxers/demux_cdda.c b/src/demuxers/demux_cdda.c index d2a2b4db4..03dcc2605 100644 --- a/src/demuxers/demux_cdda.c +++ b/src/demuxers/demux_cdda.c @@ -41,10 +41,10 @@ /* #define LOG_VERBOSE */ /* #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" -#include "buffer.h" +#include +#include +#include +#include #include "bswap.h" #include "group_audio.h" diff --git a/src/demuxers/demux_dts.c b/src/demuxers/demux_dts.c index be552653f..9d3313a72 100644 --- a/src/demuxers/demux_dts.c +++ b/src/demuxers/demux_dts.c @@ -40,10 +40,10 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" -#include "buffer.h" +#include +#include +#include +#include #include "bswap.h" #include "group_audio.h" diff --git a/src/demuxers/demux_eawve.c b/src/demuxers/demux_eawve.c index b0d10dc1c..04cc714d7 100644 --- a/src/demuxers/demux_eawve.c +++ b/src/demuxers/demux_eawve.c @@ -39,10 +39,10 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" +#include +#include #include "bswap.h" -#include "demux.h" +#include #include "group_games.h" #define FOURCC_TAG BE_FOURCC diff --git a/src/demuxers/demux_elem.c b/src/demuxers/demux_elem.c index a40d3053e..e653818c4 100644 --- a/src/demuxers/demux_elem.c +++ b/src/demuxers/demux_elem.c @@ -38,10 +38,10 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "demux.h" +#include +#include +#include +#include #define NUM_PREVIEW_BUFFERS 50 #define SCRATCH_SIZE 256 diff --git a/src/demuxers/demux_film.c b/src/demuxers/demux_film.c index d09f8f4f1..cc9e90d66 100644 --- a/src/demuxers/demux_film.c +++ b/src/demuxers/demux_film.c @@ -47,10 +47,10 @@ * demuxer is dispatching to the engine */ #define DEBUG_FILM_DEMUX 0 -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "demux.h" +#include +#include +#include +#include #include "bswap.h" #include "group_games.h" diff --git a/src/demuxers/demux_flac.c b/src/demuxers/demux_flac.c index 0380de846..b4c5427c5 100644 --- a/src/demuxers/demux_flac.c +++ b/src/demuxers/demux_flac.c @@ -40,10 +40,10 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "demux.h" +#include +#include +#include +#include #include "bswap.h" #include "group_audio.h" diff --git a/src/demuxers/demux_fli.c b/src/demuxers/demux_fli.c index 2da3019b2..0dad5883a 100644 --- a/src/demuxers/demux_fli.c +++ b/src/demuxers/demux_fli.c @@ -35,10 +35,10 @@ #include #include -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "demux.h" +#include +#include +#include +#include #include "bswap.h" #define FLI_HEADER_SIZE 128 diff --git a/src/demuxers/demux_flv.c b/src/demuxers/demux_flv.c index 7f9dec5fe..86f9a038b 100644 --- a/src/demuxers/demux_flv.c +++ b/src/demuxers/demux_flv.c @@ -42,10 +42,10 @@ /* #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "demux.h" +#include +#include +#include +#include #include "bswap.h" #include "group_games.h" diff --git a/src/demuxers/demux_idcin.c b/src/demuxers/demux_idcin.c index 39b38c81d..695470415 100644 --- a/src/demuxers/demux_idcin.c +++ b/src/demuxers/demux_idcin.c @@ -83,10 +83,10 @@ * demuxer is dispatching to the engine */ /* #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "demux.h" +#include +#include +#include +#include #include "bswap.h" #include "group_games.h" diff --git a/src/demuxers/demux_iff.c b/src/demuxers/demux_iff.c index 9e91684d5..665d29cd2 100644 --- a/src/demuxers/demux_iff.c +++ b/src/demuxers/demux_iff.c @@ -47,10 +47,10 @@ #include #include -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" -#include "buffer.h" +#include +#include +#include +#include #include "bswap.h" #include "iff.h" diff --git a/src/demuxers/demux_image.c b/src/demuxers/demux_image.c index 4731acfe4..cb6f8c8fe 100644 --- a/src/demuxers/demux_image.c +++ b/src/demuxers/demux_image.c @@ -38,10 +38,10 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" +#include +#include #include "bswap.h" -#include "demux.h" +#include #define IMAGE_HEADER_LEN 4 diff --git a/src/demuxers/demux_ipmovie.c b/src/demuxers/demux_ipmovie.c index cc71da6d4..4d08af6fa 100644 --- a/src/demuxers/demux_ipmovie.c +++ b/src/demuxers/demux_ipmovie.c @@ -40,10 +40,10 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "demux.h" +#include +#include +#include +#include #include "bswap.h" #include "group_games.h" diff --git a/src/demuxers/demux_matroska.c b/src/demuxers/demux_matroska.c index 16cf87978..e976e7d63 100644 --- a/src/demuxers/demux_matroska.c +++ b/src/demuxers/demux_matroska.c @@ -42,10 +42,10 @@ /* #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" -#include "buffer.h" +#include +#include +#include +#include #include "bswap.h" #include "ebml.h" diff --git a/src/demuxers/demux_mng.c b/src/demuxers/demux_mng.c index f7af7ec42..18c4b1b57 100644 --- a/src/demuxers/demux_mng.c +++ b/src/demuxers/demux_mng.c @@ -46,9 +46,9 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" +#include +#include +#include typedef struct { demux_plugin_t demux_plugin; diff --git a/src/demuxers/demux_mod.c b/src/demuxers/demux_mod.c index 54dacdc8e..17e744b94 100644 --- a/src/demuxers/demux_mod.c +++ b/src/demuxers/demux_mod.c @@ -42,10 +42,10 @@ /* #define LOG_VERBOSE */ /* #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "demux.h" +#include +#include +#include +#include #include "modplug.h" #include "bswap.h" diff --git a/src/demuxers/demux_mpc.c b/src/demuxers/demux_mpc.c index 60750b550..6a4cfb285 100644 --- a/src/demuxers/demux_mpc.c +++ b/src/demuxers/demux_mpc.c @@ -41,10 +41,10 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" -#include "buffer.h" +#include +#include +#include +#include #include "bswap.h" #include "group_audio.h" diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c index 0a97b27bc..8c339fd88 100644 --- a/src/demuxers/demux_mpeg.c +++ b/src/demuxers/demux_mpeg.c @@ -39,9 +39,9 @@ #define LOG */ -#include "xine_internal.h" -#include "demux.h" -#include "xineutils.h" +#include +#include +#include #define NUM_PREVIEW_BUFFERS 150 #define SCRATCH_SIZE 256 diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c index 91b69328c..b46008b94 100644 --- a/src/demuxers/demux_mpeg_block.c +++ b/src/demuxers/demux_mpeg_block.c @@ -37,9 +37,9 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" +#include +#include +#include #define NUM_PREVIEW_BUFFERS 250 #define DISC_TRESHOLD 90000 diff --git a/src/demuxers/demux_mpeg_pes.c b/src/demuxers/demux_mpeg_pes.c index d47c1ed01..f5d554020 100644 --- a/src/demuxers/demux_mpeg_pes.c +++ b/src/demuxers/demux_mpeg_pes.c @@ -41,9 +41,9 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" +#include +#include +#include #define NUM_PREVIEW_BUFFERS 250 #define DISC_TRESHOLD 90000 diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c index 1648be926..39d537a4c 100644 --- a/src/demuxers/demux_mpgaudio.c +++ b/src/demuxers/demux_mpgaudio.c @@ -38,10 +38,10 @@ /* #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" -#include "compat.h" +#include +#include +#include +#include #include "bswap.h" #include "group_audio.h" #include "id3.h" diff --git a/src/demuxers/demux_nsv.c b/src/demuxers/demux_nsv.c index d5ffed5f8..74f98c7cd 100644 --- a/src/demuxers/demux_nsv.c +++ b/src/demuxers/demux_nsv.c @@ -40,12 +40,12 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "demux.h" +#include +#include +#include +#include #include "bswap.h" -#include "buffer.h" +#include #define FOURCC_TAG BE_FOURCC #define NSVf_TAG FOURCC_TAG('N', 'S', 'V', 'f') diff --git a/src/demuxers/demux_playlist.c b/src/demuxers/demux_playlist.c index c6df006fe..3dd689657 100644 --- a/src/demuxers/demux_playlist.c +++ b/src/demuxers/demux_playlist.c @@ -40,10 +40,10 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" +#include +#include #include "bswap.h" -#include "demux.h" +#include typedef enum { XINE_PLT_NONE = 0, diff --git a/src/demuxers/demux_pva.c b/src/demuxers/demux_pva.c index 2f85387b2..9987da057 100644 --- a/src/demuxers/demux_pva.c +++ b/src/demuxers/demux_pva.c @@ -39,10 +39,10 @@ /* #define LOG_VERBOSE */ /* #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "demux.h" +#include +#include +#include +#include #include "bswap.h" #define PVA_PREAMBLE_SIZE 8 diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c index 8fb554de2..a54bc4e73 100644 --- a/src/demuxers/demux_qt.c +++ b/src/demuxers/demux_qt.c @@ -43,10 +43,10 @@ #include #include -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" -#include "buffer.h" +#include +#include +#include +#include #include "bswap.h" #include "qtpalette.h" diff --git a/src/demuxers/demux_rawdv.c b/src/demuxers/demux_rawdv.c index 0ae52b6bf..10b3170e6 100644 --- a/src/demuxers/demux_rawdv.c +++ b/src/demuxers/demux_rawdv.c @@ -32,10 +32,10 @@ #include #include -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "demux.h" +#include +#include +#include +#include #define NTSC_FRAME_SIZE 120000 #define NTSC_FRAME_RATE 29.97 diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c index 962030083..c14be6b47 100644 --- a/src/demuxers/demux_real.c +++ b/src/demuxers/demux_real.c @@ -49,10 +49,10 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "demux.h" +#include +#include +#include +#include #include "bswap.h" #define FOURCC_TAG BE_FOURCC diff --git a/src/demuxers/demux_realaudio.c b/src/demuxers/demux_realaudio.c index 0ce399e11..732ddfcc4 100644 --- a/src/demuxers/demux_realaudio.c +++ b/src/demuxers/demux_realaudio.c @@ -34,10 +34,10 @@ #include #include -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" -#include "buffer.h" +#include +#include +#include +#include #include "bswap.h" #include "group_audio.h" diff --git a/src/demuxers/demux_roq.c b/src/demuxers/demux_roq.c index 95f81de9a..83e589be0 100644 --- a/src/demuxers/demux_roq.c +++ b/src/demuxers/demux_roq.c @@ -40,10 +40,10 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "demux.h" +#include +#include +#include +#include #include "bswap.h" #include "group_games.h" diff --git a/src/demuxers/demux_shn.c b/src/demuxers/demux_shn.c index 445661b8f..d5e46f873 100644 --- a/src/demuxers/demux_shn.c +++ b/src/demuxers/demux_shn.c @@ -35,10 +35,10 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" -#include "buffer.h" +#include +#include +#include +#include #include "bswap.h" #include "group_audio.h" diff --git a/src/demuxers/demux_slave.c b/src/demuxers/demux_slave.c index fc42ae4c4..80a5ebbf8 100644 --- a/src/demuxers/demux_slave.c +++ b/src/demuxers/demux_slave.c @@ -42,10 +42,10 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "demux.h" +#include +#include +#include +#include #define SCRATCH_SIZE 1024 #define CHECK_VPTS_INTERVAL 2*90000 diff --git a/src/demuxers/demux_smjpeg.c b/src/demuxers/demux_smjpeg.c index d24459f5b..10cdf8120 100644 --- a/src/demuxers/demux_smjpeg.c +++ b/src/demuxers/demux_smjpeg.c @@ -39,10 +39,10 @@ /* #define LOG_VERBOSE */ /* #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "demux.h" +#include +#include +#include +#include #include "bswap.h" #include "group_games.h" diff --git a/src/demuxers/demux_snd.c b/src/demuxers/demux_snd.c index 728caf170..d7bdd0839 100644 --- a/src/demuxers/demux_snd.c +++ b/src/demuxers/demux_snd.c @@ -33,10 +33,10 @@ #include #include -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" -#include "buffer.h" +#include +#include +#include +#include #include "bswap.h" #include "group_audio.h" diff --git a/src/demuxers/demux_str.c b/src/demuxers/demux_str.c index ccb653ad2..f125f09c5 100644 --- a/src/demuxers/demux_str.c +++ b/src/demuxers/demux_str.c @@ -123,10 +123,10 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "demux.h" +#include +#include +#include +#include #include "bswap.h" #include "group_games.h" diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c index 5b671f3c4..e80e8af70 100644 --- a/src/demuxers/demux_ts.c +++ b/src/demuxers/demux_ts.c @@ -147,9 +147,9 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" +#include +#include +#include /* #define TS_LOG diff --git a/src/demuxers/demux_tta.c b/src/demuxers/demux_tta.c index 2a8af09bb..2d35a60e8 100644 --- a/src/demuxers/demux_tta.c +++ b/src/demuxers/demux_tta.c @@ -24,13 +24,13 @@ #define LOG_MODULE "demux_tta" #define LOG_VERBOSE -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" -#include "buffer.h" +#include +#include +#include +#include #include "bswap.h" #include "group_audio.h" -#include "attributes.h" +#include typedef struct { demux_plugin_t demux_plugin; diff --git a/src/demuxers/demux_vmd.c b/src/demuxers/demux_vmd.c index 41475f966..c2902eac1 100644 --- a/src/demuxers/demux_vmd.c +++ b/src/demuxers/demux_vmd.c @@ -45,10 +45,10 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "demux.h" +#include +#include +#include +#include #include "bswap.h" #include "group_games.h" diff --git a/src/demuxers/demux_voc.c b/src/demuxers/demux_voc.c index ffd904a6f..ce42d61d8 100644 --- a/src/demuxers/demux_voc.c +++ b/src/demuxers/demux_voc.c @@ -37,10 +37,10 @@ #include #include -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" -#include "buffer.h" +#include +#include +#include +#include #include "bswap.h" #include "group_audio.h" diff --git a/src/demuxers/demux_vox.c b/src/demuxers/demux_vox.c index 0e648263e..306f2414f 100644 --- a/src/demuxers/demux_vox.c +++ b/src/demuxers/demux_vox.c @@ -34,10 +34,10 @@ #include #include -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" -#include "buffer.h" +#include +#include +#include +#include #include "bswap.h" #include "group_audio.h" diff --git a/src/demuxers/demux_vqa.c b/src/demuxers/demux_vqa.c index 3cbbced9d..3acd56bc1 100644 --- a/src/demuxers/demux_vqa.c +++ b/src/demuxers/demux_vqa.c @@ -40,10 +40,10 @@ #include #include -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "demux.h" +#include +#include +#include +#include #include "bswap.h" #include "group_games.h" diff --git a/src/demuxers/demux_wav.c b/src/demuxers/demux_wav.c index 9cf2adefe..b8f0d0194 100644 --- a/src/demuxers/demux_wav.c +++ b/src/demuxers/demux_wav.c @@ -34,10 +34,10 @@ #include #include -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" -#include "buffer.h" +#include +#include +#include +#include #include "bswap.h" #include "group_audio.h" diff --git a/src/demuxers/demux_wc3movie.c b/src/demuxers/demux_wc3movie.c index b3cf9dfb3..bb9a40306 100644 --- a/src/demuxers/demux_wc3movie.c +++ b/src/demuxers/demux_wc3movie.c @@ -42,10 +42,10 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "demux.h" +#include +#include +#include +#include #include "bswap.h" #include "group_games.h" diff --git a/src/demuxers/demux_yuv4mpeg2.c b/src/demuxers/demux_yuv4mpeg2.c index 54e8ebbaa..a0bf31bce 100644 --- a/src/demuxers/demux_yuv4mpeg2.c +++ b/src/demuxers/demux_yuv4mpeg2.c @@ -36,10 +36,10 @@ #include #include -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "demux.h" +#include +#include +#include +#include #include "bswap.h" #define Y4M_SIGNATURE_SIZE 9 diff --git a/src/demuxers/demux_yuv_frames.c b/src/demuxers/demux_yuv_frames.c index 301a5978e..0cef51f60 100644 --- a/src/demuxers/demux_yuv_frames.c +++ b/src/demuxers/demux_yuv_frames.c @@ -39,9 +39,9 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" +#include +#include +#include #define WRAP_THRESHOLD 20000 diff --git a/src/demuxers/ebml.c b/src/demuxers/ebml.c index d5f7bb9b5..772b848eb 100644 --- a/src/demuxers/ebml.c +++ b/src/demuxers/ebml.c @@ -31,8 +31,8 @@ /* #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" +#include +#include #include "bswap.h" #include "ebml.h" diff --git a/src/demuxers/group_audio.c b/src/demuxers/group_audio.c index d3832c36d..250eeefb4 100644 --- a/src/demuxers/group_audio.c +++ b/src/demuxers/group_audio.c @@ -24,8 +24,8 @@ #include "config.h" #endif -#include "xine_internal.h" -#include "demux.h" +#include +#include #include "group_audio.h" diff --git a/src/demuxers/group_audio.h b/src/demuxers/group_audio.h index 11aac35d7..394cad2a3 100644 --- a/src/demuxers/group_audio.h +++ b/src/demuxers/group_audio.h @@ -21,7 +21,7 @@ #ifndef HAVE_GROUP_AUDIO_H #define HAVE_GROUP_AUDIO_H -#include "xine_internal.h" +#include void *demux_aac_init_plugin (xine_t *xine, void *data); void *demux_ac3_init_plugin (xine_t *xine, void *data); diff --git a/src/demuxers/group_games.c b/src/demuxers/group_games.c index cfae26848..2d01b726e 100644 --- a/src/demuxers/group_games.c +++ b/src/demuxers/group_games.c @@ -24,8 +24,8 @@ #include "config.h" #endif -#include "xine_internal.h" -#include "demux.h" +#include +#include #include "group_games.h" diff --git a/src/demuxers/group_games.h b/src/demuxers/group_games.h index f93d4bb07..352ec5524 100644 --- a/src/demuxers/group_games.h +++ b/src/demuxers/group_games.h @@ -21,7 +21,7 @@ #ifndef HAVE_GROUP_GAMES_H #define HAVE_GROUP_GAMES_H -#include "xine_internal.h" +#include void *demux_eawve_init_plugin(xine_t *xine, void *data); void *demux_idcin_init_plugin (xine_t *xine, void *data); diff --git a/src/demuxers/id3.c b/src/demuxers/id3.c index ceb66014f..b9bb75744 100644 --- a/src/demuxers/id3.c +++ b/src/demuxers/id3.c @@ -40,8 +40,8 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" +#include +#include #include "bswap.h" #include "id3.h" diff --git a/src/demuxers/id3.h b/src/demuxers/id3.h index 29285bf7a..542a17bc4 100644 --- a/src/demuxers/id3.h +++ b/src/demuxers/id3.h @@ -25,8 +25,8 @@ #ifndef ID3_H #define ID3_H -#include "xine_internal.h" -#include "xineutils.h" +#include +#include #include "bswap.h" /* id3v2 */ diff --git a/src/demuxers/matroska.h b/src/demuxers/matroska.h index 6806c207d..215c63dd0 100644 --- a/src/demuxers/matroska.h +++ b/src/demuxers/matroska.h @@ -20,9 +20,9 @@ #ifndef MATROSKA_H #define MATROSKA_H -#include "xine_internal.h" -#include "xineutils.h" -#include "demux.h" +#include +#include +#include #include "ebml.h" diff --git a/src/dxr3/dxr3.h b/src/dxr3/dxr3.h index f08ddcd04..0b0961ca0 100644 --- a/src/dxr3/dxr3.h +++ b/src/dxr3/dxr3.h @@ -23,7 +23,7 @@ #include "em8300.h" -#include "xine_internal.h" +#include /* data for the device name config entry */ #define CONF_KEY "dxr3.device_number" diff --git a/src/dxr3/dxr3_decode_spu.c b/src/dxr3/dxr3_decode_spu.c index 7c501e9d8..8280d4714 100644 --- a/src/dxr3/dxr3_decode_spu.c +++ b/src/dxr3/dxr3_decode_spu.c @@ -42,9 +42,9 @@ #define LOG_SPU 0 #define LOG_BTN 0 -#include "xine_internal.h" -#include "xineutils.h" -#include "buffer.h" +#include +#include +#include #include "xine-engine/bswap.h" #ifdef HAVE_DVDNAV # include diff --git a/src/dxr3/dxr3_decode_video.c b/src/dxr3/dxr3_decode_video.c index e26e303a1..39da80249 100644 --- a/src/dxr3/dxr3_decode_video.c +++ b/src/dxr3/dxr3_decode_video.c @@ -40,8 +40,8 @@ #define LOG_VID 0 #define LOG_PTS 0 -#include "xine_internal.h" -#include "buffer.h" +#include +#include #include "video_out_dxr3.h" #include "dxr3.h" diff --git a/src/dxr3/dxr3_mpeg_encoders.c b/src/dxr3/dxr3_mpeg_encoders.c index 0c59b0b93..19ff8b81d 100644 --- a/src/dxr3/dxr3_mpeg_encoders.c +++ b/src/dxr3/dxr3_mpeg_encoders.c @@ -48,7 +48,7 @@ /* #define LOG_VERBOSE */ /* #define LOG */ -#include "xineutils.h" +#include #include "video_out_dxr3.h" /* buffer size for encoded mpeg1 stream; will hold one intra frame diff --git a/src/dxr3/dxr3_scr.h b/src/dxr3/dxr3_scr.h index d0e155c27..b9f35d643 100644 --- a/src/dxr3/dxr3_scr.h +++ b/src/dxr3/dxr3_scr.h @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA */ -#include "xine_internal.h" +#include /* plugin structure */ diff --git a/src/dxr3/video_out_dxr3.c b/src/dxr3/video_out_dxr3.c index b073e6f63..a2153dacc 100644 --- a/src/dxr3/video_out_dxr3.c +++ b/src/dxr3/video_out_dxr3.c @@ -60,9 +60,9 @@ #define LOG_VID 0 #define LOG_OVR 0 -#include "xine_internal.h" -#include "xineutils.h" -#include "video_out.h" +#include +#include +#include #include "dxr3.h" #include "video_out_dxr3.h" diff --git a/src/dxr3/video_out_dxr3.h b/src/dxr3/video_out_dxr3.h index 0297204dd..a5a1368a3 100644 --- a/src/dxr3/video_out_dxr3.h +++ b/src/dxr3/video_out_dxr3.h @@ -26,7 +26,7 @@ # include #endif -#include "xine_internal.h" +#include #include "vo_scale.h" #include "dxr3_scr.h" #include "dxr3.h" diff --git a/src/input/Makefile.am b/src/input/Makefile.am index ed32ad7c5..8330b6d43 100644 --- a/src/input/Makefile.am +++ b/src/input/Makefile.am @@ -19,7 +19,6 @@ SUBDIRS += libdvdnav endif -xineinclude_HEADERS = input_plugin.h noinst_HEADERS = net_buf_ctrl.h mms.h mmsh.h pnm.h media_helper.h http_helper.h diff --git a/src/input/http_helper.c b/src/input/http_helper.c index 279d3ff05..83562c9dc 100644 --- a/src/input/http_helper.c +++ b/src/input/http_helper.c @@ -26,7 +26,7 @@ #include -#include "xine_internal.h" +#include #include "http_helper.h" int _x_parse_url (char *url, char **proto, char** host, int *port, diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c index ed6f2b4f9..c08e1ca0b 100644 --- a/src/input/input_cdda.c +++ b/src/input/input_cdda.c @@ -66,9 +66,9 @@ #include "sha1.h" #include "base64.h" -#include "xine_internal.h" -#include "xineutils.h" -#include "input_plugin.h" +#include +#include +#include #include "media_helper.h" #if defined(__sun) diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c index 1151d9a81..b35f35fa6 100644 --- a/src/input/input_dvb.c +++ b/src/input/input_dvb.c @@ -113,9 +113,9 @@ #define LOG_READS */ -#include "xine_internal.h" -#include "xineutils.h" -#include "input_plugin.h" +#include +#include +#include #include "net_buf_ctrl.h" #define BUFSIZE 16384 diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c index 8656097bc..3c06bdec5 100644 --- a/src/input/input_dvd.c +++ b/src/input/input_dvd.c @@ -85,9 +85,9 @@ #endif /* Xine includes */ -#include "xineutils.h" -#include "buffer.h" -#include "xine_internal.h" +#include +#include +#include #include "media_helper.h" /* Print debug messages? */ diff --git a/src/input/input_file.c b/src/input/input_file.c index 1556afb09..2fe3925ea 100644 --- a/src/input/input_file.c +++ b/src/input/input_file.c @@ -44,10 +44,10 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "input_plugin.h" +#include +#include +#include +#include #define MAXFILES 65535 diff --git a/src/input/input_gnome_vfs.c b/src/input/input_gnome_vfs.c index 71a4ada85..e93a747ee 100644 --- a/src/input/input_gnome_vfs.c +++ b/src/input/input_gnome_vfs.c @@ -24,9 +24,9 @@ #include "config.h" #endif -#include "xine_internal.h" -#include "xineutils.h" -#include "input_plugin.h" +#include +#include +#include #include "net_buf_ctrl.h" #include diff --git a/src/input/input_http.c b/src/input/input_http.c index ef2606413..c2836affe 100644 --- a/src/input/input_http.c +++ b/src/input/input_http.c @@ -46,9 +46,9 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "input_plugin.h" +#include +#include +#include #include "net_buf_ctrl.h" #include "http_helper.h" diff --git a/src/input/input_mms.c b/src/input/input_mms.c index 0b9e6c7f2..0287e0060 100644 --- a/src/input/input_mms.c +++ b/src/input/input_mms.c @@ -41,9 +41,9 @@ */ #include "bswap.h" -#include "xine_internal.h" -#include "xineutils.h" -#include "input_plugin.h" +#include +#include +#include #include "mms.h" #include "mmsh.h" diff --git a/src/input/input_net.c b/src/input/input_net.c index 7a52f670d..1d7288f41 100644 --- a/src/input/input_net.c +++ b/src/input/input_net.c @@ -66,9 +66,9 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "input_plugin.h" +#include +#include +#include #include "net_buf_ctrl.h" #define NET_BS_LEN 2324 diff --git a/src/input/input_pnm.c b/src/input/input_pnm.c index 3bc026b69..3271a04c9 100644 --- a/src/input/input_pnm.c +++ b/src/input/input_pnm.c @@ -41,9 +41,9 @@ */ #include "bswap.h" -#include "xine_internal.h" -#include "xineutils.h" -#include "input_plugin.h" +#include +#include +#include #include "pnm.h" #include "net_buf_ctrl.h" diff --git a/src/input/input_pvr.c b/src/input/input_pvr.c index 40bb9dc79..d68b3fe34 100644 --- a/src/input/input_pvr.c +++ b/src/input/input_pvr.c @@ -108,10 +108,10 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "input_plugin.h" +#include +#include +#include +#include #define PVR_DEVICE "/dev/video0" diff --git a/src/input/input_rtp.c b/src/input/input_rtp.c index c3abf4bf5..33183e555 100644 --- a/src/input/input_rtp.c +++ b/src/input/input_rtp.c @@ -91,9 +91,9 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "input_plugin.h" +#include +#include +#include #include "net_buf_ctrl.h" #ifdef __GNUC__ diff --git a/src/input/input_rtsp.c b/src/input/input_rtsp.c index 690507d88..bee192c0d 100644 --- a/src/input/input_rtsp.c +++ b/src/input/input_rtsp.c @@ -41,9 +41,9 @@ */ #include "bswap.h" -#include "xine_internal.h" -#include "xineutils.h" -#include "input_plugin.h" +#include +#include +#include #include "librtsp/rtsp_session.h" #include "net_buf_ctrl.h" diff --git a/src/input/input_smb.c b/src/input/input_smb.c index 8bbbfdfe5..44fa96bfd 100644 --- a/src/input/input_smb.c +++ b/src/input/input_smb.c @@ -23,10 +23,10 @@ #include "config.h" #endif -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "input_plugin.h" +#include +#include +#include +#include #include #include diff --git a/src/input/input_stdin_fifo.c b/src/input/input_stdin_fifo.c index e28a8d0c3..d67954ea8 100644 --- a/src/input/input_stdin_fifo.c +++ b/src/input/input_stdin_fifo.c @@ -36,9 +36,9 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "input_plugin.h" +#include +#include +#include #include "net_buf_ctrl.h" #define BUFSIZE 1024 diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c index ff9ea87d0..58f982da6 100644 --- a/src/input/input_v4l.c +++ b/src/input/input_v4l.c @@ -88,9 +88,9 @@ static char *log_line_prefix() } #endif -#include "xine_internal.h" -#include "xineutils.h" -#include "input_plugin.h" +#include +#include +#include #define NUM_FRAMES 15 diff --git a/src/input/input_vcd.c b/src/input/input_vcd.c index 14a924a2a..4b624a9e7 100644 --- a/src/input/input_vcd.c +++ b/src/input/input_vcd.c @@ -45,9 +45,9 @@ #error "you need to add cdrom / VCD support for your platform to input_vcd and configure.in" #endif -#include "xine_internal.h" -#include "xineutils.h" -#include "input_plugin.h" +#include +#include +#include #include "media_helper.h" #if defined(__sun) diff --git a/src/input/libdvdnav/dvd_reader.c b/src/input/libdvdnav/dvd_reader.c index 200a1dbec..c15a5c3f5 100644 --- a/src/input/libdvdnav/dvd_reader.c +++ b/src/input/libdvdnav/dvd_reader.c @@ -70,7 +70,7 @@ static inline int _private_gettimeofday( struct timeval *tv, void *tz ) #include #endif -#include "compat.h" +#include #include "dvd_udf.h" #include "dvd_input.h" #include "dvd_reader.h" diff --git a/src/input/libreal/asmrp.c b/src/input/libreal/asmrp.c index f7206b583..9fc7a3867 100644 --- a/src/input/libreal/asmrp.c +++ b/src/input/libreal/asmrp.c @@ -43,7 +43,7 @@ */ #include "asmrp.h" -#include "xineutils.h" +#include #define ASMRP_SYM_NONE 0 #define ASMRP_SYM_EOF 1 diff --git a/src/input/libreal/real.c b/src/input/libreal/real.c index 29376868c..eb8540976 100644 --- a/src/input/libreal/real.c +++ b/src/input/libreal/real.c @@ -33,8 +33,8 @@ #include "real.h" #include "asmrp.h" #include "sdpplin.h" -#include "xine_internal.h" -#include "xineutils.h" +#include +#include #include "bswap.h" #define XOR_TABLE_LEN 37 diff --git a/src/input/libreal/rmff.c b/src/input/libreal/rmff.c index 4fea74636..a15c50b23 100644 --- a/src/input/libreal/rmff.c +++ b/src/input/libreal/rmff.c @@ -27,7 +27,7 @@ #define LOG */ -#include "xineutils.h" +#include #include "bswap.h" #include "rmff.h" diff --git a/src/input/libreal/sdpplin.c b/src/input/libreal/sdpplin.c index 5b22e9044..c81e88ac2 100644 --- a/src/input/libreal/sdpplin.c +++ b/src/input/libreal/sdpplin.c @@ -29,7 +29,7 @@ #include "rmff.h" #include "rtsp.h" #include "sdpplin.h" -#include "xineutils.h" +#include /* * Decodes base64 strings (based upon b64 package) diff --git a/src/input/librtsp/rtsp.c b/src/input/librtsp/rtsp.c index d0f09d563..7607f2221 100644 --- a/src/input/librtsp/rtsp.c +++ b/src/input/librtsp/rtsp.c @@ -45,8 +45,8 @@ */ #include "rtsp.h" -#include "io_helper.h" -#include "xineutils.h" +#include +#include #define BUF_SIZE 4096 #define HEADER_SIZE 1024 diff --git a/src/input/librtsp/rtsp.h b/src/input/librtsp/rtsp.h index 7f7a3ddba..3c829e2e8 100644 --- a/src/input/librtsp/rtsp.h +++ b/src/input/librtsp/rtsp.h @@ -25,7 +25,7 @@ #define HAVE_RTSP_H /*#include */ -#include "xine_internal.h" +#include #ifdef __CYGWIN__ #define uint32_t unsigned int diff --git a/src/input/librtsp/rtsp_session.c b/src/input/librtsp/rtsp_session.c index 84552503b..e9ce5bc5c 100644 --- a/src/input/librtsp/rtsp_session.c +++ b/src/input/librtsp/rtsp_session.c @@ -41,7 +41,7 @@ #include "real.h" #include "rmff.h" #include "asmrp.h" -#include "xineutils.h" +#include #define BUF_SIZE 4096 #define HEADER_SIZE 4096 diff --git a/src/input/media_helper.h b/src/input/media_helper.h index 7e6303dfd..a8e376fdc 100644 --- a/src/input/media_helper.h +++ b/src/input/media_helper.h @@ -22,7 +22,7 @@ #ifndef HAVE_MEDIA_HELPER_H #define HAVE_MEDIA_HELPER_H -#include "xine_internal.h" +#include int media_eject_media (xine_t *xine, const char *device); diff --git a/src/input/mms.c b/src/input/mms.c index f11a89cf3..ccc56b094 100644 --- a/src/input/mms.c +++ b/src/input/mms.c @@ -56,8 +56,8 @@ /* #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" +#include +#include #include "bswap.h" #include "http_helper.h" diff --git a/src/input/mms.h b/src/input/mms.h index a483fa0c6..67ea5ba0b 100644 --- a/src/input/mms.h +++ b/src/input/mms.h @@ -24,7 +24,7 @@ #define HAVE_MMS_H #include -#include "xine_internal.h" +#include typedef struct mms_s mms_t; diff --git a/src/input/mmsh.c b/src/input/mmsh.c index ae1c62bc1..f6bf0bcb6 100644 --- a/src/input/mmsh.c +++ b/src/input/mmsh.c @@ -51,8 +51,8 @@ /* #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" +#include +#include #include "bswap.h" #include "http_helper.h" diff --git a/src/input/mmsh.h b/src/input/mmsh.h index 633d3b5f6..eeceb030b 100644 --- a/src/input/mmsh.h +++ b/src/input/mmsh.h @@ -24,7 +24,7 @@ #define HAVE_MMSH_H #include -#include "xine_internal.h" +#include typedef struct mmsh_s mmsh_t; diff --git a/src/input/net_buf_ctrl.h b/src/input/net_buf_ctrl.h index 79f698008..c35187179 100644 --- a/src/input/net_buf_ctrl.h +++ b/src/input/net_buf_ctrl.h @@ -23,7 +23,7 @@ #ifndef HAVE_NET_BUF_CTRL_H #define HAVE_NET_BUF_CTRL_H -#include "xine_internal.h" +#include typedef struct nbc_s nbc_t; diff --git a/src/input/pnm.c b/src/input/pnm.c index 942e52957..3cb36ac3f 100644 --- a/src/input/pnm.c +++ b/src/input/pnm.c @@ -45,9 +45,9 @@ #include "pnm.h" #include "libreal/rmff.h" #include "bswap.h" -#include "io_helper.h" -#include "xineutils.h" -#include "xine_internal.h" +#include +#include +#include #define BUF_SIZE 4096 #define HEADER_SIZE 4096 diff --git a/src/input/pnm.h b/src/input/pnm.h index 838fbadcc..bf3514bae 100644 --- a/src/input/pnm.h +++ b/src/input/pnm.h @@ -26,7 +26,7 @@ #ifndef __CYGWIN__ #include #endif -#include "xine_internal.h" +#include typedef struct pnm_s pnm_t; diff --git a/src/input/vcd/xine-extra.h b/src/input/vcd/xine-extra.h index 0650f863d..4246405ba 100644 --- a/src/input/vcd/xine-extra.h +++ b/src/input/vcd/xine-extra.h @@ -36,9 +36,9 @@ #endif /* Xine includes */ -#include "xine_internal.h" +#include #include "input_plugin.h" -#include "xineutils.h" +#include /*! This routine is like xine_log, except it takes a va_list instead of diff --git a/src/input/vcd/xineplug_inp_vcd.c b/src/input/vcd/xineplug_inp_vcd.c index b794331f1..27b1cfbbf 100644 --- a/src/input/vcd/xineplug_inp_vcd.c +++ b/src/input/vcd/xineplug_inp_vcd.c @@ -52,8 +52,8 @@ #define xine_config_entry_t xine_cfg_entry_t /* Xine includes */ -#include "xineutils.h" -#include "input_plugin.h" +#include +#include #include "xine-extra.h" diff --git a/src/libffmpeg/ff_audio_decoder.c b/src/libffmpeg/ff_audio_decoder.c index 6dd9205ea..dd03cd2a3 100644 --- a/src/libffmpeg/ff_audio_decoder.c +++ b/src/libffmpeg/ff_audio_decoder.c @@ -40,9 +40,9 @@ #define LOG */ -#include "xine_internal.h" -#include "buffer.h" -#include "xineutils.h" +#include +#include +#include #include "bswap.h" #include "ffmpeg_decoder.h" diff --git a/src/libffmpeg/ff_dvaudio_decoder.c b/src/libffmpeg/ff_dvaudio_decoder.c index 482ae396e..aced7f5bb 100644 --- a/src/libffmpeg/ff_dvaudio_decoder.c +++ b/src/libffmpeg/ff_dvaudio_decoder.c @@ -36,9 +36,9 @@ #define LOG */ -#include "xine_internal.h" -#include "buffer.h" -#include "xineutils.h" +#include +#include +#include #ifdef _MSC_VER /* ffmpeg has own definitions of those types */ diff --git a/src/libffmpeg/ff_mpeg_parser.h b/src/libffmpeg/ff_mpeg_parser.h index ea43a6ce4..504e746f9 100644 --- a/src/libffmpeg/ff_mpeg_parser.h +++ b/src/libffmpeg/ff_mpeg_parser.h @@ -23,7 +23,7 @@ #ifndef HAVE_MPEG_PARSER_H #define HAVE_MPEG_PARSER_H -#include "xine_internal.h" +#include #include "ffmpeg_decoder.h" #define BUFFER_SIZE (1194 * 1024) /* libmpeg2's buffer size */ diff --git a/src/libffmpeg/ff_video_decoder.c b/src/libffmpeg/ff_video_decoder.c index 0b8728f06..4e5e1ebdf 100644 --- a/src/libffmpeg/ff_video_decoder.c +++ b/src/libffmpeg/ff_video_decoder.c @@ -40,10 +40,10 @@ /* #define LOG */ -#include "xine_internal.h" +#include #include "bswap.h" -#include "buffer.h" -#include "xineutils.h" +#include +#include #include "ffmpeg_decoder.h" #include "ff_mpeg_parser.h" diff --git a/src/libffmpeg/ffmpeg_decoder.c b/src/libffmpeg/ffmpeg_decoder.c index 45080590d..8a8a79270 100644 --- a/src/libffmpeg/ffmpeg_decoder.c +++ b/src/libffmpeg/ffmpeg_decoder.c @@ -24,7 +24,7 @@ #include "config.h" #endif -#include "xine_internal.h" +#include #include "ffmpeg_decoder.h" diff --git a/src/libmpeg2/cpu_state.c b/src/libmpeg2/cpu_state.c index 07b4c5b7e..12963644c 100644 --- a/src/libmpeg2/cpu_state.c +++ b/src/libmpeg2/cpu_state.c @@ -27,7 +27,7 @@ #include #include "mpeg2_internal.h" -#include "xineutils.h" +#include void (* mpeg2_cpu_state_save) (cpu_state_t * state) = NULL; void (* mpeg2_cpu_state_restore) (cpu_state_t * state) = NULL; diff --git a/src/libmpeg2/decode.c b/src/libmpeg2/decode.c index 58f34ccbc..145d5f58b 100644 --- a/src/libmpeg2/decode.c +++ b/src/libmpeg2/decode.c @@ -37,11 +37,11 @@ #define LOG */ -#include "xine_internal.h" -#include "video_out.h" +#include +#include #include "mpeg2.h" #include "mpeg2_internal.h" -#include "xineutils.h" +#include #include "libmpeg2_accel.h" /* diff --git a/src/libmpeg2/header.c b/src/libmpeg2/header.c index 7f1ef1fc8..12ba0ff8a 100644 --- a/src/libmpeg2/header.c +++ b/src/libmpeg2/header.c @@ -31,7 +31,7 @@ #include #include "mpeg2_internal.h" -#include "attributes.h" +#include /* default intra quant matrix, in zig-zag order */ static const uint8_t default_intra_quantizer_matrix[64] ATTR_ALIGN(16) = { diff --git a/src/libmpeg2/idct.c b/src/libmpeg2/idct.c index 157beea31..9f216db58 100644 --- a/src/libmpeg2/idct.c +++ b/src/libmpeg2/idct.c @@ -46,7 +46,7 @@ #include #include "mpeg2_internal.h" -#include "xineutils.h" +#include #define W1 2841 /* 2048*sqrt (2)*cos (1*pi/16) */ #define W2 2676 /* 2048*sqrt (2)*cos (2*pi/16) */ diff --git a/src/libmpeg2/idct_altivec.c b/src/libmpeg2/idct_altivec.c index ed8b58cfd..de396560b 100644 --- a/src/libmpeg2/idct_altivec.c +++ b/src/libmpeg2/idct_altivec.c @@ -30,7 +30,7 @@ #include #include "mpeg2_internal.h" -#include "xineutils.h" +#include #define vector_s16_t vector signed short #define vector_u16_t vector unsigned short diff --git a/src/libmpeg2/idct_mmx.c b/src/libmpeg2/idct_mmx.c index ce4bd064b..6bb4bfbf0 100644 --- a/src/libmpeg2/idct_mmx.c +++ b/src/libmpeg2/idct_mmx.c @@ -28,7 +28,7 @@ #include #include "mpeg2_internal.h" -#include "xineutils.h" +#include #define ROW_SHIFT 11 #define COL_SHIFT 6 diff --git a/src/libmpeg2/libmpeg2_accel.c b/src/libmpeg2/libmpeg2_accel.c index 63c7b1b9b..92c0e280b 100644 --- a/src/libmpeg2/libmpeg2_accel.c +++ b/src/libmpeg2/libmpeg2_accel.c @@ -20,7 +20,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "xine_internal.h" +#include #include "mpeg2.h" #include "mpeg2_internal.h" #include "xvmc_vld.h" diff --git a/src/libmpeg2/motion_comp.c b/src/libmpeg2/motion_comp.c index 8779c1296..9328dfb9f 100644 --- a/src/libmpeg2/motion_comp.c +++ b/src/libmpeg2/motion_comp.c @@ -27,7 +27,7 @@ #include #include "mpeg2_internal.h" -#include "xineutils.h" +#include mpeg2_mc_t mpeg2_mc; diff --git a/src/libmpeg2/motion_comp_mmx.c b/src/libmpeg2/motion_comp_mmx.c index 80a53685a..f9b1f085d 100644 --- a/src/libmpeg2/motion_comp_mmx.c +++ b/src/libmpeg2/motion_comp_mmx.c @@ -28,7 +28,7 @@ #include #include "mpeg2_internal.h" -#include "xineutils.h" +#include #define CPU_MMXEXT 0 #define CPU_3DNOW 1 diff --git a/src/libmpeg2/mpeg2_internal.h b/src/libmpeg2/mpeg2_internal.h index c2ffbf909..2e42aace6 100644 --- a/src/libmpeg2/mpeg2_internal.h +++ b/src/libmpeg2/mpeg2_internal.h @@ -24,7 +24,7 @@ #ifndef MPEG2_INTERNAL_H #define MPEG2_INTERNAL_H -#include "video_out.h" +#include #include "accel_xvmc.h" #ifdef ENABLE_ALTIVEC diff --git a/src/libmpeg2/slice.c b/src/libmpeg2/slice.c index 91a4c47b1..8247a9a24 100644 --- a/src/libmpeg2/slice.c +++ b/src/libmpeg2/slice.c @@ -25,10 +25,10 @@ #include -#include "xine_internal.h" -#include "video_out.h" +#include +#include #include "mpeg2_internal.h" -#include "attributes.h" +#include #include "vlc.h" diff --git a/src/libmpeg2/slice_xvmc.c b/src/libmpeg2/slice_xvmc.c index e21b1eb98..014ae7924 100644 --- a/src/libmpeg2/slice_xvmc.c +++ b/src/libmpeg2/slice_xvmc.c @@ -28,12 +28,12 @@ #include #include -#include "xine_internal.h" -#include "video_out.h" +#include +#include #include "mpeg2_internal.h" -#include "xineutils.h" +#include -#include "attributes.h" +#include #include "accel_xvmc.h" #include "xvmc.h" diff --git a/src/libmpeg2/slice_xvmc_vld.c b/src/libmpeg2/slice_xvmc_vld.c index 7e370a519..3606cf66b 100644 --- a/src/libmpeg2/slice_xvmc_vld.c +++ b/src/libmpeg2/slice_xvmc_vld.c @@ -17,8 +17,8 @@ * */ -#include "xine_internal.h" -#include "video_out.h" +#include +#include #include "mpeg2.h" #include "mpeg2_internal.h" #include "xvmc_vld.h" diff --git a/src/libmpeg2/xine_mpeg2_decoder.c b/src/libmpeg2/xine_mpeg2_decoder.c index ccce02186..3a3e28452 100644 --- a/src/libmpeg2/xine_mpeg2_decoder.c +++ b/src/libmpeg2/xine_mpeg2_decoder.c @@ -34,11 +34,11 @@ #define LOG */ -#include "xine_internal.h" -#include "video_out.h" +#include +#include #include "mpeg2.h" #include "mpeg2_internal.h" -#include "buffer.h" +#include typedef struct { video_decoder_class_t decoder_class; diff --git a/src/libmpeg2new/libmpeg2/idct_alpha.c b/src/libmpeg2new/libmpeg2/idct_alpha.c index 8f9beaf22..1d8fd08ee 100644 --- a/src/libmpeg2new/libmpeg2/idct_alpha.c +++ b/src/libmpeg2new/libmpeg2/idct_alpha.c @@ -30,7 +30,7 @@ #include #include "mpeg2.h" -#include "attributes.h" +#include #include "mpeg2_internal.h" #include "alpha_asm.h" diff --git a/src/libmpeg2new/libmpeg2/idct_altivec.c b/src/libmpeg2new/libmpeg2/idct_altivec.c index 6b1b8586c..f15bca165 100644 --- a/src/libmpeg2new/libmpeg2/idct_altivec.c +++ b/src/libmpeg2new/libmpeg2/idct_altivec.c @@ -31,7 +31,7 @@ #include #include "mpeg2.h" -#include "attributes.h" +#include #include "mpeg2_internal.h" typedef vector signed char vector_s8_t; diff --git a/src/libmpeg2new/libmpeg2/motion_comp_alpha.c b/src/libmpeg2new/libmpeg2/motion_comp_alpha.c index 05cd55084..1b3712a1a 100644 --- a/src/libmpeg2new/libmpeg2/motion_comp_alpha.c +++ b/src/libmpeg2new/libmpeg2/motion_comp_alpha.c @@ -27,7 +27,7 @@ #include #include "mpeg2.h" -#include "attributes.h" +#include #include "mpeg2_internal.h" #include "alpha_asm.h" diff --git a/src/libmpeg2new/libmpeg2/motion_comp_altivec.c b/src/libmpeg2new/libmpeg2/motion_comp_altivec.c index 4356aa6e7..ee740e14e 100644 --- a/src/libmpeg2new/libmpeg2/motion_comp_altivec.c +++ b/src/libmpeg2new/libmpeg2/motion_comp_altivec.c @@ -31,7 +31,7 @@ #include #include "mpeg2.h" -#include "attributes.h" +#include #include "mpeg2_internal.h" typedef vector signed char vector_s8_t; diff --git a/src/libmpeg2new/libmpeg2/motion_comp_vis.c b/src/libmpeg2new/libmpeg2/motion_comp_vis.c index 54c0f7e75..e724d28a2 100644 --- a/src/libmpeg2new/libmpeg2/motion_comp_vis.c +++ b/src/libmpeg2new/libmpeg2/motion_comp_vis.c @@ -27,7 +27,7 @@ #include #include "mpeg2.h" -#include "attributes.h" +#include #include "mpeg2_internal.h" #include "vis.h" diff --git a/src/libmpeg2new/libmpeg2/rgb.c b/src/libmpeg2new/libmpeg2/rgb.c index 8863b0b9f..e4abcacc2 100644 --- a/src/libmpeg2new/libmpeg2/rgb.c +++ b/src/libmpeg2new/libmpeg2/rgb.c @@ -22,7 +22,7 @@ */ #include "config.h" -#include "attributes.h" +#include #include diff --git a/src/libmpeg2new/libmpeg2/rgb_mmx.c b/src/libmpeg2new/libmpeg2/rgb_mmx.c index 912291c6a..6ca7e65a8 100644 --- a/src/libmpeg2new/libmpeg2/rgb_mmx.c +++ b/src/libmpeg2new/libmpeg2/rgb_mmx.c @@ -34,7 +34,7 @@ #include "mpeg2.h" #include "mpeg2convert.h" #include "convert_internal.h" -#include "attributes.h" +#include #include "mmx.h" #define CPU_MMXEXT 0 diff --git a/src/libmpeg2new/libmpeg2/rgb_vis.c b/src/libmpeg2new/libmpeg2/rgb_vis.c index 49d8d1d7c..cbd7c7072 100644 --- a/src/libmpeg2new/libmpeg2/rgb_vis.c +++ b/src/libmpeg2new/libmpeg2/rgb_vis.c @@ -30,7 +30,7 @@ #include "mpeg2.h" #include "mpeg2convert.h" #include "convert_internal.h" -#include "attributes.h" +#include #include "vis.h" /* Based partially upon the MMX yuv2rgb code, see there for credits. diff --git a/src/libmpeg2new/xine_mpeg2new_decoder.c b/src/libmpeg2new/xine_mpeg2new_decoder.c index 386b0049d..eeafee9c1 100644 --- a/src/libmpeg2new/xine_mpeg2new_decoder.c +++ b/src/libmpeg2new/xine_mpeg2new_decoder.c @@ -31,9 +31,9 @@ #include #include "./include/mpeg2.h" -#include "xine_internal.h" -#include "video_out.h" -#include "buffer.h" +#include +#include +#include diff --git a/src/libreal/real_common.h b/src/libreal/real_common.h index 1e3d8c264..74dc5e6e2 100644 --- a/src/libreal/real_common.h +++ b/src/libreal/real_common.h @@ -23,7 +23,7 @@ #ifndef __REAL_COMMON_H__ #define __REAL_COMMON_H__ -#include "xine_internal.h" +#include /* * some fake functions to make real codecs happy diff --git a/src/libreal/xine_real_audio_decoder.c b/src/libreal/xine_real_audio_decoder.c index 5c43f8480..bc928975d 100644 --- a/src/libreal/xine_real_audio_decoder.c +++ b/src/libreal/xine_real_audio_decoder.c @@ -38,10 +38,10 @@ */ #include "bswap.h" -#include "xine_internal.h" -#include "video_out.h" -#include "buffer.h" -#include "xineutils.h" +#include +#include +#include +#include #include "real_common.h" diff --git a/src/libreal/xine_real_video_decoder.c b/src/libreal/xine_real_video_decoder.c index 617c9f6b5..a32b3d3ef 100644 --- a/src/libreal/xine_real_video_decoder.c +++ b/src/libreal/xine_real_video_decoder.c @@ -37,10 +37,10 @@ #define LOG */ #include "bswap.h" -#include "xine_internal.h" -#include "video_out.h" -#include "buffer.h" -#include "xineutils.h" +#include +#include +#include +#include #include "real_common.h" diff --git a/src/libspucc/cc_decoder.c b/src/libspucc/cc_decoder.c index 8d666e847..e8fc09895 100644 --- a/src/libspucc/cc_decoder.c +++ b/src/libspucc/cc_decoder.c @@ -35,12 +35,12 @@ #include -#include "xine_internal.h" -#include "video_out.h" -#include "xineutils.h" -#include "osd.h" +#include +#include +#include +#include #include "cc_decoder.h" -#include "osd.h" +#include /* #define LOG_DEBUG 3 diff --git a/src/libspucc/xine_cc_decoder.c b/src/libspucc/xine_cc_decoder.c index 1e31b6d4a..e8a02a996 100644 --- a/src/libspucc/xine_cc_decoder.c +++ b/src/libspucc/xine_cc_decoder.c @@ -24,9 +24,9 @@ #include #include -#include "buffer.h" -#include "xine_internal.h" -#include "xineutils.h" +#include +#include +#include #include "cc_decoder.h" /* diff --git a/src/libspucmml/xine_cmml_decoder.c b/src/libspucmml/xine_cmml_decoder.c index 6c045ee04..6ce6d3f90 100644 --- a/src/libspucmml/xine_cmml_decoder.c +++ b/src/libspucmml/xine_cmml_decoder.c @@ -30,7 +30,7 @@ #define SUB_BUFSIZE 1024 #define SUB_MAX_TEXT 5 -#include "xine_internal.h" +#include typedef enum { SUBTITLE_SIZE_SMALL = 0, diff --git a/src/libspudec/spu.c b/src/libspudec/spu.c index ce3497ef0..c836dbf58 100644 --- a/src/libspudec/spu.c +++ b/src/libspudec/spu.c @@ -47,10 +47,10 @@ #include #include -#include "xine_internal.h" -#include "xineutils.h" +#include +#include #include "spu.h" -#include "buffer.h" +#include #include "xine-engine/bswap.h" #ifdef HAVE_DVDNAV # include diff --git a/src/libspudec/spu.h b/src/libspudec/spu.h index 8d92146f0..1e7d80596 100644 --- a/src/libspudec/spu.h +++ b/src/libspudec/spu.h @@ -30,8 +30,8 @@ #endif #include -#include "video_out.h" -#include "video_overlay.h" +#include +#include #ifdef HAVE_DVDNAV # include #else diff --git a/src/libspudec/xine_spu_decoder.c b/src/libspudec/xine_spu_decoder.c index 93ea3c3a2..7f0269dfb 100644 --- a/src/libspudec/xine_spu_decoder.c +++ b/src/libspudec/xine_spu_decoder.c @@ -29,10 +29,10 @@ #include #include -#include "xine_internal.h" -#include "buffer.h" +#include +#include #include "xine-engine/bswap.h" -#include "xineutils.h" +#include #include "spu.h" #ifdef HAVE_DVDNAV # include diff --git a/src/libspudvb/xine_spudvb_decoder.c b/src/libspudvb/xine_spudvb_decoder.c index 59790227c..9008260f7 100644 --- a/src/libspudvb/xine_spudvb_decoder.c +++ b/src/libspudvb/xine_spudvb_decoder.c @@ -27,9 +27,9 @@ #include "pthread.h" #include -#include "xine_internal.h" -#include "spu.h" -#include "osd.h" +#include +#include +#include #define MAX_REGIONS 7 /*#define LOG 1*/ diff --git a/src/libsputext/demux_sputext.c b/src/libsputext/demux_sputext.c index 811bdcbd6..270894f50 100644 --- a/src/libsputext/demux_sputext.c +++ b/src/libsputext/demux_sputext.c @@ -47,9 +47,9 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "../demuxers/demux.h" +#include +#include +#include #define ERR (void *)-1 #define SUB_MAX_TEXT 5 diff --git a/src/libsputext/xine_sputext_decoder.c b/src/libsputext/xine_sputext_decoder.c index d28e67829..12d1986bb 100644 --- a/src/libsputext/xine_sputext_decoder.c +++ b/src/libsputext/xine_sputext_decoder.c @@ -33,10 +33,10 @@ #define LOG */ -#include "buffer.h" -#include "xine_internal.h" -#include "xineutils.h" -#include "osd.h" +#include +#include +#include +#include #define SUB_MAX_TEXT 5 /* lines */ #define SUB_BUFSIZE 256 /* chars per line */ diff --git a/src/libw32dll/qt_decoder.c b/src/libw32dll/qt_decoder.c index ca358bb9b..64e30d637 100644 --- a/src/libw32dll/qt_decoder.c +++ b/src/libw32dll/qt_decoder.c @@ -38,9 +38,9 @@ */ #include "bswap.h" -#include "xine_internal.h" -#include "audio_out.h" -#include "buffer.h" +#include +#include +#include #include "qtx/qtxsdk/components.h" #include "wine/win32.h" diff --git a/src/libw32dll/w32codec.c b/src/libw32dll/w32codec.c index 3b66dfb23..bcb5db53c 100644 --- a/src/libw32dll/w32codec.c +++ b/src/libw32dll/w32codec.c @@ -50,11 +50,11 @@ #define LOG */ -#include "xine_internal.h" -#include "video_out.h" -#include "audio_out.h" -#include "buffer.h" -#include "xineutils.h" +#include +#include +#include +#include +#include #include "common.c" diff --git a/src/libw32dll/wine/registry.c b/src/libw32dll/wine/registry.c index c8e3c4dd0..20c21888d 100644 --- a/src/libw32dll/wine/registry.c +++ b/src/libw32dll/wine/registry.c @@ -18,7 +18,7 @@ #include "debugtools.h" #ifdef XINE_MAJOR -#include "xineutils.h" +#include #include #endif diff --git a/src/libw32dll/wine/win32.c b/src/libw32dll/wine/win32.c index 3b0941391..ce8132d3f 100644 --- a/src/libw32dll/wine/win32.c +++ b/src/libw32dll/wine/win32.c @@ -12,7 +12,7 @@ for DLL to know too much about its environment. ************************************************************/ #include "config.h" -#include "attributes.h" +#include #define QTX diff --git a/src/libxineadec/fooaudio.c b/src/libxineadec/fooaudio.c index 42427611f..b0ef63454 100644 --- a/src/libxineadec/fooaudio.c +++ b/src/libxineadec/fooaudio.c @@ -28,10 +28,10 @@ #include #include -#include "xine_internal.h" -#include "audio_out.h" -#include "buffer.h" -#include "xineutils.h" +#include +#include +#include +#include #include "bswap.h" /* math.h required for fooaudio sine wave generation */ diff --git a/src/libxineadec/gsm610.c b/src/libxineadec/gsm610.c index 4ca3827d7..8192aa7d8 100644 --- a/src/libxineadec/gsm610.c +++ b/src/libxineadec/gsm610.c @@ -52,10 +52,10 @@ #include #include -#include "xine_internal.h" -#include "audio_out.h" -#include "buffer.h" -#include "xineutils.h" +#include +#include +#include +#include #include "bswap.h" #include "private.h" diff --git a/src/libxineadec/xine_a52_decoder.c b/src/libxineadec/xine_a52_decoder.c index 2d901d00a..e34504553 100644 --- a/src/libxineadec/xine_a52_decoder.c +++ b/src/libxineadec/xine_a52_decoder.c @@ -44,8 +44,8 @@ #define LOG_PTS */ -#include "xine_internal.h" -#include "audio_out.h" +#include +#include #ifdef HAVE_A52DEC_A52_H # include @@ -59,8 +59,8 @@ # include "a52_internal.h" #endif -#include "buffer.h" -#include "xineutils.h" +#include +#include #include "../../contrib/a52dec/crc.c" diff --git a/src/libxineadec/xine_dts_decoder.c b/src/libxineadec/xine_dts_decoder.c index 369c354fd..9d2fc5e93 100644 --- a/src/libxineadec/xine_dts_decoder.c +++ b/src/libxineadec/xine_dts_decoder.c @@ -47,10 +47,10 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "audio_out.h" -#include "buffer.h" +#include +#include +#include +#include #include "bswap.h" diff --git a/src/libxineadec/xine_faad_decoder.c b/src/libxineadec/xine_faad_decoder.c index c12e7816d..6b242005a 100644 --- a/src/libxineadec/xine_faad_decoder.c +++ b/src/libxineadec/xine_faad_decoder.c @@ -31,10 +31,10 @@ #define LOG */ -#include "xine_internal.h" -#include "audio_out.h" -#include "buffer.h" -#include "xineutils.h" +#include +#include +#include +#include #ifdef HAVE_NEAACDEC_H #include #else diff --git a/src/libxineadec/xine_lpcm_decoder.c b/src/libxineadec/xine_lpcm_decoder.c index 96c02906d..51d2e3137 100644 --- a/src/libxineadec/xine_lpcm_decoder.c +++ b/src/libxineadec/xine_lpcm_decoder.c @@ -39,9 +39,9 @@ #include #include /* ntohs */ -#include "xine_internal.h" -#include "audio_out.h" -#include "buffer.h" +#include +#include +#include #ifdef WIN32 #include diff --git a/src/libxineadec/xine_mad_decoder.c b/src/libxineadec/xine_mad_decoder.c index 906db048a..21e5bf46b 100644 --- a/src/libxineadec/xine_mad_decoder.c +++ b/src/libxineadec/xine_mad_decoder.c @@ -34,10 +34,10 @@ #define LOG */ -#include "xine_internal.h" -#include "audio_out.h" -#include "buffer.h" -#include "xineutils.h" +#include +#include +#include +#include #ifdef HAVE_MAD_H # include diff --git a/src/libxineadec/xine_musepack_decoder.c b/src/libxineadec/xine_musepack_decoder.c index d23d1546c..268846a1a 100644 --- a/src/libxineadec/xine_musepack_decoder.c +++ b/src/libxineadec/xine_musepack_decoder.c @@ -39,10 +39,10 @@ #define LOG */ -#include "xine_internal.h" -#include "audio_out.h" -#include "buffer.h" -#include "xineutils.h" +#include +#include +#include +#include #include diff --git a/src/libxinevdec/bitplane.c b/src/libxinevdec/bitplane.c index c8400f464..327e14aee 100644 --- a/src/libxinevdec/bitplane.c +++ b/src/libxinevdec/bitplane.c @@ -35,10 +35,10 @@ #include #include -#include "xine_internal.h" -#include "video_out.h" -#include "buffer.h" -#include "xineutils.h" +#include +#include +#include +#include #include "bswap.h" #include "demuxers/iff.h" diff --git a/src/libxinevdec/foovideo.c b/src/libxinevdec/foovideo.c index b33705a3f..49c63422c 100644 --- a/src/libxinevdec/foovideo.c +++ b/src/libxinevdec/foovideo.c @@ -30,10 +30,10 @@ #include #include -#include "xine_internal.h" -#include "video_out.h" -#include "buffer.h" -#include "xineutils.h" +#include +#include +#include +#include #include "bswap.h" #define VIDEOBUFSIZE 128*1024 diff --git a/src/libxinevdec/gdkpixbuf.c b/src/libxinevdec/gdkpixbuf.c index 7fd4a6a0e..28c9c77c7 100644 --- a/src/libxinevdec/gdkpixbuf.c +++ b/src/libxinevdec/gdkpixbuf.c @@ -35,10 +35,10 @@ #define LOG */ -#include "xine_internal.h" -#include "video_out.h" -#include "buffer.h" -#include "xineutils.h" +#include +#include +#include +#include #include "bswap.h" #include diff --git a/src/libxinevdec/image.c b/src/libxinevdec/image.c index 7a97972c7..e84312624 100644 --- a/src/libxinevdec/image.c +++ b/src/libxinevdec/image.c @@ -44,10 +44,10 @@ #undef PACKAGE_VERSION #endif -#include "xine_internal.h" -#include "video_out.h" -#include "buffer.h" -#include "xineutils.h" +#include +#include +#include +#include #include "bswap.h" typedef struct { diff --git a/src/libxinevdec/rgb.c b/src/libxinevdec/rgb.c index 5360fd8b2..9c8409e5f 100644 --- a/src/libxinevdec/rgb.c +++ b/src/libxinevdec/rgb.c @@ -42,10 +42,10 @@ /* #define LOG */ -#include "xine_internal.h" -#include "video_out.h" -#include "buffer.h" -#include "xineutils.h" +#include +#include +#include +#include #include "bswap.h" typedef struct { diff --git a/src/libxinevdec/yuv.c b/src/libxinevdec/yuv.c index 352f59e9a..c1e5825c5 100644 --- a/src/libxinevdec/yuv.c +++ b/src/libxinevdec/yuv.c @@ -28,10 +28,10 @@ #include #include -#include "xine_internal.h" -#include "video_out.h" -#include "buffer.h" -#include "xineutils.h" +#include +#include +#include +#include #include "bswap.h" #define VIDEOBUFSIZE 128*1024 diff --git a/src/post/audio/audio_filters.c b/src/post/audio/audio_filters.c index 8200db51b..b7f53499a 100644 --- a/src/post/audio/audio_filters.c +++ b/src/post/audio/audio_filters.c @@ -21,9 +21,9 @@ */ -#include "xine_internal.h" -#include "xineutils.h" -#include "post.h" +#include +#include +#include #include "audio_filters.h" diff --git a/src/post/audio/audio_filters.h b/src/post/audio/audio_filters.h index 6c064945a..8a0202751 100644 --- a/src/post/audio/audio_filters.h +++ b/src/post/audio/audio_filters.h @@ -20,7 +20,7 @@ * catalog for audio filter plugins */ -#include "xine_internal.h" +#include void *upmix_init_plugin(xine_t *xine, void *data); diff --git a/src/post/audio/stretch.c b/src/post/audio/stretch.c index f02b1b899..bc079fd8d 100644 --- a/src/post/audio/stretch.c +++ b/src/post/audio/stretch.c @@ -22,11 +22,11 @@ #include -#include "xine_internal.h" -#include "xineutils.h" -#include "post.h" +#include +#include +#include #include "dsp.h" -#include "resample.h" +#include #include "audio_filters.h" diff --git a/src/post/audio/upmix.c b/src/post/audio/upmix.c index 4d0e2c2a2..30fbb452b 100644 --- a/src/post/audio/upmix.c +++ b/src/post/audio/upmix.c @@ -26,9 +26,9 @@ #include -#include "xine_internal.h" -#include "xineutils.h" -#include "post.h" +#include +#include +#include #include "dsp.h" #include "audio_filters.h" diff --git a/src/post/audio/upmix_mono.c b/src/post/audio/upmix_mono.c index b28b1f3f5..53fd23109 100644 --- a/src/post/audio/upmix_mono.c +++ b/src/post/audio/upmix_mono.c @@ -31,8 +31,8 @@ #define LOG */ -#include "xineutils.h" -#include "post.h" +#include +#include #include "audio_filters.h" diff --git a/src/post/audio/volnorm.c b/src/post/audio/volnorm.c index 7533ba94a..4fb2a0411 100644 --- a/src/post/audio/volnorm.c +++ b/src/post/audio/volnorm.c @@ -25,9 +25,9 @@ #include #include -#include "xine_internal.h" -#include "xineutils.h" -#include "post.h" +#include +#include +#include #include "dsp.h" #include "audio_filters.h" diff --git a/src/post/deinterlace/deinterlace.c b/src/post/deinterlace/deinterlace.c index 8e4a3bb00..5c0356c55 100644 --- a/src/post/deinterlace/deinterlace.c +++ b/src/post/deinterlace/deinterlace.c @@ -31,7 +31,7 @@ */ #include "deinterlace.h" -#include "xine_internal.h" +#include typedef struct methodlist_item_s methodlist_item_t; diff --git a/src/post/deinterlace/plugins/greedy.c b/src/post/deinterlace/plugins/greedy.c index b5fcad3e5..fc8013a6d 100644 --- a/src/post/deinterlace/plugins/greedy.c +++ b/src/post/deinterlace/plugins/greedy.c @@ -32,8 +32,8 @@ #include #endif -#include "attributes.h" -#include "xineutils.h" +#include +#include #include "deinterlace.h" #include "speedtools.h" #include "speedy.h" diff --git a/src/post/deinterlace/plugins/greedy2frame.c b/src/post/deinterlace/plugins/greedy2frame.c index 57e3228ac..af27d76ee 100644 --- a/src/post/deinterlace/plugins/greedy2frame.c +++ b/src/post/deinterlace/plugins/greedy2frame.c @@ -31,8 +31,8 @@ #include #endif -#include "attributes.h" -#include "xineutils.h" +#include +#include #include "deinterlace.h" #include "speedtools.h" #include "speedy.h" diff --git a/src/post/deinterlace/plugins/kdetv_greedyh.c b/src/post/deinterlace/plugins/kdetv_greedyh.c index 5ec48e4a2..2207772ca 100644 --- a/src/post/deinterlace/plugins/kdetv_greedyh.c +++ b/src/post/deinterlace/plugins/kdetv_greedyh.c @@ -31,8 +31,8 @@ #include #endif -#include "attributes.h" -#include "xineutils.h" +#include +#include #include "deinterlace.h" #include "speedtools.h" #include "speedy.h" diff --git a/src/post/deinterlace/plugins/kdetv_tomsmocomp.c b/src/post/deinterlace/plugins/kdetv_tomsmocomp.c index ae0fa0363..0f87b913f 100644 --- a/src/post/deinterlace/plugins/kdetv_tomsmocomp.c +++ b/src/post/deinterlace/plugins/kdetv_tomsmocomp.c @@ -31,8 +31,8 @@ #include #endif -#include "attributes.h" -#include "xineutils.h" +#include +#include #include "deinterlace.h" #include "speedtools.h" #include "speedy.h" diff --git a/src/post/deinterlace/plugins/linearblend.c b/src/post/deinterlace/plugins/linearblend.c index 96e56063f..4664a4969 100644 --- a/src/post/deinterlace/plugins/linearblend.c +++ b/src/post/deinterlace/plugins/linearblend.c @@ -31,8 +31,8 @@ #include #endif -#include "attributes.h" -#include "xineutils.h" +#include +#include #include "speedtools.h" #include "speedy.h" #include "deinterlace.h" diff --git a/src/post/deinterlace/plugins/vfir.c b/src/post/deinterlace/plugins/vfir.c index e66d7c789..d66c92952 100644 --- a/src/post/deinterlace/plugins/vfir.c +++ b/src/post/deinterlace/plugins/vfir.c @@ -34,8 +34,8 @@ #include #endif -#include "attributes.h" -#include "xineutils.h" +#include +#include #include "speedy.h" #include "deinterlace.h" #include "plugins.h" diff --git a/src/post/deinterlace/speedy.c b/src/post/deinterlace/speedy.c index a980780d7..d93b56c7b 100644 --- a/src/post/deinterlace/speedy.c +++ b/src/post/deinterlace/speedy.c @@ -62,8 +62,8 @@ #include #endif -#include "attributes.h" -#include "xineutils.h" +#include +#include #include "speedtools.h" #include "speedy.h" diff --git a/src/post/deinterlace/xine_plugin.c b/src/post/deinterlace/xine_plugin.c index 68eabba67..5f3f8de97 100644 --- a/src/post/deinterlace/xine_plugin.c +++ b/src/post/deinterlace/xine_plugin.c @@ -27,10 +27,10 @@ #define LOG */ -#include "xine_internal.h" -#include "post.h" -#include "xineutils.h" -#include "xine_buffer.h" +#include +#include +#include +#include #include #include "tvtime.h" diff --git a/src/post/goom/goom_core.c b/src/post/goom/goom_core.c index b24f2f496..274059da4 100644 --- a/src/post/goom/goom_core.c +++ b/src/post/goom/goom_core.c @@ -26,7 +26,7 @@ #include "goom_fx.h" #include "goomsl.h" -#include "xine_internal.h" +#include /* #define VERBOSE */ diff --git a/src/post/goom/mmx.h b/src/post/goom/mmx.h index 88789e86f..6861b7cfe 100644 --- a/src/post/goom/mmx.h +++ b/src/post/goom/mmx.h @@ -31,7 +31,7 @@ # include "config.h" #endif -#include "attributes.h" +#include #include "goom_graphic.h" diff --git a/src/post/goom/xine_goom.c b/src/post/goom/xine_goom.c index 0b540694d..50e72472b 100644 --- a/src/post/goom/xine_goom.c +++ b/src/post/goom/xine_goom.c @@ -35,9 +35,9 @@ */ #include "config.h" -#include "xine_internal.h" -#include "xineutils.h" -#include "post.h" +#include +#include +#include #include "goom.h" diff --git a/src/post/mosaico/mosaico.c b/src/post/mosaico/mosaico.c index 5683002f6..a3e846026 100644 --- a/src/post/mosaico/mosaico.c +++ b/src/post/mosaico/mosaico.c @@ -28,8 +28,8 @@ #define LOG */ -#include "xine_internal.h" -#include "post.h" +#include +#include /* FIXME: This plugin needs to handle overlays as well. */ diff --git a/src/post/mosaico/switch.c b/src/post/mosaico/switch.c index 23469e566..de963c7b3 100644 --- a/src/post/mosaico/switch.c +++ b/src/post/mosaico/switch.c @@ -28,8 +28,8 @@ #define LOG */ -#include "xine_internal.h" -#include "post.h" +#include +#include /* FIXME: This plugin needs to handle overlays as well. */ diff --git a/src/post/planar/boxblur.c b/src/post/planar/boxblur.c index 225e75954..988729af0 100644 --- a/src/post/planar/boxblur.c +++ b/src/post/planar/boxblur.c @@ -21,9 +21,9 @@ * Copyright (C) 2002 Michael Niedermayer */ -#include "xine_internal.h" -#include "post.h" -#include "xineutils.h" +#include +#include +#include #include /* plugin class initialization function */ diff --git a/src/post/planar/denoise3d.c b/src/post/planar/denoise3d.c index fb7021ece..bec59b35f 100644 --- a/src/post/planar/denoise3d.c +++ b/src/post/planar/denoise3d.c @@ -21,9 +21,9 @@ * Copyright (C) 2003 Daniel Moreno */ -#include "xine_internal.h" -#include "post.h" -#include "xineutils.h" +#include +#include +#include #include #include diff --git a/src/post/planar/eq.c b/src/post/planar/eq.c index 03f647d68..e62a808c1 100644 --- a/src/post/planar/eq.c +++ b/src/post/planar/eq.c @@ -21,9 +21,9 @@ * Copyright (C) Richard Felker */ -#include "xine_internal.h" -#include "post.h" -#include "xineutils.h" +#include +#include +#include #include diff --git a/src/post/planar/eq2.c b/src/post/planar/eq2.c index ceb9f9024..42f4580d9 100644 --- a/src/post/planar/eq2.c +++ b/src/post/planar/eq2.c @@ -25,9 +25,9 @@ * Richard Felker (original MMX contrast/brightness code (vf_eq.c)) */ -#include "xine_internal.h" -#include "post.h" -#include "xineutils.h" +#include +#include +#include #include #include diff --git a/src/post/planar/expand.c b/src/post/planar/expand.c index db62a5512..90547163f 100644 --- a/src/post/planar/expand.c +++ b/src/post/planar/expand.c @@ -27,8 +27,8 @@ * */ -#include "xine_internal.h" -#include "post.h" +#include +#include /* The expand trick explained: * diff --git a/src/post/planar/fill.c b/src/post/planar/fill.c index 62fdc1381..6dd5ce23b 100644 --- a/src/post/planar/fill.c +++ b/src/post/planar/fill.c @@ -22,8 +22,8 @@ * based on invert.c */ -#include "xine_internal.h" -#include "post.h" +#include +#include /* plugin class initialization function */ void *fill_init_plugin(xine_t *xine, void *); diff --git a/src/post/planar/invert.c b/src/post/planar/invert.c index b5ee1e3f2..8c1b6103a 100644 --- a/src/post/planar/invert.c +++ b/src/post/planar/invert.c @@ -22,8 +22,8 @@ * simple video inverter plugin */ -#include "xine_internal.h" -#include "post.h" +#include +#include /* plugin class initialization function */ diff --git a/src/post/planar/noise.c b/src/post/planar/noise.c index afe05b180..90ec331ee 100644 --- a/src/post/planar/noise.c +++ b/src/post/planar/noise.c @@ -21,9 +21,9 @@ * is copyright 2002 Michael Niedermayer */ -#include "xine_internal.h" -#include "post.h" -#include "xineutils.h" +#include +#include +#include #include #include diff --git a/src/post/planar/planar.c b/src/post/planar/planar.c index 5907d58e5..220fce68e 100644 --- a/src/post/planar/planar.c +++ b/src/post/planar/planar.c @@ -20,9 +20,9 @@ * catalog for planar post plugins */ -#include "xine_internal.h" -#include "post.h" -#include "xineutils.h" +#include +#include +#include extern void *invert_init_plugin(xine_t *xine, void *); static const post_info_t invert_special_info = { XINE_POST_TYPE_VIDEO_FILTER }; diff --git a/src/post/planar/pp.c b/src/post/planar/pp.c index 3f9c0d745..484afdd31 100644 --- a/src/post/planar/pp.c +++ b/src/post/planar/pp.c @@ -20,9 +20,9 @@ * plugin for ffmpeg libpostprocess */ -#include "xine_internal.h" -#include "post.h" -#include "xineutils.h" +#include +#include +#include #include "postprocess.h" #include diff --git a/src/post/planar/unsharp.c b/src/post/planar/unsharp.c index ff86f21bc..591f32a7b 100644 --- a/src/post/planar/unsharp.c +++ b/src/post/planar/unsharp.c @@ -21,9 +21,9 @@ * Copyright (C) 2002 Rémi Guyomarch */ -#include "xine_internal.h" -#include "post.h" -#include "xineutils.h" +#include +#include +#include #include #ifndef MIN diff --git a/src/post/visualizations/fftgraph.c b/src/post/visualizations/fftgraph.c index 7e7f52fbf..c31c529f2 100644 --- a/src/post/visualizations/fftgraph.c +++ b/src/post/visualizations/fftgraph.c @@ -26,9 +26,9 @@ #include -#include "xine_internal.h" -#include "xineutils.h" -#include "post.h" +#include +#include +#include #include "bswap.h" #include "visualizations.h" #include "fft.h" diff --git a/src/post/visualizations/fftscope.c b/src/post/visualizations/fftscope.c index 917af508d..dd474bd6f 100644 --- a/src/post/visualizations/fftscope.c +++ b/src/post/visualizations/fftscope.c @@ -26,9 +26,9 @@ #include #include -#include "xine_internal.h" -#include "xineutils.h" -#include "post.h" +#include +#include +#include #include "bswap.h" #include "visualizations.h" #include "fft.h" diff --git a/src/post/visualizations/fooviz.c b/src/post/visualizations/fooviz.c index 78803f8d2..54cd65db4 100644 --- a/src/post/visualizations/fooviz.c +++ b/src/post/visualizations/fooviz.c @@ -26,9 +26,9 @@ #include -#include "xine_internal.h" -#include "xineutils.h" -#include "post.h" +#include +#include +#include #define FPS 20 diff --git a/src/post/visualizations/oscope.c b/src/post/visualizations/oscope.c index 86b8b2750..1d498980a 100644 --- a/src/post/visualizations/oscope.c +++ b/src/post/visualizations/oscope.c @@ -23,9 +23,9 @@ #include -#include "xine_internal.h" -#include "xineutils.h" -#include "post.h" +#include +#include +#include #include "visualizations.h" #define FPS 20 diff --git a/src/post/visualizations/visualizations.c b/src/post/visualizations/visualizations.c index a26f0bd5b..db111bdd8 100644 --- a/src/post/visualizations/visualizations.c +++ b/src/post/visualizations/visualizations.c @@ -24,8 +24,8 @@ #include "config.h" #endif -#include "xine_internal.h" -#include "post.h" +#include +#include #include "visualizations.h" diff --git a/src/post/visualizations/visualizations.h b/src/post/visualizations/visualizations.h index 39d02e1cb..c72a1ad77 100644 --- a/src/post/visualizations/visualizations.h +++ b/src/post/visualizations/visualizations.h @@ -20,7 +20,7 @@ * This file contains plugin entries for several visualization post plugins. */ -#include "xine_internal.h" +#include void *oscope_init_plugin(xine_t *xine, void *data); void *fftscope_init_plugin(xine_t *xine, void *data); diff --git a/src/vdr/input_vdr.c b/src/vdr/input_vdr.c index 946e963a3..545e3fcc2 100644 --- a/src/vdr/input_vdr.c +++ b/src/vdr/input_vdr.c @@ -41,9 +41,9 @@ /* #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" -#include "input_plugin.h" +#include +#include +#include #include "input_vdr.h" #include "post_vdr.h" diff --git a/src/vdr/post_vdr.c b/src/vdr/post_vdr.c index a9b7cbc37..77b8b56fc 100644 --- a/src/vdr/post_vdr.c +++ b/src/vdr/post_vdr.c @@ -22,8 +22,8 @@ * plugins for VDR */ -#include "xine_internal.h" -#include "post.h" +#include +#include #include "post_vdr.h" diff --git a/src/vdr/post_vdr_audio.c b/src/vdr/post_vdr_audio.c index 96fa84fb5..79015ec21 100644 --- a/src/vdr/post_vdr_audio.c +++ b/src/vdr/post_vdr_audio.c @@ -28,8 +28,8 @@ #define LOG */ -#include "xine_internal.h" -#include "post.h" +#include +#include #include "post_vdr.h" diff --git a/src/vdr/post_vdr_video.c b/src/vdr/post_vdr_video.c index ed0eafc35..8e66c8eb5 100644 --- a/src/vdr/post_vdr_video.c +++ b/src/vdr/post_vdr_video.c @@ -28,8 +28,8 @@ #define LOG */ -#include "xine_internal.h" -#include "post.h" +#include +#include #include "post_vdr.h" diff --git a/src/video_out/macosx/XineOpenGLView.m b/src/video_out/macosx/XineOpenGLView.m index a9ffee00f..5ed515704 100644 --- a/src/video_out/macosx/XineOpenGLView.m +++ b/src/video_out/macosx/XineOpenGLView.m @@ -30,11 +30,7 @@ #import "XineOpenGLView.h" -#ifdef XINE_COMPILE -# include "xineutils.h" -#else -# include -#endif +#include NSString *XineViewDidResizeNotification EXPORTED = @"XineViewDidResizeNotification"; diff --git a/src/video_out/video_out_aa.c b/src/video_out/video_out_aa.c index bcbe2477e..ff9abd320 100644 --- a/src/video_out/video_out_aa.c +++ b/src/video_out/video_out_aa.c @@ -38,9 +38,9 @@ #include #include "xine.h" -#include "video_out.h" -#include "xine_internal.h" -#include "xineutils.h" +#include +#include +#include /* * global variables diff --git a/src/video_out/video_out_caca.c b/src/video_out/video_out_caca.c index 231befcdb..6b9f3756e 100644 --- a/src/video_out/video_out_caca.c +++ b/src/video_out/video_out_caca.c @@ -38,10 +38,10 @@ #include #include "xine.h" -#include "video_out.h" -#include "xine_internal.h" +#include +#include #include "yuv2rgb.h" -#include "xineutils.h" +#include /* * structures diff --git a/src/video_out/video_out_directfb.c b/src/video_out/video_out_directfb.c index 3445be127..39a7917ba 100644 --- a/src/video_out/video_out_directfb.c +++ b/src/video_out/video_out_directfb.c @@ -39,10 +39,10 @@ #define LOG_VERBOSE #include "xine.h" -#include "xine_internal.h" -#include "video_out.h" -#include "xineutils.h" -#include "vo_scale.h" +#include +#include +#include +#include #ifdef DIRECTFB_X11 # include "x11osd.h" diff --git a/src/video_out/video_out_directx.c b/src/video_out/video_out_directx.c index b70709856..c2b3aa101 100644 --- a/src/video_out/video_out_directx.c +++ b/src/video_out/video_out_directx.c @@ -35,10 +35,10 @@ typedef unsigned char boolean; */ #include "xine.h" -#include "video_out.h" -#include "xine_internal.h" +#include +#include -#include "xine_internal.h" +#include #include "yuv2rgb.h" #define NEW_YUV 1 diff --git a/src/video_out/video_out_fb.c b/src/video_out/video_out_fb.c index 859959455..4914548a1 100644 --- a/src/video_out/video_out_fb.c +++ b/src/video_out/video_out_fb.c @@ -55,7 +55,7 @@ #include #include "xine.h" -#include "video_out.h" +#include #include @@ -78,10 +78,10 @@ #define LOG */ -#include "xine_internal.h" +#include #include "yuv2rgb.h" -#include "xineutils.h" -#include "vo_scale.h" +#include +#include typedef struct fb_frame_s { diff --git a/src/video_out/video_out_none.c b/src/video_out/video_out_none.c index c28b0334e..c23c828a6 100644 --- a/src/video_out/video_out_none.c +++ b/src/video_out/video_out_none.c @@ -33,10 +33,10 @@ #include "xine.h" -#include "video_out.h" -#include "xine_internal.h" -#include "xineutils.h" -#include "vo_scale.h" +#include +#include +#include +#include typedef struct { vo_frame_t vo_frame; diff --git a/src/video_out/video_out_opengl.c b/src/video_out/video_out_opengl.c index 04413eb80..466aeda27 100644 --- a/src/video_out/video_out_opengl.c +++ b/src/video_out/video_out_opengl.c @@ -88,11 +88,11 @@ #endif #include "xine.h" -#include "video_out.h" +#include -#include "xine_internal.h" +#include #include "yuv2rgb.h" -#include "xineutils.h" +#include #include "x11osd.h" diff --git a/src/video_out/video_out_pgx32.c b/src/video_out/video_out_pgx32.c index 505a257ce..884f9939f 100644 --- a/src/video_out/video_out_pgx32.c +++ b/src/video_out/video_out_pgx32.c @@ -41,10 +41,10 @@ #include #include -#include "xine_internal.h" +#include #include "bswap.h" -#include "vo_scale.h" -#include "xineutils.h" +#include +#include /* gfxp register defines */ diff --git a/src/video_out/video_out_pgx64.c b/src/video_out/video_out_pgx64.c index 21dcdfb09..d0e74b1e3 100644 --- a/src/video_out/video_out_pgx64.c +++ b/src/video_out/video_out_pgx64.c @@ -43,10 +43,10 @@ #include #include -#include "xine_internal.h" +#include #include "bswap.h" -#include "vo_scale.h" -#include "xineutils.h" +#include +#include /* * The maximum number of frames that can be used in multi-buffering diff --git a/src/video_out/video_out_sdl.c b/src/video_out/video_out_sdl.c index 6ee6b19bd..5866f822f 100644 --- a/src/video_out/video_out_sdl.c +++ b/src/video_out/video_out_sdl.c @@ -59,10 +59,10 @@ */ #include "xine.h" -#include "xine_internal.h" -#include "video_out.h" -#include "xineutils.h" -#include "vo_scale.h" +#include +#include +#include +#include #ifdef HAVE_X11 #include diff --git a/src/video_out/video_out_stk.c b/src/video_out/video_out_stk.c index 45e9900fd..ba4687b08 100644 --- a/src/video_out/video_out_stk.c +++ b/src/video_out/video_out_stk.c @@ -59,10 +59,10 @@ */ #include "xine.h" -#include "xine_internal.h" -#include "video_out.h" -#include "xineutils.h" -#include "vo_scale.h" +#include +#include +#include +#include /* Extend the video frame class with stk private data */ typedef struct stk_frame_s { diff --git a/src/video_out/video_out_syncfb.c b/src/video_out/video_out_syncfb.c index 013695c46..e6c3ffdf6 100644 --- a/src/video_out/video_out_syncfb.c +++ b/src/video_out/video_out_syncfb.c @@ -52,10 +52,10 @@ #include "video_out_syncfb.h" #include "xine.h" -#include "video_out.h" -#include "xine_internal.h" -#include "xineutils.h" -#include "vo_scale.h" +#include +#include +#include +#include /*#define DEBUG_OUTPUT*/ diff --git a/src/video_out/video_out_vidix.c b/src/video_out/video_out_vidix.c index 3228bbdbb..251dac87e 100644 --- a/src/video_out/video_out_vidix.c +++ b/src/video_out/video_out_vidix.c @@ -57,10 +57,10 @@ #define LOG */ -#include "video_out.h" -#include "xine_internal.h" -#include "xineutils.h" -#include "vo_scale.h" +#include +#include +#include +#include #ifdef HAVE_X11 #include "x11osd.h" diff --git a/src/video_out/video_out_xcbshm.c b/src/video_out/video_out_xcbshm.c index c6ad9e2f1..9e9df7a71 100644 --- a/src/video_out/video_out_xcbshm.c +++ b/src/video_out/video_out_xcbshm.c @@ -37,7 +37,7 @@ #include #include "xine.h" -#include "video_out.h" +#include #include @@ -56,10 +56,10 @@ #define LOG */ -#include "xine_internal.h" +#include #include "yuv2rgb.h" -#include "xineutils.h" -#include "vo_scale.h" +#include +#include #include "xcbosd.h" typedef struct { diff --git a/src/video_out/video_out_xcbxv.c b/src/video_out/video_out_xcbxv.c index 1b59f5691..dff973317 100644 --- a/src/video_out/video_out_xcbxv.c +++ b/src/video_out/video_out_xcbxv.c @@ -58,11 +58,11 @@ */ #include "xine.h" -#include "video_out.h" -#include "xine_internal.h" +#include +#include /* #include "overlay.h" */ -#include "xineutils.h" -#include "vo_scale.h" +#include +#include #include "xcbosd.h" typedef struct xv_driver_s xv_driver_t; diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c index ddcdb677c..52468781a 100644 --- a/src/video_out/video_out_xshm.c +++ b/src/video_out/video_out_xshm.c @@ -35,7 +35,7 @@ #include #include "xine.h" -#include "video_out.h" +#include #include #include @@ -57,10 +57,10 @@ #define LOG */ -#include "xine_internal.h" +#include #include "yuv2rgb.h" -#include "xineutils.h" -#include "vo_scale.h" +#include +#include #include "x11osd.h" #define LOCK_DISPLAY(this) {if(this->lock_display) this->lock_display(this->user_data); \ diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index ab5410ac3..10e13ab3c 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.c @@ -63,11 +63,11 @@ */ #include "xine.h" -#include "video_out.h" -#include "xine_internal.h" +#include +#include /* #include "overlay.h" */ -#include "xineutils.h" -#include "vo_scale.h" +#include +#include #include "x11osd.h" #define LOCK_DISPLAY(this) {if(this->lock_display) this->lock_display(this->user_data); \ diff --git a/src/video_out/video_out_xvmc.c b/src/video_out/video_out_xvmc.c index 2c913dc0e..91db684da 100644 --- a/src/video_out/video_out_xvmc.c +++ b/src/video_out/video_out_xvmc.c @@ -66,12 +66,12 @@ */ #include "xine.h" -#include "video_out.h" -#include "xine_internal.h" +#include +#include #include "accel_xvmc.h" -#include "xineutils.h" -#include "vo_scale.h" +#include +#include /* #define LOG1 */ /* #define DLOG */ diff --git a/src/video_out/x11osd.c b/src/video_out/x11osd.c index e0cb6f1f6..450812f90 100644 --- a/src/video_out/x11osd.c +++ b/src/video_out/x11osd.c @@ -51,7 +51,7 @@ #define LOG */ -#include "xine_internal.h" +#include #include "x11osd.h" struct x11osd diff --git a/src/video_out/x11osd.h b/src/video_out/x11osd.h index fe0bf6208..0ffd6fba6 100644 --- a/src/video_out/x11osd.h +++ b/src/video_out/x11osd.h @@ -28,7 +28,7 @@ #ifndef X11OSD_H #define X11OSD_H -#include "vo_scale.h" +#include typedef struct x11osd x11osd; enum x11osd_mode {X11OSD_SHAPED, X11OSD_COLORKEY}; diff --git a/src/video_out/xcbosd.c b/src/video_out/xcbosd.c index 4bb2b60af..8bb96be1e 100644 --- a/src/video_out/xcbosd.c +++ b/src/video_out/xcbosd.c @@ -49,7 +49,7 @@ #define LOG */ -#include "xine_internal.h" +#include #include "xcbosd.h" struct xcbosd diff --git a/src/video_out/xcbosd.h b/src/video_out/xcbosd.h index 32af4965e..1d4fd1c3a 100644 --- a/src/video_out/xcbosd.h +++ b/src/video_out/xcbosd.h @@ -29,7 +29,7 @@ #ifndef XCBOSD_H #define XCBOSD_H -#include "vo_scale.h" +#include typedef struct xcbosd xcbosd; enum xcbosd_mode {XCBOSD_SHAPED, XCBOSD_COLORKEY}; diff --git a/src/video_out/xxmc.h b/src/video_out/xxmc.h index 84964af17..d6cd7e514 100644 --- a/src/video_out/xxmc.h +++ b/src/video_out/xxmc.h @@ -83,9 +83,9 @@ */ #include "xine.h" -#include "video_out.h" -#include "xine_internal.h" -#include "xineutils.h" +#include +#include +#include #include "vo_scale.h" #include "x11osd.h" #include "accel_xvmc.h" diff --git a/src/video_out/yuv2rgb.c b/src/video_out/yuv2rgb.c index 0ca6537a7..f1ad4dba8 100644 --- a/src/video_out/yuv2rgb.c +++ b/src/video_out/yuv2rgb.c @@ -39,7 +39,7 @@ #define LOG */ -#include "xineutils.h" +#include static int prof_scale_line = -1; diff --git a/src/video_out/yuv2rgb_mlib.c b/src/video_out/yuv2rgb_mlib.c index 8635526ed..794ce437e 100644 --- a/src/video_out/yuv2rgb_mlib.c +++ b/src/video_out/yuv2rgb_mlib.c @@ -34,8 +34,8 @@ #include #include -#include "attributes.h" -#include "xineutils.h" +#include +#include #include "yuv2rgb.h" #define MIN(a, b) (((a) < (b)) ? (a) : (b)) diff --git a/src/video_out/yuv2rgb_mmx.c b/src/video_out/yuv2rgb_mmx.c index 20a9b5a00..1835efe68 100644 --- a/src/video_out/yuv2rgb_mmx.c +++ b/src/video_out/yuv2rgb_mmx.c @@ -32,7 +32,7 @@ #include #include "yuv2rgb.h" -#include "xineutils.h" +#include #define CPU_MMXEXT 0 #define CPU_MMX 1 diff --git a/src/xine-engine/alphablend.c b/src/xine-engine/alphablend.c index 4dffa09ad..c47257273 100644 --- a/src/xine-engine/alphablend.c +++ b/src/xine-engine/alphablend.c @@ -32,9 +32,9 @@ #include #include -#include "xine_internal.h" -#include "video_out.h" -#include "alphablend.h" +#include +#include +#include #include "bswap.h" diff --git a/src/xine-engine/audio_decoder.c b/src/xine-engine/audio_decoder.c index 5476262d9..6a0688f0d 100644 --- a/src/xine-engine/audio_decoder.c +++ b/src/xine-engine/audio_decoder.c @@ -39,8 +39,8 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" +#include +#include static void *audio_decoder_loop (void *stream_gen) { diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c index aac1739aa..39e3cd1a4 100644 --- a/src/xine-engine/audio_out.c +++ b/src/xine-engine/audio_out.c @@ -89,11 +89,11 @@ #define LOG_RESAMPLE_SYNC 0 -#include "xine_internal.h" -#include "xineutils.h" -#include "audio_out.h" -#include "resample.h" -#include "metronom.h" +#include +#include +#include +#include +#include #define NUM_AUDIO_BUFFERS 32 diff --git a/src/xine-engine/broadcaster.c b/src/xine-engine/broadcaster.c index ce7494c1d..71d466c3a 100644 --- a/src/xine-engine/broadcaster.c +++ b/src/xine-engine/broadcaster.c @@ -57,9 +57,9 @@ #include #include -#include "xine_internal.h" -#include "buffer.h" -#include "xineutils.h" +#include +#include +#include #define QLEN 5 /* maximum connection queue length */ #define _BUFSIZ 512 diff --git a/src/xine-engine/buffer.c b/src/xine-engine/buffer.c index 93ad75ba0..8b8a8334a 100644 --- a/src/xine-engine/buffer.c +++ b/src/xine-engine/buffer.c @@ -43,9 +43,9 @@ #define LOG */ -#include "buffer.h" -#include "xineutils.h" -#include "xine_internal.h" +#include +#include +#include /* * put a previously allocated buffer element back into the buffer pool diff --git a/src/xine-engine/buffer_types.c b/src/xine-engine/buffer_types.c index eece2df90..08ff194fa 100644 --- a/src/xine-engine/buffer_types.c +++ b/src/xine-engine/buffer_types.c @@ -32,7 +32,7 @@ #include #include #include -#include "buffer.h" +#include #include "bswap.h" typedef struct video_db_s { diff --git a/src/xine-engine/configfile.c b/src/xine-engine/configfile.c index 2f5e6214a..47b77b03e 100644 --- a/src/xine-engine/configfile.c +++ b/src/xine-engine/configfile.c @@ -31,7 +31,7 @@ #include #include #include -#include "configfile.h" +#include #define LOG_MODULE "configfile" #define LOG_VERBOSE @@ -39,8 +39,8 @@ #define LOG */ -#include "xineutils.h" -#include "xine_internal.h" +#include +#include static const xine_config_entry_translation_t *config_entry_translation_user = NULL; static const xine_config_entry_translation_t config_entry_translation[] = { diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c index 5010c60eb..232e0342e 100644 --- a/src/xine-engine/demux.c +++ b/src/xine-engine/demux.c @@ -39,9 +39,9 @@ #define LOG */ -#include "xine_internal.h" -#include "demuxers/demux.h" -#include "buffer.h" +#include +#include +#include #ifdef WIN32 #include diff --git a/src/xine-engine/events.c b/src/xine-engine/events.c index f79187682..bf0d88fae 100644 --- a/src/xine-engine/events.c +++ b/src/xine-engine/events.c @@ -26,7 +26,7 @@ #define XINE_ENGINE_INTERNAL -#include "xine_internal.h" +#include xine_event_t *xine_event_get (xine_event_queue_t *queue) { diff --git a/src/xine-engine/info_helper.c b/src/xine-engine/info_helper.c index 1ac4ed982..bc66ba24e 100644 --- a/src/xine-engine/info_helper.c +++ b/src/xine-engine/info_helper.c @@ -35,7 +35,7 @@ #define XINE_ENGINE_INTERNAL -#include "info_helper.h" +#include /* ******************* Stream Info *************************** */ diff --git a/src/xine-engine/input_cache.c b/src/xine-engine/input_cache.c index 0535bc8f7..2989d8718 100644 --- a/src/xine-engine/input_cache.c +++ b/src/xine-engine/input_cache.c @@ -33,7 +33,7 @@ #define LOG */ -#include "xine_internal.h" +#include #include #define DEFAULT_BUFFER_SIZE 1024 diff --git a/src/xine-engine/input_rip.c b/src/xine-engine/input_rip.c index a8268552a..e7ef356b3 100644 --- a/src/xine-engine/input_rip.c +++ b/src/xine-engine/input_rip.c @@ -64,7 +64,7 @@ # define CLR_RST "\e[0;39m" #endif -#include "xine_internal.h" +#include #ifndef HAVE_FSEEKO # define fseeko fseek diff --git a/src/xine-engine/io_helper.c b/src/xine-engine/io_helper.c index b51442402..d51feb4c6 100644 --- a/src/xine-engine/io_helper.c +++ b/src/xine-engine/io_helper.c @@ -38,7 +38,7 @@ #define XINE_ENGINE_INTERNAL -#include "io_helper.h" +#include /* private constants */ #define XIO_FILE_READ 0 diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index a03ea6d17..7a6237b79 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -51,17 +51,17 @@ #define XINE_ENABLE_EXPERIMENTAL_FEATURES 1 #define XINE_ENGINE_INTERNAL -#include "xine_internal.h" -#include "xine_plugin.h" -#include "plugin_catalog.h" -#include "demuxers/demux.h" -#include "input/input_plugin.h" -#include "video_out.h" -#include "post.h" -#include "metronom.h" -#include "configfile.h" -#include "xineutils.h" -#include "compat.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #if 0 diff --git a/src/xine-engine/lrb.c b/src/xine-engine/lrb.c index 6da846a7c..a2fc5d1da 100644 --- a/src/xine-engine/lrb.c +++ b/src/xine-engine/lrb.c @@ -23,7 +23,7 @@ #endif #include "lrb.h" -#include "xineutils.h" +#include lrb_t *lrb_new (int max_num_entries, fifo_buffer_t *fifo) { diff --git a/src/xine-engine/lrb.h b/src/xine-engine/lrb.h index 491ae8843..0f524b7eb 100644 --- a/src/xine-engine/lrb.h +++ b/src/xine-engine/lrb.h @@ -24,11 +24,7 @@ #ifndef HAVE_LRB_H #define HAVE_LRB_H -#ifdef XINE_COMPILE -# include "buffer.h" -#else -# include -#endif +#include typedef struct { diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c index e9bd86836..42aed4e76 100644 --- a/src/xine-engine/metronom.c +++ b/src/xine-engine/metronom.c @@ -40,9 +40,9 @@ #define METRONOM_INTERNAL #define METRONOM_CLOCK_INTERNAL -#include "xine_internal.h" -#include "metronom.h" -#include "xineutils.h" +#include +#include +#include #define MAX_AUDIO_DELTA 1600 #define AUDIO_SAMPLE_NUM 32768 diff --git a/src/xine-engine/osd.c b/src/xine-engine/osd.c index 1587b76e4..39687e83f 100644 --- a/src/xine-engine/osd.c +++ b/src/xine-engine/osd.c @@ -50,11 +50,11 @@ #define XINE_ENGINE_INTERNAL -#include "xine_internal.h" +#include #include "xine-engine/bswap.h" -#include "xineutils.h" -#include "video_out.h" -#include "osd.h" +#include +#include +#include #ifdef HAVE_FT2 #include diff --git a/src/xine-engine/post.c b/src/xine-engine/post.c index e54d2234f..e057ff99f 100644 --- a/src/xine-engine/post.c +++ b/src/xine-engine/post.c @@ -25,7 +25,7 @@ #define POST_INTERNAL #define XINE_ENGINE_INTERNAL -#include "post.h" +#include #include diff --git a/src/xine-engine/refcounter.c b/src/xine-engine/refcounter.c index 539abf3ed..4bb6a0351 100644 --- a/src/xine-engine/refcounter.c +++ b/src/xine-engine/refcounter.c @@ -23,8 +23,8 @@ #define LOG */ -#include "xine_internal.h" -#include "refcounter.h" +#include +#include refcounter_t* _x_new_refcounter(void *object, void (*destructor)(void *)) { diff --git a/src/xine-engine/resample.c b/src/xine-engine/resample.c index 43911c401..f907c965e 100644 --- a/src/xine-engine/resample.c +++ b/src/xine-engine/resample.c @@ -24,8 +24,8 @@ #include #include -#include "attributes.h" -#include "resample.h" +#include +#include /* contributed by paul flinders */ diff --git a/src/xine-engine/scratch.c b/src/xine-engine/scratch.c index 8f9021aa1..7376a3f9e 100644 --- a/src/xine-engine/scratch.c +++ b/src/xine-engine/scratch.c @@ -33,8 +33,8 @@ #define LOG */ -#include "xineutils.h" -#include "scratch.h" +#include +#include static void __attribute__((__format__(__printf__, 2, 0))) scratch_printf (scratch_buffer_t *this, const char *format, va_list argp) diff --git a/src/xine-engine/spu.c b/src/xine-engine/spu.c index 813300fb0..c610a43c9 100644 --- a/src/xine-engine/spu.c +++ b/src/xine-engine/spu.c @@ -19,8 +19,8 @@ * */ -#include "xine_internal.h" -#include "spu.h" +#include +#include #define BLACK_OPACITY 67 #define COLOUR_OPACITY 100 diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c index c88e01714..ca6e7aa23 100644 --- a/src/xine-engine/video_decoder.c +++ b/src/xine-engine/video_decoder.c @@ -35,8 +35,8 @@ #define LOG */ -#include "xine_internal.h" -#include "xineutils.h" +#include +#include #include #define SPU_SLEEP_INTERVAL (90000/2) diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index 8c9810da1..0bab612ce 100644 --- a/src/xine-engine/video_out.c +++ b/src/xine-engine/video_out.c @@ -44,10 +44,10 @@ #define LOG */ -#include "xine_internal.h" -#include "video_out.h" -#include "metronom.h" -#include "xineutils.h" +#include +#include +#include +#include #define NUM_FRAME_BUFFERS 15 #define MAX_USEC_TO_SLEEP 20000 diff --git a/src/xine-engine/video_overlay.c b/src/xine-engine/video_overlay.c index c189fa56b..44080c469 100644 --- a/src/xine-engine/video_overlay.c +++ b/src/xine-engine/video_overlay.c @@ -25,11 +25,11 @@ #include #include -#include "buffer.h" -#include "xine_internal.h" +#include +#include #include "bswap.h" -#include "xineutils.h" -#include "video_overlay.h" +#include +#include /* #define LOG_DEBUG diff --git a/src/xine-engine/vo_scale.c b/src/xine-engine/vo_scale.c index ff30c47a6..5da5ab26e 100644 --- a/src/xine-engine/vo_scale.c +++ b/src/xine-engine/vo_scale.c @@ -32,8 +32,8 @@ #define LOG */ -#include "xine_internal.h" -#include "vo_scale.h" +#include +#include /* * convert delivered height/width to ideal width/height diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 6d6e05b19..ec2dc9170 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.c @@ -58,21 +58,21 @@ #define XINE_ENGINE_INTERNAL #define METRONOM_CLOCK_INTERNAL -#include "xine_internal.h" -#include "plugin_catalog.h" -#include "audio_out.h" -#include "video_out.h" -#include "demuxers/demux.h" -#include "buffer.h" -#include "spu_decoder.h" -#include "input/input_plugin.h" -#include "metronom.h" -#include "configfile.h" -#include "osd.h" -#include "spu.h" - -#include "xineutils.h" -#include "compat.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include #ifdef WIN32 # include diff --git a/src/xine-engine/xine_interface.c b/src/xine-engine/xine_interface.c index 7913a18d6..32b8663a6 100644 --- a/src/xine-engine/xine_interface.c +++ b/src/xine-engine/xine_interface.c @@ -40,11 +40,11 @@ #define XINE_ENGINE_INTERNAL -#include "xine_internal.h" -#include "audio_out.h" -#include "video_out.h" -#include "demuxers/demux.h" -#include "post.h" +#include +#include +#include +#include +#include /* * version information / checking diff --git a/src/xine-utils/array.c b/src/xine-utils/array.c index f6989fbb6..0db45be0c 100644 --- a/src/xine-utils/array.c +++ b/src/xine-utils/array.c @@ -23,8 +23,8 @@ #include #include -#include "attributes.h" -#include "array.h" +#include +#include #define MIN_CHUNK_SIZE 32 diff --git a/src/xine-utils/color.c b/src/xine-utils/color.c index 0b9cf0188..dc2c7e5e5 100644 --- a/src/xine-utils/color.c +++ b/src/xine-utils/color.c @@ -62,7 +62,7 @@ * instructions. */ -#include "xine_internal.h" +#include /* * In search of the perfect colorspace conversion formulae... diff --git a/src/xine-utils/copy.c b/src/xine-utils/copy.c index ed42b3a88..500b6db73 100644 --- a/src/xine-utils/copy.c +++ b/src/xine-utils/copy.c @@ -25,7 +25,7 @@ #include "config.h" #endif -#include "xineutils.h" +#include void yv12_to_yv12 (const unsigned char *y_src, int y_src_pitch, unsigned char *y_dst, int y_dst_pitch, diff --git a/src/xine-utils/cpu_accel.c b/src/xine-utils/cpu_accel.c index 8bad23db9..07978b55f 100644 --- a/src/xine-utils/cpu_accel.c +++ b/src/xine-utils/cpu_accel.c @@ -39,7 +39,7 @@ #define LOG */ -#include "xineutils.h" +#include #if defined(__i386__) || defined(__x86_64__) diff --git a/src/xine-utils/crc.c b/src/xine-utils/crc.c index ba0e3010b..4f720e9cc 100644 --- a/src/xine-utils/crc.c +++ b/src/xine-utils/crc.c @@ -20,7 +20,7 @@ * Common CRC calculation code. */ -#include "xineutils.h" +#include static const uint32_t crc32_table[256] = { 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, diff --git a/src/xine-utils/list.c b/src/xine-utils/list.c index 65bdaec26..7a2b521bd 100644 --- a/src/xine-utils/list.c +++ b/src/xine-utils/list.c @@ -23,8 +23,8 @@ #endif #include -#include "attributes.h" -#include "list.h" +#include +#include #define MIN_CHUNK_SIZE 32 #define MAX_CHUNK_SIZE 65536 diff --git a/src/xine-utils/memcpy.c b/src/xine-utils/memcpy.c index da4b83b09..15b0b228b 100644 --- a/src/xine-utils/memcpy.c +++ b/src/xine-utils/memcpy.c @@ -50,7 +50,7 @@ #define LOG */ -#include "xine_internal.h" +#include void *(* xine_fast_memcpy)(void *to, const void *from, size_t len); diff --git a/src/xine-utils/monitor.c b/src/xine-utils/monitor.c index 3c7c3e10a..8cbfdaa72 100644 --- a/src/xine-utils/monitor.c +++ b/src/xine-utils/monitor.c @@ -26,7 +26,7 @@ #include #include -#include "xineutils.h" +#include #define MAX_ID 10 diff --git a/src/xine-utils/pool.c b/src/xine-utils/pool.c index a1fddadd9..60330ef53 100644 --- a/src/xine-utils/pool.c +++ b/src/xine-utils/pool.c @@ -22,9 +22,9 @@ #endif #include -#include "attributes.h" -#include "pool.h" -#include "array.h" +#include +#include +#include #define MIN_CHUNK_SIZE 32 #define MAX_CHUNK_SIZE 65536 diff --git a/src/xine-utils/ring_buffer.c b/src/xine-utils/ring_buffer.c index 031fda4fc..7042eaa68 100644 --- a/src/xine-utils/ring_buffer.c +++ b/src/xine-utils/ring_buffer.c @@ -27,10 +27,10 @@ #include #include #include -#include "attributes.h" -#include "pool.h" -#include "list.h" -#include "ring_buffer.h" +#include +#include +#include +#include #define RING_BUFFER_EXTRA_BUFFER_SIZE (1024 * 8) diff --git a/src/xine-utils/sorted_array.c b/src/xine-utils/sorted_array.c index 363325f0b..9dbe1fd0e 100644 --- a/src/xine-utils/sorted_array.c +++ b/src/xine-utils/sorted_array.c @@ -23,8 +23,8 @@ #include #include -#include "attributes.h" -#include "sorted_array.h" +#include +#include /* Array internal struct */ struct xine_sarray_s { diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c index d9eb7fb3f..5aff537b4 100644 --- a/src/xine-utils/utils.c +++ b/src/xine-utils/utils.c @@ -27,10 +27,10 @@ #include "config.h" #endif -#include "xineutils.h" -#include "xineintl.h" +#include +#include #ifdef _MSC_VER -#include "xine_internal.h" +#include #endif #include diff --git a/src/xine-utils/xine_buffer.c b/src/xine-utils/xine_buffer.c index 190ab5197..3891aec11 100644 --- a/src/xine-utils/xine_buffer.c +++ b/src/xine-utils/xine_buffer.c @@ -58,7 +58,7 @@ #define LOG */ -#include "xineutils.h" +#include #define CHECKS diff --git a/src/xine-utils/xine_check.c b/src/xine-utils/xine_check.c index f00a23832..e850f9f48 100644 --- a/src/xine-utils/xine_check.c +++ b/src/xine-utils/xine_check.c @@ -45,7 +45,7 @@ #include #include "xine_check.h" -#include "xineutils.h" +#include #if defined(__linux__) diff --git a/src/xine-utils/xine_check.h b/src/xine-utils/xine_check.h index 4b21bf74e..75eda102d 100644 --- a/src/xine-utils/xine_check.h +++ b/src/xine-utils/xine_check.h @@ -2,11 +2,7 @@ #define XINE_CHECK_H #include -#ifdef XINE_COMPILE -# include "xine.h" -#else -# include -#endif +#include /* * Start checking xine setup here diff --git a/src/xine-utils/xine_mutex.c b/src/xine-utils/xine_mutex.c index c94f32be0..52d17d8e5 100644 --- a/src/xine-utils/xine_mutex.c +++ b/src/xine-utils/xine_mutex.c @@ -24,7 +24,7 @@ #include #include -#include "xineutils.h" +#include /* #define DBG_MUTEX diff --git a/src/xine-utils/xmllexer.c b/src/xine-utils/xmllexer.c index bb03e5a79..e276beef0 100644 --- a/src/xine-utils/xmllexer.c +++ b/src/xine-utils/xmllexer.c @@ -26,12 +26,12 @@ */ #ifdef XINE_COMPILE -#include "xineutils.h" +#include #else #define lprintf(...) #define xine_xmalloc malloc #endif -#include "xmllexer.h" +#include #include #include #include diff --git a/src/xine-utils/xmlparser.c b/src/xine-utils/xmlparser.c index a7bc146a9..1213072f3 100644 --- a/src/xine-utils/xmlparser.c +++ b/src/xine-utils/xmlparser.c @@ -37,13 +37,13 @@ */ #ifdef XINE_COMPILE -#include "xineutils.h" +#include #else #define lprintf(...) #define xine_xmalloc malloc #endif -#include "xmllexer.h" -#include "xmlparser.h" +#include +#include #define TOKEN_SIZE 4 * 1024 -- cgit v1.2.3 From 916fbee057ef45a6b7b9dbee93784b16820f6b95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Wed, 19 Dec 2007 03:00:29 +0100 Subject: Rename spu.c and spu.h to spudec.c and spudec.h to avoid confusing the two source and header files. --HG-- rename : src/libspudec/spu.c => src/libspudec/spudec.c rename : src/libspudec/spu.h => src/libspudec/spudec.h --- src/libspudec/Makefile.am | 4 +- src/libspudec/spu.c | 1026 -------------------------------------- src/libspudec/spu.h | 142 ------ src/libspudec/spudec.c | 1026 ++++++++++++++++++++++++++++++++++++++ src/libspudec/spudec.h | 142 ++++++ src/libspudec/xine_spu_decoder.c | 3 +- 6 files changed, 1172 insertions(+), 1171 deletions(-) delete mode 100644 src/libspudec/spu.c delete mode 100644 src/libspudec/spu.h create mode 100644 src/libspudec/spudec.c create mode 100644 src/libspudec/spudec.h diff --git a/src/libspudec/Makefile.am b/src/libspudec/Makefile.am index 62de3774d..337428652 100644 --- a/src/libspudec/Makefile.am +++ b/src/libspudec/Makefile.am @@ -4,7 +4,7 @@ AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG) AM_CPPFLAGS = -I$(top_srcdir)/src/input/libdvdnav AM_LDFLAGS = $(xineplug_ldflags) -noinst_HEADERS = spu.h +noinst_HEADERS = spudec.h xineplug_LTLIBRARIES = xineplug_decode_spu.la @@ -16,6 +16,6 @@ external_dvdnav_libs = internal_dvdnav_sources = nav_read.c endif -xineplug_decode_spu_la_SOURCES = $(internal_dvdnav_sources) spu.c xine_spu_decoder.c +xineplug_decode_spu_la_SOURCES = $(internal_dvdnav_sources) spudec.c xine_spu_decoder.c xineplug_decode_spu_la_LIBADD = $(XINE_LIB) $(external_dvdnav_libs) $(PTHREAD_LIBS) xineplug_decode_spu_la_CFLAGS = $(AM_CFLAGS) $(DVDNAV_CFLAGS) diff --git a/src/libspudec/spu.c b/src/libspudec/spu.c deleted file mode 100644 index c836dbf58..000000000 --- a/src/libspudec/spu.c +++ /dev/null @@ -1,1026 +0,0 @@ -/* - * Copyright (C) 2002-2004 the xine project - * - * Copyright (C) James Courtier-Dutton James@superbug.demon.co.uk - July 2001 - * - * spu.c - converts DVD subtitles to an XPM image - * - * Mostly based on hard work by: - * - * Copyright (C) 2000 Samuel Hocevar - * and Michel Lespinasse - * - * Lots of rearranging by: - * Aaron Holtzman - * Thomas Mirlacher - * implemented reassembling - * cleaner implementation of SPU are saving - * overlaying (proof of concept for now) - * ... and yes, it works now with oms - * added tranparency (provided by the SPU hdr) - * changed structures for easy porting to MGAs DVD mode - * This file is part of xine - * This file was originally part of the OMS program. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include "spu.h" -#include -#include "xine-engine/bswap.h" -#ifdef HAVE_DVDNAV -# include -# include -#else -# include "nav_read.h" -# include "nav_print.h" -#endif - - -/* -#define LOG_DEBUG 1 -#define LOG_BUTTON 1 -#define LOG_NAV 1 -*/ - -static void spudec_do_commands (xine_t *xine, spudec_state_t *state, spudec_seq_t* seq, vo_overlay_t *ovl); -static void spudec_draw_picture (xine_t *xine, spudec_state_t *state, spudec_seq_t* seq, vo_overlay_t *ovl); -static void spudec_discover_clut (xine_t *xine, spudec_state_t *state, vo_overlay_t *ovl); -#ifdef LOG_DEBUG -static void spudec_print_overlay( vo_overlay_t *overlay ); -#endif - -void spudec_decode_nav(spudec_decoder_t *this, buf_element_t *buf) { - uint8_t *p; - uint32_t packet_len; - uint32_t stream_id; - uint32_t header_len; - pci_t pci; - dsi_t dsi; - video_overlay_manager_t *ovl_manager = this->stream->video_out->get_overlay_manager (this->stream->video_out); - - p = buf->content; - if (p[0] || p[1] || (p[2] != 1)) { - xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, - "libspudec:spudec_decode_nav:nav demux error! %02x %02x %02x (should be 0x000001) \n",p[0],p[1],p[2]); - return; - } - - packet_len = p[4] << 8 | p[5]; - stream_id = p[3]; - - header_len = 6; - p += header_len; - - if (stream_id == 0xbf) { /* Private stream 2 */ -/* int i; - * for(i=0;i<80;i++) { - * printf("%02x ",p[i]); - * } - * printf("\n p[0]=0x%02x\n",p[0]); - */ - if(p[0] == 0x00) { -#ifdef LOG_NAV - printf("libspudec:nav_PCI\n"); -#endif - navRead_PCI(&pci, p+1); -#ifdef LOG_NAV - printf("libspudec:nav:hli_ss=%u, hli_s_ptm=%u, hli_e_ptm=%u, btn_sl_e_ptm=%u pts=%lli\n", - pci.hli.hl_gi.hli_ss, - pci.hli.hl_gi.hli_s_ptm, - pci.hli.hl_gi.hli_e_ptm, - pci.hli.hl_gi.btn_se_e_ptm, - buf->pts); - printf("libspudec:nav:btn_sn/ofn=%u, btn_ns=%u, fosl_btnn=%u, foac_btnn=%u\n", - pci.hli.hl_gi.btn_ofn, pci.hli.hl_gi.btn_ns, - pci.hli.hl_gi.fosl_btnn, pci.hli.hl_gi.foac_btnn); - printf("btngr_ns %d\n", pci.hli.hl_gi.btngr_ns); - printf("btngr%d_dsp_ty 0x%02x\n", 1, pci.hli.hl_gi.btngr1_dsp_ty); - printf("btngr%d_dsp_ty 0x%02x\n", 2, pci.hli.hl_gi.btngr2_dsp_ty); - printf("btngr%d_dsp_ty 0x%02x\n", 3, pci.hli.hl_gi.btngr3_dsp_ty); - //navPrint_PCI(&pci); - //navPrint_PCI_GI(&pci.pci_gi); - //navPrint_NSML_AGLI(&pci.nsml_agli); - //navPrint_HLI(&pci.hli); - //navPrint_HL_GI(&pci.hli.hl_gi, & btngr_ns, & btn_ns); -#endif - } - - p += packet_len; - - /* We should now have a DSI packet. */ - /* We don't need anything from the DSI packet here. */ - if(p[6] == 0x01) { - packet_len = p[4] << 8 | p[5]; - p += 6; -#ifdef LOG_NAV - printf("NAV DSI packet\n"); -#endif - navRead_DSI(&dsi, p+1); - -// self->vobu_start = self->dsi.dsi_gi.nv_pck_lbn; -// self->vobu_length = self->dsi.dsi_gi.vobu_ea; - } - } - - /* NAV packets contain start and end presentation timestamps, which tell the - * application, when the highlight information in the NAV is supposed to be valid. - * We handle these timestamps only in a very stripped-down way: We keep a list - * of NAV packets (or better: the PCI part of them), tagged with a VPTS timestamp - * telling, when the NAV should be processed. However, we only enqueue a new node - * into this list, when we receive new highlight information during an already - * showing menu. This happens very rarerly on common DVDs, so it is of low impact. - * And we only check for processing of queued entries at some prominent - * locations in this SPU decoder. Since presentation timestamps rarely solve a real - * purpose on most DVDs, this is ok compared to the full-blown solution, which would - * require a separate thread managing the queue all the time. */ - pthread_mutex_lock(&this->nav_pci_lock); - switch (pci.hli.hl_gi.hli_ss) { - case 0: - /* No Highlight information for this VOBU */ - if ( this->pci_cur.pci.hli.hl_gi.hli_ss == 1) { - /* Hide menu spu between menus */ -#ifdef LOG_BUTTON - printf("libspudec:nav:SHOULD HIDE SPU here\n"); -#endif - if( this->menu_handle < 0 ) { - this->menu_handle = ovl_manager->get_handle(ovl_manager,1); - } - if( this->menu_handle >= 0 ) { - this->event.object.handle = this->menu_handle; - this->event.event_type = OVERLAY_EVENT_HIDE; - /* hide menu right now */ - this->event.vpts = 0; - ovl_manager->add_event(ovl_manager, (void *)&this->event); - } else { - xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "libspudec: No video_overlay handles left for menu\n"); - } - } - spudec_clear_nav_list(this); - xine_fast_memcpy(&this->pci_cur.pci, &pci, sizeof(pci_t)); - /* incoming SPUs will be plain subtitles */ - this->event.object.object_type = 0; - if (this->button_filter) { - /* we possibly had buttons before, so we update the UI info */ - xine_event_t event; - xine_ui_data_t data; - - event.type = XINE_EVENT_UI_NUM_BUTTONS; - event.data = &data; - event.data_length = sizeof(data); - data.num_buttons = 0; - - xine_event_send(this->stream, &event); - } - this->button_filter=0; - - break; - case 1: - /* All New Highlight information for this VOBU */ - if (this->pci_cur.pci.hli.hl_gi.hli_ss != 0 && - pci.hli.hl_gi.hli_s_ptm > this->pci_cur.pci.hli.hl_gi.hli_s_ptm) { - pci_node_t *node = &this->pci_cur; -#ifdef LOG_DEBUG - printf("libspudec: allocating new PCI node for hli_s_ptm %d\n", pci.hli.hl_gi.hli_s_ptm); -#endif - /* append PCI at the end of the list */ - while (node->next) node = node->next; - node->next = (pci_node_t *)xine_xmalloc(sizeof(pci_node_t)); - node->next->vpts = this->stream->metronom->got_spu_packet(this->stream->metronom, pci.hli.hl_gi.hli_s_ptm); - node->next->next = NULL; - xine_fast_memcpy(&node->next->pci, &pci, sizeof(pci_t)); - } else { - spudec_clear_nav_list(this); - /* menu ahead, remember PCI for later use */ - xine_fast_memcpy(&this->pci_cur.pci, &pci, sizeof(pci_t)); - spudec_process_nav(this); - } - break; - case 2: - /* Use Highlight information from previous VOBU */ - if (this->pci_cur.next) { - /* apply changes to last enqueued NAV */ - pci_node_t *node = this->pci_cur.next; - while (node->next) node = node->next; - node->pci.pci_gi.vobu_s_ptm = pci.pci_gi.vobu_s_ptm; - node->pci.pci_gi.vobu_e_ptm = pci.pci_gi.vobu_e_ptm; - node->pci.pci_gi.vobu_se_e_ptm = pci.pci_gi.vobu_se_e_ptm; - spudec_update_nav(this); - } else { - this->pci_cur.pci.pci_gi.vobu_s_ptm = pci.pci_gi.vobu_s_ptm; - this->pci_cur.pci.pci_gi.vobu_e_ptm = pci.pci_gi.vobu_e_ptm; - this->pci_cur.pci.pci_gi.vobu_se_e_ptm = pci.pci_gi.vobu_se_e_ptm; - } - break; - case 3: - /* Use Highlight information from previous VOBU except commands, which come from this VOBU */ - if (this->pci_cur.next) { - /* apply changes to last enqueued NAV */ - pci_node_t *node = this->pci_cur.next; - while (node->next) node = node->next; - node->pci.pci_gi.vobu_s_ptm = pci.pci_gi.vobu_s_ptm; - node->pci.pci_gi.vobu_e_ptm = pci.pci_gi.vobu_e_ptm; - node->pci.pci_gi.vobu_se_e_ptm = pci.pci_gi.vobu_se_e_ptm; - /* FIXME: Add command copying here */ - spudec_update_nav(this); - } else { - this->pci_cur.pci.pci_gi.vobu_s_ptm = pci.pci_gi.vobu_s_ptm; - this->pci_cur.pci.pci_gi.vobu_e_ptm = pci.pci_gi.vobu_e_ptm; - this->pci_cur.pci.pci_gi.vobu_se_e_ptm = pci.pci_gi.vobu_se_e_ptm; - /* FIXME: Add command copying here */ - } - break; - default: - xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, - "libspudec: unknown pci.hli.hl_gi.hli_ss = %d\n", pci.hli.hl_gi.hli_ss ); - break; - } - pthread_mutex_unlock(&this->nav_pci_lock); - return; -} - -void spudec_clear_nav_list(spudec_decoder_t *this) -{ - while (this->pci_cur.next) { - pci_node_t *node = this->pci_cur.next->next; - free(this->pci_cur.next); - this->pci_cur.next = node; - } - /* invalidate current timestamp */ - this->pci_cur.pci.hli.hl_gi.hli_s_ptm = (uint32_t)-1; -} - -void spudec_update_nav(spudec_decoder_t *this) -{ - metronom_clock_t *clock = this->stream->xine->clock; - - if (this->pci_cur.next && this->pci_cur.next->vpts <= clock->get_current_time(clock)) { - pci_node_t *node = this->pci_cur.next; - xine_fast_memcpy(&this->pci_cur, this->pci_cur.next, sizeof(pci_node_t)); - spudec_process_nav(this); - free(node); - } -} - -void spudec_process_nav(spudec_decoder_t *this) -{ - /* incoming SPUs will be menus */ - this->event.object.object_type = 1; - if (!this->button_filter) { - /* we possibly entered a menu, so we update the UI button info */ - xine_event_t event; - xine_ui_data_t data; - - event.type = XINE_EVENT_UI_NUM_BUTTONS; - event.data = &data; - event.data_length = sizeof(data); - data.num_buttons = this->pci_cur.pci.hli.hl_gi.btn_ns; - - xine_event_send(this->stream, &event); - } - this->button_filter=1; -} - -void spudec_reassembly (xine_t *xine, spudec_seq_t *seq, uint8_t *pkt_data, u_int pkt_len) -{ -#ifdef LOG_DEBUG - printf ("libspudec: seq->complete = %d\n", seq->complete); - printf("libspudec:1: seq->ra_offs = %d, seq->seq_len = %d, seq->buf_len = %d, seq->buf=%p\n", - seq->ra_offs, - seq->seq_len, - seq->buf_len, - seq->buf); -#endif - if (seq->complete) { - seq->seq_len = (((uint32_t)pkt_data[0])<<8) | pkt_data[1]; - seq->cmd_offs = (((uint32_t)pkt_data[2])<<8) | pkt_data[3]; - if (seq->cmd_offs >= seq->seq_len) { - xprintf(xine, XINE_VERBOSITY_DEBUG, "libspudec:faulty stream\n"); - seq->broken = 1; - } - if (seq->buf_len < seq->seq_len) { - seq->buf_len = seq->seq_len; -#ifdef LOG_DEBUG - printf ("spu: MALLOC1: seq->buf %p, len=%d\n", seq->buf,seq->buf_len); -#endif - if (seq->buf) { - free(seq->buf); - seq->buf = NULL; - } - seq->buf = malloc(seq->buf_len); -#ifdef LOG_DEBUG - printf ("spu: MALLOC2: seq->buf %p, len=%d\n", seq->buf,seq->buf_len); -#endif - - } - seq->ra_offs = 0; - -#ifdef LOG_DEBUG - printf ("spu: buf_len: %d\n", seq->buf_len); - printf ("spu: cmd_off: %d\n", seq->cmd_offs); -#endif - } - -#ifdef LOG_DEBUG - printf("libspudec:2: seq->ra_offs = %d, seq->seq_len = %d, seq->buf_len = %d, seq->buf=%p\n", - seq->ra_offs, - seq->seq_len, - seq->buf_len, - seq->buf); -#endif - if (seq->ra_offs < seq->seq_len) { - if (seq->ra_offs + pkt_len > seq->seq_len) - pkt_len = seq->seq_len - seq->ra_offs; - memcpy (seq->buf + seq->ra_offs, pkt_data, pkt_len); - seq->ra_offs += pkt_len; - } else { - xprintf(xine, XINE_VERBOSITY_DEBUG, "libspudec:faulty stream\n"); - seq->broken = 1; - } - - if (seq->ra_offs == seq->seq_len) { - seq->finished = 0; - seq->complete = 1; - return; /* sequence ready */ - } - seq->complete = 0; - return; -} - -void spudec_process (spudec_decoder_t *this, int stream_id) { - spudec_seq_t *cur_seq; - video_overlay_manager_t *ovl_manager = this->stream->video_out->get_overlay_manager (this->stream->video_out); - int pending = 1; - cur_seq = &this->spudec_stream_state[stream_id].ra_seq; - -#ifdef LOG_DEBUG - printf ("spu: Found SPU from stream %d pts=%lli vpts=%lli\n",stream_id, - this->spudec_stream_state[stream_id].pts, - this->spudec_stream_state[stream_id].vpts); -#endif - this->state.cmd_ptr = cur_seq->buf + cur_seq->cmd_offs; - this->state.modified = 1; /* Only draw picture if = 1 on first event of SPU */ - this->state.visible = OVERLAY_EVENT_SHOW; - this->state.forced_display = 0; /* 0 - No value, 1 - Forced Display. */ - this->state.delay = 0; - cur_seq->finished=0; - - do { - if (!(cur_seq->finished) ) { - pci_node_t *node; - - /* spu_channel is now set based on whether we are in the menu or not. */ - /* Bit 7 is set if only forced display SPUs should be shown */ - if ( (this->stream->spu_channel & 0x1f) != stream_id ) { -#ifdef LOG_DEBUG - printf ("spu: Dropping SPU channel %d. Not selected stream_id\n", stream_id); -#endif - return; - } - /* parse SPU command sequence, this will update forced_display, so it must come - * before the check for it */ - spudec_do_commands(this->stream->xine, &this->state, cur_seq, &this->overlay); - /* FIXME: Check for Forced-display or subtitle stream - * For subtitles, open event. - * For menus, store it for later. - */ - if (cur_seq->broken) { - xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "libspudec: dropping broken SPU\n"); - cur_seq->broken = 0; - return; - } - if ( (this->state.forced_display == 0) && (this->stream->spu_channel & 0x80) ) { -#ifdef LOG_DEBUG - printf ("spu: Dropping SPU channel %d. Only allow forced display SPUs\n", stream_id); -#endif - return; - } - -#ifdef LOG_DEBUG - spudec_print_overlay( &this->overlay ); - printf ("spu: forced display:%s\n", this->state.forced_display ? "Yes" : "No" ); -#endif - pthread_mutex_lock(&this->nav_pci_lock); - /* search for a PCI that matches this SPU's PTS */ - for (node = &this->pci_cur; node; node = node->next) - if (node->pci.hli.hl_gi.hli_s_ptm == this->spudec_stream_state[stream_id].pts) - break; - if (node) { - if (this->state.visible == OVERLAY_EVENT_HIDE) { - /* menus are hidden via nav packet decoding, not here */ - /* FIXME: James is not sure about this solution and may want to look this over. - * I'm commiting it, because I haven't found a disc it breaks, but it fixes - * some instead. Michael Roitzsch */ - pthread_mutex_unlock(&this->nav_pci_lock); - continue; - } - if (node->pci.hli.hl_gi.fosl_btnn > 0) { - xine_event_t event; - - this->buttonN = node->pci.hli.hl_gi.fosl_btnn; - event.type = XINE_EVENT_INPUT_BUTTON_FORCE; - event.stream = this->stream; - event.data = &this->buttonN; - event.data_length = sizeof(this->buttonN); - xine_event_send(this->stream, &event); - } -#ifdef LOG_BUTTON - fprintf(stderr, "libspudec:Full Overlay\n"); -#endif - if (!spudec_copy_nav_to_overlay(this->stream->xine, - &node->pci, this->state.clut, - this->buttonN, 0, &this->overlay, &this->overlay)) { - /* current button does not exist -> use another one */ - xine_event_t event; - - if (this->buttonN > node->pci.hli.hl_gi.btn_ns) - this->buttonN = node->pci.hli.hl_gi.btn_ns; - else - this->buttonN = 1; - event.type = XINE_EVENT_INPUT_BUTTON_FORCE; - event.stream = this->stream; - event.data = &this->buttonN; - event.data_length = sizeof(this->buttonN); - xine_event_send(this->stream, &event); - spudec_copy_nav_to_overlay(this->stream->xine, - &node->pci, this->state.clut, - this->buttonN, 0, &this->overlay, &this->overlay); - } - } else { - /* Subtitle and not a menu button */ - int i; - for (i = 0;i < 4; i++) { - this->overlay.hili_color[i] = this->overlay.color[i]; - this->overlay.hili_trans[i] = this->overlay.trans[i]; - } - } - pthread_mutex_unlock(&this->nav_pci_lock); - - if ((this->state.modified) ) { - spudec_draw_picture(this->stream->xine, &this->state, cur_seq, &this->overlay); - } - - if (this->state.need_clut) { - spudec_discover_clut(this->stream->xine, &this->state, &this->overlay); - } - - if (this->state.vobsub) { - int width, height; - int64_t duration; - - /* - * vobsubs are usually played with a scaled-down stream (not full DVD - * resolution), therefore we should try to realign it. - */ - - this->stream->video_out->status(this->stream->video_out, NULL, - &width, &height, &duration ); - - this->overlay.x = (width - this->overlay.width) / 2; - this->overlay.y = height - this->overlay.height; - } - - /* Subtitle */ - if( this->menu_handle < 0 ) { - this->menu_handle = ovl_manager->get_handle(ovl_manager,1); - } - - if( this->menu_handle < 0 ) { - xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, - "libspudec: No video_overlay handles left for menu\n"); - return; - } - this->event.object.handle = this->menu_handle; - this->event.object.pts = this->spudec_stream_state[stream_id].pts; - - xine_fast_memcpy(this->event.object.overlay, - &this->overlay, - sizeof(vo_overlay_t)); - this->overlay.rle=NULL; - /* For force display menus */ - //if ( !(this->state.visible) ) { - // this->state.visible = OVERLAY_EVENT_SHOW; - //} - - this->event.event_type = this->state.visible; - /* - printf("spu event %d handle: %d vpts: %lli\n", this->event.event_type, - this->event.object.handle, this->event.vpts ); - */ - - this->event.vpts = this->spudec_stream_state[stream_id].vpts+(this->state.delay*1000); - - /* Keep all the events in the correct order. */ - /* This corrects for errors during estimation around discontinuity */ - if( this->event.vpts < this->last_event_vpts ) { - this->event.vpts = this->last_event_vpts + 1; - } - this->last_event_vpts = this->event.vpts; - -#ifdef LOG_BUTTON - fprintf(stderr, "libspudec: add_event type=%d : current time=%lld, spu vpts=%lli\n", - this->event.event_type, - this->stream->xine->clock->get_current_time(this->stream->xine->clock), - this->event.vpts); -#endif - ovl_manager->add_event(ovl_manager, (void *)&this->event); - } else { - pending = 0; - } - } while (pending); - -} - -#define CMD_SPU_FORCE_DISPLAY 0x00 -#define CMD_SPU_SHOW 0x01 -#define CMD_SPU_HIDE 0x02 -#define CMD_SPU_SET_PALETTE 0x03 -#define CMD_SPU_SET_ALPHA 0x04 -#define CMD_SPU_SET_SIZE 0x05 -#define CMD_SPU_SET_PXD_OFFSET 0x06 -#define CMD_SPU_WIPE 0x07 /* Not currently implemented */ -#define CMD_SPU_EOF 0xff - -static void spudec_do_commands(xine_t *xine, spudec_state_t *state, spudec_seq_t* seq, vo_overlay_t *ovl) -{ - uint8_t *buf = state->cmd_ptr; - uint8_t *next_seq; - int32_t param_length; - -#ifdef LOG_DEBUG - printf ("spu: SPU DO COMMANDS\n"); -#endif - - state->delay = (buf[0] << 8) + buf[1]; -#ifdef LOG_DEBUG - printf ("spu: \tdelay=%d\n",state->delay); -#endif - next_seq = seq->buf + (buf[2] << 8) + buf[3]; - buf += 4; -#ifdef LOG_DEBUG - printf ("spu: \tnext_seq=%d\n",next_seq - seq->buf); -#endif - -/* if next equals current, this is the last one - */ - if (state->cmd_ptr >= next_seq) - next_seq = seq->buf + seq->seq_len; /* allow to run until end */ - - state->cmd_ptr = next_seq; - - while (buf < next_seq && *buf != CMD_SPU_EOF) { - switch (*buf) { - case CMD_SPU_SHOW: /* show subpicture */ -#ifdef LOG_DEBUG - printf ("spu: \tshow subpicture\n"); -#endif - state->visible = OVERLAY_EVENT_SHOW; - buf++; - break; - - case CMD_SPU_HIDE: /* hide subpicture */ -#ifdef LOG_DEBUG - printf ("spu: \thide subpicture\n"); -#endif - state->visible = OVERLAY_EVENT_HIDE; - buf++; - break; - - case CMD_SPU_SET_PALETTE: { /* CLUT */ - spudec_clut_t *clut = (spudec_clut_t *) (buf+1); - - state->cur_colors[3] = clut->entry0; - state->cur_colors[2] = clut->entry1; - state->cur_colors[1] = clut->entry2; - state->cur_colors[0] = clut->entry3; - -/* This is a bit out of context for now */ - ovl->color[3] = state->clut[clut->entry0]; - ovl->color[2] = state->clut[clut->entry1]; - ovl->color[1] = state->clut[clut->entry2]; - ovl->color[0] = state->clut[clut->entry3]; - -#ifdef LOG_DEBUG - printf ("spu: \tclut [%x %x %x %x]\n", - ovl->color[0], ovl->color[1], ovl->color[2], ovl->color[3]); - printf ("spu: \tclut base [%x %x %x %x]\n", - clut->entry0, clut->entry1, clut->entry2, clut->entry3); -#endif - state->modified = 1; - buf += 3; - break; - } - case CMD_SPU_SET_ALPHA: { /* transparency palette */ - spudec_clut_t *trans = (spudec_clut_t *) (buf+1); -/* This should go into state for now */ - - ovl->trans[3] = trans->entry0; - ovl->trans[2] = trans->entry1; - ovl->trans[1] = trans->entry2; - ovl->trans[0] = trans->entry3; - -#ifdef LOG_DEBUG - printf ("spu: \ttrans [%d %d %d %d]\n", - ovl->trans[0], ovl->trans[1], ovl->trans[2], ovl->trans[3]); -#endif - state->modified = 1; - buf += 3; - break; - } - - case CMD_SPU_SET_SIZE: /* image coordinates */ -/* state->o_left = (buf[1] << 4) | (buf[2] >> 4); - state->o_right = (((buf[2] & 0x0f) << 8) | buf[3]); - - state->o_top = (buf[4] << 4) | (buf[5] >> 4); - state->o_bottom = (((buf[5] & 0x0f) << 8) | buf[6]); - */ - ovl->x = (buf[1] << 4) | (buf[2] >> 4); - ovl->y = (buf[4] << 4) | (buf[5] >> 4); - ovl->width = (((buf[2] & 0x0f) << 8) | buf[3]) - ovl->x + 1; - ovl->height = (((buf[5] & 0x0f) << 8) | buf[6]) - ovl->y + 1; - ovl->hili_top = -1; - ovl->hili_bottom = -1; - ovl->hili_left = -1; - ovl->hili_right = -1; - -#ifdef LOG_DEBUG - printf ("spu: \tx = %d y = %d width = %d height = %d\n", - ovl->x, ovl->y, ovl->width, ovl->height ); -#endif - state->modified = 1; - buf += 7; - break; - - case CMD_SPU_SET_PXD_OFFSET: /* image top[0] field / image bottom[1] field*/ - state->field_offs[0] = (((u_int)buf[1]) << 8) | buf[2]; - state->field_offs[1] = (((u_int)buf[3]) << 8) | buf[4]; - -#ifdef LOG_DEBUG - printf ("spu: \toffset[0] = %d offset[1] = %d\n", - state->field_offs[0], state->field_offs[1]); -#endif - - if ((state->field_offs[0] >= seq->seq_len) || - (state->field_offs[1] >= seq->seq_len)) { - xprintf(xine, XINE_VERBOSITY_DEBUG, "libspudec:faulty stream\n"); - seq->broken = 1; - } - state->modified = 1; - buf += 5; - break; - - case CMD_SPU_WIPE: -#ifdef LOG_DEBUG - printf ("libspudec: \tSPU_WIPE not implemented yet\n"); -#endif - param_length = (buf[1] << 8) | (buf[2]); - buf += 1 + param_length; - break; - - case CMD_SPU_FORCE_DISPLAY: -#ifdef LOG_DEBUG - printf ("libspudec: \tForce Display/Menu\n"); -#endif - state->forced_display = 1; - buf++; - break; - - default: - xprintf(xine, XINE_VERBOSITY_DEBUG, "libspudec: unknown seqence command (%02x)\n", buf[0]); - /* FIXME: SPU should be dropped, and buffers resynced */ - buf = next_seq; - seq->broken = 1; - break; - } - } - - if (next_seq >= seq->buf + seq->seq_len) - seq->finished = 1; /* last sub-sequence */ -} - -/* FIXME: Get rid of all these static values */ -static uint8_t *bit_ptr[2]; -static int field; // which field we are currently decoding -static int put_x, put_y; - -static u_int get_bits (u_int bits) -{ - static u_int data; - static u_int bits_left; - u_int ret = 0; - - if (!bits) { /* for realignment to next byte */ - bits_left = 0; - } - - while (bits) { - if (bits > bits_left) { - ret |= data << (bits - bits_left); - bits -= bits_left; - - data = *bit_ptr[field]++; - bits_left = 8; - } else { - bits_left -= bits; - ret |= data >> (bits_left); - data &= (1 << bits_left) - 1; - bits = 0; - } - } - - return ret; -} - -static int spudec_next_line (vo_overlay_t *spu) -{ - get_bits (0); // byte align rle data - - put_x = 0; - put_y++; - field ^= 1; // Toggle fields - - if (put_y >= spu->height) { -#ifdef LOG_DEBUG - printf ("spu: put_y >= spu->height\n"); -#endif - return -1; - } - return 0; -} - -static void spudec_draw_picture (xine_t *xine, spudec_state_t *state, spudec_seq_t* seq, vo_overlay_t *ovl) -{ - rle_elem_t *rle; - field = 0; - bit_ptr[0] = seq->buf + state->field_offs[0]; - bit_ptr[1] = seq->buf + state->field_offs[1]; - put_x = put_y = 0; - get_bits (0); /* Reset/init bit code */ - -/* ovl->x = state->o_left; - * ovl->y = state->o_top; - * ovl->width = state->o_right - state->o_left + 1; - * ovl->height = state->o_bottom - state->o_top + 1; - - * ovl->hili_top = 0; - * ovl->hili_bottom = ovl->height - 1; - * ovl->hili_left = 0; - * ovl->hili_right = ovl->width - 1; - */ - - /* allocate for the worst case: - * - both fields running to the very end - * - 2 RLE elements per byte meaning single pixel RLE - */ - ovl->data_size = ((seq->cmd_offs - state->field_offs[0]) + - (seq->cmd_offs - state->field_offs[1])) * 2 * sizeof(rle_elem_t); - - if (ovl->rle) { - xprintf (xine, XINE_VERBOSITY_DEBUG, - "libspudec: spudec_draw_picture: ovl->rle is not empty!!!! It should be!!! " - "You should never see this message.\n"); - free(ovl->rle); - ovl->rle=NULL; - } - ovl->rle = malloc(ovl->data_size); - - state->modified = 0; /* mark as already processed */ - rle = ovl->rle; -#ifdef LOG_DEBUG - printf ("libspudec: Draw RLE=%p\n",rle); -#endif - - while (bit_ptr[1] < seq->buf + seq->cmd_offs) { - u_int len; - u_int vlc; - - vlc = get_bits (4); - if (vlc < 0x0004) { - vlc = (vlc << 4) | get_bits (4); - if (vlc < 0x0010) { - vlc = (vlc << 4) | get_bits (4); - if (vlc < 0x0040) { - vlc = (vlc << 4) | get_bits (4); - } - } - } - - len = vlc >> 2; - - /* if len == 0 -> end sequence - fill to end of line */ - if (len == 0) - len = ovl->width - put_x; - - rle->len = len; - rle->color = vlc & 0x03; - rle++; - put_x += len; - - if (put_x >= ovl->width) { - if (spudec_next_line (ovl) < 0) - break; - } - } - - ovl->num_rle = rle - ovl->rle; - ovl->rgb_clut = 0; - ovl->unscaled = 0; -#ifdef LOG_DEBUG - printf ("spu: Num RLE=%d\n",ovl->num_rle); - printf ("spu: Date size=%d\n",ovl->data_size); - printf ("spu: sizeof RLE=%d\n",sizeof(rle_elem_t)); -#endif -} - -/* Heuristic to discover the colors used by the subtitles - and assign a "readable" pallete to them. - Currently looks for sequence of border-fg-border or - border1-border2-fg-border2-border1. - MINFOUND is the number of ocurrences threshold. -*/ -#define MINFOUND 20 -static void spudec_discover_clut(xine_t *xine, spudec_state_t *state, vo_overlay_t *ovl) -{ - int bg,c; - int seqcolor[10]; - int n,i; - rle_elem_t *rle; - - int found[2][16]; - - static clut_t text_clut[] = { - CLUT_Y_CR_CB_INIT(0x80, 0x90, 0x80), - CLUT_Y_CR_CB_INIT(0x00, 0x90, 0x00), - CLUT_Y_CR_CB_INIT(0xff, 0x90, 0x00) - }; - - memset(found,0,sizeof(found)); - rle = ovl->rle; - - /* this seems to be a problem somewhere else, - why rle is null? */ - if( !rle ) - return; - - /* suppose the first and last pixels are bg */ - if( rle[0].color != rle[ovl->num_rle-1].color ) - return; - - bg = rle[0].color; - - i = 0; - for( n = 0; n < ovl->num_rle; n++ ) - { - c = rle[n].color; - - if( c == bg ) - { - if( i == 3 && seqcolor[1] == seqcolor[3] ) - { - found[0][seqcolor[2]]++; - if( found[0][seqcolor[2]] > MINFOUND ) - { - memcpy(&state->clut[state->cur_colors[seqcolor[1]]], &text_clut[1], - sizeof(clut_t)); - memcpy(&state->clut[state->cur_colors[seqcolor[2]]], &text_clut[2], - sizeof(clut_t)); - ovl->color[seqcolor[1]] = state->clut[state->cur_colors[seqcolor[1]]]; - ovl->color[seqcolor[2]] = state->clut[state->cur_colors[seqcolor[2]]]; - state->need_clut = 0; - break; - } - } - if( i == 5 && seqcolor[1] == seqcolor[5] - && seqcolor[2] == seqcolor[4] ) - { - found[1][seqcolor[3]]++; - if( found[1][seqcolor[3]] > MINFOUND ) - { - memcpy(&state->clut[state->cur_colors[seqcolor[1]]], &text_clut[0], - sizeof(clut_t)); - memcpy(&state->clut[state->cur_colors[seqcolor[2]]], &text_clut[1], - sizeof(clut_t)); - memcpy(&state->clut[state->cur_colors[seqcolor[3]]], &text_clut[2], - sizeof(clut_t)); - ovl->color[seqcolor[1]] = state->clut[state->cur_colors[seqcolor[1]]]; - ovl->color[seqcolor[2]] = state->clut[state->cur_colors[seqcolor[2]]]; - ovl->color[seqcolor[3]] = state->clut[state->cur_colors[seqcolor[3]]]; - state->need_clut = 0; - break; - } - } - i = 0; - seqcolor[i] = c; - } - else if ( i < 6 ) - { - i++; - seqcolor[i] = c; - } - } -} - -#ifdef LOG_DEBUG -static void spudec_print_overlay( vo_overlay_t *ovl ) { - printf ("spu: OVERLAY to show\n"); - printf ("spu: \tx = %d y = %d width = %d height = %d\n", - ovl->x, ovl->y, ovl->width, ovl->height ); - printf ("spu: \tclut [%x %x %x %x]\n", - ovl->color[0], ovl->color[1], ovl->color[2], ovl->color[3]); - printf ("spu: \ttrans [%d %d %d %d]\n", - ovl->trans[0], ovl->trans[1], ovl->trans[2], ovl->trans[3]); - printf ("spu: \tclip top=%d bottom=%d left=%d right=%d\n", - ovl->hili_top, ovl->hili_bottom, ovl->hili_left, ovl->hili_right); - printf ("spu: \tclip_clut [%x %x %x %x]\n", - ovl->hili_color[0], ovl->hili_color[1], ovl->hili_color[2], ovl->hili_color[3]); - printf ("spu: \thili_trans [%d %d %d %d]\n", - ovl->hili_trans[0], ovl->hili_trans[1], ovl->hili_trans[2], ovl->hili_trans[3]); - return; -} -#endif - -int spudec_copy_nav_to_overlay(xine_t *xine, pci_t* nav_pci, uint32_t* clut, - int32_t button, int32_t mode, vo_overlay_t * overlay, vo_overlay_t * base ) { - btni_t *button_ptr = NULL; - unsigned int btns_per_group; - int i; - - if((button <= 0) || (button > nav_pci->hli.hl_gi.btn_ns)) - return 0; - - btns_per_group = 36 / nav_pci->hli.hl_gi.btngr_ns; - - /* choose button group: we can always use a normal 4:3 or widescreen button group - * as long as xine blends the overlay before scaling the image to its aspect */ - if (!button_ptr && nav_pci->hli.hl_gi.btngr_ns >= 1 && !(nav_pci->hli.hl_gi.btngr1_dsp_ty & 6)) - button_ptr = &nav_pci->hli.btnit[0 * btns_per_group + button - 1]; - if (!button_ptr && nav_pci->hli.hl_gi.btngr_ns >= 2 && !(nav_pci->hli.hl_gi.btngr2_dsp_ty & 6)) - button_ptr = &nav_pci->hli.btnit[1 * btns_per_group + button - 1]; - if (!button_ptr && nav_pci->hli.hl_gi.btngr_ns >= 3 && !(nav_pci->hli.hl_gi.btngr3_dsp_ty & 6)) - button_ptr = &nav_pci->hli.btnit[2 * btns_per_group + button - 1]; - if (!button_ptr) { - xprintf(xine, XINE_VERBOSITY_DEBUG, - "libspudec: No suitable menu button group found, using group 1.\n"); - button_ptr = &nav_pci->hli.btnit[button - 1]; - } - - /* button areas in the nav packet are in screen coordinates, - * overlay clipping areas are in overlay coordinates; - * therefore we must subtract the display coordinates of the underlying overlay */ - overlay->hili_left = (button_ptr->x_start > base->x) ? (button_ptr->x_start - base->x) : 0; - overlay->hili_top = (button_ptr->y_start > base->y) ? (button_ptr->y_start - base->y) : 0; - overlay->hili_right = (button_ptr->x_end > base->x) ? (button_ptr->x_end - base->x) : 0; - overlay->hili_bottom = (button_ptr->y_end > base->y) ? (button_ptr->y_end - base->y) : 0; - if(button_ptr->btn_coln != 0) { -#ifdef LOG_BUTTON - fprintf(stderr, "libspudec: normal button clut\n"); -#endif - for (i = 0;i < 4; i++) { - overlay->hili_color[i] = clut[0xf & (nav_pci->hli.btn_colit.btn_coli[button_ptr->btn_coln-1][mode] >> (16 + 4*i))]; - overlay->hili_trans[i] = 0xf & (nav_pci->hli.btn_colit.btn_coli[button_ptr->btn_coln-1][mode] >> (4*i)); - } - } else { -#ifdef LOG_BUTTON - fprintf(stderr, "libspudec: abnormal button clut\n"); -#endif - for (i = 0;i < 4; i++) { -#ifdef LOG_BUTTON - printf("libspudec:btn_coln = 0, hili_color = color\n"); -#endif - overlay->hili_color[i] = overlay->color[i]; - overlay->hili_trans[i] = overlay->trans[i]; - } - } - - /* spudec_print_overlay( overlay ); */ -#ifdef LOG_BUTTON - printf("libspudec:xine_decoder.c:NAV to SPU pts match!\n"); -#endif - - return 1; -} diff --git a/src/libspudec/spu.h b/src/libspudec/spu.h deleted file mode 100644 index 1e7d80596..000000000 --- a/src/libspudec/spu.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (C) 2000-2004 the xine project - * - * Copyright (C) James Courtier-Dutton James@superbug.demon.co.uk - July 2001 - * - * This file is part of xine, a free video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * This file was originally part of the OMS program. - */ - -#ifndef __SPU_H__ -#define __SPU_H__ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#ifdef HAVE_DVDNAV -# include -#else -# include "nav_types.h" -#endif - -#define NUM_SEQ_BUFFERS 50 -#define MAX_STREAMS 32 - -typedef struct spudec_clut_struct { -#ifdef WORDS_BIGENDIAN - uint8_t entry0 : 4; - uint8_t entry1 : 4; - uint8_t entry2 : 4; - uint8_t entry3 : 4; -#else - uint8_t entry1 : 4; - uint8_t entry0 : 4; - uint8_t entry3 : 4; - uint8_t entry2 : 4; -#endif -} spudec_clut_t; - -typedef struct { - uint8_t *buf; - uint32_t ra_offs; /* reassembly offset */ - uint32_t seq_len; - uint32_t buf_len; - uint32_t cmd_offs; - int64_t pts; /* Base PTS of this sequence */ - int32_t finished; /* Has this control sequence been finished? */ - uint32_t complete; /* Has this reassembly been finished? */ - uint32_t broken; /* this SPU is broken and should be dropped */ -} spudec_seq_t; - -typedef struct { - uint8_t *cmd_ptr; - - uint32_t field_offs[2]; - int32_t b_top, o_top; - int32_t b_bottom, o_bottom; - int32_t b_left, o_left; - int32_t b_right, o_right; - - int32_t modified; /* Was the sub-picture modified? */ - int32_t visible; /* Must the sub-picture be shown? */ - int32_t forced_display; /* This overlay is a menu */ - int32_t delay; /* Delay in 90Khz / 1000 */ - int32_t need_clut; /* doesn't have the right clut yet */ - int32_t cur_colors[4];/* current 4 colors been used */ - int32_t vobsub; /* vobsub must be aligned to bottom */ - - uint32_t clut[16]; -} spudec_state_t; - -typedef struct spudec_stream_state_s { - spudec_seq_t ra_seq; - spudec_state_t state; - int64_t vpts; - int64_t pts; - int32_t overlay_handle; -} spudec_stream_state_t; - -typedef struct { - spu_decoder_class_t decoder_class; -} spudec_class_t; - -typedef struct pci_node_s pci_node_t; -struct pci_node_s { - pci_t pci; - uint64_t vpts; - pci_node_t *next; -}; - -typedef struct spudec_decoder_s { - spu_decoder_t spu_decoder; - - spudec_class_t *class; - xine_stream_t *stream; - spudec_stream_state_t spudec_stream_state[MAX_STREAMS]; - - video_overlay_event_t event; - video_overlay_object_t object; - int32_t menu_handle; - - spudec_state_t state; - - vo_overlay_t overlay; - int ovl_caps; - int output_open; - pthread_mutex_t nav_pci_lock; - pci_node_t pci_cur; - uint32_t buttonN; /* Current button number for highlights */ - int32_t button_filter; /* Allow highlight changes or not */ - int64_t last_event_vpts; -} spudec_decoder_t; - -void spudec_reassembly (xine_t *xine, spudec_seq_t *seq, uint8_t *pkt_data, u_int pkt_len); -void spudec_process( spudec_decoder_t *this, int stream_id); -/* the nav functions must be called with the nav_pci_lock held */ -void spudec_decode_nav( spudec_decoder_t *this, buf_element_t *buf); -void spudec_clear_nav_list(spudec_decoder_t *this); -void spudec_update_nav(spudec_decoder_t *this); -void spudec_process_nav(spudec_decoder_t *this); -int spudec_copy_nav_to_overlay(xine_t *xine, pci_t* nav_pci, uint32_t* clut, int32_t button, int32_t mode, - vo_overlay_t * overlay, vo_overlay_t * base ); - -#endif diff --git a/src/libspudec/spudec.c b/src/libspudec/spudec.c new file mode 100644 index 000000000..13136a53f --- /dev/null +++ b/src/libspudec/spudec.c @@ -0,0 +1,1026 @@ +/* + * Copyright (C) 2002-2004 the xine project + * + * Copyright (C) James Courtier-Dutton James@superbug.demon.co.uk - July 2001 + * + * spu.c - converts DVD subtitles to an XPM image + * + * Mostly based on hard work by: + * + * Copyright (C) 2000 Samuel Hocevar + * and Michel Lespinasse + * + * Lots of rearranging by: + * Aaron Holtzman + * Thomas Mirlacher + * implemented reassembling + * cleaner implementation of SPU are saving + * overlaying (proof of concept for now) + * ... and yes, it works now with oms + * added tranparency (provided by the SPU hdr) + * changed structures for easy porting to MGAs DVD mode + * This file is part of xine + * This file was originally part of the OMS program. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include "xine-engine/bswap.h" +#ifdef HAVE_DVDNAV +# include +# include +#else +# include "nav_read.h" +# include "nav_print.h" +#endif + +#include "spudec.h" + +/* +#define LOG_DEBUG 1 +#define LOG_BUTTON 1 +#define LOG_NAV 1 +*/ + +static void spudec_do_commands (xine_t *xine, spudec_state_t *state, spudec_seq_t* seq, vo_overlay_t *ovl); +static void spudec_draw_picture (xine_t *xine, spudec_state_t *state, spudec_seq_t* seq, vo_overlay_t *ovl); +static void spudec_discover_clut (xine_t *xine, spudec_state_t *state, vo_overlay_t *ovl); +#ifdef LOG_DEBUG +static void spudec_print_overlay( vo_overlay_t *overlay ); +#endif + +void spudec_decode_nav(spudec_decoder_t *this, buf_element_t *buf) { + uint8_t *p; + uint32_t packet_len; + uint32_t stream_id; + uint32_t header_len; + pci_t pci; + dsi_t dsi; + video_overlay_manager_t *ovl_manager = this->stream->video_out->get_overlay_manager (this->stream->video_out); + + p = buf->content; + if (p[0] || p[1] || (p[2] != 1)) { + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "libspudec:spudec_decode_nav:nav demux error! %02x %02x %02x (should be 0x000001) \n",p[0],p[1],p[2]); + return; + } + + packet_len = p[4] << 8 | p[5]; + stream_id = p[3]; + + header_len = 6; + p += header_len; + + if (stream_id == 0xbf) { /* Private stream 2 */ +/* int i; + * for(i=0;i<80;i++) { + * printf("%02x ",p[i]); + * } + * printf("\n p[0]=0x%02x\n",p[0]); + */ + if(p[0] == 0x00) { +#ifdef LOG_NAV + printf("libspudec:nav_PCI\n"); +#endif + navRead_PCI(&pci, p+1); +#ifdef LOG_NAV + printf("libspudec:nav:hli_ss=%u, hli_s_ptm=%u, hli_e_ptm=%u, btn_sl_e_ptm=%u pts=%lli\n", + pci.hli.hl_gi.hli_ss, + pci.hli.hl_gi.hli_s_ptm, + pci.hli.hl_gi.hli_e_ptm, + pci.hli.hl_gi.btn_se_e_ptm, + buf->pts); + printf("libspudec:nav:btn_sn/ofn=%u, btn_ns=%u, fosl_btnn=%u, foac_btnn=%u\n", + pci.hli.hl_gi.btn_ofn, pci.hli.hl_gi.btn_ns, + pci.hli.hl_gi.fosl_btnn, pci.hli.hl_gi.foac_btnn); + printf("btngr_ns %d\n", pci.hli.hl_gi.btngr_ns); + printf("btngr%d_dsp_ty 0x%02x\n", 1, pci.hli.hl_gi.btngr1_dsp_ty); + printf("btngr%d_dsp_ty 0x%02x\n", 2, pci.hli.hl_gi.btngr2_dsp_ty); + printf("btngr%d_dsp_ty 0x%02x\n", 3, pci.hli.hl_gi.btngr3_dsp_ty); + //navPrint_PCI(&pci); + //navPrint_PCI_GI(&pci.pci_gi); + //navPrint_NSML_AGLI(&pci.nsml_agli); + //navPrint_HLI(&pci.hli); + //navPrint_HL_GI(&pci.hli.hl_gi, & btngr_ns, & btn_ns); +#endif + } + + p += packet_len; + + /* We should now have a DSI packet. */ + /* We don't need anything from the DSI packet here. */ + if(p[6] == 0x01) { + packet_len = p[4] << 8 | p[5]; + p += 6; +#ifdef LOG_NAV + printf("NAV DSI packet\n"); +#endif + navRead_DSI(&dsi, p+1); + +// self->vobu_start = self->dsi.dsi_gi.nv_pck_lbn; +// self->vobu_length = self->dsi.dsi_gi.vobu_ea; + } + } + + /* NAV packets contain start and end presentation timestamps, which tell the + * application, when the highlight information in the NAV is supposed to be valid. + * We handle these timestamps only in a very stripped-down way: We keep a list + * of NAV packets (or better: the PCI part of them), tagged with a VPTS timestamp + * telling, when the NAV should be processed. However, we only enqueue a new node + * into this list, when we receive new highlight information during an already + * showing menu. This happens very rarerly on common DVDs, so it is of low impact. + * And we only check for processing of queued entries at some prominent + * locations in this SPU decoder. Since presentation timestamps rarely solve a real + * purpose on most DVDs, this is ok compared to the full-blown solution, which would + * require a separate thread managing the queue all the time. */ + pthread_mutex_lock(&this->nav_pci_lock); + switch (pci.hli.hl_gi.hli_ss) { + case 0: + /* No Highlight information for this VOBU */ + if ( this->pci_cur.pci.hli.hl_gi.hli_ss == 1) { + /* Hide menu spu between menus */ +#ifdef LOG_BUTTON + printf("libspudec:nav:SHOULD HIDE SPU here\n"); +#endif + if( this->menu_handle < 0 ) { + this->menu_handle = ovl_manager->get_handle(ovl_manager,1); + } + if( this->menu_handle >= 0 ) { + this->event.object.handle = this->menu_handle; + this->event.event_type = OVERLAY_EVENT_HIDE; + /* hide menu right now */ + this->event.vpts = 0; + ovl_manager->add_event(ovl_manager, (void *)&this->event); + } else { + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "libspudec: No video_overlay handles left for menu\n"); + } + } + spudec_clear_nav_list(this); + xine_fast_memcpy(&this->pci_cur.pci, &pci, sizeof(pci_t)); + /* incoming SPUs will be plain subtitles */ + this->event.object.object_type = 0; + if (this->button_filter) { + /* we possibly had buttons before, so we update the UI info */ + xine_event_t event; + xine_ui_data_t data; + + event.type = XINE_EVENT_UI_NUM_BUTTONS; + event.data = &data; + event.data_length = sizeof(data); + data.num_buttons = 0; + + xine_event_send(this->stream, &event); + } + this->button_filter=0; + + break; + case 1: + /* All New Highlight information for this VOBU */ + if (this->pci_cur.pci.hli.hl_gi.hli_ss != 0 && + pci.hli.hl_gi.hli_s_ptm > this->pci_cur.pci.hli.hl_gi.hli_s_ptm) { + pci_node_t *node = &this->pci_cur; +#ifdef LOG_DEBUG + printf("libspudec: allocating new PCI node for hli_s_ptm %d\n", pci.hli.hl_gi.hli_s_ptm); +#endif + /* append PCI at the end of the list */ + while (node->next) node = node->next; + node->next = (pci_node_t *)xine_xmalloc(sizeof(pci_node_t)); + node->next->vpts = this->stream->metronom->got_spu_packet(this->stream->metronom, pci.hli.hl_gi.hli_s_ptm); + node->next->next = NULL; + xine_fast_memcpy(&node->next->pci, &pci, sizeof(pci_t)); + } else { + spudec_clear_nav_list(this); + /* menu ahead, remember PCI for later use */ + xine_fast_memcpy(&this->pci_cur.pci, &pci, sizeof(pci_t)); + spudec_process_nav(this); + } + break; + case 2: + /* Use Highlight information from previous VOBU */ + if (this->pci_cur.next) { + /* apply changes to last enqueued NAV */ + pci_node_t *node = this->pci_cur.next; + while (node->next) node = node->next; + node->pci.pci_gi.vobu_s_ptm = pci.pci_gi.vobu_s_ptm; + node->pci.pci_gi.vobu_e_ptm = pci.pci_gi.vobu_e_ptm; + node->pci.pci_gi.vobu_se_e_ptm = pci.pci_gi.vobu_se_e_ptm; + spudec_update_nav(this); + } else { + this->pci_cur.pci.pci_gi.vobu_s_ptm = pci.pci_gi.vobu_s_ptm; + this->pci_cur.pci.pci_gi.vobu_e_ptm = pci.pci_gi.vobu_e_ptm; + this->pci_cur.pci.pci_gi.vobu_se_e_ptm = pci.pci_gi.vobu_se_e_ptm; + } + break; + case 3: + /* Use Highlight information from previous VOBU except commands, which come from this VOBU */ + if (this->pci_cur.next) { + /* apply changes to last enqueued NAV */ + pci_node_t *node = this->pci_cur.next; + while (node->next) node = node->next; + node->pci.pci_gi.vobu_s_ptm = pci.pci_gi.vobu_s_ptm; + node->pci.pci_gi.vobu_e_ptm = pci.pci_gi.vobu_e_ptm; + node->pci.pci_gi.vobu_se_e_ptm = pci.pci_gi.vobu_se_e_ptm; + /* FIXME: Add command copying here */ + spudec_update_nav(this); + } else { + this->pci_cur.pci.pci_gi.vobu_s_ptm = pci.pci_gi.vobu_s_ptm; + this->pci_cur.pci.pci_gi.vobu_e_ptm = pci.pci_gi.vobu_e_ptm; + this->pci_cur.pci.pci_gi.vobu_se_e_ptm = pci.pci_gi.vobu_se_e_ptm; + /* FIXME: Add command copying here */ + } + break; + default: + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "libspudec: unknown pci.hli.hl_gi.hli_ss = %d\n", pci.hli.hl_gi.hli_ss ); + break; + } + pthread_mutex_unlock(&this->nav_pci_lock); + return; +} + +void spudec_clear_nav_list(spudec_decoder_t *this) +{ + while (this->pci_cur.next) { + pci_node_t *node = this->pci_cur.next->next; + free(this->pci_cur.next); + this->pci_cur.next = node; + } + /* invalidate current timestamp */ + this->pci_cur.pci.hli.hl_gi.hli_s_ptm = (uint32_t)-1; +} + +void spudec_update_nav(spudec_decoder_t *this) +{ + metronom_clock_t *clock = this->stream->xine->clock; + + if (this->pci_cur.next && this->pci_cur.next->vpts <= clock->get_current_time(clock)) { + pci_node_t *node = this->pci_cur.next; + xine_fast_memcpy(&this->pci_cur, this->pci_cur.next, sizeof(pci_node_t)); + spudec_process_nav(this); + free(node); + } +} + +void spudec_process_nav(spudec_decoder_t *this) +{ + /* incoming SPUs will be menus */ + this->event.object.object_type = 1; + if (!this->button_filter) { + /* we possibly entered a menu, so we update the UI button info */ + xine_event_t event; + xine_ui_data_t data; + + event.type = XINE_EVENT_UI_NUM_BUTTONS; + event.data = &data; + event.data_length = sizeof(data); + data.num_buttons = this->pci_cur.pci.hli.hl_gi.btn_ns; + + xine_event_send(this->stream, &event); + } + this->button_filter=1; +} + +void spudec_reassembly (xine_t *xine, spudec_seq_t *seq, uint8_t *pkt_data, u_int pkt_len) +{ +#ifdef LOG_DEBUG + printf ("libspudec: seq->complete = %d\n", seq->complete); + printf("libspudec:1: seq->ra_offs = %d, seq->seq_len = %d, seq->buf_len = %d, seq->buf=%p\n", + seq->ra_offs, + seq->seq_len, + seq->buf_len, + seq->buf); +#endif + if (seq->complete) { + seq->seq_len = (((uint32_t)pkt_data[0])<<8) | pkt_data[1]; + seq->cmd_offs = (((uint32_t)pkt_data[2])<<8) | pkt_data[3]; + if (seq->cmd_offs >= seq->seq_len) { + xprintf(xine, XINE_VERBOSITY_DEBUG, "libspudec:faulty stream\n"); + seq->broken = 1; + } + if (seq->buf_len < seq->seq_len) { + seq->buf_len = seq->seq_len; +#ifdef LOG_DEBUG + printf ("spu: MALLOC1: seq->buf %p, len=%d\n", seq->buf,seq->buf_len); +#endif + if (seq->buf) { + free(seq->buf); + seq->buf = NULL; + } + seq->buf = malloc(seq->buf_len); +#ifdef LOG_DEBUG + printf ("spu: MALLOC2: seq->buf %p, len=%d\n", seq->buf,seq->buf_len); +#endif + + } + seq->ra_offs = 0; + +#ifdef LOG_DEBUG + printf ("spu: buf_len: %d\n", seq->buf_len); + printf ("spu: cmd_off: %d\n", seq->cmd_offs); +#endif + } + +#ifdef LOG_DEBUG + printf("libspudec:2: seq->ra_offs = %d, seq->seq_len = %d, seq->buf_len = %d, seq->buf=%p\n", + seq->ra_offs, + seq->seq_len, + seq->buf_len, + seq->buf); +#endif + if (seq->ra_offs < seq->seq_len) { + if (seq->ra_offs + pkt_len > seq->seq_len) + pkt_len = seq->seq_len - seq->ra_offs; + memcpy (seq->buf + seq->ra_offs, pkt_data, pkt_len); + seq->ra_offs += pkt_len; + } else { + xprintf(xine, XINE_VERBOSITY_DEBUG, "libspudec:faulty stream\n"); + seq->broken = 1; + } + + if (seq->ra_offs == seq->seq_len) { + seq->finished = 0; + seq->complete = 1; + return; /* sequence ready */ + } + seq->complete = 0; + return; +} + +void spudec_process (spudec_decoder_t *this, int stream_id) { + spudec_seq_t *cur_seq; + video_overlay_manager_t *ovl_manager = this->stream->video_out->get_overlay_manager (this->stream->video_out); + int pending = 1; + cur_seq = &this->spudec_stream_state[stream_id].ra_seq; + +#ifdef LOG_DEBUG + printf ("spu: Found SPU from stream %d pts=%lli vpts=%lli\n",stream_id, + this->spudec_stream_state[stream_id].pts, + this->spudec_stream_state[stream_id].vpts); +#endif + this->state.cmd_ptr = cur_seq->buf + cur_seq->cmd_offs; + this->state.modified = 1; /* Only draw picture if = 1 on first event of SPU */ + this->state.visible = OVERLAY_EVENT_SHOW; + this->state.forced_display = 0; /* 0 - No value, 1 - Forced Display. */ + this->state.delay = 0; + cur_seq->finished=0; + + do { + if (!(cur_seq->finished) ) { + pci_node_t *node; + + /* spu_channel is now set based on whether we are in the menu or not. */ + /* Bit 7 is set if only forced display SPUs should be shown */ + if ( (this->stream->spu_channel & 0x1f) != stream_id ) { +#ifdef LOG_DEBUG + printf ("spu: Dropping SPU channel %d. Not selected stream_id\n", stream_id); +#endif + return; + } + /* parse SPU command sequence, this will update forced_display, so it must come + * before the check for it */ + spudec_do_commands(this->stream->xine, &this->state, cur_seq, &this->overlay); + /* FIXME: Check for Forced-display or subtitle stream + * For subtitles, open event. + * For menus, store it for later. + */ + if (cur_seq->broken) { + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "libspudec: dropping broken SPU\n"); + cur_seq->broken = 0; + return; + } + if ( (this->state.forced_display == 0) && (this->stream->spu_channel & 0x80) ) { +#ifdef LOG_DEBUG + printf ("spu: Dropping SPU channel %d. Only allow forced display SPUs\n", stream_id); +#endif + return; + } + +#ifdef LOG_DEBUG + spudec_print_overlay( &this->overlay ); + printf ("spu: forced display:%s\n", this->state.forced_display ? "Yes" : "No" ); +#endif + pthread_mutex_lock(&this->nav_pci_lock); + /* search for a PCI that matches this SPU's PTS */ + for (node = &this->pci_cur; node; node = node->next) + if (node->pci.hli.hl_gi.hli_s_ptm == this->spudec_stream_state[stream_id].pts) + break; + if (node) { + if (this->state.visible == OVERLAY_EVENT_HIDE) { + /* menus are hidden via nav packet decoding, not here */ + /* FIXME: James is not sure about this solution and may want to look this over. + * I'm commiting it, because I haven't found a disc it breaks, but it fixes + * some instead. Michael Roitzsch */ + pthread_mutex_unlock(&this->nav_pci_lock); + continue; + } + if (node->pci.hli.hl_gi.fosl_btnn > 0) { + xine_event_t event; + + this->buttonN = node->pci.hli.hl_gi.fosl_btnn; + event.type = XINE_EVENT_INPUT_BUTTON_FORCE; + event.stream = this->stream; + event.data = &this->buttonN; + event.data_length = sizeof(this->buttonN); + xine_event_send(this->stream, &event); + } +#ifdef LOG_BUTTON + fprintf(stderr, "libspudec:Full Overlay\n"); +#endif + if (!spudec_copy_nav_to_overlay(this->stream->xine, + &node->pci, this->state.clut, + this->buttonN, 0, &this->overlay, &this->overlay)) { + /* current button does not exist -> use another one */ + xine_event_t event; + + if (this->buttonN > node->pci.hli.hl_gi.btn_ns) + this->buttonN = node->pci.hli.hl_gi.btn_ns; + else + this->buttonN = 1; + event.type = XINE_EVENT_INPUT_BUTTON_FORCE; + event.stream = this->stream; + event.data = &this->buttonN; + event.data_length = sizeof(this->buttonN); + xine_event_send(this->stream, &event); + spudec_copy_nav_to_overlay(this->stream->xine, + &node->pci, this->state.clut, + this->buttonN, 0, &this->overlay, &this->overlay); + } + } else { + /* Subtitle and not a menu button */ + int i; + for (i = 0;i < 4; i++) { + this->overlay.hili_color[i] = this->overlay.color[i]; + this->overlay.hili_trans[i] = this->overlay.trans[i]; + } + } + pthread_mutex_unlock(&this->nav_pci_lock); + + if ((this->state.modified) ) { + spudec_draw_picture(this->stream->xine, &this->state, cur_seq, &this->overlay); + } + + if (this->state.need_clut) { + spudec_discover_clut(this->stream->xine, &this->state, &this->overlay); + } + + if (this->state.vobsub) { + int width, height; + int64_t duration; + + /* + * vobsubs are usually played with a scaled-down stream (not full DVD + * resolution), therefore we should try to realign it. + */ + + this->stream->video_out->status(this->stream->video_out, NULL, + &width, &height, &duration ); + + this->overlay.x = (width - this->overlay.width) / 2; + this->overlay.y = height - this->overlay.height; + } + + /* Subtitle */ + if( this->menu_handle < 0 ) { + this->menu_handle = ovl_manager->get_handle(ovl_manager,1); + } + + if( this->menu_handle < 0 ) { + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "libspudec: No video_overlay handles left for menu\n"); + return; + } + this->event.object.handle = this->menu_handle; + this->event.object.pts = this->spudec_stream_state[stream_id].pts; + + xine_fast_memcpy(this->event.object.overlay, + &this->overlay, + sizeof(vo_overlay_t)); + this->overlay.rle=NULL; + /* For force display menus */ + //if ( !(this->state.visible) ) { + // this->state.visible = OVERLAY_EVENT_SHOW; + //} + + this->event.event_type = this->state.visible; + /* + printf("spu event %d handle: %d vpts: %lli\n", this->event.event_type, + this->event.object.handle, this->event.vpts ); + */ + + this->event.vpts = this->spudec_stream_state[stream_id].vpts+(this->state.delay*1000); + + /* Keep all the events in the correct order. */ + /* This corrects for errors during estimation around discontinuity */ + if( this->event.vpts < this->last_event_vpts ) { + this->event.vpts = this->last_event_vpts + 1; + } + this->last_event_vpts = this->event.vpts; + +#ifdef LOG_BUTTON + fprintf(stderr, "libspudec: add_event type=%d : current time=%lld, spu vpts=%lli\n", + this->event.event_type, + this->stream->xine->clock->get_current_time(this->stream->xine->clock), + this->event.vpts); +#endif + ovl_manager->add_event(ovl_manager, (void *)&this->event); + } else { + pending = 0; + } + } while (pending); + +} + +#define CMD_SPU_FORCE_DISPLAY 0x00 +#define CMD_SPU_SHOW 0x01 +#define CMD_SPU_HIDE 0x02 +#define CMD_SPU_SET_PALETTE 0x03 +#define CMD_SPU_SET_ALPHA 0x04 +#define CMD_SPU_SET_SIZE 0x05 +#define CMD_SPU_SET_PXD_OFFSET 0x06 +#define CMD_SPU_WIPE 0x07 /* Not currently implemented */ +#define CMD_SPU_EOF 0xff + +static void spudec_do_commands(xine_t *xine, spudec_state_t *state, spudec_seq_t* seq, vo_overlay_t *ovl) +{ + uint8_t *buf = state->cmd_ptr; + uint8_t *next_seq; + int32_t param_length; + +#ifdef LOG_DEBUG + printf ("spu: SPU DO COMMANDS\n"); +#endif + + state->delay = (buf[0] << 8) + buf[1]; +#ifdef LOG_DEBUG + printf ("spu: \tdelay=%d\n",state->delay); +#endif + next_seq = seq->buf + (buf[2] << 8) + buf[3]; + buf += 4; +#ifdef LOG_DEBUG + printf ("spu: \tnext_seq=%d\n",next_seq - seq->buf); +#endif + +/* if next equals current, this is the last one + */ + if (state->cmd_ptr >= next_seq) + next_seq = seq->buf + seq->seq_len; /* allow to run until end */ + + state->cmd_ptr = next_seq; + + while (buf < next_seq && *buf != CMD_SPU_EOF) { + switch (*buf) { + case CMD_SPU_SHOW: /* show subpicture */ +#ifdef LOG_DEBUG + printf ("spu: \tshow subpicture\n"); +#endif + state->visible = OVERLAY_EVENT_SHOW; + buf++; + break; + + case CMD_SPU_HIDE: /* hide subpicture */ +#ifdef LOG_DEBUG + printf ("spu: \thide subpicture\n"); +#endif + state->visible = OVERLAY_EVENT_HIDE; + buf++; + break; + + case CMD_SPU_SET_PALETTE: { /* CLUT */ + spudec_clut_t *clut = (spudec_clut_t *) (buf+1); + + state->cur_colors[3] = clut->entry0; + state->cur_colors[2] = clut->entry1; + state->cur_colors[1] = clut->entry2; + state->cur_colors[0] = clut->entry3; + +/* This is a bit out of context for now */ + ovl->color[3] = state->clut[clut->entry0]; + ovl->color[2] = state->clut[clut->entry1]; + ovl->color[1] = state->clut[clut->entry2]; + ovl->color[0] = state->clut[clut->entry3]; + +#ifdef LOG_DEBUG + printf ("spu: \tclut [%x %x %x %x]\n", + ovl->color[0], ovl->color[1], ovl->color[2], ovl->color[3]); + printf ("spu: \tclut base [%x %x %x %x]\n", + clut->entry0, clut->entry1, clut->entry2, clut->entry3); +#endif + state->modified = 1; + buf += 3; + break; + } + case CMD_SPU_SET_ALPHA: { /* transparency palette */ + spudec_clut_t *trans = (spudec_clut_t *) (buf+1); +/* This should go into state for now */ + + ovl->trans[3] = trans->entry0; + ovl->trans[2] = trans->entry1; + ovl->trans[1] = trans->entry2; + ovl->trans[0] = trans->entry3; + +#ifdef LOG_DEBUG + printf ("spu: \ttrans [%d %d %d %d]\n", + ovl->trans[0], ovl->trans[1], ovl->trans[2], ovl->trans[3]); +#endif + state->modified = 1; + buf += 3; + break; + } + + case CMD_SPU_SET_SIZE: /* image coordinates */ +/* state->o_left = (buf[1] << 4) | (buf[2] >> 4); + state->o_right = (((buf[2] & 0x0f) << 8) | buf[3]); + + state->o_top = (buf[4] << 4) | (buf[5] >> 4); + state->o_bottom = (((buf[5] & 0x0f) << 8) | buf[6]); + */ + ovl->x = (buf[1] << 4) | (buf[2] >> 4); + ovl->y = (buf[4] << 4) | (buf[5] >> 4); + ovl->width = (((buf[2] & 0x0f) << 8) | buf[3]) - ovl->x + 1; + ovl->height = (((buf[5] & 0x0f) << 8) | buf[6]) - ovl->y + 1; + ovl->hili_top = -1; + ovl->hili_bottom = -1; + ovl->hili_left = -1; + ovl->hili_right = -1; + +#ifdef LOG_DEBUG + printf ("spu: \tx = %d y = %d width = %d height = %d\n", + ovl->x, ovl->y, ovl->width, ovl->height ); +#endif + state->modified = 1; + buf += 7; + break; + + case CMD_SPU_SET_PXD_OFFSET: /* image top[0] field / image bottom[1] field*/ + state->field_offs[0] = (((u_int)buf[1]) << 8) | buf[2]; + state->field_offs[1] = (((u_int)buf[3]) << 8) | buf[4]; + +#ifdef LOG_DEBUG + printf ("spu: \toffset[0] = %d offset[1] = %d\n", + state->field_offs[0], state->field_offs[1]); +#endif + + if ((state->field_offs[0] >= seq->seq_len) || + (state->field_offs[1] >= seq->seq_len)) { + xprintf(xine, XINE_VERBOSITY_DEBUG, "libspudec:faulty stream\n"); + seq->broken = 1; + } + state->modified = 1; + buf += 5; + break; + + case CMD_SPU_WIPE: +#ifdef LOG_DEBUG + printf ("libspudec: \tSPU_WIPE not implemented yet\n"); +#endif + param_length = (buf[1] << 8) | (buf[2]); + buf += 1 + param_length; + break; + + case CMD_SPU_FORCE_DISPLAY: +#ifdef LOG_DEBUG + printf ("libspudec: \tForce Display/Menu\n"); +#endif + state->forced_display = 1; + buf++; + break; + + default: + xprintf(xine, XINE_VERBOSITY_DEBUG, "libspudec: unknown seqence command (%02x)\n", buf[0]); + /* FIXME: SPU should be dropped, and buffers resynced */ + buf = next_seq; + seq->broken = 1; + break; + } + } + + if (next_seq >= seq->buf + seq->seq_len) + seq->finished = 1; /* last sub-sequence */ +} + +/* FIXME: Get rid of all these static values */ +static uint8_t *bit_ptr[2]; +static int field; // which field we are currently decoding +static int put_x, put_y; + +static u_int get_bits (u_int bits) +{ + static u_int data; + static u_int bits_left; + u_int ret = 0; + + if (!bits) { /* for realignment to next byte */ + bits_left = 0; + } + + while (bits) { + if (bits > bits_left) { + ret |= data << (bits - bits_left); + bits -= bits_left; + + data = *bit_ptr[field]++; + bits_left = 8; + } else { + bits_left -= bits; + ret |= data >> (bits_left); + data &= (1 << bits_left) - 1; + bits = 0; + } + } + + return ret; +} + +static int spudec_next_line (vo_overlay_t *spu) +{ + get_bits (0); // byte align rle data + + put_x = 0; + put_y++; + field ^= 1; // Toggle fields + + if (put_y >= spu->height) { +#ifdef LOG_DEBUG + printf ("spu: put_y >= spu->height\n"); +#endif + return -1; + } + return 0; +} + +static void spudec_draw_picture (xine_t *xine, spudec_state_t *state, spudec_seq_t* seq, vo_overlay_t *ovl) +{ + rle_elem_t *rle; + field = 0; + bit_ptr[0] = seq->buf + state->field_offs[0]; + bit_ptr[1] = seq->buf + state->field_offs[1]; + put_x = put_y = 0; + get_bits (0); /* Reset/init bit code */ + +/* ovl->x = state->o_left; + * ovl->y = state->o_top; + * ovl->width = state->o_right - state->o_left + 1; + * ovl->height = state->o_bottom - state->o_top + 1; + + * ovl->hili_top = 0; + * ovl->hili_bottom = ovl->height - 1; + * ovl->hili_left = 0; + * ovl->hili_right = ovl->width - 1; + */ + + /* allocate for the worst case: + * - both fields running to the very end + * - 2 RLE elements per byte meaning single pixel RLE + */ + ovl->data_size = ((seq->cmd_offs - state->field_offs[0]) + + (seq->cmd_offs - state->field_offs[1])) * 2 * sizeof(rle_elem_t); + + if (ovl->rle) { + xprintf (xine, XINE_VERBOSITY_DEBUG, + "libspudec: spudec_draw_picture: ovl->rle is not empty!!!! It should be!!! " + "You should never see this message.\n"); + free(ovl->rle); + ovl->rle=NULL; + } + ovl->rle = malloc(ovl->data_size); + + state->modified = 0; /* mark as already processed */ + rle = ovl->rle; +#ifdef LOG_DEBUG + printf ("libspudec: Draw RLE=%p\n",rle); +#endif + + while (bit_ptr[1] < seq->buf + seq->cmd_offs) { + u_int len; + u_int vlc; + + vlc = get_bits (4); + if (vlc < 0x0004) { + vlc = (vlc << 4) | get_bits (4); + if (vlc < 0x0010) { + vlc = (vlc << 4) | get_bits (4); + if (vlc < 0x0040) { + vlc = (vlc << 4) | get_bits (4); + } + } + } + + len = vlc >> 2; + + /* if len == 0 -> end sequence - fill to end of line */ + if (len == 0) + len = ovl->width - put_x; + + rle->len = len; + rle->color = vlc & 0x03; + rle++; + put_x += len; + + if (put_x >= ovl->width) { + if (spudec_next_line (ovl) < 0) + break; + } + } + + ovl->num_rle = rle - ovl->rle; + ovl->rgb_clut = 0; + ovl->unscaled = 0; +#ifdef LOG_DEBUG + printf ("spu: Num RLE=%d\n",ovl->num_rle); + printf ("spu: Date size=%d\n",ovl->data_size); + printf ("spu: sizeof RLE=%d\n",sizeof(rle_elem_t)); +#endif +} + +/* Heuristic to discover the colors used by the subtitles + and assign a "readable" pallete to them. + Currently looks for sequence of border-fg-border or + border1-border2-fg-border2-border1. + MINFOUND is the number of ocurrences threshold. +*/ +#define MINFOUND 20 +static void spudec_discover_clut(xine_t *xine, spudec_state_t *state, vo_overlay_t *ovl) +{ + int bg,c; + int seqcolor[10]; + int n,i; + rle_elem_t *rle; + + int found[2][16]; + + static clut_t text_clut[] = { + CLUT_Y_CR_CB_INIT(0x80, 0x90, 0x80), + CLUT_Y_CR_CB_INIT(0x00, 0x90, 0x00), + CLUT_Y_CR_CB_INIT(0xff, 0x90, 0x00) + }; + + memset(found,0,sizeof(found)); + rle = ovl->rle; + + /* this seems to be a problem somewhere else, + why rle is null? */ + if( !rle ) + return; + + /* suppose the first and last pixels are bg */ + if( rle[0].color != rle[ovl->num_rle-1].color ) + return; + + bg = rle[0].color; + + i = 0; + for( n = 0; n < ovl->num_rle; n++ ) + { + c = rle[n].color; + + if( c == bg ) + { + if( i == 3 && seqcolor[1] == seqcolor[3] ) + { + found[0][seqcolor[2]]++; + if( found[0][seqcolor[2]] > MINFOUND ) + { + memcpy(&state->clut[state->cur_colors[seqcolor[1]]], &text_clut[1], + sizeof(clut_t)); + memcpy(&state->clut[state->cur_colors[seqcolor[2]]], &text_clut[2], + sizeof(clut_t)); + ovl->color[seqcolor[1]] = state->clut[state->cur_colors[seqcolor[1]]]; + ovl->color[seqcolor[2]] = state->clut[state->cur_colors[seqcolor[2]]]; + state->need_clut = 0; + break; + } + } + if( i == 5 && seqcolor[1] == seqcolor[5] + && seqcolor[2] == seqcolor[4] ) + { + found[1][seqcolor[3]]++; + if( found[1][seqcolor[3]] > MINFOUND ) + { + memcpy(&state->clut[state->cur_colors[seqcolor[1]]], &text_clut[0], + sizeof(clut_t)); + memcpy(&state->clut[state->cur_colors[seqcolor[2]]], &text_clut[1], + sizeof(clut_t)); + memcpy(&state->clut[state->cur_colors[seqcolor[3]]], &text_clut[2], + sizeof(clut_t)); + ovl->color[seqcolor[1]] = state->clut[state->cur_colors[seqcolor[1]]]; + ovl->color[seqcolor[2]] = state->clut[state->cur_colors[seqcolor[2]]]; + ovl->color[seqcolor[3]] = state->clut[state->cur_colors[seqcolor[3]]]; + state->need_clut = 0; + break; + } + } + i = 0; + seqcolor[i] = c; + } + else if ( i < 6 ) + { + i++; + seqcolor[i] = c; + } + } +} + +#ifdef LOG_DEBUG +static void spudec_print_overlay( vo_overlay_t *ovl ) { + printf ("spu: OVERLAY to show\n"); + printf ("spu: \tx = %d y = %d width = %d height = %d\n", + ovl->x, ovl->y, ovl->width, ovl->height ); + printf ("spu: \tclut [%x %x %x %x]\n", + ovl->color[0], ovl->color[1], ovl->color[2], ovl->color[3]); + printf ("spu: \ttrans [%d %d %d %d]\n", + ovl->trans[0], ovl->trans[1], ovl->trans[2], ovl->trans[3]); + printf ("spu: \tclip top=%d bottom=%d left=%d right=%d\n", + ovl->hili_top, ovl->hili_bottom, ovl->hili_left, ovl->hili_right); + printf ("spu: \tclip_clut [%x %x %x %x]\n", + ovl->hili_color[0], ovl->hili_color[1], ovl->hili_color[2], ovl->hili_color[3]); + printf ("spu: \thili_trans [%d %d %d %d]\n", + ovl->hili_trans[0], ovl->hili_trans[1], ovl->hili_trans[2], ovl->hili_trans[3]); + return; +} +#endif + +int spudec_copy_nav_to_overlay(xine_t *xine, pci_t* nav_pci, uint32_t* clut, + int32_t button, int32_t mode, vo_overlay_t * overlay, vo_overlay_t * base ) { + btni_t *button_ptr = NULL; + unsigned int btns_per_group; + int i; + + if((button <= 0) || (button > nav_pci->hli.hl_gi.btn_ns)) + return 0; + + btns_per_group = 36 / nav_pci->hli.hl_gi.btngr_ns; + + /* choose button group: we can always use a normal 4:3 or widescreen button group + * as long as xine blends the overlay before scaling the image to its aspect */ + if (!button_ptr && nav_pci->hli.hl_gi.btngr_ns >= 1 && !(nav_pci->hli.hl_gi.btngr1_dsp_ty & 6)) + button_ptr = &nav_pci->hli.btnit[0 * btns_per_group + button - 1]; + if (!button_ptr && nav_pci->hli.hl_gi.btngr_ns >= 2 && !(nav_pci->hli.hl_gi.btngr2_dsp_ty & 6)) + button_ptr = &nav_pci->hli.btnit[1 * btns_per_group + button - 1]; + if (!button_ptr && nav_pci->hli.hl_gi.btngr_ns >= 3 && !(nav_pci->hli.hl_gi.btngr3_dsp_ty & 6)) + button_ptr = &nav_pci->hli.btnit[2 * btns_per_group + button - 1]; + if (!button_ptr) { + xprintf(xine, XINE_VERBOSITY_DEBUG, + "libspudec: No suitable menu button group found, using group 1.\n"); + button_ptr = &nav_pci->hli.btnit[button - 1]; + } + + /* button areas in the nav packet are in screen coordinates, + * overlay clipping areas are in overlay coordinates; + * therefore we must subtract the display coordinates of the underlying overlay */ + overlay->hili_left = (button_ptr->x_start > base->x) ? (button_ptr->x_start - base->x) : 0; + overlay->hili_top = (button_ptr->y_start > base->y) ? (button_ptr->y_start - base->y) : 0; + overlay->hili_right = (button_ptr->x_end > base->x) ? (button_ptr->x_end - base->x) : 0; + overlay->hili_bottom = (button_ptr->y_end > base->y) ? (button_ptr->y_end - base->y) : 0; + if(button_ptr->btn_coln != 0) { +#ifdef LOG_BUTTON + fprintf(stderr, "libspudec: normal button clut\n"); +#endif + for (i = 0;i < 4; i++) { + overlay->hili_color[i] = clut[0xf & (nav_pci->hli.btn_colit.btn_coli[button_ptr->btn_coln-1][mode] >> (16 + 4*i))]; + overlay->hili_trans[i] = 0xf & (nav_pci->hli.btn_colit.btn_coli[button_ptr->btn_coln-1][mode] >> (4*i)); + } + } else { +#ifdef LOG_BUTTON + fprintf(stderr, "libspudec: abnormal button clut\n"); +#endif + for (i = 0;i < 4; i++) { +#ifdef LOG_BUTTON + printf("libspudec:btn_coln = 0, hili_color = color\n"); +#endif + overlay->hili_color[i] = overlay->color[i]; + overlay->hili_trans[i] = overlay->trans[i]; + } + } + + /* spudec_print_overlay( overlay ); */ +#ifdef LOG_BUTTON + printf("libspudec:xine_decoder.c:NAV to SPU pts match!\n"); +#endif + + return 1; +} diff --git a/src/libspudec/spudec.h b/src/libspudec/spudec.h new file mode 100644 index 000000000..1e7d80596 --- /dev/null +++ b/src/libspudec/spudec.h @@ -0,0 +1,142 @@ +/* + * Copyright (C) 2000-2004 the xine project + * + * Copyright (C) James Courtier-Dutton James@superbug.demon.co.uk - July 2001 + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * This file was originally part of the OMS program. + */ + +#ifndef __SPU_H__ +#define __SPU_H__ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#ifdef HAVE_DVDNAV +# include +#else +# include "nav_types.h" +#endif + +#define NUM_SEQ_BUFFERS 50 +#define MAX_STREAMS 32 + +typedef struct spudec_clut_struct { +#ifdef WORDS_BIGENDIAN + uint8_t entry0 : 4; + uint8_t entry1 : 4; + uint8_t entry2 : 4; + uint8_t entry3 : 4; +#else + uint8_t entry1 : 4; + uint8_t entry0 : 4; + uint8_t entry3 : 4; + uint8_t entry2 : 4; +#endif +} spudec_clut_t; + +typedef struct { + uint8_t *buf; + uint32_t ra_offs; /* reassembly offset */ + uint32_t seq_len; + uint32_t buf_len; + uint32_t cmd_offs; + int64_t pts; /* Base PTS of this sequence */ + int32_t finished; /* Has this control sequence been finished? */ + uint32_t complete; /* Has this reassembly been finished? */ + uint32_t broken; /* this SPU is broken and should be dropped */ +} spudec_seq_t; + +typedef struct { + uint8_t *cmd_ptr; + + uint32_t field_offs[2]; + int32_t b_top, o_top; + int32_t b_bottom, o_bottom; + int32_t b_left, o_left; + int32_t b_right, o_right; + + int32_t modified; /* Was the sub-picture modified? */ + int32_t visible; /* Must the sub-picture be shown? */ + int32_t forced_display; /* This overlay is a menu */ + int32_t delay; /* Delay in 90Khz / 1000 */ + int32_t need_clut; /* doesn't have the right clut yet */ + int32_t cur_colors[4];/* current 4 colors been used */ + int32_t vobsub; /* vobsub must be aligned to bottom */ + + uint32_t clut[16]; +} spudec_state_t; + +typedef struct spudec_stream_state_s { + spudec_seq_t ra_seq; + spudec_state_t state; + int64_t vpts; + int64_t pts; + int32_t overlay_handle; +} spudec_stream_state_t; + +typedef struct { + spu_decoder_class_t decoder_class; +} spudec_class_t; + +typedef struct pci_node_s pci_node_t; +struct pci_node_s { + pci_t pci; + uint64_t vpts; + pci_node_t *next; +}; + +typedef struct spudec_decoder_s { + spu_decoder_t spu_decoder; + + spudec_class_t *class; + xine_stream_t *stream; + spudec_stream_state_t spudec_stream_state[MAX_STREAMS]; + + video_overlay_event_t event; + video_overlay_object_t object; + int32_t menu_handle; + + spudec_state_t state; + + vo_overlay_t overlay; + int ovl_caps; + int output_open; + pthread_mutex_t nav_pci_lock; + pci_node_t pci_cur; + uint32_t buttonN; /* Current button number for highlights */ + int32_t button_filter; /* Allow highlight changes or not */ + int64_t last_event_vpts; +} spudec_decoder_t; + +void spudec_reassembly (xine_t *xine, spudec_seq_t *seq, uint8_t *pkt_data, u_int pkt_len); +void spudec_process( spudec_decoder_t *this, int stream_id); +/* the nav functions must be called with the nav_pci_lock held */ +void spudec_decode_nav( spudec_decoder_t *this, buf_element_t *buf); +void spudec_clear_nav_list(spudec_decoder_t *this); +void spudec_update_nav(spudec_decoder_t *this); +void spudec_process_nav(spudec_decoder_t *this); +int spudec_copy_nav_to_overlay(xine_t *xine, pci_t* nav_pci, uint32_t* clut, int32_t button, int32_t mode, + vo_overlay_t * overlay, vo_overlay_t * base ); + +#endif diff --git a/src/libspudec/xine_spu_decoder.c b/src/libspudec/xine_spu_decoder.c index 7f0269dfb..e36b39fc8 100644 --- a/src/libspudec/xine_spu_decoder.c +++ b/src/libspudec/xine_spu_decoder.c @@ -33,7 +33,6 @@ #include #include "xine-engine/bswap.h" #include -#include "spu.h" #ifdef HAVE_DVDNAV # include # include @@ -42,6 +41,8 @@ # include "nav_types.h" #endif +#include "spudec.h" + /* #define LOG_DEBUG 1 #define LOG_BUTTON 1 -- cgit v1.2.3 From d92d390d8f4cf6198c36e88af9bbadc203ca49d6 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Thu, 20 Dec 2007 23:04:55 +0000 Subject: Correct some #includes. --- src/dxr3/video_out_dxr3.h | 2 +- src/input/vcd/xine-extra.h | 2 +- src/video_out/xxmc.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dxr3/video_out_dxr3.h b/src/dxr3/video_out_dxr3.h index a5a1368a3..b3c607109 100644 --- a/src/dxr3/video_out_dxr3.h +++ b/src/dxr3/video_out_dxr3.h @@ -27,7 +27,7 @@ #endif #include -#include "vo_scale.h" +#include #include "dxr3_scr.h" #include "dxr3.h" diff --git a/src/input/vcd/xine-extra.h b/src/input/vcd/xine-extra.h index 4246405ba..59f562cbd 100644 --- a/src/input/vcd/xine-extra.h +++ b/src/input/vcd/xine-extra.h @@ -37,7 +37,7 @@ /* Xine includes */ #include -#include "input_plugin.h" +#include #include /*! diff --git a/src/video_out/xxmc.h b/src/video_out/xxmc.h index d6cd7e514..9aea10854 100644 --- a/src/video_out/xxmc.h +++ b/src/video_out/xxmc.h @@ -86,7 +86,7 @@ #include #include #include -#include "vo_scale.h" +#include #include "x11osd.h" #include "accel_xvmc.h" -- cgit v1.2.3 From 3a217974c83b61f59a8a86684802864d4f9e03d6 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Fri, 21 Dec 2007 23:59:48 +0000 Subject: More #include fixes. --- contrib/a52dec/imdct.c | 2 +- contrib/a52dec/parse.c | 2 +- src/libw32dll/wine/debugtools.h | 2 +- src/libw32dll/wine/ext.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/a52dec/imdct.c b/contrib/a52dec/imdct.c index 5835e70a1..aa1c85464 100644 --- a/contrib/a52dec/imdct.c +++ b/contrib/a52dec/imdct.c @@ -38,7 +38,7 @@ #include "a52.h" #include "a52_internal.h" -#include "xineutils.h" +#include typedef struct complex_s { sample_t real; diff --git a/contrib/a52dec/parse.c b/contrib/a52dec/parse.c index 0bfd02fce..7aba1d809 100644 --- a/contrib/a52dec/parse.c +++ b/contrib/a52dec/parse.c @@ -31,7 +31,7 @@ #include "a52_internal.h" #include "bitstream.h" #include "tables.h" -#include "xineutils.h" +#include typedef struct { sample_t q1[2]; diff --git a/src/libw32dll/wine/debugtools.h b/src/libw32dll/wine/debugtools.h index 3b342e10c..c6fac518d 100644 --- a/src/libw32dll/wine/debugtools.h +++ b/src/libw32dll/wine/debugtools.h @@ -8,7 +8,7 @@ #include "config.h" #include "windef.h" -#include "compat.h" +#include struct _GUID; diff --git a/src/libw32dll/wine/ext.h b/src/libw32dll/wine/ext.h index f0f505c4d..ad22edc5e 100644 --- a/src/libw32dll/wine/ext.h +++ b/src/libw32dll/wine/ext.h @@ -2,7 +2,7 @@ #define loader_ext_h #include "windef.h" -#include "attributes.h" +#include extern LPVOID FILE_dommap( int unix_handle, LPVOID start, DWORD size_high, DWORD size_low, -- cgit v1.2.3