summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2001-04-23 22:43:59 +0000
committerDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2001-04-23 22:43:59 +0000
commitdbd6a0cfee0d90385cccbf7e6a6d28534918b8a0 (patch)
tree3958aed69403dd80d2d2c35e8296370e97789826
parent0f2bc0625a00c5596cd84bd58698ab53c34d9cf7 (diff)
downloadxine-lib-dbd6a0cfee0d90385cccbf7e6a6d28534918b8a0.tar.gz
xine-lib-dbd6a0cfee0d90385cccbf7e6a6d28534918b8a0.tar.bz2
Fixed libmpeg2 plugin decoder name (i think) + debug build cflags. Add
get_id in video_decoder_t struct type. Harmonize plugin array names in xine_t struct type (video_decoders and audio_decoders names). More works in load_plugins.c (not finished, really not). CVS patchset: 18 CVS date: 2001/04/23 22:43:59
-rw-r--r--include/video_out.h4
-rw-r--r--src/libmpeg2/Makefile.am11
-rw-r--r--src/libmpeg2/xine_decoder.c9
-rw-r--r--src/xine-engine/Makefile.am19
-rw-r--r--src/xine-engine/audio_decoder.c36
-rw-r--r--src/xine-engine/load_plugins.c312
-rw-r--r--src/xine-engine/video_decoder.c38
-rw-r--r--src/xine-engine/xine_internal.h23
8 files changed, 378 insertions, 74 deletions
diff --git a/include/video_out.h b/include/video_out.h
index 1f3c10285..8e733bde2 100644
--- a/include/video_out.h
+++ b/include/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.5 2001/04/23 00:34:59 guenter Exp $
+ * $Id: video_out.h,v 1.6 2001/04/23 22:43:59 f1rmb Exp $
*
*
* xine version of video_out.h
@@ -43,6 +43,8 @@
#include "xine/metronom.h"
#endif
+#define VIDEO_OUT_PLUGIN_IFACE_VERSION 1
+
typedef struct vo_frame_s vo_frame_t;
typedef struct vo_driver_s vo_driver_t ;
typedef struct vo_instance_s vo_instance_t;
diff --git a/src/libmpeg2/Makefile.am b/src/libmpeg2/Makefile.am
index c6c6a1391..8eadd03a0 100644
--- a/src/libmpeg2/Makefile.am
+++ b/src/libmpeg2/Makefile.am
@@ -6,20 +6,19 @@ LIBTOOL = $(SHELL) $(top_builddir)/libtool-nofpic
libdir = $(XINE_PLUGINDIR)
-lib_LTLIBRARIES = xineplug_decode_mpeg2.la
+lib_LTLIBRARIES = xineplug_vo_dec_mpeg2.la
#libmpeg2_la_SOURCES = slice.c header.c stats.c idct.c motion_comp.c\
# decode.c idct_mmx.c motion_comp_mmx.c
-xineplug_decode_mpeg2_la_SOURCES = slice.c header.c stats.c idct.c motion_comp.c\
- decode.c idct_mmx.c motion_comp_mmx.c xine_decoder.c
-xineplug_decode_mpeg2_la_LDFLAGS = -avoid-version -module
-
+xineplug_vo_dec_mpeg2_la_SOURCES = slice.c header.c stats.c idct.c \
+ motion_comp.c decode.c idct_mmx.c motion_comp_mmx.c xine_decoder.c
+xineplug_vo_dec_mpeg2_la_LDFLAGS = -avoid-version -module
noinst_HEADERS = vlc.h mpeg2.h mpeg2_internal.h
debug:
- $(MAKE) CFLAGS="$(DEBUG_CFLAGS) @BUILD_LIB_STATIC@"
+ $(MAKE) CFLAGS="$(DEBUG_CFLAGS)"
mostlyclean-generic:
-rm -f *~ \#* .*~ .\#*
diff --git a/src/libmpeg2/xine_decoder.c b/src/libmpeg2/xine_decoder.c
index a2f358b6d..9e8214d5e 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.1 2001/04/23 00:34:59 guenter Exp $
+ * $Id: xine_decoder.c,v 1.2 2001/04/23 22:43:59 f1rmb Exp $
*
* stuff needed to turn libmpeg2 into a xine decoder plugin
*/
@@ -70,6 +70,10 @@ void mpeg2dec_close (video_decoder_t *this_gen) {
mpeg2_close (&this->mpeg2);
}
+static char *mpeg2dec_get_id(void) {
+ return "MPEG2DEC";
+}
+
video_decoder_t *init_video_decoder_plugin (int iface_version, config_values_t *cfg) {
mpeg2dec_decoder_t *this ;
@@ -85,7 +89,8 @@ video_decoder_t *init_video_decoder_plugin (int iface_version, config_values_t *
this->video_decoder.decode_data = mpeg2dec_decode_data;
this->video_decoder.release_img_buffers = mpeg2dec_release_img_buffers;
this->video_decoder.close = mpeg2dec_close;
-
+ this->video_decoder.get_identifier = mpeg2dec_get_id;
+
return (video_decoder_t *) this;
}
diff --git a/src/xine-engine/Makefile.am b/src/xine-engine/Makefile.am
index 27e76693b..b07b728ee 100644
--- a/src/xine-engine/Makefile.am
+++ b/src/xine-engine/Makefile.am
@@ -12,7 +12,7 @@ libxine_la_SOURCES = metronom.c configfile.c monitor.c utils.c cpu_accel.c \
load_plugins.c video_decoder.c audio_decoder.c
libxine_la_DEPENDENCIES = libsdeps
libxine_la_LIBADD = \
-# $(top_srcdir)/src/libmpeg2/libmpeg2.la \
+## $(top_srcdir)/src/libmpeg2/libmpeg2.la \
$(top_srcdir)/src/libac3/libac3.la \
$(top_srcdir)/src/libmpg123/libmpg123.la \
## $(top_srcdir)/src/libspudec/libspudec.la \
@@ -23,11 +23,10 @@ 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
-##
+###
# Hardcoded rule:
# gcc failed to compile this with -fPIC flag
# hackish: [X] yes [ ] no
@@ -50,15 +49,15 @@ debug:
libsdeps:
- @cd $(top_builddir)/src/libmpeg2 && $(MAKE) libmpeg2.la
+## @cd $(top_builddir)/src/libmpeg2 && $(MAKE) libmpeg2.la
@cd $(top_builddir)/src/libac3 && $(MAKE) libac3.la
@cd $(top_builddir)/src/libmpg123 && $(MAKE) libmpg123.la
## @cd $(top_builddir)/src/libspudec && $(MAKE) libspudec.la
-##
-## Install header files (default=$includedir/xine)
-##
+###
+# Install header files (default=$includedir/xine)
+#
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(includedir)/xine
@@ -69,9 +68,9 @@ install-includeHEADERS: $(include_HEADERS)
done
-##
-## Remove them
-##
+###
+# Remove them
+#
uninstall-includeHEADERS:
@$(NORMAL_UNINSTALL)
list='$(include_HEADERS)'; for p in $$list; do \
diff --git a/src/xine-engine/audio_decoder.c b/src/xine-engine/audio_decoder.c
index bcd51d1dc..13b21d0ab 100644
--- a/src/xine-engine/audio_decoder.c
+++ b/src/xine-engine/audio_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: audio_decoder.c,v 1.2 2001/04/22 02:42:49 guenter Exp $
+ * $Id: audio_decoder.c,v 1.3 2001/04/23 22:43:59 f1rmb Exp $
*
*
* functions that implement audio decoding
@@ -47,9 +47,9 @@ void *audio_decoder_loop (void *this_gen) {
switch (buf->type) {
case BUF_CONTROL_START:
- if (this->audio_cur_decoder) {
- this->audio_cur_decoder->close (this->audio_cur_decoder);
- this->audio_cur_decoder = NULL;
+ if (this->cur_audio_decoder_plugin) {
+ this->cur_audio_decoder_plugin->close (this->cur_audio_decoder_plugin);
+ this->cur_audio_decoder_plugin = NULL;
}
pthread_mutex_lock (&this->xine_lock);
@@ -63,16 +63,16 @@ void *audio_decoder_loop (void *this_gen) {
case BUF_AUDIO_LPCM:
case BUF_AUDIO_AVI:
- decoder = this->audio_decoders [(buf->type>>16) & 0xFF];
+ decoder = this->audio_decoder_plugins [(buf->type>>16) & 0xFF];
if (decoder) {
- if (this->audio_cur_decoder != decoder) {
+ if (this->cur_audio_decoder_plugin != decoder) {
- if (this->audio_cur_decoder)
- this->audio_cur_decoder->close (this->audio_cur_decoder);
+ if (this->cur_audio_decoder_plugin)
+ this->cur_audio_decoder_plugin->close (this->cur_audio_decoder_plugin);
- this->audio_cur_decoder = decoder;
- this->audio_cur_decoder->init (this->audio_cur_decoder, this->audio_out);
+ this->cur_audio_decoder_plugin = decoder;
+ this->cur_audio_decoder_plugin->init (this->cur_audio_decoder_plugin, this->audio_out);
}
@@ -82,9 +82,9 @@ void *audio_decoder_loop (void *this_gen) {
break;
case BUF_CONTROL_END:
- if (this->audio_cur_decoder) {
- this->audio_cur_decoder->close (this->audio_cur_decoder);
- this->audio_cur_decoder = NULL;
+ if (this->cur_audio_decoder_plugin) {
+ this->cur_audio_decoder_plugin->close (this->cur_audio_decoder_plugin);
+ this->cur_audio_decoder_plugin = NULL;
}
pthread_mutex_lock (&this->xine_lock);
@@ -100,9 +100,9 @@ void *audio_decoder_loop (void *this_gen) {
break;
case BUF_CONTROL_QUIT:
- if (this->audio_cur_decoder) {
- this->audio_cur_decoder->close (this->audio_cur_decoder);
- this->audio_cur_decoder = NULL;
+ if (this->cur_audio_decoder_plugin) {
+ this->cur_audio_decoder_plugin->close (this->cur_audio_decoder_plugin);
+ this->cur_audio_decoder_plugin = NULL;
}
running = 0;
break;
@@ -119,9 +119,9 @@ void audio_decoder_init (xine_t *this) {
int i;
- this->audio_cur_decoder = NULL;
+ this->cur_audio_decoder_plugin = NULL;
for (i=0; i<AUDIO_OUT_PLUGIN_MAX; i++)
- this->audio_decoders[i] = NULL;
+ this->audio_decoder_plugins[i] = NULL;
/* FIXME: dynamically load these
this->audio_decoders[BUF_AC3AUDIO] = init_audio_decoder_ac3dec ();
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c
index 29d18bf44..4d274fb93 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.3 2001/04/21 00:14:41 f1rmb Exp $
+ * $Id: load_plugins.c,v 1.4 2001/04/23 22:43:59 f1rmb Exp $
*
*
* Load input/demux/audio_out/video_out/codec plugins
@@ -87,12 +87,12 @@ void load_demux_plugins (xine_t *this,
demux_plugin_t *dxp;
dxp = (demux_plugin_t *) initplug(iface_version, config);
- this->demuxer_plugins[this->num_demuxer_plugins] = *dxp;
+ this->demuxer_plugins[this->num_demuxer_plugins] = dxp;
printf("demux plugin found : %s(ID: %s, iface: %d)\n",
str,
- this->demuxer_plugins[this->num_demuxer_plugins].get_identifier(),
- this->demuxer_plugins[this->num_demuxer_plugins].interface_version);
+ this->demuxer_plugins[this->num_demuxer_plugins]->get_identifier(),
+ this->demuxer_plugins[this->num_demuxer_plugins]->interface_version);
this->num_demuxer_plugins++;
}
@@ -160,12 +160,12 @@ void load_input_plugins (xine_t *this,
input_plugin_t *ip;
ip = (input_plugin_t *) initplug(iface_version, config);
- this->input_plugins[this->num_input_plugins] = *ip;
+ this->input_plugins[this->num_input_plugins] = ip;
printf("input plugin found : %s(ID: %s, iface: %d)\n",
str,
- this->input_plugins[this->num_input_plugins].get_identifier(),
- this->input_plugins[this->num_input_plugins].interface_version);
+ this->input_plugins[this->num_input_plugins]->get_identifier(),
+ this->input_plugins[this->num_input_plugins]->interface_version);
this->num_input_plugins++;
}
@@ -188,20 +188,312 @@ void load_input_plugins (xine_t *this,
}
+
+void load_video_decoder_plugins (xine_t *this,
+ config_values_t *config, int iface_version) {
+ DIR *dir;
+
+ this->num_video_decoder_plugins = 0;
+
+ dir = opendir (XINE_PLUGINDIR) ;
+
+ if (dir) {
+ struct dirent *pEntry;
+
+ while ((pEntry = readdir (dir)) != NULL) {
+ char str[1024];
+ void *plugin;
+
+ int nLen = strlen (pEntry->d_name);
+
+ if ((strncasecmp(pEntry->d_name,
+ XINE_VIDEO_DECODER_PLUGIN_PREFIXNAME,
+ XINE_VIDEO_DECODER_PLUGIN_PREFIXNAME_LENGTH) == 0) &&
+ ((pEntry->d_name[nLen-3]=='.')
+ && (pEntry->d_name[nLen-2]=='s')
+ && (pEntry->d_name[nLen-1]=='o'))) {
+
+ /*
+ * video decoder plugin found => load it
+ */
+
+ sprintf (str, "%s/%s", XINE_PLUGINDIR, pEntry->d_name);
+
+ if(!(plugin = dlopen (str, RTLD_LAZY))) {
+ fprintf(stderr, "%s(%d): %s doesn't seem to be installed (%s)\n",
+ __FILE__, __LINE__, str, dlerror());
+ exit(1);
+ }
+ else {
+ void *(*initplug) (int, config_values_t *);
+
+ if((initplug = dlsym(plugin, "init_video_decoder_plugin")) != NULL) {
+ video_decoder_t *vdp;
+
+ vdp = (video_decoder_t *) initplug(iface_version, config);
+ this->video_decoder_plugins[this->num_video_decoder_plugins] = vdp;
+
+ printf("video decoder plugin found : %s(ID: %s, iface: %d)\n",
+ str,
+ this->video_decoder_plugins[this->num_video_decoder_plugins]->get_identifier(),
+ this->video_decoder_plugins[this->num_video_decoder_plugins]->interface_version);
+
+ this->num_video_decoder_plugins++;
+ }
+
+ if(this->num_video_decoder_plugins > VIDEO_DECODER_PLUGIN_MAX) {
+ fprintf(stderr, "%s(%d): too many video decoder plugins installed,"
+ " exiting.\n", __FILE__, __LINE__);
+ exit(1);
+ }
+ }
+ }
+ }
+ }
+
+ this->cur_video_decoder_plugin = NULL;
+}
+
+void load_audio_decoder_plugins (xine_t *this,
+ config_values_t *config, int iface_version) {
+ DIR *dir;
+
+ this->num_audio_decoder_plugins = 0;
+
+ dir = opendir (XINE_PLUGINDIR) ;
+
+ if (dir) {
+ struct dirent *pEntry;
+
+ while ((pEntry = readdir (dir)) != NULL) {
+ char str[1024];
+ void *plugin;
+
+ int nLen = strlen (pEntry->d_name);
+
+ if ((strncasecmp(pEntry->d_name,
+ XINE_AUDIO_DECODER_PLUGIN_PREFIXNAME,
+ XINE_AUDIO_DECODER_PLUGIN_PREFIXNAME_LENGTH) == 0) &&
+ ((pEntry->d_name[nLen-3]=='.')
+ && (pEntry->d_name[nLen-2]=='s')
+ && (pEntry->d_name[nLen-1]=='o'))) {
+
+ /*
+ * audio decoder plugin found => load it
+ */
+
+ sprintf (str, "%s/%s", XINE_PLUGINDIR, pEntry->d_name);
+
+ if(!(plugin = dlopen (str, RTLD_LAZY))) {
+ fprintf(stderr, "%s(%d): %s doesn't seem to be installed (%s)\n",
+ __FILE__, __LINE__, str, dlerror());
+ exit(1);
+ }
+ else {
+ void *(*initplug) (int, config_values_t *);
+
+ if((initplug = dlsym(plugin, "init_audio_decoder_plugin")) != NULL) {
+ audio_decoder_t *vdp;
+
+ vdp = (audio_decoder_t *) initplug(iface_version, config);
+ this->audio_decoder_plugins[this->num_audio_decoder_plugins] = vdp;
+
+ printf("audio decoder plugin found : %s(ID: %s, iface: %d)\n",
+ str,
+ this->audio_decoder_plugins[this->num_audio_decoder_plugins]->get_identifier(),
+ this->audio_decoder_plugins[this->num_audio_decoder_plugins]->interface_version);
+
+ this->num_audio_decoder_plugins++;
+ }
+
+ if(this->num_audio_decoder_plugins > AUDIO_DECODER_PLUGIN_MAX) {
+ fprintf(stderr, "%s(%d): too many audio decoder plugins installed,"
+ " exiting.\n", __FILE__, __LINE__);
+ exit(1);
+ }
+ }
+ }
+ }
+ }
+
+ this->cur_audio_decoder_plugin = NULL;
+}
+
void load_video_out_plugins (xine_t *this,
config_values_t *config, int iface_version) {
- // Not implemented yet.
}
void load_audio_out_plugins (xine_t *this,
config_values_t *config, int iface_version) {
- // Not implemented yet.
}
void load_codec_plugins (xine_t *this,
config_values_t *config, int iface_version) {
- // Not implemented yet.
}
+
+/*
+vo_instance_t *load_video_output_plugin(char *filename, char *id) {
+ DIR *dir;
+ vo_instance_t *voi;
+
+ if(filename == NULL && id == NULL)
+ return NULL;
+
+ dir = opendir (XINE_PLUGINDIR);
+
+ if (dir) {
+ struct dirent *pEntry;
+
+ while ((pEntry = readdir (dir)) != NULL) {
+
+ char str[1024];
+ void *plugin;
+
+ int nLen = strlen (pEntry->d_name);
+
+ if ((strncasecmp(pEntry->d_name,
+ XINE_VIDEO_OUT_PLUGIN_PREFIXNAME,
+ XINE_VIDEO_OUT_PLUGIN_PREFIXNAME_LENGTH) == 0) &&
+ ((pEntry->d_name[nLen-3]=='.')
+ && (pEntry->d_name[nLen-2]=='s')
+ && (pEntry->d_name[nLen-1]=='o'))) {
+
+ sprintf (str, "%s/%s", XINE_PLUGINDIR, pEntry->d_name);
+
+ if(filename) {
+ if(!strncasecmp(filename, pEntry->d_name, strlen(filename))) {
+
+ if(!(plugin = dlopen (str, RTLD_LAZY))) {
+ fprintf(stderr, "%s(%d): %s doesn't seem to be installed (%s)\n",
+ __FILE__, __LINE__, str, dlerror());
+ exit(1);
+ }
+ else {
+ void *(*initplug) (int, config_values_t *);
+
+ if((initplug = dlsym(plugin, "init_video_out_plugin")) != NULL) {
+ video_out_plugin_t *vop;
+
+ vop = (video_out_plugin_t *) initplug(iface_version, config);
+ this->video_out_plugins[this->num_input_plugins] = vop;
+
+ printf("video output plugin found : %s(ID: %s, iface: %d)\n",
+ str,
+ this->input_plugins[this->num_input_plugins].get_identifier(),
+ this->input_plugins[this->num_input_plugins].interface_version);
+
+
+ if((voi = xmalloc(sizeof(vo_instance_t))) != NULL) {
+ voi =
+ }
+ }
+
+*/ /*
+ if(!(plugin = dlopen (str, RTLD_LAZY))) {
+ fprintf(stderr, "%s(%d): %s doesn't seem to be installed (%s)\n",
+ __FILE__, __LINE__, str, dlerror());
+ exit(1);
+ }
+ else {
+ void *(*initplug) (int, config_values_t *);
+
+ if((initplug = dlsym(plugin, "init_demuxer_plugin")) != NULL) {
+ input_plugin_t *ip;
+
+ ip = (input_plugin_t *) initplug(iface_version, config);
+ this->input_plugins[this->num_input_plugins] = *ip;
+
+ printf("input plugin found : %s(ID: %s, iface: %d)\n",
+ str,
+ this->input_plugins[this->num_input_plugins].get_identifier(),
+ this->input_plugins[this->num_input_plugins].interface_version);
+
+ this->num_input_plugins++;
+ }
+
+ */
+
+
+ /*
+ * input plugin found => load it
+ */
+/*
+ sprintf (str, "%s/%s", XINE_PLUGINDIR, pEntry->d_name);
+
+ if(!(plugin = dlopen (str, RTLD_LAZY))) {
+ fprintf(stderr, "%s(%d): %s doesn't seem to be installed (%s)\n",
+ __FILE__, __LINE__, str, dlerror());
+ exit(1);
+ }
+ else {
+ void *(*initplug) (int, config_values_t *);
+
+ if((initplug = dlsym(plugin, "init_demuxer_plugin")) != NULL) {
+ input_plugin_t *ip;
+
+ ip = (input_plugin_t *) initplug(iface_version, config);
+ this->input_plugins[this->num_input_plugins] = *ip;
+
+ printf("input plugin found : %s(ID: %s, iface: %d)\n",
+ str,
+ this->input_plugins[this->num_input_plugins].get_identifier(),
+ this->input_plugins[this->num_input_plugins].interface_version);
+
+ this->num_input_plugins++;
+ }
+
+ if(this->num_input_plugins > INPUT_PLUGIN_MAX) {
+ fprintf(stderr, "%s(%d): too many input plugins installed, "
+ "exiting.\n", __FILE__, __LINE__);
+ exit(1);
+ }
+ }
+ }
+ }
+ }
+
+ if (this->num_input_plugins == 0) {
+ printf ("No input plugins found in %s! - "
+ "Did you install xine correctly??\n", XINE_PLUGINDIR);
+ exit (1);
+ }
+}
+*/
+
+char **enum_video_output_plugins(int output_type) {
+ /*
+ Add into xine.h and xine_internal.h
+ VIDEO_OUTPUT_TYPE_ALL
+ VIDEO_OUTPUT_TYPE_X11
+ VIDEO_OUTPUT_TYPE_FB
+ ...
+ */
+ return NULL;
+}
+
+ao_functions_t *load_audio_output_plugin(char *filename, char *id) {
+
+ if(filename == NULL && id == NULL)
+ return NULL;
+
+ // Not implemented
+
+ return NULL;
+}
+char **enum_audio_output_plugins(int output_type) {
+ /*
+ Add into xine.h and xine_internal.h
+ not sure about names !!
+ AUDIO_OUTPUT_TYPE_ALL
+ AUDIO_OUTPUT_TYPE_OSS
+ AUDIO_OUTPUT_TYPE_ALSA
+ AUDIO_OUTPUT_TYPE_ESD
+ ...
+ */
+ return NULL;
+}
+
+
diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c
index 3d3632b1e..7112beec1 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.5 2001/04/23 00:34:59 guenter Exp $
+ * $Id: video_decoder.c,v 1.6 2001/04/23 22:43:59 f1rmb Exp $
*
*/
@@ -42,9 +42,9 @@ 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);
- this->video_cur_decoder = NULL;
+ if (this->cur_video_decoder_plugin) {
+ this->cur_video_decoder_plugin->close (this->cur_video_decoder_plugin);
+ this->cur_video_decoder_plugin = NULL;
}
pthread_mutex_lock (&this->xine_lock);
@@ -56,28 +56,28 @@ void *video_decoder_loop (void *this_gen) {
case BUF_VIDEO_MPEG:
case BUF_VIDEO_AVI:
- decoder = this->video_decoders [(buf->type>>16) & 0xFF];
+ decoder = this->video_decoder_plugins [(buf->type>>16) & 0xFF];
if (decoder) {
- if (this->video_cur_decoder != decoder) {
+ if (this->cur_video_decoder_plugin != decoder) {
- if (this->video_cur_decoder)
- this->video_cur_decoder->close (this->video_cur_decoder);
+ if (this->cur_video_decoder_plugin)
+ this->cur_video_decoder_plugin->close (this->cur_video_decoder_plugin);
- this->video_cur_decoder = decoder;
- this->video_cur_decoder->init (this->video_cur_decoder, this->video_out);
+ this->cur_video_decoder_plugin = decoder;
+ this->cur_video_decoder_plugin->init (this->cur_video_decoder_plugin, this->video_out);
}
- decoder->decode_data (this->video_cur_decoder, buf);
+ decoder->decode_data (this->cur_video_decoder_plugin, buf);
}
break;
case BUF_CONTROL_END:
- if (this->video_cur_decoder) {
- this->video_cur_decoder->close (this->video_cur_decoder);
- this->video_cur_decoder = NULL;
+ if (this->cur_video_decoder_plugin) {
+ this->cur_video_decoder_plugin->close (this->cur_video_decoder_plugin);
+ this->cur_video_decoder_plugin = NULL;
}
pthread_mutex_lock (&this->xine_lock);
@@ -93,9 +93,9 @@ void *video_decoder_loop (void *this_gen) {
break;
case BUF_CONTROL_QUIT:
- if (this->video_cur_decoder) {
- this->video_cur_decoder->close (this->video_cur_decoder);
- this->video_cur_decoder = NULL;
+ if (this->cur_video_decoder_plugin) {
+ this->cur_video_decoder_plugin->close (this->cur_video_decoder_plugin);
+ this->cur_video_decoder_plugin = NULL;
}
running = 0;
break;
@@ -112,9 +112,9 @@ void video_decoder_init (xine_t *this) {
int i;
- this->video_cur_decoder = NULL;
+ this->cur_video_decoder_plugin = NULL;
for (i=0; i<DECODER_PLUGIN_MAX; i++)
- this->video_decoders[i] = NULL;
+ this->video_decoder_plugins[i] = NULL;
/* FIXME: load video decoder plugins
this->video_decoders[0x00] = init_video_decoder_mpeg2dec ();
diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h
index 681e12bc9..910f8be77 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.7 2001/04/23 00:34:59 guenter Exp $
+ * $Id: xine_internal.h,v 1.8 2001/04/23 22:43:59 f1rmb Exp $
*
*/
@@ -38,8 +38,9 @@
#define CODEC_PLUGIN_MAX 50
#define AUDIO_OUT_PLUGIN_IFACE_VERSION 1
#define AUDIO_OUT_PLUGIN_MAX 50
-#define VIDEO_OUT_PLUGIN_IFACE_VERSION 1
#define VIDEO_OUT_PLUGIN_MAX 50
+#define VIDEO_DECODER_PLUGIN_MAX 50
+#define AUDIO_DECODER_PLUGIN_MAX 50
/*
@@ -66,6 +67,8 @@ struct video_decoder_s {
void (*close) (video_decoder_t *this);
+ char* (*get_identifier) (void);
+
};
/*
@@ -86,6 +89,8 @@ struct audio_decoder_s {
void (*close) (audio_decoder_t *this);
+ char* (*get_identifier) (void);
+
};
/*
@@ -112,11 +117,11 @@ typedef struct xine_s {
config_values_t *config;
- input_plugin_t input_plugins[INPUT_PLUGIN_MAX];
+ input_plugin_t *input_plugins[INPUT_PLUGIN_MAX];
int num_input_plugins;
input_plugin_t *cur_input_plugin;
- demux_plugin_t demuxer_plugins[DEMUXER_PLUGIN_MAX];
+ demux_plugin_t *demuxer_plugins[DEMUXER_PLUGIN_MAX];
int num_demuxer_plugins;
demux_plugin_t *cur_demuxer_plugin;
int demux_stragegy;
@@ -133,15 +138,17 @@ typedef struct xine_s {
vo_instance_t *video_out;
fifo_buffer_t *video_fifo;
pthread_t video_thread;
- video_decoder_t *video_decoders[DECODER_PLUGIN_MAX];
- video_decoder_t *video_cur_decoder;
+ video_decoder_t *video_decoder_plugins[DECODER_PLUGIN_MAX];
+ int num_video_decoder_plugins;
+ video_decoder_t *cur_video_decoder_plugin;
int video_finished;
ao_functions_t *audio_out;
fifo_buffer_t *audio_fifo;
pthread_t audio_thread;
- audio_decoder_t *audio_decoders[DECODER_PLUGIN_MAX];
- audio_decoder_t *audio_cur_decoder;
+ audio_decoder_t *audio_decoder_plugins[DECODER_PLUGIN_MAX];
+ int num_audio_decoder_plugins;
+ audio_decoder_t *cur_audio_decoder_plugin;
int audio_finished;
gui_status_callback_func_t gui_status_callback;