summaryrefslogtreecommitdiff
path: root/src/xine-engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/xine-engine')
-rw-r--r--src/xine-engine/video_decoder.c10
-rw-r--r--src/xine-engine/xine.c49
-rw-r--r--src/xine-engine/xine_internal.h14
3 files changed, 39 insertions, 34 deletions
diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c
index dab46d628..3d3632b1e 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.4 2001/04/22 02:42:49 guenter Exp $
+ * $Id: video_decoder.c,v 1.5 2001/04/23 00:34:59 guenter Exp $
*
*/
@@ -43,7 +43,7 @@ void *video_decoder_loop (void *this_gen) {
switch (buf->type) {
case BUF_CONTROL_START:
if (this->video_cur_decoder) {
- this->video_cur_decoder->close ();
+ this->video_cur_decoder->close (this->video_cur_decoder);
this->video_cur_decoder = NULL;
}
@@ -62,7 +62,7 @@ void *video_decoder_loop (void *this_gen) {
if (this->video_cur_decoder != decoder) {
if (this->video_cur_decoder)
- this->video_cur_decoder->close ();
+ this->video_cur_decoder->close (this->video_cur_decoder);
this->video_cur_decoder = decoder;
this->video_cur_decoder->init (this->video_cur_decoder, this->video_out);
@@ -76,7 +76,7 @@ void *video_decoder_loop (void *this_gen) {
case BUF_CONTROL_END:
if (this->video_cur_decoder) {
- this->video_cur_decoder->close ();
+ this->video_cur_decoder->close (this->video_cur_decoder);
this->video_cur_decoder = NULL;
}
@@ -94,7 +94,7 @@ void *video_decoder_loop (void *this_gen) {
case BUF_CONTROL_QUIT:
if (this->video_cur_decoder) {
- this->video_cur_decoder->close ();
+ this->video_cur_decoder->close (this->video_cur_decoder);
this->video_cur_decoder = NULL;
}
running = 0;
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index 6e6b25496..63cdd01f0 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.4 2001/04/22 00:31:44 guenter Exp $
+ * $Id: xine.c,v 1.5 2001/04/23 00:34:59 guenter Exp $
*
* top-level xine functions
*
@@ -412,17 +412,17 @@ static void xine_pause (xine_t *this) {
/*
*
*/
-xine_t *xine_init (vo_instance_t *vo,
+xine_t *xine_init (vo_driver_t *vo,
ao_functions_t *ao,
gui_status_callback_func_t gui_status_callback,
- config_values_t *config, int demux_strategy, uint32_t debug_lvl) {
+ config_values_t *config) {
xine_t *this = xmalloc (sizeof (xine_t));
int err;
this->status_callback = gui_status_callback;
- this->demux_strategy = demux_strategy;
- xine_debug = debug_lvl;
+ this->config = config;
+ xine_debug = config->lookup_int (config, "xine_debug", 0);
#ifdef TEST_FILE
gTestFile = open ("/tmp/test.mp3", O_WRONLY | O_CREAT, 0644);
@@ -441,23 +441,38 @@ xine_t *xine_init (vo_instance_t *vo,
buffer_pool_init (2000, 4096);
/*
- * init demuxer
+ * create a metronom
*/
+
+ this->metronom = metronom_init ();
+
+ /*
+ * load input and demuxer plugins
+ */
+
+ load_input_plugins (this, config, INPUT_PLUGIN_IFACE_VERSION);
+ printf ("xine_init: input plugins loaded\n");
+
+ this->demux_strategy = config->lookup_int (config, "demux_strategy", 0);
+
load_demux_plugins(this, config, DEMUXER_PLUGIN_IFACE_VERSION);
this->audio_channel = 0;
this->spu_channel = -1;
this->cur_input_pos = 0;
- printf ("xine_init: demuxer initialized\n");
+ printf ("xine_init: demuxer plugins loaded\n");
/*
* init and start decoder threads
*/
+ this->video_out = vo_new_instance (vo, this->metronom);
video_decoder_init (this);
- this->mBufAudio = audio_decoder_init (ao);
+
+ this->audio_out = ao;
+ audio_decoder_init (this);
/*
* init SPU decoder
@@ -466,14 +481,6 @@ xine_t *xine_init (vo_instance_t *vo,
this->spu_fifo = fifo_buffer_new ();
spudec_init(NULL);
- /*
- * load input plugins
- */
-
- load_input_plugins (this, config, INPUT_PLUGIN_IFACE_VERSION);
-
- printf ("xine_init: plugins loaded\n");
-
return this;
}
@@ -527,15 +534,6 @@ void xine_select_spu_channel (xine_t *this, int nChannel) {
/*
*
*/
-input_plugin_t* xine_get_input_plugin_list (xine_t *this, int *nInputPlugins) {
-
- *nInputPlugins = this->num_input_plugins;
- return this->input_plugins;
-}
-
-/*
- *
- */
int xine_get_current_position (xine_t *this) {
off_t len;
@@ -566,3 +564,4 @@ int xine_get_status(xine_t *this) {
return this->status;
}
+
diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h
index 36c04b108..681e12bc9 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.6 2001/04/22 02:42:49 guenter Exp $
+ * $Id: xine_internal.h,v 1.7 2001/04/23 00:34:59 guenter Exp $
*
*/
@@ -44,6 +44,10 @@
/*
* generic xine video decoder plugin interface
+ *
+ * for a dynamic plugin make sure you provide this function call:
+ * video_decoder_t *init_video_decoder_plugin (int iface_version,
+ * config_values_t *cfg);
*/
typedef struct video_decoder_s video_decoder_t;
@@ -60,7 +64,7 @@ struct video_decoder_s {
void (*release_img_buffers) (video_decoder_t *this);
- void (*close) (void);
+ void (*close) (video_decoder_t *this);
};
@@ -105,6 +109,8 @@ typedef struct xine_s {
/* private : */
metronom_t *metronom;
+
+ config_values_t *config;
input_plugin_t input_plugins[INPUT_PLUGIN_MAX];
int num_input_plugins;
@@ -165,10 +171,10 @@ config_values_t *config_file_init (char *filename);
*
*/
-xine_t *xine_init (vo_instance_t *vo,
+xine_t *xine_init (vo_driver_t *vo,
ao_functions_t *ao,
gui_status_callback_func_t gui_status_callback,
- config_values_t *config, int demux_strategy, uint32_t debug_lvl) ;
+ config_values_t *config);
/*
* open a stream and play it