summaryrefslogtreecommitdiff
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
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
-rw-r--r--src/input/input_file.c4
-rw-r--r--src/libmpeg2/decode.c3
-rw-r--r--src/libmpeg2/xine_decoder.c6
-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
6 files changed, 48 insertions, 35 deletions
diff --git a/src/input/input_file.c b/src/input/input_file.c
index b71e6121d..71a62ca73 100644
--- a/src/input/input_file.c
+++ b/src/input/input_file.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: input_file.c,v 1.5 2001/04/28 21:23:04 guenter Exp $
+ * $Id: input_file.c,v 1.6 2001/04/30 23:07:00 guenter Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -95,6 +95,8 @@ static buf_element_t *file_plugin_read_block (input_plugin_t *this_gen, fifo_buf
}
}
+ buf->size = total_bytes;
+
return buf;
}
diff --git a/src/libmpeg2/decode.c b/src/libmpeg2/decode.c
index c4d456fa1..072622075 100644
--- a/src/libmpeg2/decode.c
+++ b/src/libmpeg2/decode.c
@@ -307,6 +307,8 @@ int mpeg2_decode_data (mpeg2dec_t * mpeg2dec, uint8_t * current, uint8_t * end,
chunk_ptr = mpeg2dec->chunk_ptr;
mpeg2dec->pts = pts;
+ printf ("mpeg2_decode_data\n");
+
while (current != end) {
while (1) {
byte = *current++;
@@ -329,6 +331,7 @@ int mpeg2_decode_data (mpeg2dec_t * mpeg2dec, uint8_t * current, uint8_t * end,
/* found start_code following chunk */
+ printf ("mpeg2: parse_chunk\n");
ret += parse_chunk (mpeg2dec, mpeg2dec->code, mpeg2dec->chunk_buffer, pts);
/* done with header or slice, prepare for next one */
diff --git a/src/libmpeg2/xine_decoder.c b/src/libmpeg2/xine_decoder.c
index 2892aabd9..932e59ee3 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.3 2001/04/29 14:32:11 guenter Exp $
+ * $Id: xine_decoder.c,v 1.4 2001/04/30 23:07:00 guenter Exp $
*
* stuff needed to turn libmpeg2 into a xine decoder plugin
*/
@@ -46,12 +46,16 @@ void mpeg2dec_init (video_decoder_t *this_gen, vo_instance_t *video_out) {
mpeg2dec_decoder_t *this = (mpeg2dec_decoder_t *) this_gen;
+ printf ("libmpeg: initializing mpeg2dec\n");
+
mpeg2_init (&this->mpeg2, video_out);
}
void mpeg2dec_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
mpeg2dec_decoder_t *this = (mpeg2dec_decoder_t *) this_gen;
+ printf ("libmpeg: decoding data (pts = %d)\n", buf->PTS);
+
mpeg2_decode_data (&this->mpeg2, buf->content, buf->content + buf->size,
buf->PTS);
}
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;