summaryrefslogtreecommitdiff
path: root/src/xine-engine
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2001-04-30 23:07:00 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2001-04-30 23:07:00 +0000
commit28c416d618957287e261cdbec7a521ee4d30e101 (patch)
treebf74762ce43faf162b58a33b35f650ce6f307ad6 /src/xine-engine
parent44d0a5b25906375317025cbb82f1d80a5a9c7f2a (diff)
downloadxine-lib-28c416d618957287e261cdbec7a521ee4d30e101.tar.gz
xine-lib-28c416d618957287e261cdbec7a521ee4d30e101.tar.bz2
changed decoder storing and a file input plugin bugfix
CVS patchset: 50 CVS date: 2001/04/30 23:07:00
Diffstat (limited to 'src/xine-engine')
-rw-r--r--src/xine-engine/load_plugins.c47
-rw-r--r--src/xine-engine/video_decoder.c18
-rw-r--r--src/xine-engine/xine_internal.h5
3 files changed, 37 insertions, 33 deletions
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c
index d0c40cda7..56b89cc74 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.16 2001/04/29 01:09:23 guenter Exp $
+ * $Id: load_plugins.c,v 1.17 2001/04/30 23:07:00 guenter Exp $
*
*
* Load input/demux/audio_out/video_out/codec plugins
@@ -217,12 +217,10 @@ void load_decoder_plugins (xine_t *this,
* clean up first
*/
- this->num_video_decoder_plugins = 0;
this->cur_video_decoder_plugin = NULL;
for (i=0; i<DECODER_PLUGIN_MAX; i++)
this->video_decoder_plugins[i] = NULL;
- this->num_audio_decoder_plugins = 0;
this->cur_audio_decoder_plugin = NULL;
for (i=0; i<AUDIO_OUT_PLUGIN_MAX; i++)
this->audio_decoder_plugins[i] = NULL;
@@ -268,50 +266,43 @@ void load_decoder_plugins (xine_t *this,
*/
if((initplug = dlsym(plugin, "init_video_decoder_plugin")) != NULL) {
+
video_decoder_t *vdp;
+ int streamtype;
vdp = (video_decoder_t *) initplug(iface_version, config);
- this->video_decoder_plugins[this->num_video_decoder_plugins] = vdp;
+
+ for (streamtype = 0; streamtype<256; streamtype++) {
+ if (vdp->can_handle (vdp, (streamtype<<16) | BUF_VIDEO_BASE))
+ this->video_decoder_plugins[streamtype] = 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);
+ printf("video decoder plugin found : %s (ID: %s, iface: %d)\n",
+ pEntry->d_name, vdp->get_identifier(), vdp->interface_version);
- this->num_video_decoder_plugins++;
}
- if(this->num_video_decoder_plugins > DECODER_PLUGIN_MAX) {
- fprintf(stderr, "%s(%d): too many video decoder plugins installed,"
- " exiting.\n", __FILE__, __LINE__);
- exit(1);
- }
-
/*
* does this plugin provide an audio decoder plugin?
*/
if((initplug = dlsym(plugin, "init_audio_decoder_plugin")) != NULL) {
+
audio_decoder_t *adp;
+ int streamtype;
adp = (audio_decoder_t *) initplug(iface_version, config);
- this->audio_decoder_plugins[this->num_audio_decoder_plugins] = adp;
-
+
+ for (streamtype = 0; streamtype<256; streamtype++) {
+ if (adp->can_handle (adp, (streamtype<<16) | BUF_AUDIO_BASE))
+ this->audio_decoder_plugins[streamtype] = adp;
+ }
+
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);
+ pEntry->d_name, adp->get_identifier(), adp->interface_version);
- this->num_audio_decoder_plugins++;
}
- if(this->num_audio_decoder_plugins > DECODER_PLUGIN_MAX) {
- fprintf(stderr, "%s(%d): too many audio decoder plugins installed,"
- " exiting.\n", __FILE__, __LINE__);
- exit(1);
- }
-
-
}
}
}
diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c
index e5a886a44..255c69f6d 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.9 2001/04/29 14:32:11 guenter Exp $
+ * $Id: video_decoder.c,v 1.10 2001/04/30 23:07:00 guenter Exp $
*
*/
@@ -32,6 +32,7 @@ void *video_decoder_loop (void *this_gen) {
buf_element_t *buf;
xine_t *this = (xine_t *) this_gen;
int running = 1;
+ int streamtype;
video_decoder_t *decoder;
while (running) {
@@ -42,6 +43,9 @@ void *video_decoder_loop (void *this_gen) {
switch (buf->type) {
case BUF_CONTROL_START:
+
+ printf ("video_decoder: found start of stream\n");
+
if (this->cur_video_decoder_plugin) {
this->cur_video_decoder_plugin->close (this->cur_video_decoder_plugin);
this->cur_video_decoder_plugin = NULL;
@@ -55,10 +59,17 @@ void *video_decoder_loop (void *this_gen) {
case BUF_VIDEO_MPEG:
case BUF_VIDEO_AVI:
+
+ streamtype = (buf->type>>16) & 0xFF;
- decoder = this->video_decoder_plugins [(buf->type>>16) & 0xFF];
+ printf ("video_decoder: processing buffer %d, type= %08x (%02x), size=%d\n",buf, buf->type,streamtype, buf->size);
+
+ decoder = this->video_decoder_plugins [streamtype];
if (decoder) {
+
+ printf ("video_decoder: decoder found.\n");
+
if (this->cur_video_decoder_plugin != decoder) {
if (this->cur_video_decoder_plugin)
@@ -75,6 +86,9 @@ void *video_decoder_loop (void *this_gen) {
break;
case BUF_CONTROL_END:
+
+ printf ("video_decoder: found end of stream\n");
+
if (this->cur_video_decoder_plugin) {
this->cur_video_decoder_plugin->close (this->cur_video_decoder_plugin);
this->cur_video_decoder_plugin = NULL;
diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h
index 7bbf797c1..c446d1e82 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.15 2001/04/29 14:32:11 guenter Exp $
+ * $Id: xine_internal.h,v 1.16 2001/04/30 23:07:00 guenter Exp $
*
*/
@@ -33,7 +33,7 @@
#define INPUT_PLUGIN_MAX 50
#define DEMUXER_PLUGIN_MAX 50
-#define DECODER_PLUGIN_MAX 50
+#define DECODER_PLUGIN_MAX 256
#define DECODER_PLUGIN_IFACE_VERSION 1
#define AUDIO_OUT_PLUGIN_MAX 50
#define VIDEO_OUT_PLUGIN_MAX 50
@@ -138,7 +138,6 @@ typedef struct xine_s {
fifo_buffer_t *video_fifo;
pthread_t video_thread;
video_decoder_t *video_decoder_plugins[DECODER_PLUGIN_MAX];
- int num_video_decoder_plugins;
video_decoder_t *cur_video_decoder_plugin;
int video_finished;