From 4e95a4f5224e241075b8cd86b4423c85c1d0ee26 Mon Sep 17 00:00:00 2001 From: Michael Roitzsch Date: Wed, 20 Nov 2002 11:57:38 +0000 Subject: engine modifications to allow post plugin layer: * new public output interface xine_{audio,video}_port_t instead of xine_{ao,vo}_driver_t, old names kept as aliases for compatibility * modified the engine to allow multiple streams per output * renaming of some internal structures according to public changes * moving SCR out of per-stream-metronom into a global metronom_clock_t residing in xine_t and therefore easily available to the output layer * adapting all available plugins (note to external projects: the compiler will help you a lot, if a plugin compiles, it is adapted, because all changes add new parameters to some functions) * bump up all interface versions because of xine_t and xine_stream_t changes CVS patchset: 3312 CVS date: 2002/11/20 11:57:38 --- src/audio_out/audio_alsa_out.c | 34 ++++----- src/audio_out/audio_arts_out.c | 28 ++++---- src/audio_out/audio_esd_out.c | 28 ++++---- src/audio_out/audio_oss_out.c | 32 ++++----- src/audio_out/audio_sun_out.c | 32 ++++----- src/demuxers/demux.h | 4 +- src/demuxers/demux_aiff.c | 4 +- src/demuxers/demux_asf.c | 4 +- src/demuxers/demux_avi.c | 4 +- src/demuxers/demux_cda.c | 4 +- src/demuxers/demux_eawve.c | 4 +- src/demuxers/demux_elem.c | 4 +- src/demuxers/demux_film.c | 4 +- src/demuxers/demux_fli.c | 4 +- src/demuxers/demux_idcin.c | 4 +- src/demuxers/demux_mpeg.c | 4 +- src/demuxers/demux_mpeg_block.c | 4 +- src/demuxers/demux_mpgaudio.c | 4 +- src/demuxers/demux_ogg.c | 4 +- src/demuxers/demux_qt.c | 4 +- src/demuxers/demux_real.c | 4 +- src/demuxers/demux_realaudio.c | 4 +- src/demuxers/demux_roq.c | 4 +- src/demuxers/demux_smjpeg.c | 4 +- src/demuxers/demux_snd.c | 4 +- src/demuxers/demux_ts.c | 4 +- src/demuxers/demux_voc.c | 4 +- src/demuxers/demux_vqa.c | 4 +- src/demuxers/demux_wav.c | 4 +- src/demuxers/demux_wc3movie.c | 4 +- src/demuxers/demux_yuv4mpeg2.c | 4 +- src/dxr3/dxr3_decode_spu.c | 6 +- src/dxr3/dxr3_decode_video.c | 32 +++++---- src/dxr3/video_out_dxr3.c | 66 +++++++++--------- src/dxr3/video_out_dxr3.h | 4 +- src/input/input_dvd.c | 24 +++++-- src/input/input_file.c | 4 +- src/input/input_http.c | 2 +- src/input/input_mms.c | 4 +- src/input/input_plugin.h | 4 +- src/input/input_stdin_fifo.c | 4 +- src/input/input_vcd.c | 4 +- src/input/net_buf_ctrl.c | 10 +-- src/liba52/xine_decoder.c | 20 +++--- src/libdts/xine_decoder.c | 11 +-- src/libfaad/xine_decoder.c | 11 +-- src/libffmpeg/xine_decoder.c | 19 ++--- src/liblpcm/xine_decoder.c | 12 ++-- src/libmad/xine_decoder.c | 13 ++-- src/libmpeg2/decode.c | 13 ++-- src/libmpeg2/mpeg2.h | 4 +- src/libmpeg2/xine_decoder.c | 10 +-- src/libreal/xine_decoder.c | 8 +-- src/libspudec/spu.h | 4 +- src/libspudec/spu_decoder_api.h | 2 +- src/libspudec/xine_decoder.c | 6 +- src/libvorbis/xine_decoder.c | 9 +-- src/libw32dll/w32codec.c | 24 +++---- src/libxineadec/adpcm.c | 26 +++---- src/libxineadec/fooaudio.c | 9 +-- src/libxineadec/gsm610.c | 12 ++-- src/libxineadec/logpcm.c | 10 +-- src/libxineadec/roqaudio.c | 10 +-- src/libxinevdec/cinepak.c | 10 +-- src/libxinevdec/cyuv.c | 10 +-- src/libxinevdec/fli.c | 12 ++-- src/libxinevdec/foovideo.c | 14 ++-- src/libxinevdec/idcinvideo.c | 12 ++-- src/libxinevdec/msrle.c | 12 ++-- src/libxinevdec/msvc.c | 10 +-- src/libxinevdec/qtrle.c | 11 ++- src/libxinevdec/qtrpza.c | 12 ++-- src/libxinevdec/qtsmc.c | 12 ++-- src/libxinevdec/rgb.c | 12 ++-- src/libxinevdec/roqvideo.c | 10 +-- src/libxinevdec/svq1.c | 10 +-- src/libxinevdec/wc3video.c | 11 ++- src/libxinevdec/yuv.c | 11 ++- src/video_out/video_out_aa.c | 26 +++---- src/video_out/video_out_fb.c | 24 +++---- src/video_out/video_out_none.c | 28 ++++---- src/video_out/video_out_pgx64.c | 8 +-- src/video_out/video_out_sdl.c | 22 +++--- src/video_out/video_out_syncfb.c | 24 +++---- src/video_out/video_out_vidix.c | 30 ++++---- src/video_out/video_out_xshm.c | 30 ++++---- src/video_out/video_out_xv.c | 30 ++++---- src/xine-engine/audio_decoder.h | 4 +- src/xine-engine/audio_out.c | 147 ++++++++++++++++++++++++--------------- src/xine-engine/audio_out.h | 76 ++++++++++---------- src/xine-engine/demux.c | 4 +- src/xine-engine/load_plugins.c | 42 ++++++----- src/xine-engine/metronom.c | 133 ++++++++++++++++++++++++----------- src/xine-engine/metronom.h | 142 ++++++++++++++++++++++--------------- src/xine-engine/video_decoder.h | 4 +- src/xine-engine/video_out.c | 146 +++++++++++++++++++++++++------------- src/xine-engine/video_out.h | 85 +++++++++++----------- src/xine-engine/video_overlay.c | 4 +- src/xine-engine/xine.c | 39 +++++------ src/xine-engine/xine_interface.c | 4 +- src/xine-engine/xine_internal.h | 17 ++--- 101 files changed, 1044 insertions(+), 849 deletions(-) (limited to 'src') diff --git a/src/audio_out/audio_alsa_out.c b/src/audio_out/audio_alsa_out.c index c0f52b6c8..7ed2363fa 100644 --- a/src/audio_out/audio_alsa_out.c +++ b/src/audio_out/audio_alsa_out.c @@ -26,7 +26,7 @@ * (c) 2001 James Courtier-Dutton * * - * $Id: audio_alsa_out.c,v 1.83 2002/10/24 13:52:56 jcdutton Exp $ + * $Id: audio_alsa_out.c,v 1.84 2002/11/20 11:57:38 mroi Exp $ */ #ifdef HAVE_CONFIG_H @@ -65,7 +65,7 @@ #define LOG_DEBUG */ -#define AO_OUT_ALSA_IFACE_VERSION 5 +#define AO_OUT_ALSA_IFACE_VERSION 6 #define BUFFER_TIME 1000*1000 #define PERIOD_TIME 100*1000 @@ -83,7 +83,7 @@ typedef struct { typedef struct alsa_driver_s { - xine_ao_driver_t ao_driver; + ao_driver_t ao_driver; alsa_class_t *class; @@ -166,7 +166,7 @@ static long ao_alsa_get_volume_from_percent(int val, long min, long max) /* * open the audio device for writing to */ -static int ao_alsa_open(xine_ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int mode) +static int ao_alsa_open(ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int mode) { alsa_driver_t *this = (alsa_driver_t *) this_gen; config_values_t *config = this->class->xine->config; @@ -412,7 +412,7 @@ __close: /* * Return the number of audio channels */ -static int ao_alsa_num_channels(xine_ao_driver_t *this_gen) +static int ao_alsa_num_channels(ao_driver_t *this_gen) { alsa_driver_t *this = (alsa_driver_t *) this_gen; return this->num_channels; @@ -421,7 +421,7 @@ static int ao_alsa_num_channels(xine_ao_driver_t *this_gen) /* * Return the number of bytes per frame */ -static int ao_alsa_bytes_per_frame(xine_ao_driver_t *this_gen) +static int ao_alsa_bytes_per_frame(ao_driver_t *this_gen) { alsa_driver_t *this = (alsa_driver_t *) this_gen; return this->bytes_per_frame; @@ -430,7 +430,7 @@ static int ao_alsa_bytes_per_frame(xine_ao_driver_t *this_gen) /* * Return gap tolerance (in pts) */ -static int ao_alsa_get_gap_tolerance (xine_ao_driver_t *this_gen) +static int ao_alsa_get_gap_tolerance (ao_driver_t *this_gen) { return GAP_TOLERANCE; } @@ -441,7 +441,7 @@ static int ao_alsa_get_gap_tolerance (xine_ao_driver_t *this_gen) /* FIXME: delay returns invalid data if status is not RUNNING. * e.g When there is an XRUN or we are in PREPARED mode. */ -static int ao_alsa_delay (xine_ao_driver_t *this_gen) +static int ao_alsa_delay (ao_driver_t *this_gen) { snd_pcm_state_t state; snd_pcm_sframes_t delay = 0; @@ -494,7 +494,7 @@ static void xrun(alsa_driver_t *this) /* * Write audio data to output buffer (blocking using snd_pcm_wait) */ -static int ao_alsa_write(xine_ao_driver_t *this_gen,int16_t *data, uint32_t count) +static int ao_alsa_write(ao_driver_t *this_gen,int16_t *data, uint32_t count) { snd_pcm_sframes_t result; snd_pcm_status_t *pcm_stat; @@ -586,7 +586,7 @@ static int ao_alsa_write(xine_ao_driver_t *this_gen,int16_t *data, uint32_t coun /* * This is called when the decoder no longer uses the audio */ -static void ao_alsa_close(xine_ao_driver_t *this_gen) +static void ao_alsa_close(ao_driver_t *this_gen) { alsa_driver_t *this = (alsa_driver_t *) this_gen; if(this->audio_fd) snd_pcm_close(this->audio_fd); @@ -597,7 +597,7 @@ static void ao_alsa_close(xine_ao_driver_t *this_gen) /* * Find out what output modes + capatilities are supported */ -static uint32_t ao_alsa_get_capabilities (xine_ao_driver_t *this_gen) { +static uint32_t ao_alsa_get_capabilities (ao_driver_t *this_gen) { alsa_driver_t *this = (alsa_driver_t *) this_gen; return this->capabilities; } @@ -605,7 +605,7 @@ static uint32_t ao_alsa_get_capabilities (xine_ao_driver_t *this_gen) { /* * Shut down audio output driver plugin and free all resources allocated */ -static void ao_alsa_exit(xine_ao_driver_t *this_gen) +static void ao_alsa_exit(ao_driver_t *this_gen) { alsa_driver_t *this = (alsa_driver_t *) this_gen; void *p; @@ -632,7 +632,7 @@ static void ao_alsa_exit(xine_ao_driver_t *this_gen) /* * Get a property of audio driver */ -static int ao_alsa_get_property (xine_ao_driver_t *this_gen, int property) { +static int ao_alsa_get_property (ao_driver_t *this_gen, int property) { alsa_driver_t *this = (alsa_driver_t *) this_gen; int err; @@ -676,7 +676,7 @@ static int ao_alsa_get_property (xine_ao_driver_t *this_gen, int property) { /* * Set a property of audio driver */ -static int ao_alsa_set_property (xine_ao_driver_t *this_gen, int property, int value) { +static int ao_alsa_set_property (ao_driver_t *this_gen, int property, int value) { alsa_driver_t *this = (alsa_driver_t *) this_gen; int err; @@ -747,7 +747,7 @@ static int ao_alsa_set_property (xine_ao_driver_t *this_gen, int property, int v /* * Misc control operations */ -static int ao_alsa_ctrl(xine_ao_driver_t *this_gen, int cmd, ...) { +static int ao_alsa_ctrl(ao_driver_t *this_gen, int cmd, ...) { alsa_driver_t *this = (alsa_driver_t *) this_gen; int result; @@ -805,7 +805,7 @@ static int ao_alsa_ctrl(xine_ao_driver_t *this_gen, int cmd, ...) { /* * Initialize mixer */ -static void ao_alsa_mixer_init(xine_ao_driver_t *this_gen) { +static void ao_alsa_mixer_init(ao_driver_t *this_gen) { alsa_driver_t *this = (alsa_driver_t *) this_gen; config_values_t *config = this->class->xine->config; char *pcm_device; @@ -994,7 +994,7 @@ static void ao_alsa_mixer_init(xine_ao_driver_t *this_gen) { /* * Initialize plugin */ -static xine_ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *data) { +static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *data) { alsa_class_t *class = (alsa_class_t *) class_gen; config_values_t *config = class->xine->config; diff --git a/src/audio_out/audio_arts_out.c b/src/audio_out/audio_arts_out.c index a808ac1ce..d3a920a23 100644 --- a/src/audio_out/audio_arts_out.c +++ b/src/audio_out/audio_arts_out.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_arts_out.c,v 1.15 2002/09/05 20:44:38 mroi Exp $ + * $Id: audio_arts_out.c,v 1.16 2002/11/20 11:57:39 mroi Exp $ */ /* required for swab() */ @@ -50,7 +50,7 @@ typedef struct arts_driver_s { - xine_ao_driver_t ao_driver; + ao_driver_t ao_driver; arts_stream_t audio_stream; int capabilities; @@ -95,7 +95,7 @@ static void ao_arts_volume(void *buffer, int length, int left, int right) /* * open the audio device for writing to */ -static int ao_arts_open(xine_ao_driver_t *this_gen, +static int ao_arts_open(ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int mode) { arts_driver_t *this = (arts_driver_t *) this_gen; @@ -154,24 +154,24 @@ static int ao_arts_open(xine_ao_driver_t *this_gen, } -static int ao_arts_num_channels(xine_ao_driver_t *this_gen) +static int ao_arts_num_channels(ao_driver_t *this_gen) { arts_driver_t *this = (arts_driver_t *) this_gen; return this->num_channels; } -static int ao_arts_bytes_per_frame(xine_ao_driver_t *this_gen) +static int ao_arts_bytes_per_frame(ao_driver_t *this_gen) { arts_driver_t *this = (arts_driver_t *) this_gen; return this->bytes_per_frame; } -static int ao_arts_get_gap_tolerance (xine_ao_driver_t *this_gen) +static int ao_arts_get_gap_tolerance (ao_driver_t *this_gen) { return GAP_TOLERANCE; } -static int ao_arts_write(xine_ao_driver_t *this_gen, int16_t *data, +static int ao_arts_write(ao_driver_t *this_gen, int16_t *data, uint32_t num_frames) { arts_driver_t *this = (arts_driver_t *) this_gen; @@ -184,7 +184,7 @@ static int ao_arts_write(xine_ao_driver_t *this_gen, int16_t *data, } -static int ao_arts_delay (xine_ao_driver_t *this_gen) +static int ao_arts_delay (ao_driver_t *this_gen) { arts_driver_t *this = (arts_driver_t *) this_gen; @@ -197,7 +197,7 @@ static int ao_arts_delay (xine_ao_driver_t *this_gen) return this->latency * this->sample_rate / 1000; } -static void ao_arts_close(xine_ao_driver_t *this_gen) +static void ao_arts_close(ao_driver_t *this_gen) { arts_driver_t *this = (arts_driver_t *) this_gen; @@ -207,12 +207,12 @@ static void ao_arts_close(xine_ao_driver_t *this_gen) } } -static uint32_t ao_arts_get_capabilities (xine_ao_driver_t *this_gen) { +static uint32_t ao_arts_get_capabilities (ao_driver_t *this_gen) { arts_driver_t *this = (arts_driver_t *) this_gen; return this->capabilities; } -static void ao_arts_exit(xine_ao_driver_t *this_gen) +static void ao_arts_exit(ao_driver_t *this_gen) { arts_driver_t *this = (arts_driver_t *) this_gen; @@ -225,7 +225,7 @@ static void ao_arts_exit(xine_ao_driver_t *this_gen) /* * */ -static int ao_arts_get_property (xine_ao_driver_t *this_gen, int property) { +static int ao_arts_get_property (ao_driver_t *this_gen, int property) { arts_driver_t *this = (arts_driver_t *) this_gen; @@ -246,7 +246,7 @@ static int ao_arts_get_property (xine_ao_driver_t *this_gen, int property) { /* * */ -static int ao_arts_set_property (xine_ao_driver_t *this_gen, int property, int value) { +static int ao_arts_set_property (ao_driver_t *this_gen, int property, int value) { arts_driver_t *this = (arts_driver_t *) this_gen; int mute = (value) ? 1 : 0; @@ -279,7 +279,7 @@ static int ao_arts_set_property (xine_ao_driver_t *this_gen, int property, int v /* * */ -static int ao_arts_ctrl(xine_ao_driver_t *this_gen, int cmd, ...) { +static int ao_arts_ctrl(ao_driver_t *this_gen, int cmd, ...) { /*arts_driver_t *this = (arts_driver_t *) this_gen;*/ switch (cmd) { diff --git a/src/audio_out/audio_esd_out.c b/src/audio_out/audio_esd_out.c index 5d7e32194..2eb93a1f5 100644 --- a/src/audio_out/audio_esd_out.c +++ b/src/audio_out/audio_esd_out.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_esd_out.c,v 1.21 2002/09/05 20:44:38 mroi Exp $ + * $Id: audio_esd_out.c,v 1.22 2002/11/20 11:57:39 mroi Exp $ */ #ifdef HAVE_CONFIG_H @@ -45,7 +45,7 @@ typedef struct esd_driver_s { - xine_ao_driver_t ao_driver; + ao_driver_t ao_driver; int audio_fd; int capabilities; @@ -76,7 +76,7 @@ typedef struct esd_driver_s { /* * connect to esd */ -static int ao_esd_open(xine_ao_driver_t *this_gen, +static int ao_esd_open(ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int mode) { esd_driver_t *this = (esd_driver_t *) this_gen; @@ -139,20 +139,20 @@ static int ao_esd_open(xine_ao_driver_t *this_gen, return this->output_sample_rate; } -static int ao_esd_num_channels(xine_ao_driver_t *this_gen) +static int ao_esd_num_channels(ao_driver_t *this_gen) { esd_driver_t *this = (esd_driver_t *) this_gen; return this->num_channels; } -static int ao_esd_bytes_per_frame(xine_ao_driver_t *this_gen) +static int ao_esd_bytes_per_frame(ao_driver_t *this_gen) { esd_driver_t *this = (esd_driver_t *) this_gen; return this->bytes_per_frame; } -static int ao_esd_delay(xine_ao_driver_t *this_gen) +static int ao_esd_delay(ao_driver_t *this_gen) { esd_driver_t *this = (esd_driver_t *) this_gen; int bytes_left; @@ -178,7 +178,7 @@ static int ao_esd_delay(xine_ao_driver_t *this_gen) return bytes_left / this->bytes_per_frame; } -static int ao_esd_write(xine_ao_driver_t *this_gen, +static int ao_esd_write(ao_driver_t *this_gen, int16_t* frame_buffer, uint32_t num_frames) { @@ -214,24 +214,24 @@ static int ao_esd_write(xine_ao_driver_t *this_gen, return 1; } -static void ao_esd_close(xine_ao_driver_t *this_gen) +static void ao_esd_close(ao_driver_t *this_gen) { esd_driver_t *this = (esd_driver_t *) this_gen; esd_close(this->audio_fd); this->audio_fd = -1; } -static uint32_t ao_esd_get_capabilities (xine_ao_driver_t *this_gen) { +static uint32_t ao_esd_get_capabilities (ao_driver_t *this_gen) { esd_driver_t *this = (esd_driver_t *) this_gen; return this->capabilities; } -static int ao_esd_get_gap_tolerance (xine_ao_driver_t *this_gen) { +static int ao_esd_get_gap_tolerance (ao_driver_t *this_gen) { /* esd_driver_t *this = (esd_driver_t *) this_gen; */ return GAP_TOLERANCE; } -static void ao_esd_exit(xine_ao_driver_t *this_gen) +static void ao_esd_exit(ao_driver_t *this_gen) { esd_driver_t *this = (esd_driver_t *) this_gen; @@ -243,7 +243,7 @@ static void ao_esd_exit(xine_ao_driver_t *this_gen) free (this); } -static int ao_esd_get_property (xine_ao_driver_t *this_gen, int property) { +static int ao_esd_get_property (ao_driver_t *this_gen, int property) { esd_driver_t *this = (esd_driver_t *) this_gen; int mixer_fd; esd_player_info_t *esd_pi; @@ -281,7 +281,7 @@ static int ao_esd_get_property (xine_ao_driver_t *this_gen, int property) { return 0; } -static int ao_esd_set_property (xine_ao_driver_t *this_gen, int property, int value) { +static int ao_esd_set_property (ao_driver_t *this_gen, int property, int value) { esd_driver_t *this = (esd_driver_t *) this_gen; int mixer_fd; @@ -343,7 +343,7 @@ static int ao_esd_set_property (xine_ao_driver_t *this_gen, int property, int va return ~value; } -static int ao_esd_ctrl(xine_ao_driver_t *this_gen, int cmd, ...) { +static int ao_esd_ctrl(ao_driver_t *this_gen, int cmd, ...) { /* esd_driver_t *this = (esd_driver_t *) this_gen; */ diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c index bde236e99..fec8cacec 100644 --- a/src/audio_out/audio_oss_out.c +++ b/src/audio_out/audio_oss_out.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_oss_out.c,v 1.81 2002/11/16 11:39:10 mroi Exp $ + * $Id: audio_oss_out.c,v 1.82 2002/11/20 11:57:40 mroi Exp $ * * 20-8-2001 First implementation of Audio sync and Audio driver separation. * Copyright (C) 2001 James Courtier-Dutton James@superbug.demon.co.uk @@ -87,7 +87,7 @@ # define AFMT_AC3 0x00000400 #endif -#define AO_OUT_OSS_IFACE_VERSION 5 +#define AO_OUT_OSS_IFACE_VERSION 6 #define AUDIO_NUM_FRAGMENTS 15 #define AUDIO_FRAGMENT_SIZE 8192 @@ -112,7 +112,7 @@ typedef struct oss_driver_s { - xine_ao_driver_t ao_driver; + ao_driver_t ao_driver; char audio_dev[20]; int audio_fd; int capabilities; @@ -152,7 +152,7 @@ typedef struct { /* * open the audio device for writing to */ -static int ao_oss_open(xine_ao_driver_t *this_gen, +static int ao_oss_open(ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int mode) { oss_driver_t *this = (oss_driver_t *) this_gen; @@ -333,27 +333,27 @@ static int ao_oss_open(xine_ao_driver_t *this_gen, return this->output_sample_rate; } -static int ao_oss_num_channels(xine_ao_driver_t *this_gen) { +static int ao_oss_num_channels(ao_driver_t *this_gen) { oss_driver_t *this = (oss_driver_t *) this_gen; return this->num_channels; } -static int ao_oss_bytes_per_frame(xine_ao_driver_t *this_gen) { +static int ao_oss_bytes_per_frame(ao_driver_t *this_gen) { oss_driver_t *this = (oss_driver_t *) this_gen; return this->bytes_per_frame; } -static int ao_oss_get_gap_tolerance (xine_ao_driver_t *this_gen){ +static int ao_oss_get_gap_tolerance (ao_driver_t *this_gen){ /* oss_driver_t *this = (oss_driver_t *) this_gen; */ return GAP_TOLERANCE; } -static int ao_oss_delay(xine_ao_driver_t *this_gen) { +static int ao_oss_delay(ao_driver_t *this_gen) { count_info info; oss_driver_t *this = (oss_driver_t *) this_gen; @@ -409,7 +409,7 @@ static int ao_oss_delay(xine_ao_driver_t *this_gen) { * audio frames are equivalent one sample on each channel. * I.E. Stereo 16 bits audio frames are 4 bytes. */ -static int ao_oss_write(xine_ao_driver_t *this_gen, +static int ao_oss_write(ao_driver_t *this_gen, int16_t* frame_buffer, uint32_t num_frames) { oss_driver_t *this = (oss_driver_t *) this_gen; @@ -450,7 +450,7 @@ static int ao_oss_write(xine_ao_driver_t *this_gen, return n; } -static void ao_oss_close(xine_ao_driver_t *this_gen) { +static void ao_oss_close(ao_driver_t *this_gen) { oss_driver_t *this = (oss_driver_t *) this_gen; @@ -458,14 +458,14 @@ static void ao_oss_close(xine_ao_driver_t *this_gen) { this->audio_fd = -1; } -static uint32_t ao_oss_get_capabilities (xine_ao_driver_t *this_gen) { +static uint32_t ao_oss_get_capabilities (ao_driver_t *this_gen) { oss_driver_t *this = (oss_driver_t *) this_gen; return this->capabilities; } -static void ao_oss_exit(xine_ao_driver_t *this_gen) { +static void ao_oss_exit(ao_driver_t *this_gen) { oss_driver_t *this = (oss_driver_t *) this_gen; @@ -475,7 +475,7 @@ static void ao_oss_exit(xine_ao_driver_t *this_gen) { free (this); } -static int ao_oss_get_property (xine_ao_driver_t *this_gen, int property) { +static int ao_oss_get_property (ao_driver_t *this_gen, int property) { oss_driver_t *this = (oss_driver_t *) this_gen; int mixer_fd; @@ -520,7 +520,7 @@ static int ao_oss_get_property (xine_ao_driver_t *this_gen, int property) { return 0; } -static int ao_oss_set_property (xine_ao_driver_t *this_gen, int property, int value) { +static int ao_oss_set_property (ao_driver_t *this_gen, int property, int value) { oss_driver_t *this = (oss_driver_t *) this_gen; int mixer_fd; @@ -604,7 +604,7 @@ static int ao_oss_set_property (xine_ao_driver_t *this_gen, int property, int va return ~value; } -static int ao_oss_ctrl(xine_ao_driver_t *this_gen, int cmd, ...) { +static int ao_oss_ctrl(ao_driver_t *this_gen, int cmd, ...) { oss_driver_t *this = (oss_driver_t *) this_gen; switch (cmd) { @@ -642,7 +642,7 @@ static int ao_oss_ctrl(xine_ao_driver_t *this_gen, int cmd, ...) { return 0; } -static xine_ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *data) { +static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *data) { oss_class_t *class = (oss_class_t *) class_gen; config_values_t *config = class->config; diff --git a/src/audio_out/audio_sun_out.c b/src/audio_out/audio_sun_out.c index ed4448af3..24f1644c1 100644 --- a/src/audio_out/audio_sun_out.c +++ b/src/audio_out/audio_sun_out.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_sun_out.c,v 1.26 2002/11/02 14:39:51 jkeil Exp $ + * $Id: audio_sun_out.c,v 1.27 2002/11/20 11:57:40 mroi Exp $ */ #ifdef HAVE_CONFIG_H @@ -59,7 +59,7 @@ #define AUDIO_PRECISION_16 16 #endif -#define AO_SUN_IFACE_VERSION 5 +#define AO_SUN_IFACE_VERSION 6 #define GAP_TOLERANCE 5000 #define GAP_NONRT_TOLERANCE AO_MAX_GAP @@ -75,7 +75,7 @@ typedef struct { typedef struct sun_driver_s { - xine_ao_driver_t ao_driver; + ao_driver_t ao_driver; char *audio_dev; int audio_fd; @@ -399,7 +399,7 @@ find_highest_samplerate(int dev) * other 8-bit formats (uLaw, aLaw, etc) are currently not supported * by xine */ -static int ao_sun_open(xine_ao_driver_t *this_gen, +static int ao_sun_open(ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int mode) { sun_driver_t *this = (sun_driver_t *) this_gen; @@ -541,19 +541,19 @@ static int ao_sun_open(xine_ao_driver_t *this_gen, return this->output_sample_rate; } -static int ao_sun_num_channels(xine_ao_driver_t *this_gen) +static int ao_sun_num_channels(ao_driver_t *this_gen) { sun_driver_t *this = (sun_driver_t *) this_gen; return this->num_channels; } -static int ao_sun_bytes_per_frame(xine_ao_driver_t *this_gen) +static int ao_sun_bytes_per_frame(ao_driver_t *this_gen) { sun_driver_t *this = (sun_driver_t *) this_gen; return this->bytes_per_frame; } -static int ao_sun_delay(xine_ao_driver_t *this_gen) +static int ao_sun_delay(ao_driver_t *this_gen) { sun_driver_t *this = (sun_driver_t *) this_gen; audio_info_t info; @@ -606,7 +606,7 @@ static int ao_sun_delay(xine_ao_driver_t *this_gen) return NOT_REAL_TIME; } -static int ao_sun_get_gap_tolerance (xine_ao_driver_t *this_gen) +static int ao_sun_get_gap_tolerance (ao_driver_t *this_gen) { sun_driver_t *this = (sun_driver_t *) this_gen; @@ -688,7 +688,7 @@ static void sun_audio_flush(sun_driver_t *this) * audio frames are equivalent one sample on each channel. * I.E. Stereo 16 bits audio frames are 4 bytes. */ -static int ao_sun_write(xine_ao_driver_t *this_gen, +static int ao_sun_write(ao_driver_t *this_gen, int16_t* data, uint32_t num_frames) { uint8_t *frame_buffer=(uint8_t *)data; @@ -733,7 +733,7 @@ static int ao_sun_write(xine_ao_driver_t *this_gen, return num_written; } -static void ao_sun_close(xine_ao_driver_t *this_gen) +static void ao_sun_close(ao_driver_t *this_gen) { sun_driver_t *this = (sun_driver_t *) this_gen; sun_audio_flush(this); @@ -741,12 +741,12 @@ static void ao_sun_close(xine_ao_driver_t *this_gen) this->audio_fd = -1; } -static uint32_t ao_sun_get_capabilities (xine_ao_driver_t *this_gen) { +static uint32_t ao_sun_get_capabilities (ao_driver_t *this_gen) { sun_driver_t *this = (sun_driver_t *) this_gen; return this->capabilities; } -static void ao_sun_exit(xine_ao_driver_t *this_gen) +static void ao_sun_exit(ao_driver_t *this_gen) { sun_driver_t *this = (sun_driver_t *) this_gen; @@ -760,7 +760,7 @@ static void ao_sun_exit(xine_ao_driver_t *this_gen) * Get a property of audio driver. * return 1 in success, 0 on failure. (and the property value?) */ -static int ao_sun_get_property (xine_ao_driver_t *this_gen, int property) { +static int ao_sun_get_property (ao_driver_t *this_gen, int property) { sun_driver_t *this = (sun_driver_t *) this_gen; audio_info_t info; @@ -785,7 +785,7 @@ static int ao_sun_get_property (xine_ao_driver_t *this_gen, int property) { * Set a property of audio driver. * return value on success, ~value on failure */ -static int ao_sun_set_property (xine_ao_driver_t *this_gen, int property, int value) { +static int ao_sun_set_property (ao_driver_t *this_gen, int property, int value) { sun_driver_t *this = (sun_driver_t *) this_gen; audio_info_t info; @@ -810,7 +810,7 @@ static int ao_sun_set_property (xine_ao_driver_t *this_gen, int property, int va return ~value; } -static int ao_sun_ctrl(xine_ao_driver_t *this_gen, int cmd, ...) { +static int ao_sun_ctrl(ao_driver_t *this_gen, int cmd, ...) { sun_driver_t *this = (sun_driver_t *) this_gen; audio_info_t info; @@ -859,7 +859,7 @@ static int ao_sun_ctrl(xine_ao_driver_t *this_gen, int cmd, ...) { return 0; } -static xine_ao_driver_t *ao_sun_open_plugin (audio_driver_class_t *class_gen, const void *data) { +static ao_driver_t *ao_sun_open_plugin (audio_driver_class_t *class_gen, const void *data) { sun_class_t *class = (sun_class_t *) class_gen; config_values_t *config = class->config; diff --git a/src/demuxers/demux.h b/src/demuxers/demux.h index 16c827cae..e0fb6c33b 100644 --- a/src/demuxers/demux.h +++ b/src/demuxers/demux.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux.h,v 1.24 2002/11/09 23:22:32 guenter Exp $ + * $Id: demux.h,v 1.25 2002/11/20 11:57:40 mroi Exp $ */ #ifndef HAVE_DEMUX_H @@ -32,7 +32,7 @@ #include "input_plugin.h" #endif -#define DEMUXER_PLUGIN_IFACE_VERSION 16 +#define DEMUXER_PLUGIN_IFACE_VERSION 17 #define DEMUX_OK 0 #define DEMUX_FINISHED 1 diff --git a/src/demuxers/demux_aiff.c b/src/demuxers/demux_aiff.c index ac4bb13fa..e6cc0f0d5 100644 --- a/src/demuxers/demux_aiff.c +++ b/src/demuxers/demux_aiff.c @@ -19,7 +19,7 @@ * * AIFF File Demuxer by Mike Melanson (melanson@pcisys.net) * - * $Id: demux_aiff.c,v 1.16 2002/11/09 23:22:32 guenter Exp $ + * $Id: demux_aiff.c,v 1.17 2002/11/20 11:57:40 mroi Exp $ * */ @@ -456,6 +456,6 @@ static void *init_plugin (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 16, "aiff", XINE_VERSION_CODE, NULL, init_plugin }, + { PLUGIN_DEMUX, 17, "aiff", XINE_VERSION_CODE, NULL, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c index 17f9be69c..5b411e685 100644 --- a/src/demuxers/demux_asf.c +++ b/src/demuxers/demux_asf.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_asf.c,v 1.80 2002/11/20 01:49:42 komadori Exp $ + * $Id: demux_asf.c,v 1.81 2002/11/20 11:57:40 mroi Exp $ * * demultiplexer for asf streams * @@ -1457,6 +1457,6 @@ static void *init_class (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 16, "asf", XINE_VERSION_CODE, NULL, init_class }, + { PLUGIN_DEMUX, 17, "asf", XINE_VERSION_CODE, NULL, init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index f13c8bf43..0f577dd41 100644 --- a/src/demuxers/demux_avi.c +++ b/src/demuxers/demux_avi.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_avi.c,v 1.132 2002/11/09 23:22:32 guenter Exp $ + * $Id: demux_avi.c,v 1.133 2002/11/20 11:57:40 mroi Exp $ * * demultiplexer for avi streams * @@ -1615,6 +1615,6 @@ static void *init_class (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 16, "avi", XINE_VERSION_CODE, NULL, init_class }, + { PLUGIN_DEMUX, 17, "avi", XINE_VERSION_CODE, NULL, init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/demuxers/demux_cda.c b/src/demuxers/demux_cda.c index 8dd2fc144..68a2b6290 100644 --- a/src/demuxers/demux_cda.c +++ b/src/demuxers/demux_cda.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_cda.c,v 1.33 2002/11/09 23:22:32 guenter Exp $ + * $Id: demux_cda.c,v 1.34 2002/11/20 11:57:40 mroi Exp $ */ #ifdef HAVE_CONFIG_H @@ -283,6 +283,6 @@ static void *init_plugin (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 16, "cda", XINE_VERSION_CODE, NULL, init_plugin }, + { PLUGIN_DEMUX, 17, "cda", XINE_VERSION_CODE, NULL, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/demuxers/demux_eawve.c b/src/demuxers/demux_eawve.c index f12fd0c67..4efc78e1d 100644 --- a/src/demuxers/demux_eawve.c +++ b/src/demuxers/demux_eawve.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_eawve.c,v 1.6 2002/11/09 23:22:32 guenter Exp $ + * $Id: demux_eawve.c,v 1.7 2002/11/20 11:57:40 mroi Exp $ * * demux_eawve.c, Demuxer plugin for Electronic Arts' WVE file format * @@ -488,6 +488,6 @@ static void *init_plugin (xine_t *xine, void *data) } plugin_info_t xine_plugin_info[] = { - { PLUGIN_DEMUX, 16, "wve", XINE_VERSION_CODE, NULL, (void*)init_plugin}, + { PLUGIN_DEMUX, 17, "wve", XINE_VERSION_CODE, NULL, (void*)init_plugin}, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/demuxers/demux_elem.c b/src/demuxers/demux_elem.c index fcd6c4b37..0e1f5297d 100644 --- a/src/demuxers/demux_elem.c +++ b/src/demuxers/demux_elem.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_elem.c,v 1.61 2002/11/11 22:33:00 tmattern Exp $ + * $Id: demux_elem.c,v 1.62 2002/11/20 11:57:40 mroi Exp $ * * demultiplexer for elementary mpeg streams * @@ -340,6 +340,6 @@ static void *init_plugin (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 16, "elem", XINE_VERSION_CODE, NULL, init_plugin }, + { PLUGIN_DEMUX, 17, "elem", XINE_VERSION_CODE, NULL, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/demuxers/demux_film.c b/src/demuxers/demux_film.c index aaecfb395..23befca4c 100644 --- a/src/demuxers/demux_film.c +++ b/src/demuxers/demux_film.c @@ -21,7 +21,7 @@ * For more information on the FILM file format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_film.c,v 1.43 2002/11/09 23:22:32 guenter Exp $ + * $Id: demux_film.c,v 1.44 2002/11/20 11:57:40 mroi Exp $ */ #ifdef HAVE_CONFIG_H @@ -790,6 +790,6 @@ static void *init_plugin (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 16, "film", XINE_VERSION_CODE, NULL, init_plugin }, + { PLUGIN_DEMUX, 17, "film", XINE_VERSION_CODE, NULL, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/demuxers/demux_fli.c b/src/demuxers/demux_fli.c index 924f795de..661319928 100644 --- a/src/demuxers/demux_fli.c +++ b/src/demuxers/demux_fli.c @@ -22,7 +22,7 @@ * avoid while programming a FLI decoder, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_fli.c,v 1.26 2002/11/09 23:22:32 guenter Exp $ + * $Id: demux_fli.c,v 1.27 2002/11/20 11:57:40 mroi Exp $ */ #ifdef HAVE_CONFIG_H @@ -405,6 +405,6 @@ static void *init_plugin (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 16, "fli", XINE_VERSION_CODE, NULL, init_plugin }, + { PLUGIN_DEMUX, 17, "fli", XINE_VERSION_CODE, NULL, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/demuxers/demux_idcin.c b/src/demuxers/demux_idcin.c index 3996afce5..07b9878a6 100644 --- a/src/demuxers/demux_idcin.c +++ b/src/demuxers/demux_idcin.c @@ -63,7 +63,7 @@ * - if any bytes exceed 63, do not shift the bytes at all before * transmitting them to the video decoder * - * $Id: demux_idcin.c,v 1.27 2002/11/09 23:22:32 guenter Exp $ + * $Id: demux_idcin.c,v 1.28 2002/11/20 11:57:40 mroi Exp $ */ #ifdef HAVE_CONFIG_H @@ -579,6 +579,6 @@ static void *init_plugin (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 16, "idcin", XINE_VERSION_CODE, NULL, init_plugin }, + { PLUGIN_DEMUX, 17, "idcin", XINE_VERSION_CODE, NULL, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c index 97092dd7e..014061329 100644 --- a/src/demuxers/demux_mpeg.c +++ b/src/demuxers/demux_mpeg.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_mpeg.c,v 1.96 2002/11/10 13:33:13 mroi Exp $ + * $Id: demux_mpeg.c,v 1.97 2002/11/20 11:57:40 mroi Exp $ * * demultiplexer for mpeg 1/2 program streams * reads streams of variable blocksizes @@ -1130,6 +1130,6 @@ static void *init_plugin (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 16, "mpeg", XINE_VERSION_CODE, NULL, init_plugin }, + { PLUGIN_DEMUX, 17, "mpeg", XINE_VERSION_CODE, NULL, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c index b2b888296..9e30a0187 100644 --- a/src/demuxers/demux_mpeg_block.c +++ b/src/demuxers/demux_mpeg_block.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_mpeg_block.c,v 1.144 2002/11/18 13:07:29 mroi Exp $ + * $Id: demux_mpeg_block.c,v 1.145 2002/11/20 11:57:40 mroi Exp $ * * demultiplexer for mpeg 1/2 program streams * @@ -1168,6 +1168,6 @@ static void *init_plugin (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 16, "mpeg_block", XINE_VERSION_CODE, NULL, init_plugin }, + { PLUGIN_DEMUX, 17, "mpeg_block", XINE_VERSION_CODE, NULL, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c index d6ef7afd7..fe225e4ef 100644 --- a/src/demuxers/demux_mpgaudio.c +++ b/src/demuxers/demux_mpgaudio.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_mpgaudio.c,v 1.80 2002/11/13 00:14:27 guenter Exp $ + * $Id: demux_mpgaudio.c,v 1.81 2002/11/20 11:57:40 mroi Exp $ * * demultiplexer for mpeg audio (i.e. mp3) streams * @@ -642,6 +642,6 @@ static void *init_class (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 16, "mp3", XINE_VERSION_CODE, NULL, init_class }, + { PLUGIN_DEMUX, 17, "mp3", XINE_VERSION_CODE, NULL, init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/demuxers/demux_ogg.c b/src/demuxers/demux_ogg.c index b16258b43..05d9e89c2 100644 --- a/src/demuxers/demux_ogg.c +++ b/src/demuxers/demux_ogg.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_ogg.c,v 1.52 2002/11/10 13:33:15 mroi Exp $ + * $Id: demux_ogg.c,v 1.53 2002/11/20 11:57:40 mroi Exp $ * * demultiplexer for ogg streams * @@ -1062,6 +1062,6 @@ static void *init_class (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 16, "ogg", XINE_VERSION_CODE, NULL, init_class }, + { PLUGIN_DEMUX, 17, "ogg", XINE_VERSION_CODE, NULL, init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c index fc3000ed5..80943a29f 100644 --- a/src/demuxers/demux_qt.c +++ b/src/demuxers/demux_qt.c @@ -30,7 +30,7 @@ * build_frame_table * free_qt_info * - * $Id: demux_qt.c,v 1.118 2002/11/20 05:09:55 tmmm Exp $ + * $Id: demux_qt.c,v 1.119 2002/11/20 11:57:40 mroi Exp $ * */ @@ -2284,6 +2284,6 @@ static void *init_plugin (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 16, "quicktime", XINE_VERSION_CODE, NULL, init_plugin }, + { PLUGIN_DEMUX, 17, "quicktime", XINE_VERSION_CODE, NULL, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c index 7107d2e47..e49342cc1 100644 --- a/src/demuxers/demux_real.c +++ b/src/demuxers/demux_real.c @@ -21,7 +21,7 @@ * For more information regarding the Real file format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_real.c,v 1.10 2002/11/19 23:23:47 komadori Exp $ + * $Id: demux_real.c,v 1.11 2002/11/20 11:57:41 mroi Exp $ */ #ifdef HAVE_CONFIG_H @@ -784,6 +784,6 @@ static void *init_plugin (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 16, "real", XINE_VERSION_CODE, NULL, init_plugin }, + { PLUGIN_DEMUX, 17, "real", XINE_VERSION_CODE, NULL, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/demuxers/demux_realaudio.c b/src/demuxers/demux_realaudio.c index a3f5fb210..46a98c3ac 100644 --- a/src/demuxers/demux_realaudio.c +++ b/src/demuxers/demux_realaudio.c @@ -19,7 +19,7 @@ * * RealAudio File Demuxer by Mike Melanson (melanson@pcisys.net) * - * $Id: demux_realaudio.c,v 1.4 2002/11/09 23:22:32 guenter Exp $ + * $Id: demux_realaudio.c,v 1.5 2002/11/20 11:57:41 mroi Exp $ * */ @@ -400,7 +400,7 @@ static void *init_plugin (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 16, "realaudio", XINE_VERSION_CODE, NULL, init_plugin }, + { PLUGIN_DEMUX, 17, "realaudio", XINE_VERSION_CODE, NULL, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/demuxers/demux_roq.c b/src/demuxers/demux_roq.c index dee6c5ef5..131cd200a 100644 --- a/src/demuxers/demux_roq.c +++ b/src/demuxers/demux_roq.c @@ -21,7 +21,7 @@ * For more information regarding the RoQ file format, visit: * http://www.csse.monash.edu.au/~timf/ * - * $Id: demux_roq.c,v 1.29 2002/11/09 23:22:32 guenter Exp $ + * $Id: demux_roq.c,v 1.30 2002/11/20 11:57:41 mroi Exp $ */ #ifdef HAVE_CONFIG_H @@ -521,6 +521,6 @@ static void *init_plugin (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 16, "roq", XINE_VERSION_CODE, NULL, init_plugin }, + { PLUGIN_DEMUX, 17, "roq", XINE_VERSION_CODE, NULL, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/demuxers/demux_smjpeg.c b/src/demuxers/demux_smjpeg.c index 7ab3819d9..409825fab 100644 --- a/src/demuxers/demux_smjpeg.c +++ b/src/demuxers/demux_smjpeg.c @@ -21,7 +21,7 @@ * For more information on the SMJPEG file format, visit: * http://www.lokigames.com/development/smjpeg.php3 * - * $Id: demux_smjpeg.c,v 1.25 2002/11/09 23:22:32 guenter Exp $ + * $Id: demux_smjpeg.c,v 1.26 2002/11/20 11:57:41 mroi Exp $ */ #ifdef HAVE_CONFIG_H @@ -549,6 +549,6 @@ static void *init_plugin (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 16, "smjpeg", XINE_VERSION_CODE, NULL, init_plugin }, + { PLUGIN_DEMUX, 17, "smjpeg", XINE_VERSION_CODE, NULL, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/demuxers/demux_snd.c b/src/demuxers/demux_snd.c index 72458cf51..90a4fd961 100644 --- a/src/demuxers/demux_snd.c +++ b/src/demuxers/demux_snd.c @@ -19,7 +19,7 @@ * * SND/AU File Demuxer by Mike Melanson (melanson@pcisys.net) * - * $Id: demux_snd.c,v 1.17 2002/11/09 23:22:32 guenter Exp $ + * $Id: demux_snd.c,v 1.18 2002/11/20 11:57:41 mroi Exp $ * */ @@ -440,6 +440,6 @@ static void *init_plugin (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 16, "snd", XINE_VERSION_CODE, NULL, init_plugin }, + { PLUGIN_DEMUX, 17, "snd", XINE_VERSION_CODE, NULL, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c index ae2037a06..7464cc5bd 100644 --- a/src/demuxers/demux_ts.c +++ b/src/demuxers/demux_ts.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_ts.c,v 1.65 2002/11/15 00:20:31 miguelfreitas Exp $ + * $Id: demux_ts.c,v 1.66 2002/11/20 11:57:41 mroi Exp $ * * Demultiplexer for MPEG2 Transport Streams. * @@ -1672,6 +1672,6 @@ static void *init_class (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 16, "mpeg-ts", XINE_VERSION_CODE, NULL, init_class }, + { PLUGIN_DEMUX, 17, "mpeg-ts", XINE_VERSION_CODE, NULL, init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/demuxers/demux_voc.c b/src/demuxers/demux_voc.c index 96bdcc362..ea0e60135 100644 --- a/src/demuxers/demux_voc.c +++ b/src/demuxers/demux_voc.c @@ -23,7 +23,7 @@ * It will only play that block if it is PCM data. More variations will be * supported as they are encountered. * - * $Id: demux_voc.c,v 1.17 2002/11/09 23:22:32 guenter Exp $ + * $Id: demux_voc.c,v 1.18 2002/11/20 11:57:41 mroi Exp $ * */ @@ -428,6 +428,6 @@ static void *init_plugin (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 16, "voc", XINE_VERSION_CODE, NULL, init_plugin }, + { PLUGIN_DEMUX, 17, "voc", XINE_VERSION_CODE, NULL, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/demuxers/demux_vqa.c b/src/demuxers/demux_vqa.c index e48cf1a20..1c2aa9e7b 100644 --- a/src/demuxers/demux_vqa.c +++ b/src/demuxers/demux_vqa.c @@ -27,7 +27,7 @@ * block needs information from the previous audio block in order to be * decoded, thus making random seeking difficult. * - * $Id: demux_vqa.c,v 1.19 2002/11/20 06:16:24 tmmm Exp $ + * $Id: demux_vqa.c,v 1.20 2002/11/20 11:57:41 mroi Exp $ */ #ifdef HAVE_CONFIG_H @@ -463,6 +463,6 @@ static void *init_plugin (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 16, "vqa", XINE_VERSION_CODE, NULL, init_plugin }, + { PLUGIN_DEMUX, 17, "vqa", XINE_VERSION_CODE, NULL, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/demuxers/demux_wav.c b/src/demuxers/demux_wav.c index bcf85babb..60b2a67d2 100644 --- a/src/demuxers/demux_wav.c +++ b/src/demuxers/demux_wav.c @@ -20,7 +20,7 @@ * MS WAV File Demuxer by Mike Melanson (melanson@pcisys.net) * based on WAV specs that are available far and wide * - * $Id: demux_wav.c,v 1.25 2002/11/09 23:22:33 guenter Exp $ + * $Id: demux_wav.c,v 1.26 2002/11/20 11:57:41 mroi Exp $ * */ @@ -442,6 +442,6 @@ static void *init_plugin (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 16, "wav", XINE_VERSION_CODE, NULL, init_plugin }, + { PLUGIN_DEMUX, 17, "wav", XINE_VERSION_CODE, NULL, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/demuxers/demux_wc3movie.c b/src/demuxers/demux_wc3movie.c index 1c7705f7c..202e704ee 100644 --- a/src/demuxers/demux_wc3movie.c +++ b/src/demuxers/demux_wc3movie.c @@ -22,7 +22,7 @@ * For more information on the MVE file format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_wc3movie.c,v 1.25 2002/11/09 23:22:33 guenter Exp $ + * $Id: demux_wc3movie.c,v 1.26 2002/11/20 11:57:41 mroi Exp $ */ #ifdef HAVE_CONFIG_H @@ -778,6 +778,6 @@ static void *init_plugin (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 16, "wc3movie", XINE_VERSION_CODE, NULL, init_plugin }, + { PLUGIN_DEMUX, 17, "wc3movie", XINE_VERSION_CODE, NULL, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/demuxers/demux_yuv4mpeg2.c b/src/demuxers/demux_yuv4mpeg2.c index 084828fc7..1c1725d59 100644 --- a/src/demuxers/demux_yuv4mpeg2.c +++ b/src/demuxers/demux_yuv4mpeg2.c @@ -22,7 +22,7 @@ * tools, visit: * http://mjpeg.sourceforge.net/ * - * $Id: demux_yuv4mpeg2.c,v 1.10 2002/11/09 23:22:33 guenter Exp $ + * $Id: demux_yuv4mpeg2.c,v 1.11 2002/11/20 11:57:41 mroi Exp $ */ #ifdef HAVE_CONFIG_H @@ -444,6 +444,6 @@ static void *init_plugin (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 16, "yuv4mpeg2", XINE_VERSION_CODE, NULL, init_plugin }, + { PLUGIN_DEMUX, 17, "yuv4mpeg2", XINE_VERSION_CODE, NULL, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/dxr3/dxr3_decode_spu.c b/src/dxr3/dxr3_decode_spu.c index 74729dc03..2695cce0e 100644 --- a/src/dxr3/dxr3_decode_spu.c +++ b/src/dxr3/dxr3_decode_spu.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: dxr3_decode_spu.c,v 1.25 2002/11/15 00:20:31 miguelfreitas Exp $ + * $Id: dxr3_decode_spu.c,v 1.26 2002/11/20 11:57:41 mroi Exp $ */ /* dxr3 spu decoder plugin. @@ -66,7 +66,7 @@ static decoder_info_t dxr3_spudec_info = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_SPU_DECODER, 10, "dxr3-spudec", XINE_VERSION_CODE, &dxr3_spudec_info, &dxr3_spudec_init_plugin }, + { PLUGIN_SPU_DECODER, 11, "dxr3-spudec", XINE_VERSION_CODE, &dxr3_spudec_info, &dxr3_spudec_init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; @@ -435,7 +435,7 @@ static void dxr3_spudec_decode_data(spu_decoder_t *this_gen, buf_element_t *buf) vpts = this->stream->metronom->got_spu_packet(this->stream->metronom, buf->pts); /* estimate with current time, when metronom doesn't know */ - if (!vpts) vpts = this->stream->metronom->get_current_time(this->stream->metronom); + if (!vpts) vpts = this->stream->xine->clock->get_current_time(this->stream->xine->clock); #if LOG_PTS printf("dxr3_decode_spu: pts = %lld vpts = %lld\n", buf->pts, vpts); #endif diff --git a/src/dxr3/dxr3_decode_video.c b/src/dxr3/dxr3_decode_video.c index 8fb4d45e6..f6f2f3dc1 100644 --- a/src/dxr3/dxr3_decode_video.c +++ b/src/dxr3/dxr3_decode_video.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: dxr3_decode_video.c,v 1.21 2002/11/17 17:55:21 mroi Exp $ + * $Id: dxr3_decode_video.c,v 1.22 2002/11/20 11:57:42 mroi Exp $ */ /* dxr3 video decoder plugin. @@ -72,7 +72,7 @@ static decoder_info_t dxr3_video_decoder_info = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 12, "dxr3-mpeg2", XINE_VERSION_CODE, &dxr3_video_decoder_info, &dxr3_init_plugin }, + { PLUGIN_VIDEO_DECODER, 13, "dxr3-mpeg2", XINE_VERSION_CODE, &dxr3_video_decoder_info, &dxr3_init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; @@ -98,6 +98,8 @@ typedef struct dxr3_decoder_class_s { char devname[128]; char devnum[3]; + + metronom_clock_t *clock; /* used for syncing */ } dxr3_decoder_class_t; typedef struct dxr3_decoder_s { @@ -179,6 +181,8 @@ static void *dxr3_init_plugin(xine_t *xine, void *data) this->instance = 0; + this->clock = xine->clock; + return &this->video_decoder_class; } @@ -238,7 +242,7 @@ static video_decoder_t *dxr3_open_plugin(video_decoder_class_t *class_gen, xine_ this->skip_count = 0; this->force_duration_window = -FORCE_DURATION_WINDOW_SIZE; - this->last_vpts = this->stream->metronom->get_current_time(this->stream->metronom); + this->last_vpts = this->class->clock->get_current_time(this->class->clock); this->avg_duration = 0; this->sync_every_frame = cfg->register_bool(cfg, @@ -258,7 +262,7 @@ static video_decoder_t *dxr3_open_plugin(video_decoder_class_t *class_gen, xine_ /* set a/v offset to compensate dxr3 internal delay */ this->stream->metronom->set_option(this->stream->metronom, METRONOM_AV_OFFSET, -21600); - stream->video_out->open(stream->video_out); + stream->video_out->open(stream->video_out, stream); class->instance = 1; @@ -369,7 +373,7 @@ static void dxr3_decode_data(video_decoder_t *this_gen, buf_element_t *buf) img->bad_frame = 0; img->duration = get_duration(this); - skip = img->draw(img); + skip = img->draw(img, this->stream); if (skip <= 0) { /* don't skip */ vpts = img->vpts; /* copy so we can free img */ @@ -470,13 +474,13 @@ static void dxr3_decode_data(video_decoder_t *this_gen, buf_element_t *buf) if (!this->scr) { int64_t time; - time = this->stream->metronom->get_current_time(this->stream->metronom); + time = this->class->clock->get_current_time(this->class->clock); this->scr = dxr3_scr_init(this->stream); this->scr->scr_plugin.start(&this->scr->scr_plugin, time); - this->stream->metronom->register_scr( - this->stream->metronom, &this->scr->scr_plugin); - if (this->stream->metronom->scr_master == &this->scr->scr_plugin) + this->class->clock->register_scr( + this->class->clock, &this->scr->scr_plugin); + if (this->class->clock->scr_master == &this->scr->scr_plugin) #if LOG_VID printf("dxr3_decode_video: dxr3_scr plugin is master\n"); #endif @@ -490,8 +494,8 @@ static void dxr3_decode_data(video_decoder_t *this_gen, buf_element_t *buf) if (vpts) { int64_t delay; - delay = vpts - this->stream->metronom->get_current_time( - this->stream->metronom); + delay = vpts - this->class->clock->get_current_time( + this->class->clock); #if LOG_PTS printf("dxr3_decode_video: SETPTS got %lld\n", vpts); #endif @@ -554,10 +558,10 @@ static void dxr3_flush(video_decoder_t *this_gen) static void dxr3_dispose(video_decoder_t *this_gen) { dxr3_decoder_t *this = (dxr3_decoder_t *)this_gen; - metronom_t *metronom = this->stream->metronom; + metronom_clock_t *clock = this->class->clock; if (this->scr) { - metronom->unregister_scr(metronom, &this->scr->scr_plugin); + clock->unregister_scr(clock, &this->scr->scr_plugin); this->scr->scr_plugin.exit(&this->scr->scr_plugin); } @@ -566,7 +570,7 @@ static void dxr3_dispose(video_decoder_t *this_gen) if (this->fd_video >= 0) close(this->fd_video); close(this->fd_control); - this->stream->video_out->close(this->stream->video_out); + this->stream->video_out->close(this->stream->video_out, this->stream); this->class->instance = 0; free(this); diff --git a/src/dxr3/video_out_dxr3.c b/src/dxr3/video_out_dxr3.c index d7d7117dd..b6613f9b1 100644 --- a/src/dxr3/video_out_dxr3.c +++ b/src/dxr3/video_out_dxr3.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_dxr3.c,v 1.60 2002/10/29 15:19:44 mroi Exp $ + * $Id: video_out_dxr3.c,v 1.61 2002/11/20 11:57:42 mroi Exp $ */ /* mpeg1 encoding video out plugin for the dxr3. @@ -75,39 +75,39 @@ static vo_info_t vo_info_dxr3 = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_OUT, 10, "dxr3", XINE_VERSION_CODE, &vo_info_dxr3, &dxr3_vo_init_plugin }, + { PLUGIN_VIDEO_OUT, 11, "dxr3", XINE_VERSION_CODE, &vo_info_dxr3, &dxr3_vo_init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; /* plugin class functions */ -static xine_vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const void *visual); -static char *dxr3_vo_get_identifier(video_driver_class_t *class_gen); -static char *dxr3_vo_get_description(video_driver_class_t *class_gen); -static void dxr3_vo_class_dispose(video_driver_class_t *class_gen); +static vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const void *visual); +static char *dxr3_vo_get_identifier(video_driver_class_t *class_gen); +static char *dxr3_vo_get_description(video_driver_class_t *class_gen); +static void dxr3_vo_class_dispose(video_driver_class_t *class_gen); /* plugin instance functions */ -static uint32_t dxr3_get_capabilities(xine_vo_driver_t *this_gen); -static vo_frame_t *dxr3_alloc_frame(xine_vo_driver_t *this_gen); +static uint32_t dxr3_get_capabilities(vo_driver_t *this_gen); +static vo_frame_t *dxr3_alloc_frame(vo_driver_t *this_gen); static void dxr3_frame_copy(vo_frame_t *frame_gen, uint8_t **src); static void dxr3_frame_field(vo_frame_t *vo_img, int which_field); static void dxr3_frame_dispose(vo_frame_t *frame_gen); -static void dxr3_update_frame_format(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen, +static void dxr3_update_frame_format(vo_driver_t *this_gen, vo_frame_t *frame_gen, uint32_t width, uint32_t height, int ratio_code, int format, int flags); -static void dxr3_overlay_begin(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen, int changed); -static void dxr3_overlay_blend(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen, +static void dxr3_overlay_begin(vo_driver_t *this_gen, vo_frame_t *frame_gen, int changed); +static void dxr3_overlay_blend(vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay); -static void dxr3_overlay_end(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen); -static void dxr3_display_frame(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen); -static int dxr3_redraw_needed(xine_vo_driver_t *this_gen); -static int dxr3_get_property(xine_vo_driver_t *this_gen, int property); -static int dxr3_set_property(xine_vo_driver_t *this_gen, int property, int value); -static void dxr3_get_property_min_max(xine_vo_driver_t *this_gen, int property, +static void dxr3_overlay_end(vo_driver_t *this_gen, vo_frame_t *frame_gen); +static void dxr3_display_frame(vo_driver_t *this_gen, vo_frame_t *frame_gen); +static int dxr3_redraw_needed(vo_driver_t *this_gen); +static int dxr3_get_property(vo_driver_t *this_gen, int property); +static int dxr3_set_property(vo_driver_t *this_gen, int property, int value); +static void dxr3_get_property_min_max(vo_driver_t *this_gen, int property, int *min, int *max); -static int dxr3_gui_data_exchange(xine_vo_driver_t *this_gen, +static int dxr3_gui_data_exchange(vo_driver_t *this_gen, int data_type, void *data); -static void dxr3_dispose(xine_vo_driver_t *this_gen); +static void dxr3_dispose(vo_driver_t *this_gen); /* overlay helper functions only called once during plugin init */ static void gather_screen_vars(dxr3_driver_t *this, const x11_visual_t *vis); @@ -177,7 +177,7 @@ static void dxr3_vo_class_dispose(video_driver_class_t *class_gen) } -static xine_vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const void *visual_gen) +static vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const void *visual_gen) { dxr3_driver_t *this; dxr3_driver_class_t *class = (dxr3_driver_class_t *)class_gen; @@ -431,13 +431,13 @@ static xine_vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, co } -static uint32_t dxr3_get_capabilities(xine_vo_driver_t *this_gen) +static uint32_t dxr3_get_capabilities(vo_driver_t *this_gen) { return VO_CAP_YV12 | VO_CAP_YUY2 | VO_CAP_SATURATION | VO_CAP_BRIGHTNESS | VO_CAP_CONTRAST; } -static vo_frame_t *dxr3_alloc_frame(xine_vo_driver_t *this_gen) +static vo_frame_t *dxr3_alloc_frame(vo_driver_t *this_gen) { dxr3_frame_t *frame; dxr3_driver_t *this = (dxr3_driver_t *)this_gen; @@ -481,7 +481,7 @@ static void dxr3_frame_dispose(vo_frame_t *frame_gen) free(frame); } -static void dxr3_update_frame_format(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen, +static void dxr3_update_frame_format(vo_driver_t *this_gen, vo_frame_t *frame_gen, uint32_t width, uint32_t height, int ratio_code, int format, int flags) { dxr3_driver_t *this = (dxr3_driver_t *)this_gen; @@ -669,7 +669,7 @@ static void dxr3_update_frame_format(xine_vo_driver_t *this_gen, vo_frame_t *fra frame->swap_fields = this->swap_fields; } -static void dxr3_overlay_begin(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen, int changed) +static void dxr3_overlay_begin(vo_driver_t *this_gen, vo_frame_t *frame_gen, int changed) { dxr3_driver_t *this = (dxr3_driver_t *)this_gen; @@ -687,7 +687,7 @@ static void dxr3_overlay_begin(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen this->spu_enc->overlay = NULL; } -static void dxr3_overlay_blend(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen, +static void dxr3_overlay_blend(vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay) { if (frame_gen->format != XINE_IMGFMT_DXR3) { @@ -709,7 +709,7 @@ static void dxr3_overlay_blend(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen } } -static void dxr3_overlay_end(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen) +static void dxr3_overlay_end(vo_driver_t *this_gen, vo_frame_t *frame_gen) { dxr3_driver_t *this = (dxr3_driver_t *)this_gen; em8300_button_t btn; @@ -784,7 +784,7 @@ static void dxr3_overlay_end(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen) pthread_mutex_unlock(&this->spu_device_lock); } -static void dxr3_display_frame(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen) +static void dxr3_display_frame(vo_driver_t *this_gen, vo_frame_t *frame_gen) { dxr3_driver_t *this = (dxr3_driver_t *)this_gen; dxr3_frame_t *frame = (dxr3_frame_t *)frame_gen; @@ -853,7 +853,7 @@ static void dxr3_display_frame(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen } } -static int dxr3_redraw_needed(xine_vo_driver_t *this_gen) +static int dxr3_redraw_needed(vo_driver_t *this_gen) { dxr3_driver_t *this = (dxr3_driver_t *)this_gen; @@ -863,7 +863,7 @@ static int dxr3_redraw_needed(xine_vo_driver_t *this_gen) return 0; } -static int dxr3_get_property(xine_vo_driver_t *this_gen, int property) +static int dxr3_get_property(vo_driver_t *this_gen, int property) { dxr3_driver_t *this = (dxr3_driver_t *)this_gen; @@ -887,7 +887,7 @@ static int dxr3_get_property(xine_vo_driver_t *this_gen, int property) return 0; } -static int dxr3_set_property(xine_vo_driver_t *this_gen, int property, int value) +static int dxr3_set_property(vo_driver_t *this_gen, int property, int value) { dxr3_driver_t *this = (dxr3_driver_t *)this_gen; int val, bcs_changed = 0; @@ -985,7 +985,7 @@ static int dxr3_set_property(xine_vo_driver_t *this_gen, int property, int value return value; } -static void dxr3_get_property_min_max(xine_vo_driver_t *this_gen, int property, +static void dxr3_get_property_min_max(vo_driver_t *this_gen, int property, int *min, int *max) { switch (property) { @@ -1001,7 +1001,7 @@ static void dxr3_get_property_min_max(xine_vo_driver_t *this_gen, int property, } } -static int dxr3_gui_data_exchange(xine_vo_driver_t *this_gen, int data_type, void *data) +static int dxr3_gui_data_exchange(vo_driver_t *this_gen, int data_type, void *data) { #ifdef HAVE_X11 dxr3_driver_t *this = (dxr3_driver_t *)this_gen; @@ -1059,7 +1059,7 @@ static int dxr3_gui_data_exchange(xine_vo_driver_t *this_gen, int data_type, voi return 0; } -static void dxr3_dispose(xine_vo_driver_t *this_gen) +static void dxr3_dispose(vo_driver_t *this_gen) { dxr3_driver_t *this = (dxr3_driver_t *)this_gen; int val = EM8300_OVERLAY_MODE_OFF; diff --git a/src/dxr3/video_out_dxr3.h b/src/dxr3/video_out_dxr3.h index 83d7f80d2..70f65d8ac 100644 --- a/src/dxr3/video_out_dxr3.h +++ b/src/dxr3/video_out_dxr3.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_dxr3.h,v 1.12 2002/10/26 14:35:05 mroi Exp $ + * $Id: video_out_dxr3.h,v 1.13 2002/11/20 11:57:42 mroi Exp $ */ #ifdef HAVE_CONFIG_H @@ -80,7 +80,7 @@ typedef struct dxr3_driver_class_s { } dxr3_driver_class_t; typedef struct dxr3_driver_s { - xine_vo_driver_t vo_driver; + vo_driver_t vo_driver; dxr3_driver_class_t *class; int fd_control; diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c index 56b9ac80d..8d3ac5f48 100644 --- a/src/input/input_dvd.c +++ b/src/input/input_dvd.c @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: input_dvd.c,v 1.117 2002/11/18 11:48:35 mroi Exp $ + * $Id: input_dvd.c,v 1.118 2002/11/20 11:57:42 mroi Exp $ * */ @@ -790,9 +790,9 @@ static void flush_buffers(dvd_input_plugin_t *this) { if (stream->audio_out) { stream->audio_out->flush(stream->audio_out); } - - stream->metronom->adjust_clock(stream->metronom, - stream->metronom->get_current_time(stream->metronom) + 30 * 90000 ); + + this->stream->xine->clock->adjust_clock(this->stream->xine->clock, + this->stream->xine->clock->get_current_time(this->stream->xine->clock) + 30 * 90000 ); } static void xine_dvd_send_button_update(dvd_input_plugin_t *this, int mode) { @@ -1664,6 +1664,20 @@ static void *init_class (xine_t *xine, void *data) { /* * $Log: input_dvd.c,v $ + * Revision 1.118 2002/11/20 11:57:42 mroi + * engine modifications to allow post plugin layer: + * * new public output interface xine_{audio,video}_port_t instead of + * xine_{ao,vo}_driver_t, old names kept as aliases for compatibility + * * modified the engine to allow multiple streams per output + * * renaming of some internal structures according to public changes + * * moving SCR out of per-stream-metronom into a global metronom_clock_t + * residing in xine_t and therefore easily available to the output layer + * * adapting all available plugins + * (note to external projects: the compiler will help you a lot, if a plugin + * compiles, it is adapted, because all changes add new parameters to some + * functions) + * * bump up all interface versions because of xine_t and xine_stream_t changes + * * Revision 1.117 2002/11/18 11:48:35 mroi * DVD input should now be initially unseekable * @@ -1892,6 +1906,6 @@ static void *init_class (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_INPUT, 9, "DVD", XINE_VERSION_CODE, NULL, init_class }, + { PLUGIN_INPUT, 10, "DVD", XINE_VERSION_CODE, NULL, init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/input/input_file.c b/src/input/input_file.c index 75bec4f02..8da57ae65 100644 --- a/src/input/input_file.c +++ b/src/input/input_file.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: input_file.c,v 1.68 2002/11/17 17:48:47 mroi Exp $ + * $Id: input_file.c,v 1.69 2002/11/20 11:57:43 mroi Exp $ */ #ifdef HAVE_CONFIG_H @@ -876,7 +876,7 @@ static void *init_plugin (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_INPUT, 9, "file", XINE_VERSION_CODE, NULL, init_plugin }, + { PLUGIN_INPUT, 10, "file", XINE_VERSION_CODE, NULL, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/input/input_http.c b/src/input/input_http.c index e7d27b1e4..1fbe13133 100644 --- a/src/input/input_http.c +++ b/src/input/input_http.c @@ -957,7 +957,7 @@ static void *init_class (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_INPUT, 9, "http", XINE_VERSION_CODE, NULL, init_class }, + { PLUGIN_INPUT, 10, "http", XINE_VERSION_CODE, NULL, init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/input/input_mms.c b/src/input/input_mms.c index 593e5c9b7..87cc05b4b 100644 --- a/src/input/input_mms.c +++ b/src/input/input_mms.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: input_mms.c,v 1.25 2002/11/17 17:48:47 mroi Exp $ + * $Id: input_mms.c,v 1.26 2002/11/20 11:57:43 mroi Exp $ * * mms input plugin based on work from major mms */ @@ -338,7 +338,7 @@ static void *init_class (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_INPUT, 9, "mms", XINE_VERSION_CODE, NULL, init_class }, + { PLUGIN_INPUT, 10, "mms", XINE_VERSION_CODE, NULL, init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/input/input_plugin.h b/src/input/input_plugin.h index eff5fd3d7..bccde4b57 100644 --- a/src/input/input_plugin.h +++ b/src/input/input_plugin.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: input_plugin.h,v 1.38 2002/11/18 11:36:28 mroi Exp $ + * $Id: input_plugin.h,v 1.39 2002/11/20 11:57:43 mroi Exp $ */ #ifndef HAVE_INPUT_PLUGIN_H @@ -29,7 +29,7 @@ #include "buffer.h" #include "configfile.h" -#define INPUT_PLUGIN_IFACE_VERSION 9 +#define INPUT_PLUGIN_IFACE_VERSION 10 typedef struct input_class_s input_class_t ; typedef struct input_plugin_s input_plugin_t; diff --git a/src/input/input_stdin_fifo.c b/src/input/input_stdin_fifo.c index cfe8bf6b8..092c2b7b0 100644 --- a/src/input/input_stdin_fifo.c +++ b/src/input/input_stdin_fifo.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: input_stdin_fifo.c,v 1.36 2002/11/17 17:48:47 mroi Exp $ + * $Id: input_stdin_fifo.c,v 1.37 2002/11/20 11:57:43 mroi Exp $ */ #ifdef HAVE_CONFIG_H @@ -393,6 +393,6 @@ static void *init_class (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_INPUT, 9, "stdin", XINE_VERSION_CODE, NULL, init_class }, + { PLUGIN_INPUT, 10, "stdin", XINE_VERSION_CODE, NULL, init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/input/input_vcd.c b/src/input/input_vcd.c index aca7d9cf9..c35a8ad66 100644 --- a/src/input/input_vcd.c +++ b/src/input/input_vcd.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: input_vcd.c,v 1.58 2002/11/08 15:49:03 komadori Exp $ + * $Id: input_vcd.c,v 1.59 2002/11/20 11:57:43 mroi Exp $ * */ @@ -1148,6 +1148,6 @@ static void *init_class (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_INPUT, 9, "VCD", XINE_VERSION_CODE, NULL, init_class }, + { PLUGIN_INPUT, 10, "VCD", XINE_VERSION_CODE, NULL, init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/input/net_buf_ctrl.c b/src/input/net_buf_ctrl.c index bedd061ba..12ede3d53 100644 --- a/src/input/net_buf_ctrl.c +++ b/src/input/net_buf_ctrl.c @@ -99,15 +99,15 @@ void nbc_check_buffers (nbc_t *this) { } } - this->stream->metronom->set_speed (this->stream->metronom, XINE_SPEED_PAUSE); - this->stream->metronom->set_option (this->stream->metronom, METRONOM_SCR_ADJUSTABLE, 0); + this->stream->xine->clock->set_speed (this->stream->xine->clock, XINE_SPEED_PAUSE); + this->stream->xine->clock->set_option (this->stream->xine->clock, CLOCK_SCR_ADJUSTABLE, 0); if (this->stream->audio_out) this->stream->audio_out->audio_paused = 2; this->buffering = 1; } else if ( (fifo_fill>this->high_water_mark) && (this->buffering)) { - this->stream->metronom->set_speed (this->stream->metronom, XINE_SPEED_NORMAL); - this->stream->metronom->set_option (this->stream->metronom, METRONOM_SCR_ADJUSTABLE, 1); + this->stream->xine->clock->set_speed (this->stream->xine->clock, XINE_SPEED_NORMAL); + this->stream->xine->clock->set_option (this->stream->xine->clock, CLOCK_SCR_ADJUSTABLE, 1); if (this->stream->audio_out) this->stream->audio_out->audio_paused = 0; this->buffering = 0; @@ -116,7 +116,7 @@ void nbc_check_buffers (nbc_t *this) { } void nbc_close (nbc_t *this) { - this->stream->metronom->set_option (this->stream->metronom, METRONOM_SCR_ADJUSTABLE, 1); + this->stream->xine->clock->set_option (this->stream->xine->clock, CLOCK_SCR_ADJUSTABLE, 1); free (this); } diff --git a/src/liba52/xine_decoder.c b/src/liba52/xine_decoder.c index 6775a37d3..7773ba694 100644 --- a/src/liba52/xine_decoder.c +++ b/src/liba52/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.39 2002/11/12 18:40:50 miguelfreitas Exp $ + * $Id: xine_decoder.c,v 1.40 2002/11/20 11:57:43 mroi Exp $ * * stuff needed to turn liba52 into a xine decoder plugin */ @@ -75,7 +75,7 @@ typedef struct a52dec_decoder_s { int a52_flags_map[11]; int ao_flags_map[11]; - ao_instance_t *audio_out; + xine_audio_port_t *audio_out; int audio_caps; int bypass_mode; int output_sampling_rate; @@ -219,10 +219,11 @@ static void a52dec_decode_frame (a52dec_decoder_t *this, int64_t pts) { || (output_mode != this->output_mode)) { if (this->output_open) - this->audio_out->close (this->audio_out); + this->audio_out->close (this->audio_out, this->stream); - this->output_open = this->audio_out->open (this->audio_out, 16, + this->output_open = this->audio_out->open (this->audio_out, + this->stream, 16, this->a52_sample_rate, output_mode) ; this->output_sampling_rate = this->a52_sample_rate; @@ -286,7 +287,7 @@ static void a52dec_decode_frame (a52dec_decoder_t *this, int64_t pts) { /* output decoded samples */ buf->vpts = pts; - this->audio_out->put_buffer (this->audio_out, buf); + this->audio_out->put_buffer (this->audio_out, buf, this->stream); } else { @@ -300,7 +301,8 @@ static void a52dec_decode_frame (a52dec_decoder_t *this, int64_t pts) { a52_syncinfo (this->frame_buffer, &flags, &sample_rate, &bit_rate); - this->output_open = this->audio_out->open (this->audio_out, 16, + this->output_open = this->audio_out->open (this->audio_out, + this->stream, 16, sample_rate, AO_CAP_MODE_A52) ; this->output_mode = AO_CAP_MODE_A52; @@ -334,7 +336,7 @@ static void a52dec_decode_frame (a52dec_decoder_t *this, int64_t pts) { buf->num_frames = 1536; buf->vpts = pts; - this->audio_out->put_buffer (this->audio_out, buf); + this->audio_out->put_buffer (this->audio_out, buf, this->stream); } } @@ -457,7 +459,7 @@ static void a52dec_dispose (audio_decoder_t *this_gen) { a52dec_decoder_t *this = (a52dec_decoder_t *) this_gen; if (this->output_open) - this->audio_out->close (this->audio_out); + this->audio_out->close (this->audio_out, this->stream); this->output_open = 0; @@ -642,6 +644,6 @@ static decoder_info_t dec_info_audio = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_AUDIO_DECODER, 11, "a/52", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, + { PLUGIN_AUDIO_DECODER, 12, "a/52", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libdts/xine_decoder.c b/src/libdts/xine_decoder.c index 4b6881bd6..0023eaabe 100644 --- a/src/libdts/xine_decoder.c +++ b/src/libdts/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.31 2002/11/12 21:34:46 mroi Exp $ + * $Id: xine_decoder.c,v 1.32 2002/11/20 11:57:43 mroi Exp $ * * 04-09-2001 DTS passtrough (C) Joachim Koenig * 09-12-2001 DTS passthrough inprovements (C) James Courtier-Dutton @@ -95,7 +95,8 @@ void dts_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { return; } if (!this->output_open) { - this->output_open = (this->stream->audio_out->open (this->stream->audio_out, this->bits_per_sample, + this->output_open = (this->stream->audio_out->open (this->stream->audio_out, this->stream, + this->bits_per_sample, this->rate, AO_CAP_MODE_AC5)); } @@ -211,14 +212,14 @@ void dts_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { if( ac5_pcm_length ) swab(data_in, &data_out[8], ac5_length ); - this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer); + this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream); } } static void dts_dispose (audio_decoder_t *this_gen) { dts_decoder_t *this = (dts_decoder_t *) this_gen; if (this->output_open) - this->stream->audio_out->close (this->stream->audio_out); + this->stream->audio_out->close (this->stream->audio_out, this->stream); this->output_open = 0; free (this); } @@ -282,6 +283,6 @@ static decoder_info_t dec_info_audio = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_AUDIO_DECODER, 11, "dts", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, + { PLUGIN_AUDIO_DECODER, 12, "dts", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libfaad/xine_decoder.c b/src/libfaad/xine_decoder.c index 87048dcc5..fc7954641 100644 --- a/src/libfaad/xine_decoder.c +++ b/src/libfaad/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.9 2002/11/19 02:31:03 tmmm Exp $ + * $Id: xine_decoder.c,v 1.10 2002/11/20 11:57:43 mroi Exp $ * */ @@ -148,7 +148,7 @@ static void faad_decode_audio ( faad_decoder_t *this, int end_frame ) { audio_buffer->num_frames = outsize / (this->num_channels*2); audio_buffer->vpts = this->pts; - this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer); + this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream); this->pts = 0; decoded -= outsize; @@ -230,7 +230,7 @@ static void faad_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { this->num_channels=buf->decoder_info[3] ; if (this->output_open) { - this->stream->audio_out->close (this->stream->audio_out); + this->stream->audio_out->close (this->stream->audio_out, this->stream); this->output_open = 0; } @@ -300,6 +300,7 @@ static void faad_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { } this->output_open = this->stream->audio_out->open (this->stream->audio_out, + this->stream, this->bits_per_sample, this->rate, this->ao_cap_mode) ; @@ -320,7 +321,7 @@ static void faad_dispose (audio_decoder_t *this_gen) { faad_decoder_t *this = (faad_decoder_t *) this_gen; if (this->output_open) - this->stream->audio_out->close (this->stream->audio_out); + this->stream->audio_out->close (this->stream->audio_out, this->stream); this->output_open = 0; if( this->buf ) @@ -398,6 +399,6 @@ static decoder_info_t dec_info_audio = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_AUDIO_DECODER, 11, "faad", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, + { PLUGIN_AUDIO_DECODER, 12, "faad", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libffmpeg/xine_decoder.c b/src/libffmpeg/xine_decoder.c index eb2c11e22..9ddbf2a7b 100644 --- a/src/libffmpeg/xine_decoder.c +++ b/src/libffmpeg/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.71 2002/11/18 00:32:20 miguelfreitas Exp $ + * $Id: xine_decoder.c,v 1.72 2002/11/20 11:57:43 mroi Exp $ * * xine decoder plugin using ffmpeg * @@ -132,7 +132,7 @@ static void init_video_codec (ff_video_decoder_t *this, AVCodec *codec) { } this->decoder_ok = 1; - this->stream->video_out->open (this->stream->video_out); + this->stream->video_out->open (this->stream->video_out, this->stream); /* needed to play streams generated by MS ISO MPEG4 codec. Michael Niedermayer explained: @@ -575,7 +575,7 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { } } - this->skipframes = img->draw(img); + this->skipframes = img->draw(img, this->stream); if( this->skipframes < 0 ) this->skipframes = 0; img->free(img); @@ -649,7 +649,7 @@ static void ff_dispose (video_decoder_t *this_gen) { if (this->decoder_ok) { avcodec_close (this->context); - this->stream->video_out->close(this->stream->video_out); + this->stream->video_out->close(this->stream->video_out, this->stream); this->decoder_ok = 0; } @@ -810,7 +810,7 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) if (!this->output_open) { this->output_open = this->stream->audio_out->open(this->stream->audio_out, - this->audio_bits, this->audio_sample_rate, + this->stream, this->audio_bits, this->audio_sample_rate, (this->audio_channels == 2) ? AO_CAP_MODE_STEREO : AO_CAP_MODE_MONO); } @@ -867,7 +867,8 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) audio_buffer->vpts = buf->pts; buf->pts = 0; /* only first buffer gets the real pts */ - this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer); + this->stream->audio_out->put_buffer (this->stream->audio_out, + audio_buffer, this->stream); out += bytes_to_send; } @@ -907,7 +908,7 @@ static void ff_audio_dispose (audio_decoder_t *this_gen) { ff_audio_decoder_t *this = (ff_audio_decoder_t *) this_gen; if (this->output_open) - this->stream->audio_out->close (this->stream->audio_out); + this->stream->audio_out->close (this->stream->audio_out, this->stream); this->output_open = 0; free(this->buf); @@ -1013,7 +1014,7 @@ static decoder_info_t dec_info_ffmpeg_audio = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 12, "ffmpegvideo", XINE_VERSION_CODE, &dec_info_ffmpeg_video, init_video_plugin }, - { PLUGIN_AUDIO_DECODER, 11, "ffmpegaudio", XINE_VERSION_CODE, &dec_info_ffmpeg_audio, init_audio_plugin }, + { PLUGIN_VIDEO_DECODER, 13, "ffmpegvideo", XINE_VERSION_CODE, &dec_info_ffmpeg_video, init_video_plugin }, + { PLUGIN_AUDIO_DECODER, 12, "ffmpegaudio", XINE_VERSION_CODE, &dec_info_ffmpeg_audio, init_audio_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/liblpcm/xine_decoder.c b/src/liblpcm/xine_decoder.c index 547b4329d..c23b5fe1f 100644 --- a/src/liblpcm/xine_decoder.c +++ b/src/liblpcm/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.37 2002/11/12 18:40:51 miguelfreitas Exp $ + * $Id: xine_decoder.c,v 1.38 2002/11/20 11:57:43 mroi Exp $ * * 31-8-2001 Added LPCM rate sensing. * (c) 2001 James Courtier-Dutton James@superbug.demon.co.uk @@ -120,11 +120,11 @@ void lpcm_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { */ if ( format_changed ) { if (this->output_open) - this->stream->audio_out->close (this->stream->audio_out); + this->stream->audio_out->close (this->stream->audio_out, this->stream); this->ao_cap_mode=(this->number_of_channels == 2) ? AO_CAP_MODE_STEREO : AO_CAP_MODE_MONO; - this->output_open = this->stream->audio_out->open (this->stream->audio_out, + this->output_open = this->stream->audio_out->open (this->stream->audio_out, this->stream, (this->bits_per_sample>16)?16:this->bits_per_sample, this->rate, this->ao_cap_mode) ; @@ -173,7 +173,7 @@ void lpcm_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { audio_buffer->vpts = buf->pts; audio_buffer->num_frames = (((buf->size*8)/this->number_of_channels)/this->bits_per_sample); - this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer); + this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream); } @@ -181,7 +181,7 @@ static void lpcm_dispose (audio_decoder_t *this_gen) { lpcm_decoder_t *this = (lpcm_decoder_t *) this_gen; if (this->output_open) - this->stream->audio_out->close (this->stream->audio_out); + this->stream->audio_out->close (this->stream->audio_out, this->stream); this->output_open = 0; free (this_gen); @@ -247,6 +247,6 @@ static decoder_info_t dec_info_audio = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_AUDIO_DECODER, 11, "pcm", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, + { PLUGIN_AUDIO_DECODER, 12, "pcm", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libmad/xine_decoder.c b/src/libmad/xine_decoder.c index 0433a3243..9b827a64b 100644 --- a/src/libmad/xine_decoder.c +++ b/src/libmad/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.34 2002/11/12 18:40:51 miguelfreitas Exp $ + * $Id: xine_decoder.c,v 1.35 2002/11/20 11:57:43 mroi Exp $ * * stuff needed to turn libmad into a xine decoder plugin */ @@ -199,11 +199,12 @@ static void mad_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { } if (this->output_open) { - this->xstream->audio_out->close (this->xstream->audio_out); + this->xstream->audio_out->close (this->xstream->audio_out, this->xstream); this->output_open = 0; } if (!this->output_open) { - this->output_open = this->xstream->audio_out->open(this->xstream->audio_out, 16, + this->output_open = this->xstream->audio_out->open(this->xstream->audio_out, + this->xstream, 16, this->frame.header.samplerate, mode) ; } @@ -245,7 +246,7 @@ static void mad_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { audio_buffer->num_frames = pcm->length; audio_buffer->vpts = buf->pts; - this->xstream->audio_out->put_buffer (this->xstream->audio_out, audio_buffer); + this->xstream->audio_out->put_buffer (this->xstream->audio_out, audio_buffer, this->xstream); buf->pts = 0; @@ -268,7 +269,7 @@ static void mad_dispose (audio_decoder_t *this_gen) { mad_stream_finish(&this->stream); if (this->output_open) { - this->xstream->audio_out->close (this->xstream->audio_out); + this->xstream->audio_out->close (this->xstream->audio_out, this->xstream); this->output_open = 0; } @@ -343,6 +344,6 @@ static decoder_info_t dec_info_audio = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_AUDIO_DECODER, 11, "mad", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, + { PLUGIN_AUDIO_DECODER, 12, "mad", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libmpeg2/decode.c b/src/libmpeg2/decode.c index f0674512f..5e6d73ca1 100644 --- a/src/libmpeg2/decode.c +++ b/src/libmpeg2/decode.c @@ -51,7 +51,7 @@ static void process_userdata(mpeg2dec_t *mpeg2dec, uint8_t *buffer); void mpeg2_init (mpeg2dec_t * mpeg2dec, - vo_instance_t * output) + xine_video_port_t * output) { static int do_init = 1; uint32_t mm_accel; @@ -258,12 +258,13 @@ static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code, picture->current_frame->pts = 0; get_frame_duration(mpeg2dec, picture->current_frame); - mpeg2dec->frames_to_drop = picture->current_frame->draw (picture->current_frame); + mpeg2dec->frames_to_drop = picture->current_frame->draw (picture->current_frame, mpeg2dec->stream); picture->current_frame->drawn = 1; } } else if (picture->forward_reference_frame && !picture->forward_reference_frame->drawn) { get_frame_duration(mpeg2dec, picture->forward_reference_frame); - mpeg2dec->frames_to_drop = picture->forward_reference_frame->draw (picture->forward_reference_frame); + mpeg2dec->frames_to_drop = picture->forward_reference_frame->draw (picture->forward_reference_frame, + mpeg2dec->stream); picture->forward_reference_frame->drawn = 1; } } @@ -631,7 +632,7 @@ void mpeg2_flush (mpeg2dec_t * mpeg2dec) { get_frame_duration(mpeg2dec, picture->current_frame); picture->current_frame->pts = 0; - picture->current_frame->draw(picture->current_frame); + picture->current_frame->draw(picture->current_frame, mpeg2dec->stream); } } @@ -657,7 +658,7 @@ void mpeg2_close (mpeg2dec_t * mpeg2dec) printf ("libmpeg2: blasting out current frame on close\n"); picture->current_frame->pts = 0; get_frame_duration(mpeg2dec, picture->current_frame); - picture->current_frame->draw (picture->current_frame); + picture->current_frame->draw (picture->current_frame, mpeg2dec->stream); picture->current_frame->drawn = 1; } @@ -679,7 +680,7 @@ void mpeg2_close (mpeg2dec_t * mpeg2dec) printf ("libmpeg2: blasting out backward reference frame on close\n"); picture->backward_reference_frame->pts = 0; get_frame_duration(mpeg2dec, picture->backward_reference_frame); - picture->backward_reference_frame->draw (picture->backward_reference_frame); + picture->backward_reference_frame->draw (picture->backward_reference_frame, mpeg2dec->stream); picture->backward_reference_frame->drawn = 1; } picture->backward_reference_frame->free (picture->backward_reference_frame); diff --git a/src/libmpeg2/mpeg2.h b/src/libmpeg2/mpeg2.h index 38e868919..993bdffc4 100644 --- a/src/libmpeg2/mpeg2.h +++ b/src/libmpeg2/mpeg2.h @@ -22,7 +22,7 @@ /* Structure for the mpeg2dec decoder */ typedef struct mpeg2dec_s { - vo_instance_t * output; + xine_video_port_t * output; /* this is where we keep the state of the decoder */ struct picture_s * picture, *picture_base; @@ -52,7 +52,7 @@ typedef struct mpeg2dec_s { /* initialize mpegdec with a opaque user pointer */ void mpeg2_init (mpeg2dec_t * mpeg2dec, - vo_instance_t * output); + xine_video_port_t * output); /* destroy everything which was allocated, shutdown the output */ void mpeg2_close (mpeg2dec_t * mpeg2dec); diff --git a/src/libmpeg2/xine_decoder.c b/src/libmpeg2/xine_decoder.c index 07034af72..ae634fd87 100644 --- a/src/libmpeg2/xine_decoder.c +++ b/src/libmpeg2/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.43 2002/11/12 18:40:52 miguelfreitas Exp $ + * $Id: xine_decoder.c,v 1.44 2002/11/20 11:57:44 mroi Exp $ * * stuff needed to turn libmpeg2 into a xine decoder plugin */ @@ -50,7 +50,7 @@ typedef struct mpeg2dec_decoder_s { mpeg2dec_t mpeg2; mpeg2_class_t *class; xine_stream_t *stream; - vo_instance_t *video_out; + xine_video_port_t *video_out; pthread_mutex_t lock; /* mutex for async flush */ } mpeg2dec_decoder_t; @@ -135,7 +135,7 @@ static void mpeg2dec_dispose (video_decoder_t *this_gen) { mpeg2_close (&this->mpeg2); - this->video_out->close(this->video_out); + this->video_out->close(this->video_out, this->stream); pthread_mutex_unlock (&this->lock); @@ -162,7 +162,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre pthread_mutex_lock (&this->lock); mpeg2_init (&this->mpeg2, stream->video_out); - stream->video_out->open(stream->video_out); + stream->video_out->open(stream->video_out, stream); this->video_out = stream->video_out; this->mpeg2.force_aspect = 0; @@ -213,6 +213,6 @@ static decoder_info_t dec_info_mpeg2 = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 12, "mpeg2", XINE_VERSION_CODE, &dec_info_mpeg2, init_plugin }, + { PLUGIN_VIDEO_DECODER, 13, "mpeg2", XINE_VERSION_CODE, &dec_info_mpeg2, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libreal/xine_decoder.c b/src/libreal/xine_decoder.c index 1912dd974..b44ade64d 100644 --- a/src/libreal/xine_decoder.c +++ b/src/libreal/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.1 2002/11/18 03:03:09 guenter Exp $ + * $Id: xine_decoder.c,v 1.2 2002/11/20 11:57:44 mroi Exp $ * * thin layer to use real binary-only codecs in xine * @@ -177,7 +177,7 @@ static void realdec_decode_data (video_decoder_t *this_gen, buf_element_t *buf) real_init (&this->real, stream->video_out); */ - this->stream->video_out->open(this->stream->video_out); + this->stream->video_out->open(this->stream->video_out, this->stream); } else if (this->context) { @@ -221,7 +221,7 @@ static void realdec_decode_data (video_decoder_t *this_gen, buf_element_t *buf) /* xine_fast_memcpy (dy, sy, this->bih.biWidth); */ - img->draw(img); + img->draw(img, this->stream); img->free(img); } else { @@ -381,6 +381,6 @@ static decoder_info_t dec_info_real = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 12, "real", XINE_VERSION_CODE, &dec_info_real, init_class }, + { PLUGIN_VIDEO_DECODER, 13, "real", XINE_VERSION_CODE, &dec_info_real, init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libspudec/spu.h b/src/libspudec/spu.h index dc5959498..5fd959859 100644 --- a/src/libspudec/spu.h +++ b/src/libspudec/spu.h @@ -19,7 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: spu.h,v 1.16 2002/10/21 12:11:01 jcdutton Exp $ + * $Id: spu.h,v 1.17 2002/11/20 11:57:44 mroi Exp $ * * This file was originally part of the OMS program. * @@ -110,7 +110,7 @@ typedef struct spudec_decoder_s { spudec_state_t state; - vo_instance_t *vo_out; + xine_video_port_t *vo_out; vo_overlay_t overlay; int ovl_caps; int output_open; diff --git a/src/libspudec/spu_decoder_api.h b/src/libspudec/spu_decoder_api.h index e0a64c6ed..68011c1a2 100644 --- a/src/libspudec/spu_decoder_api.h +++ b/src/libspudec/spu_decoder_api.h @@ -24,7 +24,7 @@ #ifndef HAVE_SPU_API_H #define HAVE_SPU_API_H -#define SPU_DECODER_IFACE_VERSION 11 +#define SPU_DECODER_IFACE_VERSION 12 /* FIXME: Needed for spu_button_t */ /* But will not be on all users's systems. (From the libspudec directory or libdvdread). */ /*#include "nav_types.h" */ diff --git a/src/libspudec/xine_decoder.c b/src/libspudec/xine_decoder.c index 2da1241d0..756582dfc 100644 --- a/src/libspudec/xine_decoder.c +++ b/src/libspudec/xine_decoder.c @@ -19,7 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.87 2002/11/19 00:45:41 miguelfreitas Exp $ + * $Id: xine_decoder.c,v 1.88 2002/11/20 11:57:45 mroi Exp $ * * stuff needed to turn libspu into a xine decoder plugin */ @@ -249,7 +249,7 @@ static void spudec_set_button (spu_decoder_t *this_gen, int32_t button, int32_t #ifdef LOG_BUTTON fprintf(stderr, "libspudec: add_event type=%d : current time=%lld, spu vpts=%lli\n", overlay_event->event_type, - this->stream->metronom->get_current_time(this->stream->metronom), + this->stream->xine->clock->get_current_time(this->stream->xine->clock), overlay_event->vpts); #endif ovl_instance->add_event (ovl_instance, (void *)overlay_event); @@ -348,6 +348,6 @@ static decoder_info_t dec_info_data = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_SPU_DECODER, 11, "spudec", XINE_VERSION_CODE, &dec_info_data, &init_plugin }, + { PLUGIN_SPU_DECODER, 12, "spudec", XINE_VERSION_CODE, &dec_info_data, &init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libvorbis/xine_decoder.c b/src/libvorbis/xine_decoder.c index bc0bb779f..df513c221 100644 --- a/src/libvorbis/xine_decoder.c +++ b/src/libvorbis/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.21 2002/11/12 18:40:52 miguelfreitas Exp $ + * $Id: xine_decoder.c,v 1.22 2002/11/20 11:57:45 mroi Exp $ * * (ogg/)vorbis audio decoder plugin (libvorbis wrapper) for xine */ @@ -186,6 +186,7 @@ static void vorbis_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { if (!this->output_open) { this->output_open = this->stream->audio_out->open(this->stream->audio_out, + this->stream, 16, this->vi.rate, mode) ; @@ -240,7 +241,7 @@ static void vorbis_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { audio_buffer->vpts = buf->pts; audio_buffer->num_frames = bout; - this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer); + this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream); buf->pts=0; vorbis_synthesis_read(&this->vd,bout); @@ -263,7 +264,7 @@ static void vorbis_dispose (audio_decoder_t *this_gen) { vorbis_info_clear(&this->vi); /* must be called last */ if (this->output_open) - this->stream->audio_out->close (this->stream->audio_out); + this->stream->audio_out->close (this->stream->audio_out, this->stream); free (this_gen); } @@ -332,6 +333,6 @@ static decoder_info_t dec_info_audio = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_AUDIO_DECODER, 11, "vorbis", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, + { PLUGIN_AUDIO_DECODER, 12, "vorbis", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libw32dll/w32codec.c b/src/libw32dll/w32codec.c index 9e4d54514..162e2ce81 100644 --- a/src/libw32dll/w32codec.c +++ b/src/libw32dll/w32codec.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: w32codec.c,v 1.102 2002/11/15 18:01:59 esnel Exp $ + * $Id: w32codec.c,v 1.103 2002/11/20 11:57:45 mroi Exp $ * * routines for using w32 codecs * DirectShow support by Miguel Freitas (Nov/2001) @@ -536,7 +536,7 @@ static void w32v_init_codec (w32v_decoder_t *this, int buf_type) { this->bufsize = VIDEOBUFSIZE; this->buf = malloc(this->bufsize); - this->stream->video_out->open (this->stream->video_out); + this->stream->video_out->open (this->stream->video_out, this->stream); this->outfmt = outfmt; this->decoder_ok = 1; @@ -612,7 +612,7 @@ static void w32v_init_ds_codec (w32v_decoder_t *this, int buf_type) { this->bufsize = VIDEOBUFSIZE; this->buf = malloc(this->bufsize); - this->stream->video_out->open (this->stream->video_out); + this->stream->video_out->open (this->stream->video_out, this->stream); this->outfmt = outfmt; this->decoder_ok = 1; @@ -831,7 +831,7 @@ static void w32v_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { } } - this->skipframes = img->draw(img); + this->skipframes = img->draw(img, this->stream); #ifdef LOG printf ("w32codec: skipframes is %d\n", this->skipframes); @@ -911,7 +911,7 @@ static void w32v_dispose (video_decoder_t *this_gen) { if( this->decoder_ok ) { this->decoder_ok = 0; - this->stream->video_out->close(this->stream->video_out); + this->stream->video_out->close(this->stream->video_out, this->stream); } free (this); @@ -1011,9 +1011,9 @@ static int w32a_init_audio (w32a_decoder_t *this, buf_element_t *buf ) { this->rate = in_fmt->nSamplesPerSec; if (this->output_open) - this->stream->audio_out->close (this->stream->audio_out); + this->stream->audio_out->close (this->stream->audio_out, this->stream); - this->output_open = this->stream->audio_out->open( this->stream->audio_out, + this->output_open = this->stream->audio_out->open( this->stream->audio_out, this->stream, 16, in_fmt->nSamplesPerSec, (in_fmt->nChannels == 2) ? AO_CAP_MODE_STEREO : AO_CAP_MODE_MONO); if (!this->output_open) { @@ -1026,7 +1026,7 @@ static int w32a_init_audio (w32a_decoder_t *this, buf_element_t *buf ) { audio_buffer_mem_size = audio_buffer->mem_size; audio_buffer->num_frames = 0; audio_buffer->vpts = 0; - this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer); + this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream); wf.nChannels = in_fmt->nChannels; wf.nSamplesPerSec = in_fmt->nSamplesPerSec; @@ -1230,7 +1230,7 @@ static void w32a_decode_audio (w32a_decoder_t *this, audio_buffer->num_frames = bufsize / (this->num_channels*2); audio_buffer->vpts = this->pts; - this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer); + this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream); this->pts = 0; DstLengthUsed -= bufsize; @@ -1329,7 +1329,7 @@ static void w32a_dispose (audio_decoder_t *this_gen) { this->decoder_ok = 0; if (this->output_open) { - this->stream->audio_out->close (this->stream->audio_out); + this->stream->audio_out->close (this->stream->audio_out, this->stream); this->output_open = 0; } @@ -1505,7 +1505,7 @@ static decoder_info_t dec_info_audio = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 12, "win32v", XINE_VERSION_CODE, &dec_info_video, init_video_decoder_class }, - { PLUGIN_AUDIO_DECODER, 11, "win32a", XINE_VERSION_CODE, &dec_info_audio, init_audio_decoder_class }, + { PLUGIN_VIDEO_DECODER, 13, "win32v", XINE_VERSION_CODE, &dec_info_video, init_video_decoder_class }, + { PLUGIN_AUDIO_DECODER, 12, "win32a", XINE_VERSION_CODE, &dec_info_audio, init_audio_decoder_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxineadec/adpcm.c b/src/libxineadec/adpcm.c index 9bbf6fb69..d86a14a29 100644 --- a/src/libxineadec/adpcm.c +++ b/src/libxineadec/adpcm.c @@ -24,7 +24,7 @@ * formats can be found here: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: adpcm.c,v 1.23 2002/11/12 18:40:53 miguelfreitas Exp $ + * $Id: adpcm.c,v 1.24 2002/11/20 11:57:45 mroi Exp $ */ #include @@ -374,7 +374,7 @@ static void dk3_adpcm_decode_block(adpcm_decoder_t *this, buf_element_t *buf) { audio_buffer->vpts = buf->pts; buf->pts = 0; /* only first buffer gets the real pts */ - this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer); + this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream); j += bytes_to_send / 2; /* 2 bytes per sample */ } @@ -455,7 +455,7 @@ static void dk4_adpcm_decode_block(adpcm_decoder_t *this, buf_element_t *buf) { audio_buffer->vpts = buf->pts; buf->pts = 0; /* only first buffer gets the real pts */ - this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer); + this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream); j += bytes_to_send / 2; /* 2 bytes per sample */ } @@ -565,7 +565,7 @@ static void ms_ima_adpcm_decode_block(adpcm_decoder_t *this, audio_buffer->vpts = buf->pts; buf->pts = 0; /* only first buffer gets the real pts */ - this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer); + this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream); j += bytes_to_send / 2; /* 2 bytes per sample */ } @@ -611,7 +611,7 @@ static void qt_ima_adpcm_decode_block(adpcm_decoder_t *this, audio_buffer->vpts = buf->pts; buf->pts = 0; audio_buffer->num_frames = out_ptr / this->channels; - this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer); + this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream); /* get a new audio buffer */ audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out); @@ -676,7 +676,7 @@ static void qt_ima_adpcm_decode_block(adpcm_decoder_t *this, audio_buffer->vpts = buf->pts; audio_buffer->num_frames = out_ptr / this->channels; - this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer); + this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream); this->size = 0; } @@ -818,7 +818,7 @@ static void ms_adpcm_decode_block(adpcm_decoder_t *this, buf_element_t *buf) { audio_buffer->vpts = buf->pts; buf->pts = 0; /* only first buffer gets the real pts */ - this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer); + this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream); j += bytes_to_send / 2; /* 2 bytes per sample */ } @@ -890,7 +890,7 @@ static void smjpeg_adpcm_decode_block(adpcm_decoder_t *this, buf_element_t *buf) audio_buffer->vpts = buf->pts; buf->pts = 0; /* only first buffer gets the real pts */ - this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer); + this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream); i += bytes_to_send / 2; /* 2 bytes per sample */ } @@ -963,7 +963,7 @@ static void vqa_adpcm_decode_block(adpcm_decoder_t *this, buf_element_t *buf) { audio_buffer->vpts = buf->pts; buf->pts = 0; /* only first buffer gets the real pts */ - this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer); + this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream); i += bytes_to_send / 2; /* 2 bytes per sample */ } @@ -1056,7 +1056,7 @@ static void ea_adpcm_decode_block(adpcm_decoder_t *this, buf_element_t *buf) { audio_buffer->num_frames = (bytes_to_send / 4); audio_buffer->vpts = buf->pts; buf->pts = 0; - this->stream->audio_out->put_buffer(this->stream->audio_out, audio_buffer); + this->stream->audio_out->put_buffer(this->stream->audio_out, audio_buffer, this->stream); i += bytes_to_send / 2; } @@ -1189,7 +1189,7 @@ static void adpcm_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { printf ("adpcm: opening audio output (%d Hz sampling rate, mode=%d)\n", this->rate, this->ao_cap_mode); this->output_open = this->stream->audio_out->open (this->stream->audio_out, - this->bits_per_sample, this->rate, this->ao_cap_mode); + this->stream, this->bits_per_sample, this->rate, this->ao_cap_mode); } /* if the audio still isn't open, bail */ @@ -1264,7 +1264,7 @@ static void adpcm_dispose (audio_decoder_t *this_gen) { adpcm_decoder_t *this = (adpcm_decoder_t *) this_gen; if (this->output_open) - this->stream->audio_out->close (this->stream->audio_out); + this->stream->audio_out->close (this->stream->audio_out, this->stream); this->output_open = 0; if (this->decode_buffer) @@ -1342,6 +1342,6 @@ static decoder_info_t dec_info_audio = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_AUDIO_DECODER, 11, "adpcm", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, + { PLUGIN_AUDIO_DECODER, 12, "adpcm", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxineadec/fooaudio.c b/src/libxineadec/fooaudio.c index f8b9d938f..6b9ce9cd6 100644 --- a/src/libxineadec/fooaudio.c +++ b/src/libxineadec/fooaudio.c @@ -21,7 +21,7 @@ * player. It really works too! It will output a continuous sine wave in * place of the data it should actually send. * - * $Id: fooaudio.c,v 1.3 2002/11/12 18:40:53 miguelfreitas Exp $ + * $Id: fooaudio.c,v 1.4 2002/11/20 11:57:46 mroi Exp $ */ #include @@ -113,6 +113,7 @@ static void fooaudio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) if (!this->output_open) { this->output_open = this->stream->audio_out->open( this->stream->audio_out, + this->stream, /* this->bits_per_sample, */ 16, this->sample_rate, @@ -200,7 +201,7 @@ static void fooaudio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) audio_buffer->num_frames = samples_to_send; audio_buffer->vpts = buf->pts; buf->pts = 0; /* only first buffer gets the real pts */ - this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer); + this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream); } } else { @@ -242,7 +243,7 @@ static void fooaudio_dispose (audio_decoder_t *this_gen) { /* close the audio output */ if (this->output_open) - this->stream->audio_out->close (this->stream->audio_out); + this->stream->audio_out->close (this->stream->audio_out, this->stream); this->output_open = 0; /* free anything that was allocated during operation */ @@ -343,7 +344,7 @@ static decoder_info_t dec_info_audio = { * will export to the public. */ plugin_info_t xine_plugin_info[] = { /* { type, API version, "name", version, special_info, init_function }, */ - { PLUGIN_AUDIO_DECODER, 11, "fooaudio", XINE_VERSION_CODE, &dec_info_audio, &init_plugin }, + { PLUGIN_AUDIO_DECODER, 12, "fooaudio", XINE_VERSION_CODE, &dec_info_audio, &init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxineadec/gsm610.c b/src/libxineadec/gsm610.c index 902081574..0f75ba631 100644 --- a/src/libxineadec/gsm610.c +++ b/src/libxineadec/gsm610.c @@ -44,7 +44,7 @@ * Carsten Bormann * -------------------------------------------------------------------- * - * $Id: gsm610.c,v 1.5 2002/11/12 18:40:53 miguelfreitas Exp $ + * $Id: gsm610.c,v 1.6 2002/11/20 11:57:46 mroi Exp $ * */ @@ -121,7 +121,7 @@ static void gsm610_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { this->buf_type = buf->type; this->output_open = this->stream->audio_out->open(this->stream->audio_out, - GSM610_SAMPLE_SIZE, this->sample_rate, AO_CAP_MODE_MONO); + this->stream, GSM610_SAMPLE_SIZE, this->sample_rate, AO_CAP_MODE_MONO); } /* if the audio still isn't open, bail */ @@ -173,7 +173,7 @@ static void gsm610_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { audio_buffer->vpts = buf->pts; buf->pts = 0; /* only first buffer gets the real pts */ - this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer); + this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream); } } else { @@ -203,7 +203,7 @@ static void gsm610_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { audio_buffer->vpts = buf->pts; buf->pts = 0; /* only first buffer gets the real pts */ - this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer); + this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream); } } } @@ -223,7 +223,7 @@ static void gsm610_dispose (audio_decoder_t *this_gen) { gsm_destroy(this->gsm_state); if (this->output_open) - this->stream->audio_out->close (this->stream->audio_out); + this->stream->audio_out->close (this->stream->audio_out, this->stream); this->output_open = 0; if (this->buf) @@ -291,6 +291,6 @@ static decoder_info_t dec_info_audio = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_AUDIO_DECODER, 11, "gsm610", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, + { PLUGIN_AUDIO_DECODER, 12, "gsm610", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxineadec/logpcm.c b/src/libxineadec/logpcm.c index ce6366833..b3a85368b 100644 --- a/src/libxineadec/logpcm.c +++ b/src/libxineadec/logpcm.c @@ -30,7 +30,7 @@ * http://sox.sourceforge.net/ * which listed the code as being lifted from Sun Microsystems. * - * $Id: logpcm.c,v 1.9 2002/11/12 18:40:53 miguelfreitas Exp $ + * $Id: logpcm.c,v 1.10 2002/11/20 11:57:46 mroi Exp $ * */ @@ -178,7 +178,7 @@ static void logpcm_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { if (!this->output_open) { this->output_open = this->stream->audio_out->open(this->stream->audio_out, - LOGPCM_BITS_PER_SAMPLE, this->samplerate, + this->stream, LOGPCM_BITS_PER_SAMPLE, this->samplerate, (this->output_channels == 2) ? AO_CAP_MODE_STEREO : AO_CAP_MODE_MONO); } @@ -221,7 +221,7 @@ static void logpcm_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { audio_buffer->num_frames = bytes_to_send / this->output_channels; audio_buffer->vpts = buf->pts; buf->pts = 0; /* only first buffer gets the real pts */ - this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer); + this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream); } /* reset internal accumulation buffer */ @@ -243,7 +243,7 @@ static void logpcm_dispose (audio_decoder_t *this_gen) { logpcm_decoder_t *this = (logpcm_decoder_t *) this_gen; if (this->output_open) - this->stream->audio_out->close (this->stream->audio_out); + this->stream->audio_out->close (this->stream->audio_out, this->stream); this->output_open = 0; if (this->buf) @@ -307,6 +307,6 @@ static decoder_info_t dec_info_audio = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_AUDIO_DECODER, 11, "logpcm", XINE_VERSION_CODE, &dec_info_audio, &init_plugin }, + { PLUGIN_AUDIO_DECODER, 12, "logpcm", XINE_VERSION_CODE, &dec_info_audio, &init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxineadec/roqaudio.c b/src/libxineadec/roqaudio.c index 001349242..bf33aec53 100644 --- a/src/libxineadec/roqaudio.c +++ b/src/libxineadec/roqaudio.c @@ -21,7 +21,7 @@ * For more information regarding the RoQ file format, visit: * http://www.csse.monash.edu.au/~timf/ * - * $Id: roqaudio.c,v 1.12 2002/11/12 18:40:53 miguelfreitas Exp $ + * $Id: roqaudio.c,v 1.13 2002/11/20 11:57:46 mroi Exp $ * */ @@ -92,7 +92,7 @@ static void roqaudio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) if (!this->output_open) { this->output_open = this->stream->audio_out->open(this->stream->audio_out, - RoQ_AUDIO_BITS_PER_SAMPLE, RoQ_AUDIO_SAMPLE_RATE, + this->stream, RoQ_AUDIO_BITS_PER_SAMPLE, RoQ_AUDIO_SAMPLE_RATE, (this->output_channels == 2) ? AO_CAP_MODE_STEREO : AO_CAP_MODE_MONO); } @@ -141,7 +141,7 @@ static void roqaudio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) audio_buffer->num_frames = (buf->size - 8) / this->output_channels; - this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer); + this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream); this->size = 0; } @@ -162,7 +162,7 @@ static void roqaudio_dispose (audio_decoder_t *this_gen) { roqaudio_decoder_t *this = (roqaudio_decoder_t *) this_gen; if (this->output_open) - this->stream->audio_out->close (this->stream->audio_out); + this->stream->audio_out->close (this->stream->audio_out, this->stream); this->output_open = 0; if (this->buf) @@ -238,6 +238,6 @@ static decoder_info_t dec_info_audio = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_AUDIO_DECODER, 11, "roqaudio", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, + { PLUGIN_AUDIO_DECODER, 12, "roqaudio", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/cinepak.c b/src/libxinevdec/cinepak.c index 298e01154..c345c31bf 100644 --- a/src/libxinevdec/cinepak.c +++ b/src/libxinevdec/cinepak.c @@ -22,7 +22,7 @@ * based on overview of Cinepak algorithm and example decoder * by Tim Ferguson: http://www.csse.monash.edu.au/~timf/ * - * $Id: cinepak.c,v 1.20 2002/11/12 18:40:53 miguelfreitas Exp $ + * $Id: cinepak.c,v 1.21 2002/11/20 11:57:46 mroi Exp $ */ #include @@ -369,7 +369,7 @@ static void cvid_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { color_depth = bih->biBitCount; - this->stream->video_out->open (this->stream->video_out); + this->stream->video_out->open (this->stream->video_out, this->stream); this->decoder_ok = 1; /* stream/meta info */ @@ -447,7 +447,7 @@ static void cvid_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { } } - img->draw(img); + img->draw(img, this->stream); img->free(img); this->size = 0; @@ -482,7 +482,7 @@ static void cvid_dispose (video_decoder_t *this_gen) { if (this->decoder_ok) { this->decoder_ok = 0; - this->stream->video_out->close(this->stream->video_out); + this->stream->video_out->close(this->stream->video_out, this->stream); } free (this_gen); @@ -553,6 +553,6 @@ static decoder_info_t dec_info_video = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 12, "cinepak", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 13, "cinepak", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/cyuv.c b/src/libxinevdec/cyuv.c index 1daf75a17..f2d614aaa 100644 --- a/src/libxinevdec/cyuv.c +++ b/src/libxinevdec/cyuv.c @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: cyuv.c,v 1.11 2002/11/12 18:40:53 miguelfreitas Exp $ + * $Id: cyuv.c,v 1.12 2002/11/20 11:57:46 mroi Exp $ */ /* And this is the header that came with the CYUV decoder: */ @@ -149,7 +149,7 @@ static void cyuv_decode_data (video_decoder_t *this_gen, return; if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */ - this->stream->video_out->open (this->stream->video_out); + this->stream->video_out->open (this->stream->video_out, this->stream); if(this->buf) free(this->buf); @@ -204,7 +204,7 @@ static void cyuv_decode_data (video_decoder_t *this_gen, } } - this->skipframes = img->draw(img); + this->skipframes = img->draw(img, this->stream); if( this->skipframes < 0 ) this->skipframes = 0; img->free(img); @@ -226,7 +226,7 @@ static void cyuv_dispose (video_decoder_t *this_gen) { cyuv_decoder_t *this = (cyuv_decoder_t *) this_gen; - this->stream->video_out->close(this->stream->video_out); + this->stream->video_out->close(this->stream->video_out, this->stream); free (this_gen); } @@ -294,6 +294,6 @@ static decoder_info_t dec_info_video = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 12, "cyuv", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 13, "cyuv", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/fli.c b/src/libxinevdec/fli.c index 6c898093b..4aae7d418 100644 --- a/src/libxinevdec/fli.c +++ b/src/libxinevdec/fli.c @@ -23,7 +23,7 @@ * avoid when implementing a FLI decoder, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: fli.c,v 1.9 2002/11/12 18:40:53 miguelfreitas Exp $ + * $Id: fli.c,v 1.10 2002/11/20 11:57:46 mroi Exp $ */ #include @@ -421,7 +421,7 @@ static void fli_decode_data (video_decoder_t *this_gen, return; if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */ - this->stream->video_out->open (this->stream->video_out); + this->stream->video_out->open (this->stream->video_out, this->stream); if(this->buf) free(this->buf); @@ -439,7 +439,7 @@ static void fli_decode_data (video_decoder_t *this_gen, this->buf = malloc(this->bufsize); this->size = 0; - this->stream->video_out->open (this->stream->video_out); + this->stream->video_out->open (this->stream->video_out, this->stream); this->decoder_ok = 1; return; @@ -482,7 +482,7 @@ static void fli_decode_data (video_decoder_t *this_gen, } } - img->draw(img); + img->draw(img, this->stream); img->free(img); this->size = 0; @@ -526,7 +526,7 @@ static void fli_dispose (video_decoder_t *this_gen) { if (this->decoder_ok) { this->decoder_ok = 0; - this->stream->video_out->close(this->stream->video_out); + this->stream->video_out->close(this->stream->video_out, this->stream); } free (this_gen); @@ -596,7 +596,7 @@ static decoder_info_t dec_info_video = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 12, "fli", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 13, "fli", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/foovideo.c b/src/libxinevdec/foovideo.c index 2ca96e8d9..23e48a6fe 100644 --- a/src/libxinevdec/foovideo.c +++ b/src/libxinevdec/foovideo.c @@ -23,7 +23,7 @@ * value from the last frame. This creates a slowly rotating solid color * frame when the frames are played in succession. * - * $Id: foovideo.c,v 1.10 2002/11/12 18:40:54 miguelfreitas Exp $ + * $Id: foovideo.c,v 1.11 2002/11/20 11:57:46 mroi Exp $ */ #include @@ -92,7 +92,7 @@ static void foovideo_decode_data (video_decoder_t *this_gen, return; if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */ - this->stream->video_out->open (this->stream->video_out); + this->stream->video_out->open (this->stream->video_out, this->stream); if(this->buf) free(this->buf); @@ -115,7 +115,6 @@ static void foovideo_decode_data (video_decoder_t *this_gen, /* do anything else relating to initializing this decoder */ this->current_yuv_byte = 0; - this->stream->video_out->open (this->stream->video_out); this->decoder_ok = 1; return; @@ -160,7 +159,7 @@ static void foovideo_decode_data (video_decoder_t *this_gen, } } - img->draw(img); + img->draw(img, this->stream); img->free(img); this->size = 0; @@ -183,6 +182,9 @@ static void foovideo_reset (video_decoder_t *this_gen) { this->size = 0; } +/* + * The decoder should forget any stored pts values here. + */ static void foovideo_discontinuity (video_decoder_t *this_gen) { foovideo_decoder_t *this = (foovideo_decoder_t *) this_gen; @@ -202,7 +204,7 @@ static void foovideo_dispose (video_decoder_t *this_gen) { if (this->decoder_ok) { this->decoder_ok = 0; - this->stream->video_out->close(this->stream->video_out); + this->stream->video_out->close(this->stream->video_out, this->stream); } free (this_gen); @@ -306,6 +308,6 @@ static decoder_info_t dec_info_video = { */ plugin_info_t xine_plugin_info[] = { /* { type, API, "name", version, special_info, init_function } */ - { PLUGIN_VIDEO_DECODER, 12, "foovideo", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 13, "foovideo", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/idcinvideo.c b/src/libxinevdec/idcinvideo.c index 6ebfa1f07..e774d7d1f 100644 --- a/src/libxinevdec/idcinvideo.c +++ b/src/libxinevdec/idcinvideo.c @@ -21,7 +21,7 @@ * the Id CIN format, visit: * http://www.csse.monash.edu.au/~timf/ * - * $Id: idcinvideo.c,v 1.8 2002/11/12 18:40:54 miguelfreitas Exp $ + * $Id: idcinvideo.c,v 1.9 2002/11/20 11:57:46 mroi Exp $ */ #include @@ -246,7 +246,7 @@ static void idcinvideo_decode_data (video_decoder_t *this_gen, } if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */ - this->stream->video_out->open (this->stream->video_out); + this->stream->video_out->open (this->stream->video_out, this->stream); if(this->buf) free(this->buf); @@ -263,7 +263,7 @@ static void idcinvideo_decode_data (video_decoder_t *this_gen, init_yuv_planes(&this->yuv_planes, this->width, this->height); - this->stream->video_out->open (this->stream->video_out); + this->stream->video_out->open (this->stream->video_out, this->stream); this->decoder_ok = 1; /* load the stream/meta info */ @@ -310,7 +310,7 @@ static void idcinvideo_decode_data (video_decoder_t *this_gen, } } - img->draw(img); + img->draw(img, this->stream); img->free(img); this->size = 0; @@ -351,7 +351,7 @@ static void idcinvideo_dispose (video_decoder_t *this_gen) { if (this->decoder_ok) { this->decoder_ok = 0; - this->stream->video_out->close(this->stream->video_out); + this->stream->video_out->close(this->stream->video_out, this->stream); } free (this_gen); @@ -415,6 +415,6 @@ static decoder_info_t video_decoder_info = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 12, "idcinvideo", XINE_VERSION_CODE, &video_decoder_info, &init_plugin }, + { PLUGIN_VIDEO_DECODER, 13, "idcinvideo", XINE_VERSION_CODE, &video_decoder_info, &init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/msrle.c b/src/libxinevdec/msrle.c index c2fd5d033..70e050f07 100644 --- a/src/libxinevdec/msrle.c +++ b/src/libxinevdec/msrle.c @@ -21,7 +21,7 @@ * For more information on the MS RLE format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: msrle.c,v 1.10 2002/11/12 18:40:54 miguelfreitas Exp $ + * $Id: msrle.c,v 1.11 2002/11/20 11:57:46 mroi Exp $ */ #include @@ -203,7 +203,7 @@ static void msrle_decode_data (video_decoder_t *this_gen, } if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */ - this->stream->video_out->open (this->stream->video_out); + this->stream->video_out->open (this->stream->video_out, this->stream); if(this->buf) free(this->buf); @@ -221,7 +221,7 @@ static void msrle_decode_data (video_decoder_t *this_gen, init_yuv_planes(&this->yuv_planes, this->width, this->height); - this->stream->video_out->open (this->stream->video_out); + this->stream->video_out->open (this->stream->video_out, this->stream); this->decoder_ok = 1; /* load the stream/meta info */ @@ -268,7 +268,7 @@ static void msrle_decode_data (video_decoder_t *this_gen, } } - img->draw(img); + img->draw(img, this->stream); img->free(img); this->size = 0; @@ -308,7 +308,7 @@ static void msrle_dispose (video_decoder_t *this_gen) { if (this->decoder_ok) { this->decoder_ok = 0; - this->stream->video_out->close(this->stream->video_out); + this->stream->video_out->close(this->stream->video_out, this->stream); } free (this_gen); @@ -378,6 +378,6 @@ static decoder_info_t dec_info_video = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 12, "msrle", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 13, "msrle", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/msvc.c b/src/libxinevdec/msvc.c index 598259654..78260833f 100644 --- a/src/libxinevdec/msvc.c +++ b/src/libxinevdec/msvc.c @@ -22,7 +22,7 @@ * based on overview of Microsoft Video-1 algorithm * by Mike Melanson: http://www.pcisys.net/~melanson/codecs/video1.txt * - * $Id: msvc.c,v 1.15 2002/11/12 18:40:54 miguelfreitas Exp $ + * $Id: msvc.c,v 1.16 2002/11/20 11:57:47 mroi Exp $ */ #include @@ -240,7 +240,7 @@ static void msvc_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { this->buf = malloc(this->bufsize); this->size = 0; - this->stream->video_out->open (this->stream->video_out); + this->stream->video_out->open (this->stream->video_out, this->stream); this->decoder_ok = 1; /* load the stream/meta info */ @@ -303,7 +303,7 @@ static void msvc_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { } } - img->draw(img); + img->draw(img, this->stream); img->free(img); this->size = 0; @@ -339,7 +339,7 @@ static void msvc_dispose (video_decoder_t *this_gen) { if (this->decoder_ok) { this->decoder_ok = 0; - this->stream->video_out->close(this->stream->video_out); + this->stream->video_out->close(this->stream->video_out, this->stream); } free (this_gen); @@ -409,6 +409,6 @@ static decoder_info_t dec_info_video = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 12, "msvc", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 13, "msvc", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/qtrle.c b/src/libxinevdec/qtrle.c index 6382e888d..4c355b2c1 100644 --- a/src/libxinevdec/qtrle.c +++ b/src/libxinevdec/qtrle.c @@ -21,7 +21,7 @@ * For more information on the QT RLE format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: qtrle.c,v 1.6 2002/11/12 18:40:54 miguelfreitas Exp $ + * $Id: qtrle.c,v 1.7 2002/11/20 11:57:47 mroi Exp $ */ #include @@ -705,7 +705,7 @@ static void qtrle_decode_data (video_decoder_t *this_gen, } if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */ - this->stream->video_out->open (this->stream->video_out); + this->stream->video_out->open (this->stream->video_out, this->stream); if(this->buf) free(this->buf); @@ -724,7 +724,6 @@ static void qtrle_decode_data (video_decoder_t *this_gen, init_yuv_planes(&this->yuv_planes, this->width, this->height); - this->stream->video_out->open (this->stream->video_out); this->decoder_ok = 1; /* load the stream/meta info */ @@ -803,7 +802,7 @@ static void qtrle_decode_data (video_decoder_t *this_gen, } } - img->draw(img); + img->draw(img, this->stream); img->free(img); this->size = 0; @@ -844,7 +843,7 @@ static void qtrle_dispose (video_decoder_t *this_gen) { if (this->decoder_ok) { this->decoder_ok = 0; - this->stream->video_out->close(this->stream->video_out); + this->stream->video_out->close(this->stream->video_out, this->stream); } free (this_gen); @@ -913,6 +912,6 @@ static decoder_info_t dec_info_video = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 12, "qtrle", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 13, "qtrle", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/qtrpza.c b/src/libxinevdec/qtrpza.c index 5e215acab..733c41616 100644 --- a/src/libxinevdec/qtrpza.c +++ b/src/libxinevdec/qtrpza.c @@ -21,7 +21,7 @@ * For more information about the RPZA format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: qtrpza.c,v 1.8 2002/11/12 18:40:54 miguelfreitas Exp $ + * $Id: qtrpza.c,v 1.9 2002/11/20 11:57:47 mroi Exp $ */ #include @@ -297,7 +297,7 @@ static void qtrpza_decode_data (video_decoder_t *this_gen, return; if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */ - this->stream->video_out->open (this->stream->video_out); + this->stream->video_out->open (this->stream->video_out, this->stream); if(this->buf) free(this->buf); @@ -315,7 +315,7 @@ static void qtrpza_decode_data (video_decoder_t *this_gen, init_yuv_planes(&this->yuv_planes, this->width, this->height); - this->stream->video_out->open (this->stream->video_out); + this->stream->video_out->open (this->stream->video_out, this->stream); this->decoder_ok = 1; /* load the stream/meta info */ @@ -362,7 +362,7 @@ static void qtrpza_decode_data (video_decoder_t *this_gen, } } - img->draw(img); + img->draw(img, this->stream); img->free(img); this->size = 0; @@ -403,7 +403,7 @@ static void qtrpza_dispose (video_decoder_t *this_gen) { if (this->decoder_ok) { this->decoder_ok = 0; - this->stream->video_out->close(this->stream->video_out); + this->stream->video_out->close(this->stream->video_out, this->stream); } free (this_gen); @@ -467,6 +467,6 @@ static decoder_info_t video_decoder_info = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 12, "rpza", XINE_VERSION_CODE, &video_decoder_info, &init_plugin }, + { PLUGIN_VIDEO_DECODER, 13, "rpza", XINE_VERSION_CODE, &video_decoder_info, &init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/qtsmc.c b/src/libxinevdec/qtsmc.c index a3ded3765..45194b934 100644 --- a/src/libxinevdec/qtsmc.c +++ b/src/libxinevdec/qtsmc.c @@ -23,7 +23,7 @@ * For more information on the SMC format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: qtsmc.c,v 1.8 2002/11/12 18:40:54 miguelfreitas Exp $ + * $Id: qtsmc.c,v 1.9 2002/11/20 11:57:47 mroi Exp $ */ #include @@ -529,7 +529,7 @@ static void qtsmc_decode_data (video_decoder_t *this_gen, } if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */ - this->stream->video_out->open (this->stream->video_out); + this->stream->video_out->open (this->stream->video_out, this->stream); if(this->buf) free(this->buf); @@ -547,7 +547,7 @@ static void qtsmc_decode_data (video_decoder_t *this_gen, init_yuv_planes(&this->yuv_planes, this->width, this->height); - this->stream->video_out->open (this->stream->video_out); + this->stream->video_out->open (this->stream->video_out, this->stream); this->decoder_ok = 1; /* load the stream/meta info */ @@ -594,7 +594,7 @@ static void qtsmc_decode_data (video_decoder_t *this_gen, } } - img->draw(img); + img->draw(img, this->stream); img->free(img); this->size = 0; @@ -635,7 +635,7 @@ static void qtsmc_dispose (video_decoder_t *this_gen) { if (this->decoder_ok) { this->decoder_ok = 0; - this->stream->video_out->close(this->stream->video_out); + this->stream->video_out->close(this->stream->video_out, this->stream); } free (this_gen); @@ -699,7 +699,7 @@ static decoder_info_t video_decoder_info = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 12, "smc", XINE_VERSION_CODE, &video_decoder_info, &init_plugin }, + { PLUGIN_VIDEO_DECODER, 13, "smc", XINE_VERSION_CODE, &video_decoder_info, &init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/rgb.c b/src/libxinevdec/rgb.c index ff7ba044c..510108383 100644 --- a/src/libxinevdec/rgb.c +++ b/src/libxinevdec/rgb.c @@ -21,7 +21,7 @@ * Actually, this decoder just converts a raw RGB image to a YUY2 map * suitable for display under xine. * - * $Id: rgb.c,v 1.11 2002/11/12 18:40:54 miguelfreitas Exp $ + * $Id: rgb.c,v 1.12 2002/11/20 11:57:47 mroi Exp $ */ #include @@ -99,7 +99,7 @@ static void rgb_decode_data (video_decoder_t *this_gen, } if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */ - this->stream->video_out->open (this->stream->video_out); + this->stream->video_out->open (this->stream->video_out, this->stream); if(this->buf) free(this->buf); @@ -119,7 +119,7 @@ static void rgb_decode_data (video_decoder_t *this_gen, init_yuv_planes(&this->yuv_planes, this->width, this->height); - this->stream->video_out->open (this->stream->video_out); + this->stream->video_out->open (this->stream->video_out, this->stream); this->decoder_ok = 1; /* load the stream/meta info */ @@ -213,7 +213,7 @@ static void rgb_decode_data (video_decoder_t *this_gen, } } - img->draw(img); + img->draw(img, this->stream); img->free(img); this->size = 0; @@ -253,7 +253,7 @@ static void rgb_dispose (video_decoder_t *this_gen) { if (this->decoder_ok) { this->decoder_ok = 0; - this->stream->video_out->close(this->stream->video_out); + this->stream->video_out->close(this->stream->video_out, this->stream); } free (this_gen); @@ -323,6 +323,6 @@ static decoder_info_t dec_info_video = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 12, "rgb", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 13, "rgb", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/roqvideo.c b/src/libxinevdec/roqvideo.c index 2c164dae7..dc4179cf8 100644 --- a/src/libxinevdec/roqvideo.c +++ b/src/libxinevdec/roqvideo.c @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: roqvideo.c,v 1.14 2002/11/12 18:40:54 miguelfreitas Exp $ + * $Id: roqvideo.c,v 1.15 2002/11/20 11:57:47 mroi Exp $ */ /* And this is the header that came with the RoQ video decoder: */ @@ -391,7 +391,7 @@ static void roqvideo_decode_data (video_decoder_t *this_gen, return; if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */ - this->stream->video_out->open (this->stream->video_out); + this->stream->video_out->open (this->stream->video_out, this->stream); if(this->buf) free(this->buf); @@ -489,7 +489,7 @@ static void roqvideo_decode_data (video_decoder_t *this_gen, } } - this->skipframes = img->draw(img); + this->skipframes = img->draw(img, this->stream); if( this->skipframes < 0 ) this->skipframes = 0; img->free(img); @@ -511,7 +511,7 @@ static void roqvideo_dispose (video_decoder_t *this_gen) { roqvideo_decoder_t *this = (roqvideo_decoder_t *) this_gen; - this->stream->video_out->close(this->stream->video_out); + this->stream->video_out->close(this->stream->video_out, this->stream); free(this->y[0]); free(this->y[1]); @@ -586,6 +586,6 @@ static decoder_info_t dec_info_video = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 12, "roq", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 13, "roq", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/svq1.c b/src/libxinevdec/svq1.c index 161bd84d2..a06c38d58 100644 --- a/src/libxinevdec/svq1.c +++ b/src/libxinevdec/svq1.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: svq1.c,v 1.13 2002/11/12 18:40:54 miguelfreitas Exp $ + * $Id: svq1.c,v 1.14 2002/11/20 11:57:47 mroi Exp $ */ #include @@ -1387,7 +1387,7 @@ static void svq1dec_decode_data (video_decoder_t *this_gen, buf_element_t *buf) this->buf = malloc(this->bufsize); this->size = 0; - this->stream->video_out->open (this->stream->video_out); + this->stream->video_out->open (this->stream->video_out, this->stream); this->decoder_ok = 1; /* load the stream/meta info */ @@ -1446,7 +1446,7 @@ static void svq1dec_decode_data (video_decoder_t *this_gen, buf_element_t *buf) } } - img->draw(img); + img->draw(img, this->stream); img->free(img); } @@ -1490,7 +1490,7 @@ static void svq1dec_dispose (video_decoder_t *this_gen) { if (this->decoder_ok) { this->decoder_ok = 0; - this->stream->video_out->close(this->stream->video_out); + this->stream->video_out->close(this->stream->video_out, this->stream); } free (this_gen); @@ -1562,6 +1562,6 @@ static decoder_info_t dec_info_video = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 12, "svq1", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 13, "svq1", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/wc3video.c b/src/libxinevdec/wc3video.c index 44fb4bf2a..bed53b93d 100644 --- a/src/libxinevdec/wc3video.c +++ b/src/libxinevdec/wc3video.c @@ -22,7 +22,7 @@ * For more information on the WC3 Movie format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: wc3video.c,v 1.9 2002/11/12 18:40:54 miguelfreitas Exp $ + * $Id: wc3video.c,v 1.10 2002/11/20 11:57:48 mroi Exp $ */ #include @@ -365,7 +365,7 @@ static void wc3video_decode_data (video_decoder_t *this_gen, } if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */ - this->stream->video_out->open (this->stream->video_out); + this->stream->video_out->open (this->stream->video_out, this->stream); if(this->buf) free(this->buf); @@ -382,7 +382,6 @@ static void wc3video_decode_data (video_decoder_t *this_gen, init_yuv_planes(&this->yuv_planes2, WC3_WIDTH, WC3_HEIGHT); this->current_planes = 1; - this->stream->video_out->open (this->stream->video_out); this->decoder_ok = 1; /* load the stream/meta info */ @@ -439,7 +438,7 @@ static void wc3video_decode_data (video_decoder_t *this_gen, } } - img->draw(img); + img->draw(img, this->stream); img->free(img); this->size = 0; @@ -480,7 +479,7 @@ static void wc3video_dispose (video_decoder_t *this_gen) { if (this->decoder_ok) { this->decoder_ok = 0; - this->stream->video_out->close(this->stream->video_out); + this->stream->video_out->close(this->stream->video_out, this->stream); } free (this_gen); @@ -544,6 +543,6 @@ static decoder_info_t video_decoder_info = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 12, "wc3video", XINE_VERSION_CODE, &video_decoder_info, &init_plugin }, + { PLUGIN_VIDEO_DECODER, 13, "wc3video", XINE_VERSION_CODE, &video_decoder_info, &init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/yuv.c b/src/libxinevdec/yuv.c index a73289f05..b83cad942 100644 --- a/src/libxinevdec/yuv.c +++ b/src/libxinevdec/yuv.c @@ -21,7 +21,7 @@ * Actually, this decoder just reorganizes chunks of raw YUV data in such * a way that xine can display them. * - * $Id: yuv.c,v 1.11 2002/11/12 18:40:54 miguelfreitas Exp $ + * $Id: yuv.c,v 1.12 2002/11/20 11:57:48 mroi Exp $ */ #include @@ -89,7 +89,7 @@ static void yuv_decode_data (video_decoder_t *this_gen, return; if (buf->decoder_flags & BUF_FLAG_HEADER) { /* need to initialize */ - this->stream->video_out->open (this->stream->video_out); + this->stream->video_out->open (this->stream->video_out, this->stream); if(this->buf) free(this->buf); @@ -105,7 +105,6 @@ static void yuv_decode_data (video_decoder_t *this_gen, this->buf = malloc(this->bufsize); this->size = 0; - this->stream->video_out->open (this->stream->video_out); this->decoder_ok = 1; /* load the stream/meta info */ @@ -239,7 +238,7 @@ static void yuv_decode_data (video_decoder_t *this_gen, } } - img->draw(img); + img->draw(img, this->stream); img->free(img); this->size = 0; @@ -279,7 +278,7 @@ static void yuv_dispose (video_decoder_t *this_gen) { if (this->decoder_ok) { this->decoder_ok = 0; - this->stream->video_out->close(this->stream->video_out); + this->stream->video_out->close(this->stream->video_out, this->stream); } free (this_gen); @@ -353,6 +352,6 @@ static decoder_info_t dec_info_video = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 12, "yuv", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 13, "yuv", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/video_out/video_out_aa.c b/src/video_out/video_out_aa.c index 85c5d5ca1..f1fb360e2 100644 --- a/src/video_out/video_out_aa.c +++ b/src/video_out/video_out_aa.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_aa.c,v 1.29 2002/10/18 20:04:24 f1rmb Exp $ + * $Id: video_out_aa.c,v 1.30 2002/11/20 11:57:48 mroi Exp $ * * video_out_aa.c, ascii-art output plugin for xine * @@ -63,7 +63,7 @@ typedef struct aa_frame_s { } aa_frame_t; typedef struct { - xine_vo_driver_t vo_driver; + vo_driver_t vo_driver; config_values_t *config; int user_ratio; @@ -81,7 +81,7 @@ typedef struct { /* * our video driver */ -static uint32_t aa_get_capabilities (xine_vo_driver_t *this) { +static uint32_t aa_get_capabilities (vo_driver_t *this) { return VO_CAP_YV12 | VO_CAP_YUY2; } @@ -103,7 +103,7 @@ static void aa_frame_field (vo_frame_t *vo_img, int which_field) { } -static vo_frame_t *aa_alloc_frame(xine_vo_driver_t *this) { +static vo_frame_t *aa_alloc_frame(vo_driver_t *this) { aa_frame_t *frame; frame = (aa_frame_t *) malloc (sizeof (aa_frame_t)); @@ -117,7 +117,7 @@ static vo_frame_t *aa_alloc_frame(xine_vo_driver_t *this) { return (vo_frame_t*) frame; } -static void aa_update_frame_format (xine_vo_driver_t *this, vo_frame_t *img, +static void aa_update_frame_format (vo_driver_t *this, vo_frame_t *img, uint32_t width, uint32_t height, int ratio_code, int format, int flags) { @@ -172,7 +172,7 @@ static void aa_update_frame_format (xine_vo_driver_t *this, vo_frame_t *img, /* printf ("aa_update_format done\n"); */ } -static void aa_display_frame (xine_vo_driver_t *this_gen, vo_frame_t *frame_gen) { +static void aa_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { int x,y; double x_fact, y_fact; /* ratio between aa's and frame's width/height */ @@ -225,7 +225,7 @@ static void aa_display_frame (xine_vo_driver_t *this_gen, vo_frame_t *frame_gen) } -static int aa_get_property (xine_vo_driver_t *this_gen, int property) { +static int aa_get_property (vo_driver_t *this_gen, int property) { aa_driver_t *this = (aa_driver_t*) this_gen; if ( property == VO_PROP_ASPECT_RATIO) { @@ -237,7 +237,7 @@ static int aa_get_property (xine_vo_driver_t *this_gen, int property) { return 0; } -static int aa_set_property (xine_vo_driver_t *this_gen, +static int aa_set_property (vo_driver_t *this_gen, int property, int value) { aa_driver_t *this = (aa_driver_t*) this_gen; @@ -253,20 +253,20 @@ static int aa_set_property (xine_vo_driver_t *this_gen, return value; } -static void aa_get_property_min_max (xine_vo_driver_t *this_gen, +static void aa_get_property_min_max (vo_driver_t *this_gen, int property, int *min, int *max) { *min = 0; *max = 0; } -static void aa_dispose (xine_vo_driver_t *this_gen) { +static void aa_dispose (vo_driver_t *this_gen) { } -static int aa_redraw_needed (xine_vo_driver_t *this_gen) { +static int aa_redraw_needed (vo_driver_t *this_gen) { return 0; } -static xine_vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *visual_gen) { +static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *visual_gen) { aa_class_t *class = (aa_class_t *) class_gen; aa_driver_t *this; @@ -328,6 +328,6 @@ static vo_info_t vo_info_aa = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_OUT, 10, "aa", XINE_VERSION_CODE, &vo_info_aa, init_class }, + { PLUGIN_VIDEO_OUT, 11, "aa", XINE_VERSION_CODE, &vo_info_aa, init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/video_out/video_out_fb.c b/src/video_out/video_out_fb.c index bf113ff01..ead079c23 100644 --- a/src/video_out/video_out_fb.c +++ b/src/video_out/video_out_fb.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_fb.c,v 1.17 2002/09/05 20:44:42 mroi Exp $ + * $Id: video_out_fb.c,v 1.18 2002/11/20 11:57:48 mroi Exp $ * * video_out_fb.c, frame buffer xine driver by Miguel Freitas * @@ -91,7 +91,7 @@ typedef struct fb_frame_s { typedef struct fb_driver_s { - xine_vo_driver_t vo_driver; + vo_driver_t vo_driver; config_values_t *config; @@ -121,7 +121,7 @@ typedef struct fb_driver_s { * and now, the driver functions */ -static uint32_t fb_get_capabilities (xine_vo_driver_t *this_gen) { +static uint32_t fb_get_capabilities (vo_driver_t *this_gen) { return VO_CAP_COPIES_IMAGE | VO_CAP_YV12 | VO_CAP_YUY2 | VO_CAP_BRIGHTNESS; } @@ -172,7 +172,7 @@ static void fb_frame_dispose (vo_frame_t *vo_img) { } -static vo_frame_t *fb_alloc_frame (xine_vo_driver_t *this_gen) { +static vo_frame_t *fb_alloc_frame (vo_driver_t *this_gen) { fb_driver_t *this = (fb_driver_t *) this_gen; fb_frame_t *frame ; @@ -227,7 +227,7 @@ static void fb_compute_rgb_size (fb_driver_t *this, fb_frame_t *frame) { #endif } -static void fb_update_frame_format (xine_vo_driver_t *this_gen, +static void fb_update_frame_format (vo_driver_t *this_gen, vo_frame_t *frame_gen, uint32_t width, uint32_t height, int ratio_code, int format, int flags) { @@ -388,7 +388,7 @@ static void fb_overlay_clut_yuv2rgb(fb_driver_t *this, vo_overlay_t *overlay, } } -static void fb_overlay_blend (xine_vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay) { +static void fb_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay) { fb_driver_t *this = (fb_driver_t *) this_gen; fb_frame_t *frame = (fb_frame_t *) frame_gen; @@ -420,11 +420,11 @@ static void fb_overlay_blend (xine_vo_driver_t *this_gen, vo_frame_t *frame_gen, } } -static int fb_redraw_needed (xine_vo_driver_t *this_gen) { +static int fb_redraw_needed (vo_driver_t *this_gen) { return 0; } -static void fb_display_frame (xine_vo_driver_t *this_gen, vo_frame_t *frame_gen) { +static void fb_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { fb_driver_t *this = (fb_driver_t *) this_gen; fb_frame_t *frame = (fb_frame_t *) frame_gen; @@ -458,7 +458,7 @@ static void fb_display_frame (xine_vo_driver_t *this_gen, vo_frame_t *frame_gen) frame->vo_frame.displayed (&frame->vo_frame); } -static int fb_get_property (xine_vo_driver_t *this_gen, int property) { +static int fb_get_property (vo_driver_t *this_gen, int property) { fb_driver_t *this = (fb_driver_t *) this_gen; @@ -497,7 +497,7 @@ static int fb_set_property (vo_driver_t *this_gen, return value; } -static void fb_get_property_min_max (xine_vo_driver_t *this_gen, +static void fb_get_property_min_max (vo_driver_t *this_gen, int property, int *min, int *max) { /* fb_driver_t *this = (fb_driver_t *) this_gen; */ @@ -518,14 +518,14 @@ static int is_fullscreen_size (fb_driver_t *this, int w, int h) return 0; } -static int fb_gui_data_exchange (xine_vo_driver_t *this_gen, +static int fb_gui_data_exchange (vo_driver_t *this_gen, int data_type, void *data) { return 0; } -static void fb_exit (xine_vo_driver_t *this_gen) { +static void fb_exit (vo_driver_t *this_gen) { fb_driver_t *this = (fb_driver_t *) this_gen; diff --git a/src/video_out/video_out_none.c b/src/video_out/video_out_none.c index c8f81f0d8..e29caa502 100644 --- a/src/video_out/video_out_none.c +++ b/src/video_out/video_out_none.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_none.c,v 1.2 2002/11/11 20:02:39 f1rmb Exp $ + * $Id: video_out_none.c,v 1.3 2002/11/20 11:57:48 mroi Exp $ * * Was originally part of toxine frontend. */ @@ -48,7 +48,7 @@ typedef struct { } none_frame_t; typedef struct { - xine_vo_driver_t vo_driver; + vo_driver_t vo_driver; config_values_t *config; int ratio; } none_driver_t; @@ -86,11 +86,11 @@ static void none_frame_field(vo_frame_t *vo_frame, int which_field) { /* do nothing */ } -static uint32_t none_get_capabilities(xine_vo_driver_t *vo_driver) { +static uint32_t none_get_capabilities(vo_driver_t *vo_driver) { return VO_CAP_YV12 | VO_CAP_YUY2; } -static vo_frame_t *none_alloc_frame(xine_vo_driver_t *vo_driver) { +static vo_frame_t *none_alloc_frame(vo_driver_t *vo_driver) { none_frame_t *frame; frame = (none_frame_t *) malloc(sizeof(none_frame_t)); @@ -113,7 +113,7 @@ static vo_frame_t *none_alloc_frame(xine_vo_driver_t *vo_driver) { return (vo_frame_t *)frame; } -static void none_update_frame_format(xine_vo_driver_t *vo_driver, vo_frame_t *vo_frame, +static void none_update_frame_format(vo_driver_t *vo_driver, vo_frame_t *vo_frame, uint32_t width, uint32_t height, int ratio_code, int format, int flags) { none_frame_t *frame = (none_frame_t *)vo_frame; @@ -160,14 +160,14 @@ static void none_update_frame_format(xine_vo_driver_t *vo_driver, vo_frame_t *vo frame->ratio_code = ratio_code; } -static void none_display_frame(xine_vo_driver_t *vo_driver, vo_frame_t *vo_frame) { +static void none_display_frame(vo_driver_t *vo_driver, vo_frame_t *vo_frame) { /* none_driver_t *driver = (none_driver_t *)vo_driver; */ none_frame_t *frame = (none_frame_t *)vo_frame; frame->vo_frame.displayed(&frame->vo_frame); } -static int none_get_property(xine_vo_driver_t *vo_driver, int property) { +static int none_get_property(vo_driver_t *vo_driver, int property) { none_driver_t *driver = (none_driver_t *)vo_driver; switch(property) { @@ -183,7 +183,7 @@ static int none_get_property(xine_vo_driver_t *vo_driver, int property) { return 0; } -static int none_set_property(xine_vo_driver_t *vo_driver, int property, int value) { +static int none_set_property(vo_driver_t *vo_driver, int property, int value) { none_driver_t *driver = (none_driver_t *)vo_driver; switch(property) { @@ -201,13 +201,13 @@ static int none_set_property(xine_vo_driver_t *vo_driver, int property, int valu return value; } -static void none_get_property_min_max(xine_vo_driver_t *vo_driver, +static void none_get_property_min_max(vo_driver_t *vo_driver, int property, int *min, int *max) { *min = 0; *max = 0; } -static int none_gui_data_exchange(xine_vo_driver_t *vo_driver, int data_type, void *data) { +static int none_gui_data_exchange(vo_driver_t *vo_driver, int data_type, void *data) { /* none_driver_t *this = (none_driver_t *) vo_driver; */ switch (data_type) { @@ -222,17 +222,17 @@ static int none_gui_data_exchange(xine_vo_driver_t *vo_driver, int data_type, vo return 0; } -static void none_dispose(xine_vo_driver_t *vo_driver) { +static void none_dispose(vo_driver_t *vo_driver) { none_driver_t *this = (none_driver_t *) vo_driver; free(this); } -static int none_redraw_needed(xine_vo_driver_t *vo_driver) { +static int none_redraw_needed(vo_driver_t *vo_driver) { return 0; } -static xine_vo_driver_t *open_plugin(video_driver_class_t *driver_class, const void *visual) { +static vo_driver_t *open_plugin(video_driver_class_t *driver_class, const void *visual) { none_class_t *class = (none_class_t *) driver_class; none_driver_t *driver; @@ -297,6 +297,6 @@ static vo_info_t vo_info_none = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_OUT, 10, "none", XINE_VERSION_CODE, &vo_info_none, init_class }, + { PLUGIN_VIDEO_OUT, 11, "none", XINE_VERSION_CODE, &vo_info_none, init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/video_out/video_out_pgx64.c b/src/video_out/video_out_pgx64.c index a39896573..b59e623e3 100644 --- a/src/video_out/video_out_pgx64.c +++ b/src/video_out/video_out_pgx64.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_pgx64.c,v 1.13 2002/11/02 22:30:21 komadori Exp $ + * $Id: video_out_pgx64.c,v 1.14 2002/11/20 11:57:48 mroi Exp $ * * video_out_pgx64.c, Sun PGX64/PGX24 output plugin for xine * @@ -116,7 +116,7 @@ typedef struct { } pgx64_frame_t; typedef struct { - xine_vo_driver_t vo_driver; + vo_driver_t vo_driver; vo_scale_t vo_scale; pgx64_driver_class_t *class; pgx64_frame_t *current; @@ -833,8 +833,8 @@ static pgx64_driver_class_t* pgx64fb_init_class(xine_t *xine, void *visual_gen) plugin_info_t xine_plugin_info[] = { #ifdef HAVE_X11 - {PLUGIN_VIDEO_OUT, 10, "pgx64", XINE_VERSION_CODE, &vo_info_pgx64, (void*)pgx64_init_class}, + {PLUGIN_VIDEO_OUT, 11, "pgx64", XINE_VERSION_CODE, &vo_info_pgx64, (void*)pgx64_init_class}, #endif - {PLUGIN_VIDEO_OUT, 10, "pgx64fb", XINE_VERSION_CODE, &vo_info_pgx64fb, (void*)pgx64fb_init_class}, + {PLUGIN_VIDEO_OUT, 11, "pgx64fb", XINE_VERSION_CODE, &vo_info_pgx64fb, (void*)pgx64fb_init_class}, {PLUGIN_NONE, 0, "", 0, NULL, NULL} }; diff --git a/src/video_out/video_out_sdl.c b/src/video_out/video_out_sdl.c index 994e7e371..bfe74aeea 100644 --- a/src/video_out/video_out_sdl.c +++ b/src/video_out/video_out_sdl.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_sdl.c,v 1.14 2002/09/05 20:44:42 mroi Exp $ + * $Id: video_out_sdl.c,v 1.15 2002/11/20 11:57:48 mroi Exp $ * * video_out_sdl.c, Simple DirectMedia Layer * @@ -75,7 +75,7 @@ typedef struct sdl_frame_s { struct sdl_driver_s { - xine_vo_driver_t vo_driver; + vo_driver_t vo_driver; config_values_t *config; @@ -98,7 +98,7 @@ struct sdl_driver_s { }; -static uint32_t sdl_get_capabilities (xine_vo_driver_t *this_gen) { +static uint32_t sdl_get_capabilities (vo_driver_t *this_gen) { sdl_driver_t *this = (sdl_driver_t *) this_gen; @@ -119,7 +119,7 @@ static void sdl_frame_dispose (vo_frame_t *vo_img) { free (frame); } -static vo_frame_t *sdl_alloc_frame (xine_vo_driver_t *this_gen) { +static vo_frame_t *sdl_alloc_frame (vo_driver_t *this_gen) { sdl_frame_t *frame ; @@ -160,7 +160,7 @@ static void sdl_compute_output_size (sdl_driver_t *this) { } -static void sdl_update_frame_format (xine_vo_driver_t *this_gen, +static void sdl_update_frame_format (vo_driver_t *this_gen, vo_frame_t *frame_gen, uint32_t width, uint32_t height, int ratio_code, int format, int flags) { @@ -219,7 +219,7 @@ static void sdl_update_frame_format (xine_vo_driver_t *this_gen, /* * */ -static void sdl_overlay_blend (xine_vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay) { +static void sdl_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay) { sdl_frame_t *frame = (sdl_frame_t *) frame_gen; @@ -251,7 +251,7 @@ static void sdl_check_events (sdl_driver_t * this) } } -static int sdl_redraw_needed (xine_vo_driver_t *this_gen) { +static int sdl_redraw_needed (vo_driver_t *this_gen) { sdl_driver_t *this = (sdl_driver_t *) this_gen; int ret = 0; @@ -290,7 +290,7 @@ static int sdl_redraw_needed (xine_vo_driver_t *this_gen) { } -static void sdl_display_frame (xine_vo_driver_t *this_gen, vo_frame_t *frame_gen) { +static void sdl_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { sdl_driver_t *this = (sdl_driver_t *) this_gen; sdl_frame_t *frame = (sdl_frame_t *) frame_gen; @@ -331,7 +331,7 @@ static void sdl_display_frame (xine_vo_driver_t *this_gen, vo_frame_t *frame_gen pthread_mutex_unlock(&this->mutex); } -static int sdl_get_property (xine_vo_driver_t *this_gen, int property) { +static int sdl_get_property (vo_driver_t *this_gen, int property) { sdl_driver_t *this = (sdl_driver_t *) this_gen; @@ -360,7 +360,7 @@ static int sdl_set_property (vo_driver_t *this_gen, return value; } -static void sdl_get_property_min_max (xine_vo_driver_t *this_gen, +static void sdl_get_property_min_max (vo_driver_t *this_gen, int property, int *min, int *max) { /* sdl_driver_t *this = (sdl_driver_t *) this_gen; */ @@ -421,7 +421,7 @@ static int sdl_gui_data_exchange (vo_driver_t *this_gen, return ret; } -static void sdl_exit (xine_vo_driver_t *this_gen) { +static void sdl_exit (vo_driver_t *this_gen) { sdl_driver_t *this = (sdl_driver_t *) this_gen; diff --git a/src/video_out/video_out_syncfb.c b/src/video_out/video_out_syncfb.c index 2c1e79b9e..f321e10f4 100644 --- a/src/video_out/video_out_syncfb.c +++ b/src/video_out/video_out_syncfb.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_syncfb.c,v 1.78 2002/09/05 20:44:42 mroi Exp $ + * $Id: video_out_syncfb.c,v 1.79 2002/11/20 11:57:48 mroi Exp $ * * video_out_syncfb.c, SyncFB (for Matrox G200/G400 cards) interface for xine * @@ -78,7 +78,7 @@ typedef struct { struct syncfb_driver_s { - xine_vo_driver_t vo_driver; + vo_driver_t vo_driver; config_values_t *config; @@ -420,7 +420,7 @@ static void syncfb_compute_output_size(syncfb_driver_t *this) * public functions defined and used by the xine interface */ -static int syncfb_redraw_needed(xine_vo_driver_t* this_gen) +static int syncfb_redraw_needed(vo_driver_t* this_gen) { syncfb_driver_t* this = (syncfb_driver_t *) this_gen; @@ -438,7 +438,7 @@ static int syncfb_redraw_needed(xine_vo_driver_t* this_gen) return ret; } -static uint32_t syncfb_get_capabilities (xine_vo_driver_t *this_gen) +static uint32_t syncfb_get_capabilities (vo_driver_t *this_gen) { syncfb_driver_t *this = (syncfb_driver_t *) this_gen; @@ -460,7 +460,7 @@ static void syncfb_frame_dispose(vo_frame_t* vo_img) } } -static vo_frame_t* syncfb_alloc_frame(xine_vo_driver_t* this_gen) +static vo_frame_t* syncfb_alloc_frame(vo_driver_t* this_gen) { syncfb_frame_t* frame; @@ -488,7 +488,7 @@ static vo_frame_t* syncfb_alloc_frame(xine_vo_driver_t* this_gen) return (vo_frame_t *) frame; } -static void syncfb_update_frame_format(xine_vo_driver_t* this_gen, +static void syncfb_update_frame_format(vo_driver_t* this_gen, vo_frame_t* frame_gen, uint32_t width, uint32_t height, int ratio_code, int format, int flags) @@ -545,7 +545,7 @@ static void syncfb_update_frame_format(xine_vo_driver_t* this_gen, frame->ratio_code = ratio_code; } -static void syncfb_overlay_blend(xine_vo_driver_t* this_gen, vo_frame_t* frame_gen, vo_overlay_t* overlay) +static void syncfb_overlay_blend(vo_driver_t* this_gen, vo_frame_t* frame_gen, vo_overlay_t* overlay) { syncfb_frame_t* frame = (syncfb_frame_t *) frame_gen; @@ -558,7 +558,7 @@ static void syncfb_overlay_blend(xine_vo_driver_t* this_gen, vo_frame_t* frame_g } } -static void syncfb_display_frame(xine_vo_driver_t* this_gen, vo_frame_t* frame_gen) +static void syncfb_display_frame(vo_driver_t* this_gen, vo_frame_t* frame_gen) { syncfb_driver_t* this = (syncfb_driver_t *) this_gen; syncfb_frame_t* frame = (syncfb_frame_t *) frame_gen; @@ -631,14 +631,14 @@ static void syncfb_display_frame(xine_vo_driver_t* this_gen, vo_frame_t* frame_g this->bufinfo.id = -1; } -static int syncfb_get_property(xine_vo_driver_t* this_gen, int property) +static int syncfb_get_property(vo_driver_t* this_gen, int property) { syncfb_driver_t* this = (syncfb_driver_t *) this_gen; return this->props[property].value; } -static int syncfb_set_property(xine_vo_driver_t* this_gen, int property, int value) +static int syncfb_set_property(vo_driver_t* this_gen, int property, int value) { syncfb_driver_t* this = (syncfb_driver_t *) this_gen; @@ -745,7 +745,7 @@ static int syncfb_set_property(xine_vo_driver_t* this_gen, int property, int val return value; } -static void syncfb_get_property_min_max(xine_vo_driver_t *this_gen, +static void syncfb_get_property_min_max(vo_driver_t *this_gen, int property, int *min, int *max) { syncfb_driver_t* this = (syncfb_driver_t *) this_gen; @@ -790,7 +790,7 @@ static int syncfb_gui_data_exchange(vo_driver_t* this_gen, int data_type, return 0; } -static void syncfb_exit(xine_vo_driver_t *this_gen) +static void syncfb_exit(vo_driver_t *this_gen) { syncfb_driver_t *this = (syncfb_driver_t *) this_gen; diff --git a/src/video_out/video_out_vidix.c b/src/video_out/video_out_vidix.c index a7db5251f..3f598f6d3 100644 --- a/src/video_out/video_out_vidix.c +++ b/src/video_out/video_out_vidix.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_vidix.c,v 1.13 2002/11/04 22:48:14 f1rmb Exp $ + * $Id: video_out_vidix.c,v 1.14 2002/11/20 11:57:48 mroi Exp $ * * video_out_vidix.c * @@ -65,7 +65,7 @@ typedef struct vidix_frame_s { struct vidix_driver_s { - xine_vo_driver_t vo_driver; + vo_driver_t vo_driver; config_values_t *config; @@ -287,7 +287,7 @@ static void write_frame_sfb(vidix_driver_t* this, vidix_frame_t* frame) } -static uint32_t vidix_get_capabilities (xine_vo_driver_t *this_gen) { +static uint32_t vidix_get_capabilities (vo_driver_t *this_gen) { vidix_driver_t *this = (vidix_driver_t *) this_gen; @@ -306,7 +306,7 @@ static void vidix_frame_dispose (vo_frame_t *vo_img) { free (frame); } -static vo_frame_t *vidix_alloc_frame (xine_vo_driver_t *this_gen) { +static vo_frame_t *vidix_alloc_frame (vo_driver_t *this_gen) { vidix_frame_t *frame ; @@ -424,7 +424,7 @@ static void vidix_compute_output_size (vidix_driver_t *this) { this->vidix_started = 1; } -static void vidix_update_frame_format (xine_vo_driver_t *this_gen, +static void vidix_update_frame_format (vo_driver_t *this_gen, vo_frame_t *frame_gen, uint32_t width, uint32_t height, int ratio_code, int format, int flags) { @@ -479,7 +479,7 @@ static void vidix_update_frame_format (xine_vo_driver_t *this_gen, /* * */ -static void vidix_overlay_blend (xine_vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay) { +static void vidix_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay) { vidix_frame_t *frame = (vidix_frame_t *) frame_gen; @@ -491,7 +491,7 @@ static void vidix_overlay_blend (xine_vo_driver_t *this_gen, vo_frame_t *frame_g } } -static int vidix_redraw_needed (xine_vo_driver_t *this_gen) { +static int vidix_redraw_needed (vo_driver_t *this_gen) { vidix_driver_t *this = (vidix_driver_t *) this_gen; int ret = 0; @@ -507,7 +507,7 @@ static int vidix_redraw_needed (xine_vo_driver_t *this_gen) { } -static void vidix_display_frame (xine_vo_driver_t *this_gen, vo_frame_t *frame_gen) { +static void vidix_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { vidix_driver_t *this = (vidix_driver_t *) this_gen; vidix_frame_t *frame = (vidix_frame_t *) frame_gen; @@ -544,7 +544,7 @@ static void vidix_display_frame (xine_vo_driver_t *this_gen, vo_frame_t *frame_g pthread_mutex_unlock(&this->mutex); } -static int vidix_get_property (xine_vo_driver_t *this_gen, int property) { +static int vidix_get_property (vo_driver_t *this_gen, int property) { vidix_driver_t *this = (vidix_driver_t *) this_gen; @@ -561,7 +561,7 @@ static int vidix_get_property (xine_vo_driver_t *this_gen, int property) { } -static int vidix_set_property (xine_vo_driver_t *this_gen, +static int vidix_set_property (vo_driver_t *this_gen, int property, int value) { vidix_driver_t *this = (vidix_driver_t *) this_gen; @@ -600,7 +600,7 @@ static int vidix_set_property (xine_vo_driver_t *this_gen, return value; } -static void vidix_get_property_min_max (xine_vo_driver_t *this_gen, +static void vidix_get_property_min_max (vo_driver_t *this_gen, int property, int *min, int *max) { /* vidix_driver_t *this = (vidix_driver_t *) this_gen; */ @@ -611,7 +611,7 @@ static void vidix_get_property_min_max (xine_vo_driver_t *this_gen, } } -static int vidix_gui_data_exchange (xine_vo_driver_t *this_gen, +static int vidix_gui_data_exchange (vo_driver_t *this_gen, int data_type, void *data) { int ret = 0; @@ -659,7 +659,7 @@ static int vidix_gui_data_exchange (xine_vo_driver_t *this_gen, return ret; } -static void vidix_exit (xine_vo_driver_t *this_gen) { +static void vidix_exit (vo_driver_t *this_gen) { vidix_driver_t *this = (vidix_driver_t *) this_gen; @@ -669,7 +669,7 @@ static void vidix_exit (xine_vo_driver_t *this_gen) { vdlClose(this->vidix_handler); } -static xine_vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *visual_gen) { +static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *visual_gen) { vidix_class_t *class = (vidix_class_t *) class_gen; config_values_t *config = class->config; vidix_driver_t *this; @@ -796,6 +796,6 @@ static vo_info_t vo_info_vidix = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_OUT, 10, "vidix", XINE_VERSION_CODE, &vo_info_vidix, init_class }, + { PLUGIN_VIDEO_OUT, 11, "vidix", XINE_VERSION_CODE, &vo_info_vidix, init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c index be8413185..291918f6a 100644 --- a/src/video_out/video_out_xshm.c +++ b/src/video_out/video_out_xshm.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_xshm.c,v 1.94 2002/10/22 16:42:25 jkeil Exp $ + * $Id: video_out_xshm.c,v 1.95 2002/11/20 11:57:49 mroi Exp $ * * video_out_xshm.c, X11 shared memory extension interface for xine * @@ -90,7 +90,7 @@ typedef struct xshm_frame_s { typedef struct xshm_driver_s { - xine_vo_driver_t vo_driver; + vo_driver_t vo_driver; /* X11 / XShm related stuff */ Display *display; @@ -300,7 +300,7 @@ static void dispose_ximage (xshm_driver_t *this, * and now, the driver functions */ -static uint32_t xshm_get_capabilities (xine_vo_driver_t *this_gen) { +static uint32_t xshm_get_capabilities (vo_driver_t *this_gen) { return VO_CAP_COPIES_IMAGE | VO_CAP_YV12 | VO_CAP_YUY2 | VO_CAP_BRIGHTNESS; } @@ -376,7 +376,7 @@ static void xshm_frame_dispose (vo_frame_t *vo_img) { } -static vo_frame_t *xshm_alloc_frame (xine_vo_driver_t *this_gen) { +static vo_frame_t *xshm_alloc_frame (vo_driver_t *this_gen) { xshm_frame_t *frame ; xshm_driver_t *this = (xshm_driver_t *) this_gen; @@ -441,7 +441,7 @@ static void xshm_compute_rgb_size (xshm_driver_t *this, xshm_frame_t *frame) { #endif } -static void xshm_update_frame_format (xine_vo_driver_t *this_gen, +static void xshm_update_frame_format (vo_driver_t *this_gen, vo_frame_t *frame_gen, uint32_t width, uint32_t height, int ratio_code, int format, int flags) { @@ -623,7 +623,7 @@ static void xshm_overlay_clut_yuv2rgb(xshm_driver_t *this, vo_overlay_t *overla } } -static void xshm_overlay_blend (xine_vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay) { +static void xshm_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay) { xshm_driver_t *this = (xshm_driver_t *) this_gen; xshm_frame_t *frame = (xshm_frame_t *) frame_gen; @@ -676,7 +676,7 @@ static void clean_output_area (xshm_driver_t *this, xshm_frame_t *frame) { XUnlockDisplay (this->display); } -static int xshm_redraw_needed (xine_vo_driver_t *this_gen) { +static int xshm_redraw_needed (vo_driver_t *this_gen) { xshm_driver_t *this = (xshm_driver_t *) this_gen; int ret = 0; @@ -697,7 +697,7 @@ static int xshm_redraw_needed (xine_vo_driver_t *this_gen) { return ret; } -static void xshm_display_frame (xine_vo_driver_t *this_gen, vo_frame_t *frame_gen) { +static void xshm_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { xshm_driver_t *this = (xshm_driver_t *) this_gen; xshm_frame_t *frame = (xshm_frame_t *) frame_gen; @@ -788,7 +788,7 @@ static void xshm_display_frame (xine_vo_driver_t *this_gen, vo_frame_t *frame_ge #endif } -static int xshm_get_property (xine_vo_driver_t *this_gen, int property) { +static int xshm_get_property (vo_driver_t *this_gen, int property) { xshm_driver_t *this = (xshm_driver_t *) this_gen; @@ -807,7 +807,7 @@ static int xshm_get_property (xine_vo_driver_t *this_gen, int property) { return 0; } -static int xshm_set_property (xine_vo_driver_t *this_gen, +static int xshm_set_property (vo_driver_t *this_gen, int property, int value) { xshm_driver_t *this = (xshm_driver_t *) this_gen; @@ -836,7 +836,7 @@ static int xshm_set_property (xine_vo_driver_t *this_gen, return value; } -static void xshm_get_property_min_max (xine_vo_driver_t *this_gen, +static void xshm_get_property_min_max (vo_driver_t *this_gen, int property, int *min, int *max) { /* xshm_driver_t *this = (xshm_driver_t *) this_gen; */ @@ -849,7 +849,7 @@ static void xshm_get_property_min_max (xine_vo_driver_t *this_gen, } } -static int xshm_gui_data_exchange (xine_vo_driver_t *this_gen, +static int xshm_gui_data_exchange (vo_driver_t *this_gen, int data_type, void *data) { xshm_driver_t *this = (xshm_driver_t *) this_gen; @@ -959,7 +959,7 @@ static int xshm_gui_data_exchange (xine_vo_driver_t *this_gen, return 0; } -static void xshm_dispose (xine_vo_driver_t *this_gen) { +static void xshm_dispose (vo_driver_t *this_gen) { xshm_driver_t *this = (xshm_driver_t *) this_gen; @@ -1026,7 +1026,7 @@ static char *visual_class_name(Visual *visual) { } -static xine_vo_driver_t *xshm_open_plugin (video_driver_class_t *class_gen, const void *visual_gen) +static vo_driver_t *xshm_open_plugin (video_driver_class_t *class_gen, const void *visual_gen) { xshm_class_t *class = (xshm_class_t *) class_gen; config_values_t *config = class->config; @@ -1265,6 +1265,6 @@ static vo_info_t vo_info_xshm = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_OUT, 10, "xshm", XINE_VERSION_CODE, &vo_info_xshm, xshm_init_class }, + { PLUGIN_VIDEO_OUT, 11, "xshm", XINE_VERSION_CODE, &vo_info_xshm, xshm_init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index bed8eb06e..ef4e04a6e 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_xv.c,v 1.149 2002/11/10 20:35:50 storri Exp $ + * $Id: video_out_xv.c,v 1.150 2002/11/20 11:57:49 mroi Exp $ * * video_out_xv.c, X11 video extension interface for xine * @@ -98,7 +98,7 @@ typedef struct { struct xv_driver_s { - xine_vo_driver_t vo_driver; + vo_driver_t vo_driver; config_values_t *config; @@ -145,7 +145,7 @@ typedef struct { int gX11Fail; -static uint32_t xv_get_capabilities (xine_vo_driver_t *this_gen) { +static uint32_t xv_get_capabilities (vo_driver_t *this_gen) { xv_driver_t *this = (xv_driver_t *) this_gen; @@ -182,7 +182,7 @@ static void xv_frame_dispose (vo_frame_t *vo_img) { free (frame); } -static vo_frame_t *xv_alloc_frame (xine_vo_driver_t *this_gen) { +static vo_frame_t *xv_alloc_frame (vo_driver_t *this_gen) { xv_frame_t *frame ; @@ -382,7 +382,7 @@ static void dispose_ximage (xv_driver_t *this, } } -static void xv_update_frame_format (xine_vo_driver_t *this_gen, +static void xv_update_frame_format (vo_driver_t *this_gen, vo_frame_t *frame_gen, uint32_t width, uint32_t height, int ratio_code, int format, int flags) { @@ -577,7 +577,7 @@ static void xv_compute_output_size (xv_driver_t *this) { } } -static void xv_overlay_blend (xine_vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay) { +static void xv_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay) { xv_frame_t *frame = (xv_frame_t *) frame_gen; @@ -623,7 +623,7 @@ static void xv_flush_recent_frames (xv_driver_t *this) { } #endif -static int xv_redraw_needed (xine_vo_driver_t *this_gen) { +static int xv_redraw_needed (vo_driver_t *this_gen) { xv_driver_t *this = (xv_driver_t *) this_gen; int ret = 0; @@ -650,7 +650,7 @@ static int xv_redraw_needed (xine_vo_driver_t *this_gen) { return ret; } -static void xv_display_frame (xine_vo_driver_t *this_gen, vo_frame_t *frame_gen) { +static void xv_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { xv_driver_t *this = (xv_driver_t *) this_gen; xv_frame_t *frame = (xv_frame_t *) frame_gen; @@ -735,7 +735,7 @@ static void xv_display_frame (xine_vo_driver_t *this_gen, vo_frame_t *frame_gen) */ } -static int xv_get_property (xine_vo_driver_t *this_gen, int property) { +static int xv_get_property (vo_driver_t *this_gen, int property) { xv_driver_t *this = (xv_driver_t *) this_gen; @@ -756,7 +756,7 @@ static void xv_property_callback (void *property_gen, xine_cfg_entry_t *entry) { } -static int xv_set_property (xine_vo_driver_t *this_gen, +static int xv_set_property (vo_driver_t *this_gen, int property, int value) { xv_driver_t *this = (xv_driver_t *) this_gen; @@ -833,7 +833,7 @@ static int xv_set_property (xine_vo_driver_t *this_gen, return value; } -static void xv_get_property_min_max (xine_vo_driver_t *this_gen, +static void xv_get_property_min_max (vo_driver_t *this_gen, int property, int *min, int *max) { xv_driver_t *this = (xv_driver_t *) this_gen; @@ -842,7 +842,7 @@ static void xv_get_property_min_max (xine_vo_driver_t *this_gen, *max = this->props[property].max; } -static int xv_gui_data_exchange (xine_vo_driver_t *this_gen, +static int xv_gui_data_exchange (vo_driver_t *this_gen, int data_type, void *data) { xv_driver_t *this = (xv_driver_t *) this_gen; @@ -940,7 +940,7 @@ static int xv_gui_data_exchange (xine_vo_driver_t *this_gen, return 0; } -static void xv_dispose (xine_vo_driver_t *this_gen) { +static void xv_dispose (vo_driver_t *this_gen) { xv_driver_t *this = (xv_driver_t *) this_gen; int i; @@ -1074,7 +1074,7 @@ static void xv_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry) } -static xine_vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *visual_gen) { +static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *visual_gen) { xv_class_t *class = (xv_class_t *) class_gen; config_values_t *config = class->config; @@ -1388,7 +1388,7 @@ static vo_info_t vo_info_xv = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_OUT, 10, "xv", XINE_VERSION_CODE, &vo_info_xv, init_class }, + { PLUGIN_VIDEO_OUT, 11, "xv", XINE_VERSION_CODE, &vo_info_xv, init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/xine-engine/audio_decoder.h b/src/xine-engine/audio_decoder.h index 847ff9736..fec946f5a 100644 --- a/src/xine-engine/audio_decoder.h +++ b/src/xine-engine/audio_decoder.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_decoder.h,v 1.6 2002/11/12 18:40:54 miguelfreitas Exp $ + * $Id: audio_decoder.h,v 1.7 2002/11/20 11:57:49 mroi Exp $ * * xine audio decoder plugin interface * @@ -29,7 +29,7 @@ #include #include "buffer.h" -#define AUDIO_DECODER_IFACE_VERSION 11 +#define AUDIO_DECODER_IFACE_VERSION 12 /* * generic xine audio decoder plugin interface diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c index 18ca40cd5..2421336b7 100644 --- a/src/xine-engine/audio_out.c +++ b/src/xine-engine/audio_out.c @@ -17,7 +17,7 @@ * along with self program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_out.c,v 1.82 2002/11/18 15:53:31 heikos Exp $ + * $Id: audio_out.c,v 1.83 2002/11/20 11:57:49 mroi Exp $ * * 22-8-2001 James imported some useful AC3 sections from the previous alsa driver. * (c) 2001 Andy Lo A Foe @@ -207,7 +207,7 @@ static audio_buffer_t *fifo_remove (audio_fifo_t *fifo) { } -void write_pause_burst(ao_instance_t *this, uint32_t num_frames) { +void write_pause_burst(xine_audio_port_t *this, uint32_t num_frames) { int error = 0; unsigned char buf[8192]; @@ -245,7 +245,7 @@ void write_pause_burst(ao_instance_t *this, uint32_t num_frames) { } -static void ao_fill_gap (ao_instance_t *this, int64_t pts_len) { +static void ao_fill_gap (xine_audio_port_t *this, int64_t pts_len) { int num_frames ; @@ -286,7 +286,7 @@ static void ensure_buffer_size (audio_buffer_t *buf, int bytes_per_frame, buf->num_frames = frames; } -static audio_buffer_t * swap_frame_buffers ( ao_instance_t *this ) { +static audio_buffer_t * swap_frame_buffers ( xine_audio_port_t *this ) { audio_buffer_t *tmp; tmp = this->frame_buf[1]; @@ -311,7 +311,7 @@ static int mode_channels( int mode ) { return 0; } -static void audio_filter_compress (ao_instance_t *this, int16_t *mem, int num_frames) { +static void audio_filter_compress (xine_audio_port_t *this, int16_t *mem, int num_frames) { int i, maxs; double f_max; @@ -354,7 +354,7 @@ static void audio_filter_compress (ao_instance_t *this, int16_t *mem, int num_fr mem [i] = mem[i] * this->compression_factor; } -static audio_buffer_t* prepare_samples( ao_instance_t *this, audio_buffer_t *buf) { +static audio_buffer_t* prepare_samples( xine_audio_port_t *this, audio_buffer_t *buf) { double acc_output_frames, output_frame_excess = 0; int num_output_frames ; @@ -488,7 +488,7 @@ static audio_buffer_t* prepare_samples( ao_instance_t *this, audio_buffer_t *bu */ static void *ao_loop (void *this_gen) { - ao_instance_t *this = (ao_instance_t *) this_gen; + xine_audio_port_t *this = (xine_audio_port_t *) this_gen; int64_t hw_vpts; audio_buffer_t *in_buf, *out_buf; int64_t gap; @@ -537,7 +537,7 @@ static void *ao_loop (void *this_gen) { if (this->audio_paused == 1) { - cur_time = this->metronom->get_current_time (this->metronom); + cur_time = this->clock->get_current_time (this->clock); if (in_buf->vpts < cur_time ) { #ifdef LOG printf ("audio_out:loop: next fifo\n"); @@ -573,7 +573,7 @@ static void *ao_loop (void *this_gen) { * hardware audio buffer at the moment? */ - cur_time = this->metronom->get_current_time (this->metronom); + cur_time = this->clock->get_current_time (this->clock); hw_vpts = cur_time; #ifdef LOG @@ -621,13 +621,19 @@ static void *ao_loop (void *this_gen) { } else if ( abs(gap) < AO_MAX_GAP && abs(gap) > this->gap_tolerance && cur_time > (last_sync_time + SYNC_TIME_INVERVAL) && bufs_since_sync >= SYNC_BUF_INTERVAL ) { + xine_stream_t *stream; #ifdef LOG printf ("audio_out: audio_loop: ADJ_VPTS\n"); #endif - this->metronom->set_option(this->metronom, METRONOM_ADJ_VPTS_OFFSET, - -gap/SYNC_GAP_RATE ); - last_sync_time = cur_time; - bufs_since_sync = 0; + pthread_mutex_lock(&this->streams_lock); + for (stream = xine_list_first_content(this->streams); stream; + stream = xine_list_next_content(this->streams)) { + stream->metronom->set_option(stream->metronom, METRONOM_ADJ_VPTS_OFFSET, + -gap/SYNC_GAP_RATE ); + last_sync_time = cur_time; + bufs_since_sync = 0; + } + pthread_mutex_unlock(&this->streams_lock); } else if ( gap > AO_MAX_GAP ) { /* for big gaps output silence */ @@ -684,7 +690,7 @@ static void *ao_loop (void *this_gen) { * open the audio device for writing to, start audio output thread */ -static int ao_open(ao_instance_t *this, +static int ao_open(xine_audio_port_t *this, xine_stream_t *stream, uint32_t bits, uint32_t rate, int mode) { int output_sample_rate, err; @@ -693,31 +699,36 @@ static int ao_open(ao_instance_t *this, /* * set metainfo */ - - switch (mode) { - case AO_CAP_MODE_MONO: - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_CHANNELS] = 1; - break; - case AO_CAP_MODE_STEREO: - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_CHANNELS] = 2; - break; - case AO_CAP_MODE_4CHANNEL: - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_CHANNELS] = 4; - break; - case AO_CAP_MODE_5CHANNEL: - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_CHANNELS] = 5; - break; - case AO_CAP_MODE_5_1CHANNEL: - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_CHANNELS] = 6; - break; - case AO_CAP_MODE_A52: - case AO_CAP_MODE_AC5: - default: - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_CHANNELS] = 255; /* unknown */ - } + pthread_mutex_lock(&this->streams_lock); + xine_list_append_content(this->streams, stream); + for (stream = xine_list_first_content(this->streams); stream; + stream = xine_list_next_content(this->streams)) { + switch (mode) { + case AO_CAP_MODE_MONO: + stream->stream_info[XINE_STREAM_INFO_AUDIO_CHANNELS] = 1; + break; + case AO_CAP_MODE_STEREO: + stream->stream_info[XINE_STREAM_INFO_AUDIO_CHANNELS] = 2; + break; + case AO_CAP_MODE_4CHANNEL: + stream->stream_info[XINE_STREAM_INFO_AUDIO_CHANNELS] = 4; + break; + case AO_CAP_MODE_5CHANNEL: + stream->stream_info[XINE_STREAM_INFO_AUDIO_CHANNELS] = 5; + break; + case AO_CAP_MODE_5_1CHANNEL: + stream->stream_info[XINE_STREAM_INFO_AUDIO_CHANNELS] = 6; + break; + case AO_CAP_MODE_A52: + case AO_CAP_MODE_AC5: + default: + stream->stream_info[XINE_STREAM_INFO_AUDIO_CHANNELS] = 255; /* unknown */ + } - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_BITS] = bits; - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_SAMPLERATE] = rate; + stream->stream_info[XINE_STREAM_INFO_AUDIO_BITS] = bits; + stream->stream_info[XINE_STREAM_INFO_AUDIO_SAMPLERATE] = rate; + } + pthread_mutex_unlock(&this->streams_lock); this->input.mode = mode; this->input.rate = rate; @@ -781,7 +792,11 @@ static int ao_open(ao_instance_t *this, printf ("audio_out : audio_step %d pts per 32768 frames\n", this->audio_step); #endif - this->metronom->set_audio_rate(this->metronom, this->audio_step); + pthread_mutex_lock(&this->streams_lock); + for (stream = xine_list_first_content(this->streams); stream; + stream = xine_list_next_content(this->streams)) + stream->metronom->set_audio_rate(stream->metronom, this->audio_step); + pthread_mutex_unlock(&this->streams_lock); /* * start output thread @@ -811,11 +826,11 @@ static int ao_open(ao_instance_t *this, return this->output.rate; } -static audio_buffer_t *ao_get_buffer (ao_instance_t *this) { +static audio_buffer_t *ao_get_buffer (xine_audio_port_t *this) { return fifo_remove (this->free_fifo); } -static void ao_put_buffer (ao_instance_t *this, audio_buffer_t *buf) { +static void ao_put_buffer (xine_audio_port_t *this, audio_buffer_t *buf, xine_stream_t *stream) { int64_t pts; @@ -826,8 +841,8 @@ static void ao_put_buffer (ao_instance_t *this, audio_buffer_t *buf) { pts = buf->vpts; - buf->vpts = this->metronom->got_audio_samples (this->metronom, pts, - buf->num_frames); + buf->vpts = stream->metronom->got_audio_samples (stream->metronom, pts, + buf->num_frames); #ifdef LOG printf ("audio_out: ao_put_buffer, pts=%lld, vpts=%lld\n", @@ -854,9 +869,10 @@ static void ao_put_buffer (ao_instance_t *this, audio_buffer_t *buf) { #endif } -static void ao_close(ao_instance_t *this) { +static void ao_close(xine_audio_port_t *this, xine_stream_t *stream) { audio_buffer_t *audio_buffer; + xine_stream_t *cur; if (this->audio_loop_running) { void *p; @@ -871,13 +887,23 @@ static void ao_close(ao_instance_t *this) { pthread_join (this->audio_thread, &p); this->audio_thread = 0; } + + /* unregister stream */ + pthread_mutex_lock(&this->streams_lock); + for (cur = xine_list_first_content(this->streams); cur; + cur = xine_list_next_content(this->streams)) + if (cur == stream) { + xine_list_delete_current(this->streams); + break; + } + pthread_mutex_unlock(&this->streams_lock); pthread_mutex_lock( &this->driver_lock ); this->driver->close(this->driver); pthread_mutex_unlock( &this->driver_lock ); } -static void ao_exit(ao_instance_t *this) { +static void ao_exit(xine_audio_port_t *this) { int vol; int prop = 0; @@ -894,6 +920,10 @@ static void ao_exit(ao_instance_t *this) { this->xine->config->update_num(this->xine->config, "audio.mixer_volume", vol); this->driver->exit(this->driver); pthread_mutex_unlock( &this->driver_lock ); + + pthread_mutex_destroy(&this->driver_lock); + pthread_mutex_destroy(&this->streams_lock); + xine_list_free(this->streams); free (this->frame_buf[0]->mem); free (this->frame_buf[0]); @@ -930,7 +960,7 @@ static void ao_exit(ao_instance_t *this) { free (this); } -static uint32_t ao_get_capabilities (ao_instance_t *this) { +static uint32_t ao_get_capabilities (xine_audio_port_t *this) { uint32_t result; pthread_mutex_lock( &this->driver_lock ); @@ -940,7 +970,7 @@ static uint32_t ao_get_capabilities (ao_instance_t *this) { return result; } -static int ao_get_property (ao_instance_t *this, int property) { +static int ao_get_property (xine_audio_port_t *this, int property) { int ret; switch (property) { @@ -956,7 +986,7 @@ static int ao_get_property (ao_instance_t *this, int property) { return ret; } -static int ao_set_property (ao_instance_t *this, int property, int value) { +static int ao_set_property (xine_audio_port_t *this, int property, int value) { int ret; switch (property) { @@ -977,7 +1007,7 @@ static int ao_set_property (ao_instance_t *this, int property, int value) { return ret; } -static int ao_control (ao_instance_t *this, int cmd, ...) { +static int ao_control (xine_audio_port_t *this, int cmd, ...) { va_list args; void *arg; @@ -993,7 +1023,7 @@ static int ao_control (ao_instance_t *this, int cmd, ...) { return rval; } -static void ao_flush (ao_instance_t *this) { +static void ao_flush (xine_audio_port_t *this) { audio_buffer_t *buf; int i, num_buffers; @@ -1023,20 +1053,21 @@ static void ao_flush (ao_instance_t *this) { pthread_mutex_unlock (&this->out_fifo->mutex); } -ao_instance_t *ao_new_instance (xine_ao_driver_t *driver, - xine_stream_t *stream) { +xine_audio_port_t *ao_new_port (xine_t *xine, ao_driver_t *driver) { - config_values_t *config = stream->xine->config; - ao_instance_t *this; + config_values_t *config = xine->config; + xine_audio_port_t *this; int i; static char *resample_modes[] = {"auto", "off", "on", NULL}; - this = xine_xmalloc (sizeof (ao_instance_t)) ; + this = xine_xmalloc (sizeof (xine_audio_port_t)) ; this->driver = driver; - this->metronom = stream->metronom; - this->xine = stream->xine; - this->stream = stream; + this->xine = xine; + this->clock = xine->clock; + this->streams = xine_list_new(); + + pthread_mutex_init( &this->streams_lock, NULL ); pthread_mutex_init( &this->driver_lock, NULL ); this->open = ao_open; diff --git a/src/xine-engine/audio_out.h b/src/xine-engine/audio_out.h index 5e1cedaa4..a839f628c 100644 --- a/src/xine-engine/audio_out.h +++ b/src/xine-engine/audio_out.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_out.h,v 1.40 2002/10/29 16:02:47 mroi Exp $ + * $Id: audio_out.h,v 1.41 2002/11/20 11:57:49 mroi Exp $ */ #ifndef HAVE_AUDIO_OUT_H #define HAVE_AUDIO_OUT_H @@ -31,20 +31,24 @@ extern "C" { #if defined(XINE_COMPILE) #include "metronom.h" #include "configfile.h" +#include "xineutils.h" #else #include #include +#inlcude #endif -#define AUDIO_OUT_IFACE_VERSION 5 +#define AUDIO_OUT_IFACE_VERSION 6 /* * ao_driver_s contains the driver every audio output * driver plugin has to implement. */ -struct xine_ao_driver_s { +typedef struct ao_driver_s ao_driver_t; + +struct ao_driver_s { /* * @@ -53,7 +57,7 @@ struct xine_ao_driver_s { * * See AO_CAP_* bellow. */ - uint32_t (*get_capabilities) (xine_ao_driver_t *this); + uint32_t (*get_capabilities) (ao_driver_t *this); /* * open the driver and make it ready to receive audio data @@ -61,26 +65,26 @@ struct xine_ao_driver_s { * * return value: 0 : failure, >0 : output sample rate */ - int (*open)(xine_ao_driver_t *this, uint32_t bits, uint32_t rate, int mode); + int (*open)(ao_driver_t *this, uint32_t bits, uint32_t rate, int mode); /* return the number of audio channels */ - int (*num_channels)(xine_ao_driver_t *self_gen); + 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)(xine_ao_driver_t *self_gen); + 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)(xine_ao_driver_t *self_gen); + int (*delay)(ao_driver_t *self_gen); /* * return gap tolerance (in pts) needed for this driver */ - int (*get_gap_tolerance) (xine_ao_driver_t *self_gen); + int (*get_gap_tolerance) (ao_driver_t *self_gen); /* * write audio data to output buffer @@ -90,20 +94,20 @@ struct xine_ao_driver_s { * 0 => audio samples were not yet processed, * call write_audio_data with the _same_ samples again */ - int (*write)(xine_ao_driver_t *this, + int (*write)(ao_driver_t *this, 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)(xine_ao_driver_t *this); + void (*close)(ao_driver_t *this); /* * shut down this audio output driver plugin and * free all resources allocated */ - void (*exit) (xine_ao_driver_t *this); + void (*exit) (ao_driver_t *this); /* * Get, Set a property of audio driver. @@ -113,9 +117,9 @@ struct xine_ao_driver_s { * * See AO_PROP_* below for available properties. */ - int (*get_property) (xine_ao_driver_t *this, int property); + int (*get_property) (ao_driver_t *this, int property); - int (*set_property) (xine_ao_driver_t *this, int property, int value); + int (*set_property) (ao_driver_t *this, int property, int value); /* @@ -123,13 +127,13 @@ struct xine_ao_driver_s { * * See AO_CTRL_* below. */ - int (*control) (xine_ao_driver_t *this, int cmd, /* arg */ ...); + int (*control) (ao_driver_t *this, int cmd, /* arg */ ...); void *node; }; /* - * ao_instance_s contains the instance every audio decoder talks to + * ao_port_s contains the port every audio decoder talks to */ typedef struct audio_fifo_s audio_fifo_t; @@ -156,63 +160,63 @@ struct ao_format_s { int mode; }; -typedef struct ao_instance_s ao_instance_t; - -struct ao_instance_s { - uint32_t (*get_capabilities) (ao_instance_t *this); /* for constants see below */ +struct xine_audio_port_s { + uint32_t (*get_capabilities) (xine_audio_port_t *this); /* for constants see below */ /* * Get/Set audio property * * See AO_PROP_* bellow */ - int (*get_property) (ao_instance_t *this, int property); - int (*set_property) (ao_instance_t *this, int property, int value); + int (*get_property) (xine_audio_port_t *this, int property); + int (*set_property) (xine_audio_port_t *this, int property, int value); /* open audio driver for audio output * return value: 0:failure, >0:output sample rate */ - int (*open) (ao_instance_t *this, + int (*open) (xine_audio_port_t *this, 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) (ao_instance_t *this); + audio_buffer_t * (*get_buffer) (xine_audio_port_t *this); /* * append a buffer filled with audio data to the audio fifo * for output */ - void (*put_buffer) (ao_instance_t *this, audio_buffer_t *buf); + void (*put_buffer) (xine_audio_port_t *this, audio_buffer_t *buf, xine_stream_t *stream); /* audio driver is no longer used by decoder => close */ - void (*close) (ao_instance_t *self); + void (*close) (xine_audio_port_t *self, xine_stream_t *stream); /* called on xine exit */ - void (*exit) (ao_instance_t *this); + void (*exit) (xine_audio_port_t *this); /* * misc control operations on the audio device. * * See AO_CTRL_* below. */ - int (*control) (ao_instance_t *this, int cmd, /* arg */ ...); + int (*control) (xine_audio_port_t *this, int cmd, /* arg */ ...); /* * Flush audio_out fifo. */ - void (*flush) (ao_instance_t *this); + void (*flush) (xine_audio_port_t *this); + /* the driver in use */ + ao_driver_t *driver; + /* private stuff */ - - xine_ao_driver_t *driver; pthread_mutex_t driver_lock; - metronom_t *metronom; - xine_stream_t *stream; + metronom_clock_t *clock; xine_t *xine; + xine_list_t *streams; + pthread_mutex_t streams_lock; int audio_loop_running; int audio_paused; @@ -242,6 +246,7 @@ struct ao_instance_s { int do_compress; double compression_factor; /* current compression */ double compression_factor_max; /* user limit on compression */ + }; typedef struct audio_driver_class_s audio_driver_class_t; @@ -251,7 +256,7 @@ struct audio_driver_class_s { /* * open a new instance of this plugin class */ - xine_ao_driver_t* (*open_plugin) (audio_driver_class_t *this, const void *data); + ao_driver_t* (*open_plugin) (audio_driver_class_t *this, const void *data); /* * return short, human readable identifier for this plugin class @@ -275,8 +280,7 @@ struct audio_driver_class_s { * this initiates the audio_out sync routines * found in ./src/xine-engine/audio_out.c */ -ao_instance_t *ao_new_instance (xine_ao_driver_t *driver, - xine_stream_t *stream) ; +xine_audio_port_t *ao_new_port (xine_t *xine, ao_driver_t *driver) ; /* * audio output modes + capabilities diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c index 5b7138cd1..54edcbe97 100644 --- a/src/xine-engine/demux.c +++ b/src/xine-engine/demux.c @@ -66,8 +66,8 @@ void xine_demux_flush_engine (xine_stream_t *stream) { stream->audio_out->flush(stream->audio_out); } - stream->metronom->adjust_clock(stream->metronom, - stream->metronom->get_current_time(stream->metronom) + 30 * 90000 ); + stream->xine->clock->adjust_clock(stream->xine->clock, + stream->xine->clock->get_current_time(stream->xine->clock) + 30 * 90000 ); } diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index b838f589e..5a82607a7 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: load_plugins.c,v 1.113 2002/11/14 19:45:01 esnel Exp $ + * $Id: load_plugins.c,v 1.114 2002/11/20 11:57:49 mroi Exp $ * * * Load input/demux/audio_out/video_out/codec plugins @@ -816,10 +816,10 @@ const char *xine_get_input_plugin_description (xine_t *this, const char *plugin_ * video out plugins section */ -static xine_vo_driver_t *_load_video_driver (xine_t *this, plugin_node_t *node, - void *data) { +static vo_driver_t *_load_video_driver (xine_t *this, plugin_node_t *node, + void *data) { - xine_vo_driver_t *driver; + vo_driver_t *driver; if (!node->plugin_class) node->plugin_class = _load_plugin_class (this, node->filename, node->info, data); @@ -843,12 +843,13 @@ static xine_vo_driver_t *_load_video_driver (xine_t *this, plugin_node_t *node, return driver; } -xine_vo_driver_t *xine_open_video_driver (xine_t *this, - const char *id, - int visual_type, void *visual) { +xine_video_port_t *xine_open_video_driver (xine_t *this, + const char *id, + int visual_type, void *visual) { plugin_node_t *node; - xine_vo_driver_t *driver; + vo_driver_t *driver; + xine_video_port_t *port; vo_info_t *vo_info; plugin_catalog_t *catalog = this->plugin_catalog; @@ -895,7 +896,9 @@ xine_vo_driver_t *xine_open_video_driver (xine_t *this, pthread_mutex_unlock (&catalog->lock); - return driver; + port = vo_new_port(this, driver); + + return port; } /* @@ -958,10 +961,10 @@ const char *const *xine_list_video_output_plugins (xine_t *this) { return catalog->ids; } -static xine_ao_driver_t *_load_audio_driver (xine_t *this, plugin_node_t *node, - void *data) { +static ao_driver_t *_load_audio_driver (xine_t *this, plugin_node_t *node, + void *data) { - xine_ao_driver_t *driver; + ao_driver_t *driver; if (!node->plugin_class) node->plugin_class = _load_plugin_class (this, node->filename, node->info, data); @@ -985,11 +988,12 @@ static xine_ao_driver_t *_load_audio_driver (xine_t *this, plugin_node_t *node, return driver; } -xine_ao_driver_t *xine_open_audio_driver (xine_t *this, const char *id, - void *data) { +xine_audio_port_t *xine_open_audio_driver (xine_t *this, const char *id, + void *data) { plugin_node_t *node; - xine_ao_driver_t *driver; + ao_driver_t *driver; + xine_audio_port_t *port; ao_info_t *ao_info; plugin_catalog_t *catalog = this->plugin_catalog; @@ -1035,16 +1039,18 @@ xine_ao_driver_t *xine_open_audio_driver (xine_t *this, const char *id, } pthread_mutex_unlock (&catalog->lock); + + port = ao_new_port(this, driver); - return driver; + return port; } -void xine_close_audio_driver (xine_t *this, xine_ao_driver_t *driver) { +void xine_close_audio_driver (xine_t *this, xine_audio_port_t *driver) { /* FIXME : implement */ } -void xine_close_video_driver (xine_t *this, xine_vo_driver_t *driver) { +void xine_close_video_driver (xine_t *this, xine_video_port_t *driver) { /* FIXME : implement */ diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c index a8ab454b6..faf803c96 100644 --- a/src/xine-engine/metronom.c +++ b/src/xine-engine/metronom.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: metronom.c,v 1.101 2002/11/19 00:45:42 miguelfreitas Exp $ + * $Id: metronom.c,v 1.102 2002/11/20 11:57:49 mroi Exp $ */ #ifdef HAVE_CONFIG_H @@ -198,28 +198,30 @@ static scr_plugin_t* unixscr_init () { */ -static void metronom_start_clock (metronom_t *this, int64_t pts) { +static void metronom_start_clock (metronom_clock_t *this, int64_t pts) { scr_plugin_t** scr; printf ("metronom: start_clock (at %lld)\n", pts); for (scr = this->scr_list; scr < this->scr_list+MAX_SCR_PROVIDERS; scr++) if (*scr) (*scr)->start(*scr, pts); + + this->speed = XINE_SPEED_NORMAL; } -static int64_t metronom_get_current_time (metronom_t *this) { +static int64_t metronom_get_current_time (metronom_clock_t *this) { return this->scr_master->get_current(this->scr_master); } -static void metronom_stop_clock(metronom_t *this) { +static void metronom_stop_clock(metronom_clock_t *this) { scr_plugin_t** scr; for (scr = this->scr_list; scr < this->scr_list+MAX_SCR_PROVIDERS; scr++) if (*scr) (*scr)->set_speed(*scr, XINE_SPEED_PAUSE); } -static void metronom_resume_clock(metronom_t *this) { +static void metronom_resume_clock(metronom_clock_t *this) { scr_plugin_t** scr; for (scr = this->scr_list; scr < this->scr_list+MAX_SCR_PROVIDERS; scr++) if (*scr) (*scr)->set_speed(*scr, XINE_SPEED_NORMAL); @@ -227,17 +229,19 @@ static void metronom_resume_clock(metronom_t *this) { -static void metronom_adjust_clock(metronom_t *this, int64_t desired_pts) { +static void metronom_adjust_clock(metronom_clock_t *this, int64_t desired_pts) { if (this->scr_adjustable) this->scr_master->adjust(this->scr_master, desired_pts); } -static int metronom_set_speed (metronom_t *this, int speed) { +static int metronom_set_speed (metronom_clock_t *this, int speed) { scr_plugin_t **scr; int true_speed; true_speed = this->scr_master->set_speed (this->scr_master, speed); + + this->speed = true_speed; for (scr = this->scr_list; scr < this->scr_list+MAX_SCR_PROVIDERS; scr++) if (*scr) (*scr)->set_speed(*scr, true_speed); @@ -554,9 +558,6 @@ static void metronom_set_option (metronom_t *this, int option, int64_t value) { this->av_offset = value; printf ("metronom: av_offset=%lld pts\n", this->av_offset); break; - case METRONOM_SCR_ADJUSTABLE: - this->scr_adjustable = value; - break; case METRONOM_ADJ_VPTS_OFFSET: this->vpts_offset += value; #ifdef LOG @@ -571,11 +572,36 @@ static void metronom_set_option (metronom_t *this, int option, int64_t value) { pthread_mutex_unlock (&this->lock); } +static void metronom_clock_set_option (metronom_clock_t *this, + int option, int64_t value) { + + pthread_mutex_lock (&this->lock); + + switch (option) { + case CLOCK_SCR_ADJUSTABLE: + this->scr_adjustable = value; + break; + default: + printf ("metronom: unknown option in set_option: %d\n", + option); + } + + pthread_mutex_unlock (&this->lock); +} + static int64_t metronom_get_option (metronom_t *this, int option) { switch (option) { case METRONOM_AV_OFFSET: return this->av_offset; - case METRONOM_SCR_ADJUSTABLE: + } + printf ("metronom: unknown option in get_option: %d\n", + option); + return 0; +} + +static int64_t metronom_clock_get_option (metronom_clock_t *this, int option) { + switch (option) { + case CLOCK_SCR_ADJUSTABLE: return this->scr_adjustable; } printf ("metronom: unknown option in get_option: %d\n", @@ -583,7 +609,7 @@ static int64_t metronom_get_option (metronom_t *this, int option) { return 0; } -static scr_plugin_t* get_master_scr(metronom_t *this) { +static scr_plugin_t* get_master_scr(metronom_clock_t *this) { int select = -1, maxprio = 0, i; /* find the SCR provider with the highest priority */ @@ -602,7 +628,7 @@ static scr_plugin_t* get_master_scr(metronom_t *this) { return this->scr_list[select]; } -static int metronom_register_scr (metronom_t *this, scr_plugin_t *scr) { +static int metronom_register_scr (metronom_clock_t *this, scr_plugin_t *scr) { int i; if (scr->interface_version != 2) return -1; @@ -612,13 +638,13 @@ static int metronom_register_scr (metronom_t *this, scr_plugin_t *scr) { if (i >= MAX_SCR_PROVIDERS) return -1; /* No free slot available */ - scr->metronom = this; + scr->clock = this; this->scr_list[i] = scr; this->scr_master = get_master_scr(this); return 0; } -static void metronom_unregister_scr (metronom_t *this, scr_plugin_t *scr) { +static void metronom_unregister_scr (metronom_clock_t *this, scr_plugin_t *scr) { int i; int64_t time; @@ -640,22 +666,22 @@ static void metronom_unregister_scr (metronom_t *this, scr_plugin_t *scr) { this->scr_master = get_master_scr(this); } -static int metronom_sync_loop (metronom_t *this) { +static int metronom_sync_loop (metronom_clock_t *this) { struct timeval tv; struct timespec ts; scr_plugin_t** scr; int64_t pts; - while (this->stream->status != XINE_STATUS_QUIT) { + while (this->thread_running) { + /* synchronise every 5 seconds */ + pthread_mutex_lock (&this->lock); + pts = this->scr_master->get_current(this->scr_master); for (scr = this->scr_list; scr < this->scr_list+MAX_SCR_PROVIDERS; scr++) if (*scr && *scr != this->scr_master) (*scr)->adjust(*scr, pts); - /* synchronise every 5 seconds */ - pthread_mutex_lock (&this->lock); - gettimeofday(&tv, NULL); ts.tv_sec = tv.tv_sec + 5; ts.tv_nsec = tv.tv_usec * 1000; @@ -668,8 +694,19 @@ static int metronom_sync_loop (metronom_t *this) { static void metronom_exit (metronom_t *this) { + pthread_mutex_destroy (&this->lock); + pthread_cond_destroy (&this->video_discontinuity_reached); + pthread_cond_destroy (&this->audio_discontinuity_reached); + + free (this); +} + +static void metronom_clock_exit (metronom_clock_t *this) { + scr_plugin_t** scr; + this->thread_running = 0; + pthread_mutex_lock (&this->lock); pthread_cond_signal (&this->cancel); pthread_mutex_unlock (&this->lock); @@ -677,8 +714,6 @@ static void metronom_exit (metronom_t *this) { pthread_join (this->sync_thread, NULL); pthread_mutex_destroy (&this->lock); - pthread_cond_destroy (&this->video_discontinuity_reached); - pthread_cond_destroy (&this->audio_discontinuity_reached); pthread_cond_destroy (&this->cancel); for (scr = this->scr_list; scr < this->scr_list+MAX_SCR_PROVIDERS; scr++) @@ -692,9 +727,9 @@ static void metronom_exit (metronom_t *this) { metronom_t * metronom_init (int have_audio, xine_stream_t *stream) { metronom_t *this = xine_xmalloc (sizeof (metronom_t)); - int err; this->stream = stream; + this->clock = stream->xine->clock; this->set_audio_rate = metronom_set_audio_rate; this->got_video_frame = metronom_got_video_frame; this->got_audio_samples = metronom_got_audio_samples; @@ -703,27 +738,9 @@ metronom_t * metronom_init (int have_audio, xine_stream_t *stream) { this->handle_video_discontinuity = metronom_handle_video_discontinuity; this->set_option = metronom_set_option; this->get_option = metronom_get_option; - this->start_clock = metronom_start_clock; - this->stop_clock = metronom_stop_clock; - this->resume_clock = metronom_resume_clock; - this->get_current_time = metronom_get_current_time; - this->adjust_clock = metronom_adjust_clock; - this->register_scr = metronom_register_scr; - this->unregister_scr = metronom_unregister_scr; - this->set_speed = metronom_set_speed; this->exit = metronom_exit; - this->scr_adjustable = 1; - this->scr_list = calloc(MAX_SCR_PROVIDERS, sizeof(void*)); - this->register_scr(this, unixscr_init()); - pthread_mutex_init (&this->lock, NULL); - pthread_cond_init (&this->cancel, NULL); - - if ((err = pthread_create(&this->sync_thread, NULL, - (void*(*)(void*)) metronom_sync_loop, this)) != 0) - printf ("metronom: cannot create sync thread (%s)\n", - strerror(err)); this->av_offset = 0; this->vpts_offset = 0; @@ -752,3 +769,37 @@ metronom_t * metronom_init (int have_audio, xine_stream_t *stream) { return this; } + +metronom_clock_t *metronom_clock_init(void) +{ + metronom_clock_t *this = (metronom_clock_t *)malloc(sizeof(metronom_clock_t)); + int err; + + this->set_option = metronom_clock_set_option; + this->get_option = metronom_clock_get_option; + this->start_clock = metronom_start_clock; + this->stop_clock = metronom_stop_clock; + this->resume_clock = metronom_resume_clock; + this->get_current_time = metronom_get_current_time; + this->adjust_clock = metronom_adjust_clock; + this->set_speed = metronom_set_speed; + this->register_scr = metronom_register_scr; + this->unregister_scr = metronom_unregister_scr; + this->exit = metronom_clock_exit; + + this->scr_adjustable = 1; + this->scr_list = calloc(MAX_SCR_PROVIDERS, sizeof(void*)); + this->register_scr(this, unixscr_init()); + + pthread_mutex_init (&this->lock, NULL); + pthread_cond_init (&this->cancel, NULL); + + this->thread_running = 1; + + if ((err = pthread_create(&this->sync_thread, NULL, + (void*(*)(void*)) metronom_sync_loop, this)) != 0) + printf ("metronom: cannot create sync thread (%s)\n", + strerror(err)); + + return this; +} diff --git a/src/xine-engine/metronom.h b/src/xine-engine/metronom.h index 0471d1209..949729010 100644 --- a/src/xine-engine/metronom.h +++ b/src/xine-engine/metronom.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: metronom.h,v 1.40 2002/11/12 18:40:55 miguelfreitas Exp $ + * $Id: metronom.h,v 1.41 2002/11/20 11:57:49 mroi Exp $ * * metronom: general pts => virtual calculation/assoc * @@ -54,6 +54,7 @@ extern "C" { #include "xine.h" typedef struct metronom_s metronom_t ; +typedef struct metronom_clock_s metronom_clock_t; typedef struct scr_plugin_s scr_plugin_t; /* see below */ @@ -150,40 +151,105 @@ struct metronom_s { */ void (*set_option) (metronom_t *this, int option, int64_t value); int64_t (*get_option) (metronom_t *this, int option); + + void (*exit) (metronom_t *this); + + /* + * pointer to current xine stream object. + */ + xine_stream_t *stream; + + metronom_clock_t *clock; + + /* + * metronom internal stuff + */ + + int64_t pts_per_smpls; + + int64_t video_vpts; + int64_t spu_vpts; + int64_t audio_vpts; + + int64_t vpts_offset; + + int64_t video_drift; + int64_t video_drift_step; + + int audio_samples; + int64_t audio_drift_step; + + int64_t av_offset; + + pthread_mutex_t lock; + + 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; + pthread_cond_t cancel; + + int force_video_jump; + int force_audio_jump; + + int64_t img_duration; + int img_cpt; + int64_t last_video_pts; + +}; + +/* + * metronom options + */ + +#define METRONOM_AV_OFFSET 2 +#define METRONOM_ADJ_VPTS_OFFSET 3 + +metronom_t *metronom_init (int have_audio, xine_stream_t *stream); + +struct metronom_clock_s { + + /* + * set/get options for clock, constants see below + */ + void (*set_option) (metronom_clock_t *this, int option, int64_t value); + int64_t (*get_option) (metronom_clock_t *this, int option); /* * system clock reference (SCR) functions */ /* - * start metronom clock (no clock reset) + * start clock (no clock reset) * at given pts */ - void (*start_clock) (metronom_t *this, int64_t pts); + void (*start_clock) (metronom_clock_t *this, int64_t pts); /* * stop metronom clock */ - void (*stop_clock) (metronom_t *this); + void (*stop_clock) (metronom_clock_t *this); /* * resume clock from where it was stopped */ - void (*resume_clock) (metronom_t *this); + void (*resume_clock) (metronom_clock_t *this); /* * get current clock value in vpts */ - int64_t (*get_current_time) (metronom_t *this); + int64_t (*get_current_time) (metronom_clock_t *this); /* * adjust master clock to external timer (e.g. audio hardware) */ - void (*adjust_clock) (metronom_t *this, int64_t desired_pts); + void (*adjust_clock) (metronom_clock_t *this, int64_t desired_pts); /* @@ -191,74 +257,36 @@ struct metronom_s { * for constants see xine_internal.h */ - int (*set_speed) (metronom_t *this, int speed); + int (*set_speed) (metronom_clock_t *this, int speed); /* * (un)register a System Clock Reference provider at the metronom */ - int (*register_scr) (metronom_t *this, scr_plugin_t *scr); - void (*unregister_scr) (metronom_t *this, scr_plugin_t *scr); - - void (*exit) (metronom_t *this); - - /* - * pointer to current xine stream object. - */ - xine_stream_t *stream; + int (*register_scr) (metronom_clock_t *this, scr_plugin_t *scr); + void (*unregister_scr) (metronom_clock_t *this, scr_plugin_t *scr); - /* - * metronom internal stuff - */ - - int64_t pts_per_smpls; - - int64_t video_vpts; - int64_t spu_vpts; - int64_t audio_vpts; - - int64_t vpts_offset; - - int64_t video_drift; - int64_t video_drift_step; + void (*exit) (metronom_clock_t *this); - int audio_samples; - int64_t audio_drift_step; - - int64_t av_offset; - scr_plugin_t* scr_master; scr_plugin_t** scr_list; pthread_t sync_thread; + int thread_running; int scr_adjustable; - + + int speed; + pthread_mutex_t lock; - - 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; pthread_cond_t cancel; - int force_video_jump; - int force_audio_jump; - - int64_t img_duration; - int img_cpt; - int64_t last_video_pts; - }; -metronom_t *metronom_init (int have_audio, xine_stream_t *stream); +metronom_clock_t *metronom_clock_init(void); /* - * metronom options + * clock options */ -#define METRONOM_SCR_ADJUSTABLE 1 -#define METRONOM_AV_OFFSET 2 -#define METRONOM_ADJ_VPTS_OFFSET 3 +#define CLOCK_SCR_ADJUSTABLE 1 /* * SCR (system clock reference) plugins @@ -287,7 +315,7 @@ struct scr_plugin_s void (*exit) (scr_plugin_t *this); - metronom_t *metronom; + metronom_clock_t *clock; }; #ifdef __cplusplus diff --git a/src/xine-engine/video_decoder.h b/src/xine-engine/video_decoder.h index 022371128..b58f0008b 100644 --- a/src/xine-engine/video_decoder.h +++ b/src/xine-engine/video_decoder.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_decoder.h,v 1.6 2002/11/12 18:40:55 miguelfreitas Exp $ + * $Id: video_decoder.h,v 1.7 2002/11/20 11:57:49 mroi Exp $ * * xine video decoder plugin interface * @@ -29,7 +29,7 @@ #include #include "buffer.h" -#define VIDEO_DECODER_IFACE_VERSION 12 +#define VIDEO_DECODER_IFACE_VERSION 13 /* * generic xine video decoder plugin interface diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index a4a3079ec..34b0be478 100644 --- a/src/xine-engine/video_out.c +++ b/src/xine-engine/video_out.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out.c,v 1.111 2002/11/10 13:18:01 mroi Exp $ + * $Id: video_out.c,v 1.112 2002/11/20 11:57:49 mroi Exp $ * * frame allocation / queuing / scheduling / output functions */ @@ -49,12 +49,13 @@ typedef struct { - vo_instance_t vo; /* public part */ + xine_video_port_t vo; /* public part */ - xine_vo_driver_t *driver; - metronom_t *metronom; + vo_driver_t *driver; xine_t *xine; - xine_stream_t *stream; + metronom_clock_t *clock; + xine_list_t *streams; + pthread_mutex_t streams_lock; img_buf_fifo_t *free_img_buf_queue; img_buf_fifo_t *display_img_buf_queue; @@ -191,7 +192,7 @@ static void vo_frame_dec_lock (vo_frame_t *img) { img->lock_counter--; if (!img->lock_counter) { - vos_t *this = (vos_t *) img->instance; + vos_t *this = (vos_t *) img->port; vo_append_to_img_buf_queue (this->free_img_buf_queue, img); } @@ -211,7 +212,7 @@ static void vo_frame_dec_lock (vo_frame_t *img) { * */ -static vo_frame_t *vo_get_frame (vo_instance_t *this_gen, +static vo_frame_t *vo_get_frame (xine_video_port_t *this_gen, uint32_t width, uint32_t height, int ratio, int format, int flags) { @@ -250,19 +251,19 @@ static vo_frame_t *vo_get_frame (vo_instance_t *this_gen, return img; } -static int vo_frame_draw (vo_frame_t *img) { +static int vo_frame_draw (vo_frame_t *img, xine_stream_t *stream) { - vos_t *this = (vos_t *) img->instance; + vos_t *this = (vos_t *) img->port; int64_t diff; int64_t cur_vpts; int64_t pic_vpts ; int frames_to_skip; - this->metronom->got_video_frame (this->metronom, img); + stream->metronom->got_video_frame (stream->metronom, img); pic_vpts = img->vpts; - cur_vpts = this->metronom->get_current_time(this->metronom); + cur_vpts = this->clock->get_current_time(this->clock); this->last_delivery_pts = cur_vpts; #ifdef LOG @@ -293,12 +294,12 @@ static int vo_frame_draw (vo_frame_t *img) { /* * Wake up xine_play if it's waiting for a frame */ - pthread_mutex_lock (&this->stream->first_frame_lock); - if (this->stream->first_frame_flag) { - this->stream->first_frame_flag = 0; - pthread_cond_broadcast(&this->stream->first_frame_reached); + pthread_mutex_lock (&stream->first_frame_lock); + if (stream->first_frame_flag) { + stream->first_frame_flag = 0; + pthread_cond_broadcast(&stream->first_frame_reached); } - pthread_mutex_unlock (&this->stream->first_frame_lock); + pthread_mutex_unlock (&stream->first_frame_lock); /* * put frame into FIFO-Buffer @@ -578,12 +579,13 @@ static vo_frame_t *get_next_frame (vos_t *this, int64_t cur_vpts) { * last frame? make backup for possible still image */ pthread_mutex_lock( &this->free_img_buf_queue->mutex ); - if (img && !img->next && + if (img && !img->next /* FIXME: is this test needed? && (this->stream->video_fifo->size(this->stream->video_fifo) < 10 - || this->stream->video_in_discontinuity) ) { + || this->stream->video_in_discontinuity)*/ ) { - printf ("video_out: possible still frame (fifosize = %d)\n", - this->stream->video_fifo->size(this->stream->video_fifo)); + /*printf ("video_out: possible still frame (fifosize = %d)\n", + this->stream->video_fifo->size(this->stream->video_fifo));*/ + printf ("video_out: possible still frame\n"); this->img_backup = duplicate_frame (this, img); } @@ -607,7 +609,7 @@ static void overlay_and_display_frame (vos_t *this, printf ("video_out: displaying image with vpts = %lld\n", img->vpts); #endif - + if (this->overlay_source) { this->overlay_source->multiple_overlay_blend (this->overlay_source, vpts, @@ -650,7 +652,7 @@ static void paused_loop( vos_t *this, int64_t vpts ) /* prevent decoder thread from allocating new frames */ this->free_img_buf_queue->locked_for_read = 1; - while (this->stream->speed == XINE_SPEED_PAUSE) { + while (this->clock->speed == XINE_SPEED_PAUSE) { /* we need at least one free frame to keep going */ if( this->display_img_buf_queue->first && @@ -704,7 +706,7 @@ static void *video_out_loop (void *this_gen) { */ frame_duration = 1500; /* default */ - next_frame_vpts = this->metronom->get_current_time (this->metronom); + next_frame_vpts = this->clock->get_current_time (this->clock); #ifdef LOG printf ("video_out: loop starting...\n"); @@ -716,7 +718,7 @@ static void *video_out_loop (void *this_gen) { * get current time and find frame to display */ - vpts = this->metronom->get_current_time (this->metronom); + vpts = this->clock->get_current_time (this->clock); #ifdef LOG printf ("video_out: loop iteration at %lld\n", vpts); #endif @@ -746,16 +748,23 @@ static void *video_out_loop (void *this_gen) { diff = vpts - this->last_delivery_pts; if (diff > 30000 && !this->display_img_buf_queue->first) { - if (this->stream->video_decoder_plugin) { + xine_stream_t *stream; + + pthread_mutex_lock(&this->streams_lock); + for (stream = xine_list_first_content(this->streams); stream; + stream = xine_list_next_content(this->streams)) { + if (stream->video_decoder_plugin) { #ifdef LOG - printf ("video_out: flushing current video decoder plugin (%d %d)\n", - this->display_img_buf_queue->num_buffers, - this->free_img_buf_queue->num_buffers); + printf ("video_out: flushing current video decoder plugin (%d %d)\n", + this->display_img_buf_queue->num_buffers, + this->free_img_buf_queue->num_buffers); #endif - this->stream->video_decoder_plugin->flush(this->stream->video_decoder_plugin); + stream->video_decoder_plugin->flush(stream->video_decoder_plugin); + } } + pthread_mutex_unlock(&this->streams_lock); this->last_delivery_pts = vpts; } @@ -775,9 +784,9 @@ static void *video_out_loop (void *this_gen) { #endif do { - vpts = this->metronom->get_current_time (this->metronom); + vpts = this->clock->get_current_time (this->clock); - if (this->stream->speed == XINE_SPEED_PAUSE) + if (this->clock->speed == XINE_SPEED_PAUSE) paused_loop (this, vpts); usec_to_sleep = (next_frame_vpts - vpts) * 100 / 9; @@ -825,31 +834,48 @@ static void *video_out_loop (void *this_gen) { pthread_exit(NULL); } -static uint32_t vo_get_capabilities (vo_instance_t *this_gen) { +static uint32_t vo_get_capabilities (xine_video_port_t *this_gen) { vos_t *this = (vos_t *) this_gen; return this->driver->get_capabilities (this->driver); } -static void vo_open (vo_instance_t *this_gen) { +static void vo_open (xine_video_port_t *this_gen, xine_stream_t *stream) { vos_t *this = (vos_t *) this_gen; this->video_opened = 1; this->last_delivery_pts = 0; + if (!this->overlay_enabled && stream->spu_channel_user > -2) + /* enable overlays if our new stream might want to show some */ + this->overlay_enabled = 1; + pthread_mutex_lock(&this->streams_lock); + xine_list_append_content(this->streams, stream); + pthread_mutex_unlock(&this->streams_lock); } -static void vo_close (vo_instance_t *this_gen) { +static void vo_close (xine_video_port_t *this_gen, xine_stream_t *stream) { - vos_t *this = (vos_t *) this_gen; + vos_t *this = (vos_t *) this_gen; + xine_stream_t *cur; /* this will make sure all hide events were processed */ if (this->overlay_source) this->overlay_source->flush_events (this->overlay_source); this->video_opened = 0; + + /* unregister stream */ + pthread_mutex_lock(&this->streams_lock); + for (cur = xine_list_first_content(this->streams); cur; + cur = xine_list_next_content(this->streams)) + if (cur == stream) { + xine_list_delete_current(this->streams); + break; + } + pthread_mutex_unlock(&this->streams_lock); } -static void vo_free_img_buffers (vo_instance_t *this_gen) { +static void vo_free_img_buffers (xine_video_port_t *this_gen) { vos_t *this = (vos_t *) this_gen; vo_frame_t *img; @@ -864,7 +890,7 @@ static void vo_free_img_buffers (vo_instance_t *this_gen) { } } -static void vo_exit (vo_instance_t *this_gen) { +static void vo_exit (xine_video_port_t *this_gen) { vos_t *this = (vos_t *) this_gen; @@ -891,6 +917,9 @@ static void vo_exit (vo_instance_t *this_gen) { if (this->overlay_source) { this->overlay_source->dispose (this->overlay_source); } + + xine_list_free(this->streams); + pthread_mutex_destroy(&this->streams_lock); free (this->free_img_buf_queue); free (this->display_img_buf_queue); @@ -898,7 +927,7 @@ static void vo_exit (vo_instance_t *this_gen) { free (this); } -static vo_frame_t *vo_get_last_frame (vo_instance_t *this_gen) { +static vo_frame_t *vo_get_last_frame (xine_video_port_t *this_gen) { vos_t *this = (vos_t *) this_gen; return this->last_frame; } @@ -907,20 +936,37 @@ static vo_frame_t *vo_get_last_frame (vo_instance_t *this_gen) { * overlay stuff */ -static video_overlay_instance_t *vo_get_overlay_instance (vo_instance_t *this_gen) { +static video_overlay_instance_t *vo_get_overlay_instance (xine_video_port_t *this_gen) { vos_t *this = (vos_t *) this_gen; return this->overlay_source; } -static void vo_enable_overlay (vo_instance_t *this_gen, int overlay_enabled) { +static void vo_enable_overlay (xine_video_port_t *this_gen, int overlay_enabled) { vos_t *this = (vos_t *) this_gen; - this->overlay_enabled = overlay_enabled; + + if (overlay_enabled) { + /* we always ENable ... */ + this->overlay_enabled = 1; + } else { + /* ... but we only actually DISable, if all associated streams have SPU off */ + xine_stream_t *stream; + pthread_mutex_lock(&this->streams_lock); + for (stream = xine_list_first_content(this->streams) ; stream ; + stream = xine_list_next_content(this->streams)) { + if (stream->spu_channel_user > -2) { + pthread_mutex_unlock(&this->streams_lock); + return; + } + } + pthread_mutex_unlock(&this->streams_lock); + this->overlay_enabled = 0; + } } /* * Flush video_out fifo */ -static void vo_flush (vo_instance_t *this_gen) { +static void vo_flush (xine_video_port_t *this_gen) { vos_t *this = (vos_t *) this_gen; vo_frame_t *img; int i, num_buffers; @@ -938,8 +984,7 @@ static void vo_flush (vo_instance_t *this_gen) { } -vo_instance_t *vo_new_instance (xine_vo_driver_t *driver, - xine_stream_t *stream) { +xine_video_port_t *vo_new_port (xine_t *xine, vo_driver_t *driver) { vos_t *this; int i; @@ -950,10 +995,12 @@ vo_instance_t *vo_new_instance (xine_vo_driver_t *driver, this = xine_xmalloc (sizeof (vos_t)) ; + this->xine = xine; + this->clock = xine->clock; this->driver = driver; - this->xine = stream->xine; - this->metronom = stream->metronom; - this->stream = stream; + this->streams = xine_list_new(); + + pthread_mutex_init(&this->streams_lock, NULL); this->vo.open = vo_open; this->vo.get_frame = vo_get_frame; @@ -964,6 +1011,7 @@ vo_instance_t *vo_new_instance (xine_vo_driver_t *driver, this->vo.enable_ovl = vo_enable_overlay; this->vo.get_overlay_instance = vo_get_overlay_instance; this->vo.flush = vo_flush; + this->vo.driver = driver; this->num_frames_delivered = 0; this->num_frames_skipped = 0; @@ -993,7 +1041,7 @@ vo_instance_t *vo_new_instance (xine_vo_driver_t *driver, img->id = i; - img->instance = &this->vo; + img->port = &this->vo; img->free = vo_frame_dec_lock; img->displayed = vo_frame_dec_lock; img->draw = vo_frame_draw; @@ -1013,7 +1061,7 @@ vo_instance_t *vo_new_instance (xine_vo_driver_t *driver, this->video_loop_running = 1; this->video_opened = 0; - + pthread_attr_init(&pth_attrs); pthread_attr_setscope(&pth_attrs, PTHREAD_SCOPE_SYSTEM); diff --git a/src/xine-engine/video_out.h b/src/xine-engine/video_out.h index 275fcd0d0..e011b2788 100644 --- a/src/xine-engine/video_out.h +++ b/src/xine-engine/video_out.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out.h,v 1.69 2002/10/29 16:02:50 mroi Exp $ + * $Id: video_out.h,v 1.70 2002/11/20 11:57:49 mroi Exp $ * * * xine version of video_out.h @@ -27,7 +27,7 @@ * * vo_driver : lowlevel, platform-specific video output code * - * vo_instance : generic frame_handling code, uses + * vo_port : generic frame_handling code, uses * a vo_driver for output * */ @@ -47,11 +47,10 @@ extern "C" { #include typedef struct vo_frame_s vo_frame_t; -typedef struct vo_instance_s vo_instance_t; typedef struct img_buf_fifo_s img_buf_fifo_t; typedef struct vo_overlay_s vo_overlay_t; typedef struct video_overlay_instance_s video_overlay_instance_t; -typedef struct vo_private_s vo_private_t; +typedef struct vo_driver_s vo_driver_t; /* public part, video drivers may add private fields */ @@ -87,8 +86,8 @@ struct vo_frame_s { pthread_mutex_t mutex; /* protect access to lock_count */ /* "backward" references to where this frame originates from */ - vo_instance_t *instance; - xine_vo_driver_t *driver; + xine_video_port_t *port; + vo_driver_t *driver; int id; /* debugging - track this frame */ @@ -107,7 +106,7 @@ struct vo_frame_s { /* append this frame to the display queue, returns number of frames to skip if decoder is late */ - int (*draw) (vo_frame_t *vo_img); + int (*draw) (vo_frame_t *vo_img, xine_stream_t *stream); /* this frame is no longer used by the video driver */ void (*displayed) (vo_frame_t *vo_img); @@ -116,12 +115,12 @@ struct vo_frame_s { void (*dispose) (vo_frame_t *vo_img); }; -struct vo_instance_s { +struct xine_video_port_s { - uint32_t (*get_capabilities) (vo_instance_t *this); /* for constants see below */ + uint32_t (*get_capabilities) (xine_video_port_t *this); /* for constants see below */ /* open display driver for video output */ - void (*open) (vo_instance_t *this); + void (*open) (xine_video_port_t *this, xine_stream_t *stream); /* * get_frame - allocate an image buffer from display driver @@ -132,29 +131,32 @@ struct vo_instance_s { * format == FOURCC descriptor of image format * flags == field/prediction flags */ - vo_frame_t* (*get_frame) (vo_instance_t *this, uint32_t width, + vo_frame_t* (*get_frame) (xine_video_port_t *this, uint32_t width, uint32_t height, int ratio_code, int format, int flags); - vo_frame_t* (*get_last_frame) (vo_instance_t *this); + vo_frame_t* (*get_last_frame) (xine_video_port_t *this); /* overlay stuff */ - void (*enable_ovl) (vo_instance_t *this, int ovl_enable); + void (*enable_ovl) (xine_video_port_t *this, int ovl_enable); /* video driver is no longer used by decoder => close */ - void (*close) (vo_instance_t *this); + void (*close) (xine_video_port_t *this, xine_stream_t *stream); /* called on xine exit */ - void (*exit) (vo_instance_t *this); + void (*exit) (xine_video_port_t *this); /* get overlay instance (overlay source) */ - video_overlay_instance_t* (*get_overlay_instance) (vo_instance_t *this); + video_overlay_instance_t* (*get_overlay_instance) (xine_video_port_t *this); /* flush video_out fifo */ - void (*flush) (vo_instance_t *this); + void (*flush) (xine_video_port_t *this); - /* private stuff can be added here */ + /* the driver in use */ + vo_driver_t *driver; + /* private stuff can be added here */ + }; /* constants for the get/set property functions */ @@ -224,37 +226,37 @@ struct vo_instance_s { #define VO_CAP_AUTOPAINT_COLORKEY 0x00000200 /* driver can set AUTOPAINT_COLORKEY value */ /* - * xine_vo_driver_s contains the functions every display driver - * has to implement. The vo_new_instance function (see below) - * should then be used to construct a vo_instance using this + * 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 vo_instance_s, others will be called + * directly into xine_video_port_s, others will be called * from generic vo functions. */ -#define VIDEO_OUT_DRIVER_IFACE_VERSION 10 +#define VIDEO_OUT_DRIVER_IFACE_VERSION 11 -struct xine_vo_driver_s { +struct vo_driver_s { - uint32_t (*get_capabilities) (xine_vo_driver_t *this); /* for constants see above */ + uint32_t (*get_capabilities) (vo_driver_t *this); /* 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) (xine_vo_driver_t *this); + vo_frame_t* (*alloc_frame) (vo_driver_t *this); /* * check if the given image fullfills the format specified * (re-)allocate memory if necessary */ - void (*update_frame_format) (xine_vo_driver_t *this, vo_frame_t *img, + void (*update_frame_format) (vo_driver_t *this, vo_frame_t *img, uint32_t width, uint32_t height, int ratio_code, int format, int flags); /* display a given frame */ - void (*display_frame) (xine_vo_driver_t *this, vo_frame_t *vo_img); + void (*display_frame) (vo_driver_t *this, 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 @@ -268,18 +270,18 @@ struct xine_vo_driver_s { * * any function pointer from this group may be set to NULL. */ - void (*overlay_begin) (xine_vo_driver_t *this, vo_frame_t *vo_img, int changed); - void (*overlay_blend) (xine_vo_driver_t *this, vo_frame_t *vo_img, vo_overlay_t *overlay); - void (*overlay_end) (xine_vo_driver_t *this, vo_frame_t *vo_img); + void (*overlay_begin) (vo_driver_t *this, vo_frame_t *vo_img, int changed); + void (*overlay_blend) (vo_driver_t *this, vo_frame_t *vo_img, vo_overlay_t *overlay); + void (*overlay_end) (vo_driver_t *this, vo_frame_t *vo_img); /* * these can be used by the gui directly: */ - int (*get_property) (xine_vo_driver_t *this, int property); - int (*set_property) (xine_vo_driver_t *this, + int (*get_property) (vo_driver_t *this, int property); + int (*set_property) (vo_driver_t *this, int property, int value); - void (*get_property_min_max) (xine_vo_driver_t *this, + void (*get_property_min_max) (vo_driver_t *this, int property, int *min, int *max); /* @@ -289,20 +291,20 @@ struct xine_vo_driver_s { * etc. to the driver */ - int (*gui_data_exchange) (xine_vo_driver_t *this, int data_type, + int (*gui_data_exchange) (vo_driver_t *this, 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) (xine_vo_driver_t *this); + int (*redraw_needed) (vo_driver_t *this); /* * free all resources, close driver */ - void (*dispose) (xine_vo_driver_t *this); + void (*dispose) (vo_driver_t *this); void *node; /* needed by plugin_loader */ }; @@ -314,7 +316,7 @@ struct video_driver_class_s { /* * open a new instance of this plugin class */ - xine_vo_driver_t* (*open_plugin) (video_driver_class_t *this, const void *visual); + vo_driver_t* (*open_plugin) (video_driver_class_t *this, const void *visual); /* * return short, human readable identifier for this plugin class @@ -382,19 +384,18 @@ struct video_overlay_instance_s { int (*redraw_needed) (video_overlay_instance_t *this_gen, int64_t vpts ); void (*multiple_overlay_blend) (video_overlay_instance_t *this_gen, int64_t vpts, - xine_vo_driver_t *output, vo_frame_t *vo_img, int enabled); + vo_driver_t *output, vo_frame_t *vo_img, int enabled); }; video_overlay_instance_t *video_overlay_new_instance (); /* - * build a video_out_instance from + * build a video_out_port from * a given video driver */ -vo_instance_t *vo_new_instance (xine_vo_driver_t *driver, - xine_stream_t *stream) ; +xine_video_port_t *vo_new_port (xine_t *xine, vo_driver_t *driver) ; #ifdef __cplusplus } diff --git a/src/xine-engine/video_overlay.c b/src/xine-engine/video_overlay.c index 56409e63a..fd51c4699 100644 --- a/src/xine-engine/video_overlay.c +++ b/src/xine-engine/video_overlay.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_overlay.c,v 1.26 2002/11/19 00:45:42 miguelfreitas Exp $ + * $Id: video_overlay.c,v 1.27 2002/11/20 11:57:49 mroi Exp $ * */ @@ -484,7 +484,7 @@ static int video_overlay_event( video_overlay_t *this, int64_t vpts ) { * must call output->overlay_blend for each active overlay. */ static void video_overlay_multiple_overlay_blend (video_overlay_instance_t *this_gen, int64_t vpts, - xine_vo_driver_t *output, vo_frame_t *vo_img, int enabled) { + vo_driver_t *output, vo_frame_t *vo_img, int enabled) { video_overlay_t *this = (video_overlay_t *) this_gen; int i; int32_t handle; diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 43bdc6b55..80c0f9686 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine.c,v 1.193 2002/11/17 17:41:45 mroi Exp $ + * $Id: xine.c,v 1.194 2002/11/20 11:57:49 mroi Exp $ * * top-level xine functions * @@ -101,7 +101,7 @@ void xine_report_codec (xine_stream_t *stream, int codec_type, static void xine_set_speed_internal (xine_stream_t *stream, int speed) { - stream->metronom->set_speed (stream->metronom, speed); + stream->xine->clock->set_speed (stream->xine->clock, speed); /* see coment on audio_out loop about audio_paused */ if( stream->audio_out ) { @@ -118,8 +118,6 @@ static void xine_set_speed_internal (xine_stream_t *stream, int speed) { stream->audio_out->control(stream->audio_out, speed == XINE_SPEED_PAUSE ? AO_CTRL_PLAY_PAUSE : AO_CTRL_PLAY_RESUME); } - - stream->speed = speed; } @@ -202,8 +200,8 @@ void xine_stop (xine_stream_t *stream) { * stream will make output threads discard about everything * am i abusing of xine architeture? :) */ - stream->metronom->adjust_clock (stream->metronom, - stream->metronom->get_current_time(stream->metronom) + 30 * 90000 ); + stream->xine->clock->adjust_clock (stream->xine->clock, + stream->xine->clock->get_current_time(stream->xine->clock) + 30 * 90000 ); pthread_mutex_unlock (&stream->frontend_lock); } @@ -256,7 +254,7 @@ void xine_close (xine_stream_t *stream) { xine_stream_t *xine_stream_new (xine_t *this, - xine_ao_driver_t *ao, xine_vo_driver_t *vo) { + xine_audio_port_t *ao, xine_video_port_t *vo) { xine_stream_t *stream; int i; @@ -277,13 +275,13 @@ xine_stream_t *xine_stream_new (xine_t *this, stream->stream_info[i] = 0; stream->meta_info[i] = NULL; } - stream->speed = XINE_SPEED_NORMAL; stream->input_pos = 0; stream->input_length = 0; stream->input_time = 0; stream->spu_out = NULL; stream->spu_decoder_plugin = NULL; stream->spu_decoder_streamtype = -1; + stream->audio_out = ao; stream->audio_channel_user = -1; stream->audio_channel_auto = 0; stream->audio_decoder_plugin = NULL; @@ -293,7 +291,8 @@ xine_stream_t *xine_stream_new (xine_t *this, stream->spu_channel_pan_scan = -1; stream->spu_channel_user = -1; stream->spu_channel = -1; - stream->video_driver = vo; + stream->video_out = vo; + stream->video_driver = vo->driver; stream->video_in_discontinuity = 0; stream->video_channel = 0; stream->video_decoder_plugin = NULL; @@ -333,11 +332,8 @@ xine_stream_t *xine_stream_new (xine_t *this, * alloc fifos, init and start decoder threads */ - stream->video_out = vo_new_instance (vo, stream); video_decoder_init (stream); - if (ao) - stream->audio_out = ao_new_instance (ao, stream); audio_decoder_init (stream); /* @@ -346,12 +342,6 @@ xine_stream_t *xine_stream_new (xine_t *this, stream->osd_renderer = osd_renderer_init (stream->video_out->get_overlay_instance (stream->video_out), stream->xine->config ); - /* - * start metronom clock - */ - - stream->metronom->start_clock (stream->metronom, 0); - /* * register stream */ @@ -685,7 +675,7 @@ static int xine_play_internal (xine_stream_t *stream, int start_pos, int start_t printf ("xine: xine_play\n"); - if (stream->speed != XINE_SPEED_NORMAL) + if (stream->xine->clock->speed != XINE_SPEED_NORMAL) xine_set_speed_internal (stream, XINE_SPEED_NORMAL); /* Wait until the first frame produced by the previous @@ -821,6 +811,7 @@ void xine_exit (xine_t *this) { this->log_buffers[i]->dispose (this->log_buffers[i]); dispose_plugins (this); + this->clock->exit (this->clock); this->config->dispose(this->config); free (this); @@ -902,6 +893,14 @@ void xine_init (xine_t *this) { this->streams = xine_list_new(); pthread_mutex_init (&this->streams_lock, NULL); + + /* + * start metronom clock + */ + + this->clock = metronom_clock_init(); + + this->clock->start_clock (this->clock, 0); } @@ -976,7 +975,7 @@ void xine_set_speed (xine_stream_t *stream, int speed) { int xine_get_speed (xine_stream_t *stream) { - return stream->speed; + return stream->xine->clock->speed; } /* diff --git a/src/xine-engine/xine_interface.c b/src/xine-engine/xine_interface.c index 440206898..439bc97cc 100644 --- a/src/xine-engine/xine_interface.c +++ b/src/xine-engine/xine_interface.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_interface.c,v 1.29 2002/11/11 04:57:18 tmmm Exp $ + * $Id: xine_interface.c,v 1.30 2002/11/20 11:57:50 mroi Exp $ * * convenience/abstraction layer, functions to implement * libxine's public interface @@ -397,7 +397,7 @@ int xine_get_param (xine_stream_t *stream, int param) { switch (param) { case XINE_PARAM_SPEED: - return stream->speed; + return stream->xine->clock->speed; case XINE_PARAM_AV_OFFSET: return stream->metronom->get_option (stream->metronom, METRONOM_AV_OFFSET); diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h index 1d02136ad..013bff436 100644 --- a/src/xine-engine/xine_internal.h +++ b/src/xine-engine/xine_internal.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_internal.h,v 1.112 2002/11/17 17:41:45 mroi Exp $ + * $Id: xine_internal.h,v 1.113 2002/11/20 11:57:50 mroi Exp $ * */ @@ -108,6 +108,8 @@ struct xine_s { xine_list_t *streams; pthread_mutex_t streams_lock; + + metronom_clock_t *clock; }; /* @@ -140,13 +142,12 @@ struct xine_stream_s { demux_plugin_t *demux_plugin; metronom_t *metronom; - int speed; off_t input_pos; off_t input_length; int input_time; - xine_vo_driver_t *video_driver; - vo_instance_t *video_out; + xine_video_port_t *video_out; + vo_driver_t *video_driver; fifo_buffer_t *video_fifo; pthread_t video_thread; video_decoder_t *video_decoder_plugin; @@ -154,7 +155,7 @@ struct xine_stream_s { int video_in_discontinuity; int video_channel; - ao_instance_t *audio_out; + xine_audio_port_t *audio_out; fifo_buffer_t *audio_fifo; lrb_t *audio_temp; pthread_t audio_thread; @@ -273,8 +274,8 @@ void free_spu_decoder (xine_stream_t *stream, spu_decoder_t *decod * load a specific video output plugin */ -xine_vo_driver_t *xine_load_video_output_plugin(xine_t *this, - char *id, int visual_type, void *visual); +vo_driver_t *xine_load_video_output_plugin(xine_t *this, + char *id, int visual_type, void *visual); /* * audio output plugin dynamic loading stuff @@ -286,7 +287,7 @@ xine_vo_driver_t *xine_load_video_output_plugin(xine_t *this, * load a specific audio output plugin */ -xine_ao_driver_t *xine_load_audio_output_plugin (xine_t *self, char *id); +ao_driver_t *xine_load_audio_output_plugin (xine_t *self, char *id); void xine_set_speed (xine_stream_t *stream, int speed) ; -- cgit v1.2.3