From bfc79c2cbb4dbdc32e05f56e00a4814b56a9981a Mon Sep 17 00:00:00 2001 From: Guenter Bartsch Date: Tue, 24 Apr 2001 21:10:42 +0000 Subject: xine.c fixed so it compiles again CVS patchset: 23 CVS date: 2001/04/24 21:10:42 --- src/xine-engine/Makefile.am | 11 +-- src/xine-engine/xine.c | 157 ++++++++++++++++------------------------ src/xine-engine/xine_internal.h | 15 +--- 3 files changed, 71 insertions(+), 112 deletions(-) (limited to 'src') diff --git a/src/xine-engine/Makefile.am b/src/xine-engine/Makefile.am index ef533c055..007d07564 100644 --- a/src/xine-engine/Makefile.am +++ b/src/xine-engine/Makefile.am @@ -7,8 +7,7 @@ CFLAGS = @GLOBAL_CFLAGS@ lib_LTLIBRARIES = libxine.la ##libxine_la_SOURCES = xine.c buffer.c metronom.c configfile.c \ -## monitor.c utils.c audio_decoder.c video_decoder.c load_plugins.c \ -## audio_out.c +## monitor.c utils.c audio_decoder.c video_decoder.c load_plugins.c libxine_la_SOURCES = metronom.c configfile.c buffer.c monitor.c utils.c \ cpu_accel.c load_plugins.c video_decoder.c audio_decoder.c \ video_out.c @@ -23,11 +22,9 @@ libxine_la_LIBADD = \ -lm libxine_la_LDFLAGS = -version-info 5:0:5 -#include_HEADERS = buffer.h metronom.h configfile.h \ -# monitor.h cpu_accel.h attributes.h utils.h audio_decoder.h -noinst_HEADERS = xine_internal.h buffer.h metronom.h configfile.h \ - monitor.h cpu_accel.h attributes.h utils.h -include_HEADERS = audio_out.h video_out.h +include_HEADERS = buffer.h metronom.h configfile.h \ + monitor.h cpu_accel.h attributes.h utils.h \ + audio_out.h video_out.h ### # Hardcoded rule: diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 178e93890..70f9bf8f2 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.6 2001/04/24 15:47:32 guenter Exp $ + * $Id: xine.c,v 1.7 2001/04/24 21:10:42 guenter Exp $ * * top-level xine functions * @@ -54,17 +54,19 @@ #include "metronom.h" #include "configfile.h" #include "monitor.h" -#include "audio_decoder.h" +#include "utils.h" /* debugging purposes only */ uint32_t xine_debug; void xine_notify_stream_finished (xine_t *this) { - printf ("xine_notify_stream_finished\n"); + printf ("xine.c: FIXME xine_notify_stream_finished not implemented\n"); + /* xine_stop (this); this->status_callback (this->status); + */ } /* @@ -77,28 +79,27 @@ void xine_stop (xine_t *this) { if (!this->cur_input_plugin) return; - this->mnStatus = XINE_STOP; + this->status = XINE_STOP; if(this->cur_demuxer_plugin) { - this->cur_demuxer_plugin->demux_stop (); + this->cur_demuxer_plugin->stop (this->cur_demuxer_plugin); this->cur_demuxer_plugin = NULL; } - // FIXME - this->fifo_funcs->fifo_buffer_clear(this->mBufVideo); - this->fifo_funcs->fifo_buffer_clear(this->mBufAudio); - this->fifo_funcs->fifo_buffer_clear(this->spu_fifo); - - if (gAudioOut) - gAudioOut->close (); + if(this->cur_input_plugin) { + this->cur_input_plugin->close(this->cur_input_plugin); + this->cur_input_plugin = NULL; + } - metronom_reset(); - metronom_stop_clock (); + this->video_fifo->clear(this->video_fifo); + this->audio_fifo->clear(this->audio_fifo); + this->spu_fifo->clear(this->spu_fifo); - vo_reset(); + if (this->audio_out) + this->audio_out->close (); - this->cur_input_plugin->close(); - this->cur_input_plugin = NULL; + this->metronom->reset(this->metronom); + this->metronom->stop_clock (this->metronom); pthread_mutex_unlock (&this->xine_lock); } @@ -122,10 +123,11 @@ static int try_demux_with_stages(xine_t *this, const char *MRL, while(stages[s] != -1) { for(i = 0; i < this->num_demuxer_plugins; i++) { - if(this->demuxer_plugins[i].open(this->cur_input_plugin, - MRL, stages[s]) == DEMUX_CAN_HANDLE) { + if(this->demuxer_plugins[i]->open(this->demuxer_plugins[i], + this->cur_input_plugin, + stages[s]) == DEMUX_CAN_HANDLE) { - this->cur_demuxer_plugin = &this->demux_plugins[i]; + this->cur_demuxer_plugin = this->demuxer_plugins[i]; xprintf(VERBOSE|DEMUX,"demuxer '%s' handle in stage '%s'.\n", this->demux_plugins[i].get_identifier(), @@ -195,12 +197,12 @@ static void xine_play_internal (xine_t *this, char *MRL, xprintf (VERBOSE|LOOP, "xine open %s, start pos = %d\n",MRL, spos); if (this->status == XINE_PAUSE) { - xine_pause(); + xine_pause(this); return; } if (this->status != XINE_STOP) { - xine_stop (); + xine_stop (this); } /* @@ -210,8 +212,8 @@ static void xine_play_internal (xine_t *this, char *MRL, this->cur_input_plugin = NULL; for (i = 0; i < this->num_input_plugins; i++) { - if (this->input_plugins[i].open(MRL)) { - this->cur_input_plugin = &this->input_plugins[i]; + if (this->input_plugins[i]->open(this->input_plugins[i], MRL)) { + this->cur_input_plugin = this->input_plugins[i]; break; } } @@ -231,54 +233,46 @@ static void xine_play_internal (xine_t *this, char *MRL, return; } - vo_set_logo_mode (0); - /* * Init SPU decoder with colour lookup table. */ + /* FIXME if(this->cur_input_plugin->get_clut) spudec_init(this->cur_input_plugin->get_clut()); else spudec_init(NULL); + */ /* * metronom */ - metronom_reset(); + this->metronom->reset(this->metronom); /* * start demuxer */ if (spos) { - len = this->cur_input_plugin->get_length (); + len = this->cur_input_plugin->get_length (this->cur_input_plugin); share = (double) spos / 65535; pos = (off_t) (share * len) ; } - this->cur_demuxer_plugin->demux_select_audio_channel (this->audio_channel); - this->cur_demuxer_plugin->demux_select_spu_channel (this->spu_channel); - this->cur_demuxer_plugin->demux_start (this->cur_input_plugin, - this->mBufVideo, //FIXME - this->mBufAudio, - this->spu_fifo, pos); + this->cur_demuxer_plugin->start (this->cur_demuxer_plugin, + this->video_fifo, + this->audio_fifo, + this->spu_fifo, pos); this->status = XINE_PLAY; this->cur_input_pos = pos; - /* - * remember MRL - */ - - strncpy (this->cur_mrl, MRL, 1024); - /* * start clock */ - metronom_start_clock (0); + this->metronom->start_clock (this->metronom, 0); } /* @@ -297,28 +291,19 @@ void xine_play (xine_t *this, char *MRL, int spos) { /* * */ -static int xine_eject (xine_t *this, char *MRL) { - int i; +int xine_eject (xine_t *this) { + + if(this->cur_input_plugin == NULL) + return 0; pthread_mutex_lock (&this->xine_lock); - if(this->cur_input_plugin == NULL) { - - for (i = 0; i < this->num_input_plugins; i++) { - if (this->input_pluginss[i].open(MRL)) { - this->cur_input_plugin = &this->input_plugins[i]; - this->cur_input_plugin->close(); - break; - } - } - } - - if (this->status == XINE_STOP + if ((this->status == XINE_STOP) && this->cur_input_plugin && this->cur_input_plugin->eject_media) { pthread_mutex_unlock (&this->xine_lock); - return this->cur_input_plugin->eject_media (); + return this->cur_input_plugin->eject_media (this->cur_input_plugin); } pthread_mutex_unlock (&this->xine_lock); @@ -330,13 +315,17 @@ static int xine_eject (xine_t *this, char *MRL) { */ void xine_exit (xine_t *this) { + /* void *p; - buf_element_t *pBuf; - + buf_element_t *buf; + */ /* * stop decoder threads */ + printf ("xine.c : xine_exit FIXME - not implemented\n"); + + /* if (this->cur_input_plugin) this->cur_input_plugin->demux_stop (); @@ -348,12 +337,13 @@ void xine_exit (xine_t *this) { this->status = XINE_QUIT; config_file_save (); + */ } /* * */ -static void xine_pause (xine_t *this) { +void xine_pause (xine_t *this) { pthread_mutex_lock (&this->xine_lock); @@ -376,23 +366,17 @@ static void xine_pause (xine_t *this) { this->status = XINE_PAUSE; - this->cur_demuxer_plugin->demux_stop (); + this->cur_demuxer_plugin->stop (this->cur_demuxer_plugin); this->cur_demuxer_plugin = NULL; - //FIXME - this->fifo_funcs->fifo_buffer_clear(this->mBufVideo); - this->fifo_funcs->fifo_buffer_clear(this->mBufAudio); - this->fifo_funcs->fifo_buffer_clear(this->spu_fifo); + this->video_fifo->clear(this->video_fifo); + this->audio_fifo->clear(this->audio_fifo); + this->spu_fifo->clear(this->spu_fifo); - if (gAudioOut) - gAudioOut->close (); - - metronom_reset(); - metronom_stop_clock (); + this->metronom->reset(this->metronom); + this->metronom->stop_clock (this->metronom); - vo_reset (); - - this->cur_input_plugin->close(); + this->cur_input_plugin->close(this->cur_input_plugin); } pthread_mutex_unlock (&this->xine_lock); @@ -407,7 +391,6 @@ xine_t *xine_init (vo_driver_t *vo, config_values_t *config) { xine_t *this = xmalloc (sizeof (xine_t)); - int err; this->status_callback = gui_status_callback; this->config = config; @@ -423,12 +406,6 @@ xine_t *xine_init (vo_driver_t *vo, pthread_mutex_init (&this->xine_lock, NULL); - /* - * Init buffers - */ - - buffer_pool_init (2000, 4096); - /* * create a metronom */ @@ -467,8 +444,9 @@ xine_t *xine_init (vo_driver_t *vo, * init SPU decoder */ - this->spu_fifo = fifo_buffer_new (); - spudec_init(NULL); + + this->spu_fifo = fifo_buffer_new (1000, 4096); + /* FIXME spudec_init(NULL); */ return this; } @@ -484,15 +462,11 @@ int xine_get_audio_channel (xine_t *this) { /* * */ -void xine_select_audio_channel (xine_t *this, int nChannel) { +void xine_select_audio_channel (xine_t *this, int channel) { pthread_mutex_lock (&this->xine_lock); - this->audio_channel = nChannel; - - if (this->cur_demuxer_plugin) { - this->cur_demuxer_plugin->demux_select_audio_channel (this->audio_channel); - } + this->audio_channel = channel; pthread_mutex_unlock (&this->xine_lock); } @@ -508,14 +482,11 @@ int xine_get_spu_channel (xine_t *this) { /* * */ -void xine_select_spu_channel (xine_t *this, int nChannel) { +void xine_select_spu_channel (xine_t *this, int channel) { pthread_mutex_lock (&this->xine_lock); - this->spu_channel = (nChannel >= -1 ? nChannel : -1); - - if (this->cur_demuxer_plugin) - this->cur_demuxer_plugin->demux_select_spu_channel (this->spu_channel); + this->spu_channel = (channel >= -1 ? channel : -1); pthread_mutex_unlock (&this->xine_lock); } @@ -537,7 +508,7 @@ int xine_get_current_position (xine_t *this) { } /* pos = this->mCurInput->seek (0, SEEK_CUR); */ - len = this->cur_input_plugin->get_length (); + len = this->cur_input_plugin->get_length (this->cur_input_plugin); share = (double) this->cur_input_pos / (double) len * 65535; diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h index 7357d25d3..140a637ef 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.9 2001/04/24 15:47:32 guenter Exp $ + * $Id: xine_internal.h,v 1.10 2001/04/24 21:10:42 guenter Exp $ * */ @@ -124,7 +124,7 @@ typedef struct xine_s { demux_plugin_t *demuxer_plugins[DEMUXER_PLUGIN_MAX]; int num_demuxer_plugins; demux_plugin_t *cur_demuxer_plugin; - int demux_stragegy; + int demux_strategy; int status; off_t cur_input_pos; @@ -151,22 +151,13 @@ typedef struct xine_s { audio_decoder_t *cur_audio_decoder_plugin; int audio_finished; - gui_status_callback_func_t gui_status_callback; + gui_status_callback_func_t status_callback; /* Lock for xine player functions */ pthread_mutex_t xine_lock; } xine_t; -/* - * player status constants: - */ - -#define XINE_STOP 0 -#define XINE_PLAY 1 -#define XINE_PAUSE 2 -#define XINE_QUIT 3 - /* * read config file and init a config object * (if it exists) -- cgit v1.2.3