diff options
author | Guenter Bartsch <guenter@users.sourceforge.net> | 2001-07-14 12:50:33 +0000 |
---|---|---|
committer | Guenter Bartsch <guenter@users.sourceforge.net> | 2001-07-14 12:50:33 +0000 |
commit | dfd980788abf3d0905a24204bf8d0554dc4d8a77 (patch) | |
tree | 3e63c268028cbe158efee41dc36f8089afaa0e4c | |
parent | 85eb608c7a602f971f779106c812b48f6c2cd030 (diff) | |
download | xine-lib-dfd980788abf3d0905a24204bf8d0554dc4d8a77.tar.gz xine-lib-dfd980788abf3d0905a24204bf8d0554dc4d8a77.tar.bz2 |
cleaned up and finished spu_thread removal
CVS patchset: 275
CVS date: 2001/07/14 12:50:33
-rw-r--r-- | src/audio_out/audio_alsa05_out.c | 3 | ||||
-rw-r--r-- | src/demuxers/demux.h | 6 | ||||
-rw-r--r-- | src/demuxers/demux_avi.c | 45 | ||||
-rw-r--r-- | src/demuxers/demux_elem.c | 45 | ||||
-rw-r--r-- | src/demuxers/demux_mpeg.c | 45 | ||||
-rw-r--r-- | src/demuxers/demux_mpeg_block.c | 65 | ||||
-rw-r--r-- | src/demuxers/demux_mpgaudio.c | 51 | ||||
-rw-r--r-- | src/xine-engine/Makefile.am | 2 | ||||
-rw-r--r-- | src/xine-engine/spu_decoder.c | 154 | ||||
-rw-r--r-- | src/xine-engine/spu_decoder.h | 22 | ||||
-rw-r--r-- | src/xine-engine/video_decoder.c | 13 | ||||
-rw-r--r-- | src/xine-engine/xine.c | 4 | ||||
-rw-r--r-- | src/xine-engine/xine_internal.h | 9 |
13 files changed, 121 insertions, 343 deletions
diff --git a/src/audio_out/audio_alsa05_out.c b/src/audio_out/audio_alsa05_out.c index 9e3fd121f..bbc4c281e 100644 --- a/src/audio_out/audio_alsa05_out.c +++ b/src/audio_out/audio_alsa05_out.c @@ -24,7 +24,7 @@ * for the SPDIF AC3 sync part * (c) 2000 Andy Lo A Foe <andy@alsaplayer.org> * - * $Id: audio_alsa05_out.c,v 1.3 2001/06/23 19:45:47 guenter Exp $ + * $Id: audio_alsa05_out.c,v 1.4 2001/07/14 12:50:33 guenter Exp $ */ /* required for swab() */ @@ -205,7 +205,6 @@ static int ao_open(ao_functions_t *this,uint32_t bits, uint32_t rate, int ao_mod xprintf (VERBOSE|AUDIO, "bits = %d, rate = %d, channels = %d\n", bits, rate, channels); -#warning "FIXME in libAC3" if(!rate) return 0; diff --git a/src/demuxers/demux.h b/src/demuxers/demux.h index 247425ea7..8518b6f81 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.5 2001/06/16 18:03:22 guenter Exp $ + * $Id: demux.h,v 1.6 2001/07/14 12:50:34 guenter Exp $ */ #ifndef HAVE_DEMUX_H @@ -31,7 +31,7 @@ #include "input_plugin.h" #endif -#define DEMUXER_PLUGIN_IFACE_VERSION 1 +#define DEMUXER_PLUGIN_IFACE_VERSION 2 #define DEMUX_OK 0 #define DEMUX_FINISHED 1 @@ -85,7 +85,7 @@ struct demux_plugin_s */ void (*start) (demux_plugin_t *this, fifo_buffer_t *video_fifo, - fifo_buffer_t *audio_fifo, fifo_buffer_t *spu_fifo, + fifo_buffer_t *audio_fifo, off_t pos, gui_get_next_mrl_cb_t next_mrl_cb, gui_branched_cb_t branched_cb) ; diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index cee6babee..c1edff642 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.22 2001/07/04 14:13:47 uid56437 Exp $ + * $Id: demux_avi.c,v 1.23 2001/07/14 12:50:34 guenter Exp $ * * demultiplexer for avi streams * @@ -901,7 +901,6 @@ static int demux_avi_get_status (demux_plugin_t *this_gen) { static void demux_avi_start (demux_plugin_t *this_gen, fifo_buffer_t *video_fifo, fifo_buffer_t *audio_fifo, - fifo_buffer_t *spu_fifo, off_t pos, gui_get_next_mrl_cb_t next_mrl_cb, gui_branched_cb_t branched_cb) @@ -1072,32 +1071,26 @@ static char *demux_avi_get_id(void) { demux_plugin_t *init_demuxer_plugin(int iface, config_values_t *config) { - demux_avi_t *this = xmalloc (sizeof (demux_avi_t)); + demux_avi_t *this; - xine_debug = config->lookup_int (config, "xine_debug", 0); - - switch (iface) { - - case 1: - - this->demux_plugin.interface_version = DEMUXER_PLUGIN_IFACE_VERSION; - this->demux_plugin.open = demux_avi_open; - this->demux_plugin.start = demux_avi_start; - this->demux_plugin.stop = demux_avi_stop; - this->demux_plugin.close = demux_avi_close; - this->demux_plugin.get_status = demux_avi_get_status; - this->demux_plugin.get_identifier = demux_avi_get_id; - - return (demux_plugin_t *) this; - break; - - default: - fprintf(stderr, - "Demuxer plugin doesn't support plugin API version %d.\n" - "PLUGIN DISABLED.\n" - "This means there's a version mismatch between xine and this " - "demuxer plugin.\nInstalling current input plugins should help.\n", + if (iface != 2) { + printf( "demux_mpeg: plugin doesn't support plugin API version %d.\n" + "demux_mpeg: this means there's a version mismatch between xine and this " + "demux_mpeg: demuxer plugin.\nInstalling current input plugins should help.\n", iface); return NULL; } + + this = xmalloc (sizeof (demux_avi_t)); + xine_debug = config->lookup_int (config, "xine_debug", 0); + + this->demux_plugin.interface_version = DEMUXER_PLUGIN_IFACE_VERSION; + this->demux_plugin.open = demux_avi_open; + this->demux_plugin.start = demux_avi_start; + this->demux_plugin.stop = demux_avi_stop; + this->demux_plugin.close = demux_avi_close; + this->demux_plugin.get_status = demux_avi_get_status; + this->demux_plugin.get_identifier = demux_avi_get_id; + + return (demux_plugin_t *) this; } diff --git a/src/demuxers/demux_elem.c b/src/demuxers/demux_elem.c index 121d92bb0..a1022be17 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.13 2001/06/21 17:34:23 guenter Exp $ + * $Id: demux_elem.c,v 1.14 2001/07/14 12:50:34 guenter Exp $ * * demultiplexer for elementary mpeg streams * @@ -176,7 +176,6 @@ static int demux_mpeg_elem_get_status (demux_plugin_t *this_gen) { static void demux_mpeg_elem_start (demux_plugin_t *this_gen, fifo_buffer_t *video_fifo, fifo_buffer_t *audio_fifo, - fifo_buffer_t *spu_fifo, off_t pos, gui_get_next_mrl_cb_t next_mrl_cb, gui_branched_cb_t branched_cb) { @@ -313,33 +312,27 @@ static void demux_mpeg_elem_close (demux_plugin_t *this) { */ demux_plugin_t *init_demuxer_plugin(int iface, config_values_t *config) { - demux_mpeg_elem_t *this = malloc (sizeof (demux_mpeg_elem_t)); + demux_mpeg_elem_t *this; - xine_debug = config->lookup_int (config, "xine_debug", 0); - - switch (iface) { - - case 1: - - this->demux_plugin.interface_version = DEMUX_MPEG_ELEM_IFACE_VERSION; - this->demux_plugin.open = demux_mpeg_elem_open; - this->demux_plugin.start = demux_mpeg_elem_start; - this->demux_plugin.stop = demux_mpeg_elem_stop; - this->demux_plugin.close = demux_mpeg_elem_close; - this->demux_plugin.get_status = demux_mpeg_elem_get_status; - this->demux_plugin.get_identifier = demux_mpeg_elem_get_id; - - return &this->demux_plugin; - break; - - default: - fprintf(stderr, - "Demuxer plugin doesn't support plugin API version %d.\n" - "PLUGIN DISABLED.\n" - "This means there's a version mismatch between xine and this " - "demuxer plugin.\nInstalling current input plugins should help.\n", + if (iface != 2) { + printf( "demux_elem: plugin doesn't support plugin API version %d.\n" + "demux_elem: this means there's a version mismatch between xine and this " + "demux_elem: demuxer plugin.\nInstalling current input plugins should help.\n", iface); return NULL; } + + this = malloc (sizeof (demux_mpeg_elem_t)); + xine_debug = config->lookup_int (config, "xine_debug", 0); + + this->demux_plugin.interface_version = DEMUX_MPEG_ELEM_IFACE_VERSION; + this->demux_plugin.open = demux_mpeg_elem_open; + this->demux_plugin.start = demux_mpeg_elem_start; + this->demux_plugin.stop = demux_mpeg_elem_stop; + this->demux_plugin.close = demux_mpeg_elem_close; + this->demux_plugin.get_status = demux_mpeg_elem_get_status; + this->demux_plugin.get_identifier = demux_mpeg_elem_get_id; + + return &this->demux_plugin; } diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c index bc17bb9bc..09fe6a23d 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.24 2001/07/04 17:10:24 uid32519 Exp $ + * $Id: demux_mpeg.c,v 1.25 2001/07/14 12:50:34 guenter Exp $ * * demultiplexer for mpeg 1/2 program streams * reads streams of variable blocksizes @@ -590,7 +590,6 @@ static int demux_mpeg_get_status (demux_plugin_t *this_gen) { static void demux_mpeg_start (demux_plugin_t *this_gen, fifo_buffer_t *video_fifo, fifo_buffer_t *audio_fifo, - fifo_buffer_t *spu_fifo, off_t pos, gui_get_next_mrl_cb_t next_mrl_cb, gui_branched_cb_t branched_cb) @@ -760,32 +759,26 @@ static void demux_mpeg_close (demux_plugin_t *this) { demux_plugin_t *init_demuxer_plugin(int iface, config_values_t *config) { - demux_mpeg_t *this = xmalloc (sizeof (demux_mpeg_t)); + demux_mpeg_t *this; - xine_debug = config->lookup_int (config, "xine_debug", 0); - - switch (iface) { - - case 1: - - this->demux_plugin.interface_version = DEMUXER_PLUGIN_IFACE_VERSION; - this->demux_plugin.open = demux_mpeg_open; - this->demux_plugin.start = demux_mpeg_start; - this->demux_plugin.stop = demux_mpeg_stop; - this->demux_plugin.close = demux_mpeg_close; - this->demux_plugin.get_status = demux_mpeg_get_status; - this->demux_plugin.get_identifier = demux_mpeg_get_id; - - return (demux_plugin_t *) this; - break; - - default: - fprintf(stderr, - "Demuxer plugin doesn't support plugin API version %d.\n" - "PLUGIN DISABLED.\n" - "This means there's a version mismatch between xine and this " - "demuxer plugin.\nInstalling current input plugins should help.\n", + if (iface != 2) { + printf( "demux_mpeg: plugin doesn't support plugin API version %d.\n" + "demux_mpeg: this means there's a version mismatch between xine and this " + "demux_mpeg: demuxer plugin.\nInstalling current input plugins should help.\n", iface); return NULL; } + + this = xmalloc (sizeof (demux_mpeg_t)); + xine_debug = config->lookup_int (config, "xine_debug", 0); + + this->demux_plugin.interface_version = DEMUXER_PLUGIN_IFACE_VERSION; + this->demux_plugin.open = demux_mpeg_open; + this->demux_plugin.start = demux_mpeg_start; + this->demux_plugin.stop = demux_mpeg_stop; + this->demux_plugin.close = demux_mpeg_close; + this->demux_plugin.get_status = demux_mpeg_get_status; + this->demux_plugin.get_identifier = demux_mpeg_get_id; + + return (demux_plugin_t *) this; } diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c index 5120c4683..e66b06560 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.25 2001/07/13 23:43:12 jcdutton Exp $ + * $Id: demux_mpeg_block.c,v 1.26 2001/07/14 12:50:34 guenter Exp $ * * demultiplexer for mpeg 1/2 program streams * @@ -47,7 +47,6 @@ typedef struct demux_mpeg_block_s { fifo_buffer_t *audio_fifo; fifo_buffer_t *video_fifo; - fifo_buffer_t *spu_fifo; input_plugin_t *input; @@ -372,10 +371,6 @@ static void *demux_mpeg_block_loop (void *this_gen) { this->audio_fifo->put (this->audio_fifo, buf); } -/* buf = this->spu_fifo->buffer_pool_alloc (this->spu_fifo); */ - buf->type = BUF_CONTROL_END; - buf->decoder_info[0] = 0; /* stream finished */ -/* this->spu_fifo->put (this->spu_fifo, buf); */ } pthread_exit(NULL); @@ -416,12 +411,6 @@ static void demux_mpeg_block_stop (demux_plugin_t *this_gen) { this->audio_fifo->put (this->audio_fifo, buf); } -/* buf = this->spu_fifo->buffer_pool_alloc (this->spu_fifo); */ - buf->type = BUF_CONTROL_END; - buf->decoder_info[0] = 1; /* forced */ - -/* this->spu_fifo->put (this->spu_fifo, buf); */ - } static int demux_mpeg_block_get_status (demux_plugin_t *this_gen) { @@ -433,7 +422,6 @@ static int demux_mpeg_block_get_status (demux_plugin_t *this_gen) { static void demux_mpeg_block_start (demux_plugin_t *this_gen, fifo_buffer_t *video_fifo, fifo_buffer_t *audio_fifo, - fifo_buffer_t *spu_fifo, off_t pos, gui_get_next_mrl_cb_t next_mrl_cb, gui_branched_cb_t branched_cb) @@ -444,7 +432,6 @@ static void demux_mpeg_block_start (demux_plugin_t *this_gen, this->video_fifo = video_fifo; this->audio_fifo = audio_fifo; - this->spu_fifo = spu_fifo; this->next_mrl_cb = next_mrl_cb; this->branched_cb = branched_cb; @@ -465,10 +452,6 @@ static void demux_mpeg_block_start (demux_plugin_t *this_gen, this->audio_fifo->put (this->audio_fifo, buf); } -/* buf = this->spu_fifo->buffer_pool_alloc (this->spu_fifo); */ - buf->type = BUF_CONTROL_START; -/* this->spu_fifo->put (this->spu_fifo, buf); */ - if((this->input->get_capabilities(this->input) & INPUT_CAP_SEEKABLE) != 0) { int num_buffers = NUM_PREVIEW_BUFFERS; @@ -612,34 +595,28 @@ static void demux_mpeg_block_close (demux_plugin_t *this) { demux_plugin_t *init_demuxer_plugin(int iface, config_values_t *config) { - demux_mpeg_block_t *this = xmalloc (sizeof (demux_mpeg_block_t)); - - xine_debug = config->lookup_int (config, "xine_debug", 0); - - switch (iface) { + demux_mpeg_block_t *this; - case 1: - - this->demux_plugin.interface_version = DEMUXER_PLUGIN_IFACE_VERSION; - this->demux_plugin.open = demux_mpeg_block_open; - this->demux_plugin.start = demux_mpeg_block_start; - this->demux_plugin.stop = demux_mpeg_block_stop; - this->demux_plugin.close = demux_mpeg_block_close; - this->demux_plugin.get_status = demux_mpeg_block_get_status; - this->demux_plugin.get_identifier = demux_mpeg_block_get_id; - - this->scratch = xmalloc_aligned (512, 4096); - - return (demux_plugin_t *) this; - break; - - default: - fprintf(stderr, - "Demuxer plugin doesn't support plugin API version %d.\n" - "PLUGIN DISABLED.\n" - "This means there's a version mismatch between xine and this " - "demuxer plugin.\nInstalling current input plugins should help.\n", + if (iface != 2) { + printf( "demux_mpeg: plugin doesn't support plugin API version %d.\n" + "demux_mpeg: this means there's a version mismatch between xine and this " + "demux_mpeg: demuxer plugin.\nInstalling current input plugins should help.\n", iface); return NULL; } + + this = xmalloc (sizeof (demux_mpeg_block_t)); + xine_debug = config->lookup_int (config, "xine_debug", 0); + + this->demux_plugin.interface_version = DEMUXER_PLUGIN_IFACE_VERSION; + this->demux_plugin.open = demux_mpeg_block_open; + this->demux_plugin.start = demux_mpeg_block_start; + this->demux_plugin.stop = demux_mpeg_block_stop; + this->demux_plugin.close = demux_mpeg_block_close; + this->demux_plugin.get_status = demux_mpeg_block_get_status; + this->demux_plugin.get_identifier = demux_mpeg_block_get_id; + + this->scratch = xmalloc_aligned (512, 4096); + + return (demux_plugin_t *) this; } diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c index 15825aa86..7da1e26cf 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.14 2001/07/03 21:30:38 guenter Exp $ + * $Id: demux_mpgaudio.c,v 1.15 2001/07/14 12:50:34 guenter Exp $ * * demultiplexer for mpeg audio (i.e. mp3) streams * @@ -177,10 +177,9 @@ static int demux_mpgaudio_get_status (demux_plugin_t *this_gen) { } static void demux_mpgaudio_start (demux_plugin_t *this_gen, - fifo_buffer_t *video_fifo, - fifo_buffer_t *audio_fifo, - fifo_buffer_t *spu_fifo, - off_t pos, + fifo_buffer_t *video_fifo, + fifo_buffer_t *audio_fifo, + off_t pos, gui_get_next_mrl_cb_t next_mrl_cb, gui_branched_cb_t branched_cb) { demux_mpgaudio_t *this = (demux_mpgaudio_t *) this_gen; @@ -290,32 +289,28 @@ static void demux_mpgaudio_close (demux_plugin_t *this) { } demux_plugin_t *init_demuxer_plugin(int iface, config_values_t *config) { - demux_mpgaudio_t *this = malloc (sizeof (demux_mpgaudio_t)); - xine_debug = config->lookup_int (config, "xine_debug", 0); - - switch (iface) { - - case 1: - - this->demux_plugin.interface_version = DEMUX_MPGAUDIO_IFACE_VERSION; - this->demux_plugin.open = demux_mpgaudio_open; - this->demux_plugin.start = demux_mpgaudio_start; - this->demux_plugin.stop = demux_mpgaudio_stop; - this->demux_plugin.close = demux_mpgaudio_close; - this->demux_plugin.get_status = demux_mpgaudio_get_status; - this->demux_plugin.get_identifier = demux_mpgaudio_get_id; - - return &this->demux_plugin; - break; + demux_mpgaudio_t *this; - default: - fprintf(stderr, - "Demuxer plugin doesn't support plugin API version %d.\n" - "PLUGIN DISABLED.\n" - "This means there's a version mismatch between xine and this " - "demuxer plugin.\nInstalling current input plugins should help.\n", + if (iface != 2) { + printf( "demux_mpeg: plugin doesn't support plugin API version %d.\n" + "demux_mpeg: this means there's a version mismatch between xine and this " + "demux_mpeg: demuxer plugin.\nInstalling current input plugins should help.\n", iface); return NULL; } + + this = malloc (sizeof (demux_mpgaudio_t)); + xine_debug = config->lookup_int (config, "xine_debug", 0); + + this->demux_plugin.interface_version = DEMUX_MPGAUDIO_IFACE_VERSION; + this->demux_plugin.open = demux_mpgaudio_open; + this->demux_plugin.start = demux_mpgaudio_start; + this->demux_plugin.stop = demux_mpgaudio_stop; + this->demux_plugin.close = demux_mpgaudio_close; + this->demux_plugin.get_status = demux_mpgaudio_get_status; + this->demux_plugin.get_identifier = demux_mpgaudio_get_id; + + return &this->demux_plugin; } + diff --git a/src/xine-engine/Makefile.am b/src/xine-engine/Makefile.am index 3f8a30189..ff5d68d17 100644 --- a/src/xine-engine/Makefile.am +++ b/src/xine-engine/Makefile.am @@ -8,7 +8,7 @@ EXTRA_DIST = cpu_accel.c lib_LTLIBRARIES = libxine.la -libxine_la_SOURCES = xine.c metronom.c configfile.c spu_decoder.c buffer.c monitor.c \ +libxine_la_SOURCES = xine.c metronom.c configfile.c buffer.c monitor.c \ utils.c load_plugins.c video_decoder.c \ audio_decoder.c video_out.c libxine_la_LIBADD = cpu_accel.lo \ diff --git a/src/xine-engine/spu_decoder.c b/src/xine-engine/spu_decoder.c deleted file mode 100644 index 68036e6f8..000000000 --- a/src/xine-engine/spu_decoder.c +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (C) 2000-2001 the xine project - * - * Copyright (C) James Courtier-Dutton James@superbug.demon.co.uk - July 2001 - * - * This file is part of xine, a unix video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - * - * $Id: spu_decoder.c,v 1.6 2001/07/13 23:43:13 jcdutton Exp $ - * - - * functions that implement spu decoding - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "xine_internal.h" - -void *spu_decoder_loop (void *this_gen) { - - buf_element_t *buf; - xine_t *this = (xine_t *) this_gen; - int running = 1; - int i; - spu_decoder_t *decoder; - - while (running) { - - buf = this->spu_fifo->get (this->spu_fifo); - - this->cur_input_pos = buf->input_pos; - - switch (buf->type) { - - case BUF_CONTROL_START: - if (this->cur_spu_decoder_plugin) { - this->cur_spu_decoder_plugin->close (this->cur_spu_decoder_plugin); - this->cur_spu_decoder_plugin = NULL; - } - - pthread_mutex_lock (&this->xine_lock); - this->spu_finished = 0; - pthread_mutex_unlock (&this->xine_lock); - -/* FIXME: I don't think we need spu_track_map. */ - for (i=0 ; i<50; i++) - this->spu_track_map[0] = 0; - - this->spu_track_map_entries = 0; - - break; - - case BUF_CONTROL_END: - if (this->cur_spu_decoder_plugin) { - this->cur_spu_decoder_plugin->close (this->cur_spu_decoder_plugin); - this->cur_spu_decoder_plugin = NULL; - } - - pthread_mutex_lock (&this->xine_lock); - - this->spu_finished = 1; - - if (this->video_finished) { - pthread_mutex_unlock (&this->xine_lock); - xine_notify_stream_finished (this); - } else - pthread_mutex_unlock (&this->xine_lock); - - break; - - case BUF_CONTROL_QUIT: - if (this->cur_spu_decoder_plugin) { - this->cur_spu_decoder_plugin->close (this->cur_spu_decoder_plugin); - this->cur_spu_decoder_plugin = NULL; - } - running = 0; - break; - - default: - if ( (buf->type & 0xFF000000) == BUF_SPU_BASE ) { - - - /* now, decode this buffer if it's the right track */ - - if ( (buf->type & 0xFFFF)== this->spu_channel) { - - int streamtype = (buf->type>>16) & 0xFF; - decoder = this->spu_decoder_plugins [streamtype]; - if (decoder) { - if (this->cur_spu_decoder_plugin != decoder) { - - if (this->cur_spu_decoder_plugin) - this->cur_spu_decoder_plugin->close (this->cur_spu_decoder_plugin); - - this->cur_spu_decoder_plugin = decoder; - - this->cur_spu_decoder_plugin->init (this->cur_spu_decoder_plugin, this->video_out); - } - - decoder->decode_data (decoder, buf); - } - } - } else - fprintf (stderr,"spu_decoder: unknown buffer type: %08x\n", buf->type); - } - - buf->free_buffer (buf); - } - - pthread_exit(NULL); -} - -void spu_decoder_init (xine_t *this) { - -/* FIXME: Tempory disable to test SPU in VIDEO Thread */ - return; - this->spu_fifo = fifo_buffer_new (1500, 4096); - printf ("spu_decoder_init: thread starting %p\n",this->video_out); - - pthread_create (&this->spu_thread, NULL, spu_decoder_loop, this) ; -} - -void spu_decoder_shutdown (xine_t *this) { - - buf_element_t *buf; - void *p; - - /* this->spu_fifo->clear(this->spu_fifo); */ -/* FIXME: Tempory disable to test SPU in VIDEO Thread */ - return; - - buf = this->spu_fifo->buffer_pool_alloc (this->spu_fifo); - buf->type = BUF_CONTROL_QUIT; - this->spu_fifo->put (this->spu_fifo, buf); - - pthread_join (this->spu_thread, &p); -} - - diff --git a/src/xine-engine/spu_decoder.h b/src/xine-engine/spu_decoder.h index 267a7fbaa..5d1a2d478 100644 --- a/src/xine-engine/spu_decoder.h +++ b/src/xine-engine/spu_decoder.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_decoder.h,v 1.2 2001/07/04 20:32:29 uid32519 Exp $ + * $Id: spu_decoder.h,v 1.3 2001/07/14 12:50:34 guenter Exp $ */ #ifndef HAVE_SPU_OUT_H #define HAVE_SPU_OUT_H @@ -123,25 +123,7 @@ struct spu_functions_s { * spu output modes + capabilities */ -#define SPU_CAP_NOCAP 0x00000000 /* Driver have no capabilities */ -#define SPU_CAP_MODE_AC3 0x00000001 /* Driver support AC3 output */ -#define SPU_CAP_MODE_AC5 0x00000002 /* Driver support AC5 output */ -/* 1 sample == 2 bytes */ -#define SPU_CAP_MODE_MONO 0x00000004 /* Driver support mono output */ - /* 1 sample == 4 bytes */ -#define SPU_CAP_MODE_STEREO 0x00000008 /* Driver support stereo output */ - /* 1 sample == 8 bytes */ -#define SPU_CAP_MODE_4CHANNEL 0x00000010 /* Driver support 4 channels */ -/* 1 sample == 10 bytes */ -#define SPU_CAP_MODE_5CHANNEL 0x00000020 /* Driver support 5 channels */ -#define SPU_CAP_MIXER_VOL 0x00000040 /* Driver support mixer control */ -#define SPU_CAP_PCM_VOL 0x00000080 /* Driver support pcm control */ -#define SPU_CAP_MUTE_VOL 0x00000100 /* Driver can mute volume */ - -/* properties supported by get/set_property() */ -#define SPU_PROP_MIXER_VOL 0 -#define SPU_PROP_PCM_VOL 1 -#define SPU_PROP_MUTE_VOL 2 +/* none yet */ typedef struct spu_info_s { diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c index a6332a5d8..5a2a72298 100644 --- a/src/xine-engine/video_decoder.c +++ b/src/xine-engine/video_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: video_decoder.c,v 1.30 2001/07/13 23:43:13 jcdutton Exp $ + * $Id: video_decoder.c,v 1.31 2001/07/14 12:50:34 guenter Exp $ * */ @@ -35,6 +35,7 @@ void *video_decoder_loop (void *this_gen) { int i; int streamtype; video_decoder_t *decoder; + spu_decoder_t *spu_decoder; while (running) { @@ -80,19 +81,19 @@ void *video_decoder_loop (void *this_gen) { if ( (buf->type & 0xFFFF)== this->spu_channel) { int streamtype = (buf->type>>16) & 0xFF; - decoder = this->spu_decoder_plugins [streamtype]; - if (decoder) { - if (this->cur_spu_decoder_plugin != decoder) { + spu_decoder = this->spu_decoder_plugins [streamtype]; + if (spu_decoder) { + if (this->cur_spu_decoder_plugin != spu_decoder) { if (this->cur_spu_decoder_plugin) this->cur_spu_decoder_plugin->close (this->cur_spu_decoder_plugin); - this->cur_spu_decoder_plugin = decoder; + this->cur_spu_decoder_plugin = spu_decoder; this->cur_spu_decoder_plugin->init (this->cur_spu_decoder_plugin, this->video_out); } - decoder->decode_data (decoder, buf); + spu_decoder->decode_data (spu_decoder, buf); } } diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index c8fd4dc2a..dd8185628 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.32 2001/07/04 17:10:24 uid32519 Exp $ + * $Id: xine.c,v 1.33 2001/07/14 12:50:34 guenter Exp $ * * top-level xine functions * @@ -233,7 +233,7 @@ static void xine_play_internal (xine_t *this, char *mrl, this->cur_demuxer_plugin->start (this->cur_demuxer_plugin, this->video_fifo, this->audio_fifo, - this->spu_fifo, pos, + pos, this->get_next_mrl_cb, this->branched_cb); diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h index 2269c2117..a9292ca9d 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.27 2001/07/04 17:10:24 uid32519 Exp $ + * $Id: xine_internal.h,v 1.28 2001/07/14 12:50:34 guenter Exp $ * */ @@ -130,12 +130,11 @@ typedef struct xine_s { off_t cur_input_pos; char cur_mrl[1024]; - spu_functions_t *spu_out; - fifo_buffer_t *spu_fifo; + spu_functions_t *spu_out; pthread_t spu_thread; - spu_decoder_t *spu_decoder_plugins[DECODER_PLUGIN_MAX]; + spu_decoder_t *spu_decoder_plugins[DECODER_PLUGIN_MAX]; int num_spu_decoder_plugins; - spu_decoder_t *cur_spu_decoder_plugin; + spu_decoder_t *cur_spu_decoder_plugin; uint32_t spu_track_map[50]; int spu_track_map_entries; int spu_finished; |