summaryrefslogtreecommitdiff
path: root/src/xine-engine
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2001-07-14 12:50:33 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2001-07-14 12:50:33 +0000
commitdfd980788abf3d0905a24204bf8d0554dc4d8a77 (patch)
tree3e63c268028cbe158efee41dc36f8089afaa0e4c /src/xine-engine
parent85eb608c7a602f971f779106c812b48f6c2cd030 (diff)
downloadxine-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
Diffstat (limited to 'src/xine-engine')
-rw-r--r--src/xine-engine/Makefile.am2
-rw-r--r--src/xine-engine/spu_decoder.c154
-rw-r--r--src/xine-engine/spu_decoder.h22
-rw-r--r--src/xine-engine/video_decoder.c13
-rw-r--r--src/xine-engine/xine.c4
-rw-r--r--src/xine-engine/xine_internal.h9
6 files changed, 16 insertions, 188 deletions
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;