diff options
author | Guenter Bartsch <guenter@users.sourceforge.net> | 2001-07-30 17:13:20 +0000 |
---|---|---|
committer | Guenter Bartsch <guenter@users.sourceforge.net> | 2001-07-30 17:13:20 +0000 |
commit | f16cbec39f3f2455582feb65a0b0bcd089d4eeb5 (patch) | |
tree | fefa04ad6daf1e3684be6cdd2ac62c478a1ca7df | |
parent | d7d643a64c67075d7c8afed2b89d94db242b2f5c (diff) | |
download | xine-lib-f16cbec39f3f2455582feb65a0b0bcd089d4eeb5.tar.gz xine-lib-f16cbec39f3f2455582feb65a0b0bcd089d4eeb5.tar.bz2 |
fixed video/audio/spu decoder version handling
CVS patchset: 370
CVS date: 2001/07/30 17:13:20
-rw-r--r-- | src/dxr3/dxr3_decoder.c | 9 | ||||
-rw-r--r-- | src/libac3/xine_decoder.c | 13 | ||||
-rw-r--r-- | src/libmpeg2/xine_decoder.c | 12 | ||||
-rw-r--r-- | src/libspudec/xine_decoder.c | 6 | ||||
-rw-r--r-- | src/libw32dll/w32codec.c | 12 | ||||
-rw-r--r-- | src/xine-engine/load_plugins.c | 113 | ||||
-rw-r--r-- | src/xine-engine/xine_internal.h | 4 |
7 files changed, 91 insertions, 78 deletions
diff --git a/src/dxr3/dxr3_decoder.c b/src/dxr3/dxr3_decoder.c index cbdfe65ad..537da7eb9 100644 --- a/src/dxr3/dxr3_decoder.c +++ b/src/dxr3/dxr3_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: dxr3_decoder.c,v 1.3 2001/07/25 15:03:15 ehasenle Exp $ + * $Id: dxr3_decoder.c,v 1.4 2001/07/30 17:13:20 guenter Exp $ * * dxr3 video and spu decoder plugin. Accepts the video and spu data * from XINE and sends it directly to the corresponding dxr3 devices. @@ -273,8 +273,13 @@ spu_decoder_t *init_spu_decoder_plugin (int iface_version, { spudec_decoder_t *this; - if (iface_version != 1) + if (iface_version != 2) { + printf( "dxr3: plugin doesn't support plugin API version %d.\n" + "dxr3: this means there's a version mismatch between xine and this " + "dxr3: decoder plugin.\nInstalling current plugins should help.\n", + iface_version); return NULL; + } this = (spudec_decoder_t *) malloc (sizeof (spudec_decoder_t)); diff --git a/src/libac3/xine_decoder.c b/src/libac3/xine_decoder.c index a6d81104b..092582463 100644 --- a/src/libac3/xine_decoder.c +++ b/src/libac3/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.19 2001/07/23 23:15:16 f1rmb Exp $ + * $Id: xine_decoder.c,v 1.20 2001/07/30 17:13:21 guenter Exp $ * * stuff needed to turn libac3 into a xine decoder plugin */ @@ -448,17 +448,24 @@ audio_decoder_t *init_audio_decoder_plugin (int iface_version, config_values_t * ac3dec_decoder_t *this ; - if (iface_version != 1) + if (iface_version != 2) { + printf( "libac3: plugin doesn't support plugin API version %d.\n" + "libac3: this means there's a version mismatch between xine and this " + "libac3: decoder plugin.\nInstalling current plugins should help.\n", + iface_version); return NULL; + } this = (ac3dec_decoder_t *) malloc (sizeof (ac3dec_decoder_t)); - this->audio_decoder.interface_version = 1; + this->audio_decoder.interface_version = 2; this->audio_decoder.can_handle = ac3dec_can_handle; this->audio_decoder.init = ac3dec_init; this->audio_decoder.decode_data = ac3dec_decode_data; this->audio_decoder.close = ac3dec_close; this->audio_decoder.get_identifier = ac3dec_get_id; + this->audio_decoder.priority = 0; + this->ac3_level = (float) cfg->lookup_int (cfg, "ac3_level", 100) / 100.0; diff --git a/src/libmpeg2/xine_decoder.c b/src/libmpeg2/xine_decoder.c index c259d9cdd..613dc3010 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.11 2001/07/17 01:59:48 guenter Exp $ + * $Id: xine_decoder.c,v 1.12 2001/07/30 17:13:21 guenter Exp $ * * stuff needed to turn libmpeg2 into a xine decoder plugin */ @@ -100,17 +100,23 @@ video_decoder_t *init_video_decoder_plugin (int iface_version, config_values_t * mpeg2dec_decoder_t *this ; - if (iface_version != 1) + if (iface_version != 2) { + printf( "libmpeg2: plugin doesn't support plugin API version %d.\n" + "libmpeg2: this means there's a version mismatch between xine and this " + "libmpeg2: decoder plugin.\nInstalling current plugins should help.\n", + iface_version); return NULL; + } this = (mpeg2dec_decoder_t *) malloc (sizeof (mpeg2dec_decoder_t)); - this->video_decoder.interface_version = 1; + this->video_decoder.interface_version = 2; this->video_decoder.can_handle = mpeg2dec_can_handle; this->video_decoder.init = mpeg2dec_init; this->video_decoder.decode_data = mpeg2dec_decode_data; this->video_decoder.close = mpeg2dec_close; this->video_decoder.get_identifier = mpeg2dec_get_id; + this->video_decoder.priority = 0; return (video_decoder_t *) this; } diff --git a/src/libspudec/xine_decoder.c b/src/libspudec/xine_decoder.c index 714ebe179..60d7e2d47 100644 --- a/src/libspudec/xine_decoder.c +++ b/src/libspudec/xine_decoder.c @@ -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: xine_decoder.c,v 1.3 2001/07/08 18:15:54 guenter Exp $ + * $Id: xine_decoder.c,v 1.4 2001/07/30 17:13:21 guenter Exp $ * * stuff needed to turn libspu into a xine decoder plugin */ @@ -164,12 +164,12 @@ spu_decoder_t *init_spu_decoder_plugin (int iface_version, config_values_t *cfg) spudec_decoder_t *this ; - if (iface_version != 1) + if (iface_version != 2) return NULL; this = (spudec_decoder_t *) malloc (sizeof (spudec_decoder_t)); - this->spu_decoder.interface_version = 1; + this->spu_decoder.interface_version = 2; this->spu_decoder.can_handle = spudec_can_handle; this->spu_decoder.init = spudec_init; this->spu_decoder.decode_data = spudec_decode_data; diff --git a/src/libw32dll/w32codec.c b/src/libw32dll/w32codec.c index 6486f2aa9..3348da98d 100644 --- a/src/libw32dll/w32codec.c +++ b/src/libw32dll/w32codec.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: w32codec.c,v 1.12 2001/07/24 12:57:29 guenter Exp $ + * $Id: w32codec.c,v 1.13 2001/07/30 17:13:21 guenter Exp $ * * routines for using w32 codecs * @@ -586,7 +586,7 @@ video_decoder_t *init_video_decoder_plugin (int iface_version, config_values_t * w32v_decoder_t *this ; - if (iface_version != 1) { + if (iface_version != 2) { printf( "w32codec: plugin doesn't support plugin API version %d.\n" "w32codec: this means there's a version mismatch between xine and this " "w32codec: decoder plugin.\nInstalling current input plugins should help.\n", @@ -599,12 +599,13 @@ video_decoder_t *init_video_decoder_plugin (int iface_version, config_values_t * this = (w32v_decoder_t *) malloc (sizeof (w32v_decoder_t)); - this->video_decoder.interface_version = 1; + this->video_decoder.interface_version = 2; this->video_decoder.can_handle = w32v_can_handle; this->video_decoder.init = w32v_init; this->video_decoder.decode_data = w32v_decode_data; this->video_decoder.close = w32v_close; this->video_decoder.get_identifier = w32v_get_id; + this->video_decoder.priority = 0; return (video_decoder_t *) this; } @@ -613,7 +614,7 @@ audio_decoder_t *init_audio_decoder_plugin (int iface_version, config_values_t * w32a_decoder_t *this ; - if (iface_version != 1) { + if (iface_version != 2) { printf( "w32codec: plugin doesn't support plugin API version %d.\n" "w32codec: this means there's a version mismatch between xine and this " "w32codec: decoder plugin.\nInstalling current input plugins should help.\n", @@ -626,12 +627,13 @@ audio_decoder_t *init_audio_decoder_plugin (int iface_version, config_values_t * this = (w32a_decoder_t *) malloc (sizeof (w32a_decoder_t)); - this->audio_decoder.interface_version = 1; + this->audio_decoder.interface_version = 2; this->audio_decoder.can_handle = w32a_can_handle; this->audio_decoder.init = w32a_init; this->audio_decoder.decode_data = w32a_decode_data; this->audio_decoder.close = w32a_close; this->audio_decoder.get_identifier = w32a_get_id; + this->audio_decoder.priority = 0; return (audio_decoder_t *) this; } diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index b9882fb95..d15622143 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.34 2001/07/27 21:46:59 f1rmb Exp $ + * $Id: load_plugins.c,v 1.35 2001/07/30 17:13:22 guenter Exp $ * * * Load input/demux/audio_out/video_out/codec plugins @@ -252,48 +252,39 @@ char **xine_get_browsable_input_plugin_ids(xine_t *this) { * Decoder plugins section */ static int decide_spu_insert(spu_decoder_t *p, int streamtype, int prio) { -int plugin_prio; + if (!p->can_handle (p, (streamtype<<16) | BUF_SPU_BASE)) return 0; - /* Only iface_version 2 is known to have priorities */ - if (p->interface_version == 2) - plugin_prio = p->priority; - else - plugin_prio = 5; - if (plugin_prio < prio) + + if (p->priority < prio) return 0; + /* All conditions successfully passed */ - return plugin_prio; + return p->priority; } static int decide_video_insert(video_decoder_t *p, int streamtype, int prio) { -int plugin_prio; + if (!p->can_handle (p, (streamtype<<16) | BUF_VIDEO_BASE)) return 0; - /* Only iface_version 2 is known to have priorities */ - if (p->interface_version == 2) - plugin_prio = p->priority; - else - plugin_prio = 5; - if (plugin_prio < prio) + + if (p->priority < prio) return 0; + /* All conditions successfully passed */ - return plugin_prio; + return p->priority; } static int decide_audio_insert(audio_decoder_t *p, int streamtype, int prio) { -int plugin_prio; + if (!p->can_handle (p, (streamtype<<16) | BUF_AUDIO_BASE)) return 0; - /* Only iface_version 2 is known to have priorities */ - if (p->interface_version == 2) - plugin_prio = p->priority; - else - plugin_prio = 5; - if (plugin_prio < prio) + + if (p->priority < prio) return 0; + /* All conditions successfully passed */ - return plugin_prio; + return p->priority; } /* @@ -381,19 +372,19 @@ void load_decoder_plugins (xine_t *this, int streamtype; sdp = (spu_decoder_t *) initplug(iface_version, config); - sdp->metronom = this->metronom; - - printf("SPU Can Handle ?\n"); - for (streamtype = 0; streamtype<DECODER_PLUGIN_MAX; streamtype++) - if ((plugin_prio = - decide_spu_insert(sdp, streamtype, spu_prio[streamtype]))) { - printf("SPU Can Handle yes %x\n",streamtype); - this->spu_decoder_plugins[streamtype] = sdp; - spu_prio[streamtype] = plugin_prio; - } - - printf("spu decoder plugin found : %s\n", - sdp->get_identifier()); + if (sdp) { + sdp->metronom = this->metronom; + + for (streamtype = 0; streamtype<DECODER_PLUGIN_MAX; streamtype++) + if ((plugin_prio = + decide_spu_insert(sdp, streamtype, spu_prio[streamtype]))) { + this->spu_decoder_plugins[streamtype] = sdp; + spu_prio[streamtype] = plugin_prio; + } + + printf("spu decoder plugin found : %s\n", + sdp->get_identifier()); + } } /* @@ -406,18 +397,19 @@ void load_decoder_plugins (xine_t *this, int streamtype; vdp = (video_decoder_t *) initplug(iface_version, config); - vdp->metronom = this->metronom; - - for (streamtype = 0; streamtype<DECODER_PLUGIN_MAX; streamtype++) - if ((plugin_prio = - decide_video_insert(vdp, streamtype, video_prio[streamtype]))) { - this->video_decoder_plugins[streamtype] = vdp; - video_prio[streamtype] = plugin_prio; - } + if (vdp) { + vdp->metronom = this->metronom; + + for (streamtype = 0; streamtype<DECODER_PLUGIN_MAX; streamtype++) + if ((plugin_prio = + decide_video_insert(vdp, streamtype, video_prio[streamtype]))) { + this->video_decoder_plugins[streamtype] = vdp; + video_prio[streamtype] = plugin_prio; + } - printf("video decoder plugin found : %s\n", - vdp->get_identifier()); - + printf("video decoder plugin found : %s\n", + vdp->get_identifier()); + } } /* @@ -430,17 +422,18 @@ void load_decoder_plugins (xine_t *this, int streamtype; adp = (audio_decoder_t *) initplug(iface_version, config); - - for (streamtype = 0; streamtype<DECODER_PLUGIN_MAX; streamtype++) - if ((plugin_prio = - decide_audio_insert(adp, streamtype, audio_prio[streamtype]))) { - this->audio_decoder_plugins[streamtype] = adp; - audio_prio[streamtype] = plugin_prio; - } - - printf("audio decoder plugin found : %s\n", - adp->get_identifier()); - + if (adp) { + + for (streamtype = 0; streamtype<DECODER_PLUGIN_MAX; streamtype++) + if ((plugin_prio = + decide_audio_insert(adp, streamtype, audio_prio[streamtype]))) { + this->audio_decoder_plugins[streamtype] = adp; + audio_prio[streamtype] = plugin_prio; + } + + printf("audio decoder plugin found : %s\n", + adp->get_identifier()); + } } } diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h index 619b5b16d..55a4c1ad9 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.35 2001/07/26 11:12:26 f1rmb Exp $ + * $Id: xine_internal.h,v 1.36 2001/07/30 17:13:22 guenter Exp $ * */ @@ -42,7 +42,7 @@ extern "C" { #define INPUT_PLUGIN_MAX 50 #define DEMUXER_PLUGIN_MAX 50 #define DECODER_PLUGIN_MAX 256 -#define DECODER_PLUGIN_IFACE_VERSION 1 +#define DECODER_PLUGIN_IFACE_VERSION 2 #define AUDIO_OUT_PLUGIN_MAX 50 #define VIDEO_OUT_PLUGIN_MAX 50 #define XINE_MAX_EVENT_LISTENERS 50 |