diff options
Diffstat (limited to 'src/libxinevdec/cinepak.c')
-rw-r--r-- | src/libxinevdec/cinepak.c | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/src/libxinevdec/cinepak.c b/src/libxinevdec/cinepak.c index 089506dc2..58b006659 100644 --- a/src/libxinevdec/cinepak.c +++ b/src/libxinevdec/cinepak.c @@ -22,17 +22,17 @@ * based on overview of Cinepak algorithm and example decoder * by Tim Ferguson: http://www.csse.monash.edu.au/~timf/ * - * $Id: cinepak.c,v 1.11 2002/07/18 20:08:00 esnel Exp $ + * $Id: cinepak.c,v 1.12 2002/09/04 23:31:11 guenter Exp $ */ #include <stdlib.h> #include <unistd.h> +#include "xine_internal.h" #include "video_out.h" #include "buffer.h" #include "bswap.h" #include "xineutils.h" -#include "xine_internal.h" #define MAX_STRIPS 32 #define VIDEOBUFSIZE 128 * 1024 @@ -291,10 +291,6 @@ static void cinepak_decode_frame (cvid_decoder_t *this, uint8_t *data, int size) } } -static int cvid_can_handle (video_decoder_t *this_gen, int buf_type) { - return ((buf_type & 0xFFFF0000) == BUF_VIDEO_CINEPAK); -} - static void cvid_init (video_decoder_t *this_gen, vo_instance_t *video_out) { cvid_decoder_t *this = (cvid_decoder_t *) this_gen; @@ -353,8 +349,8 @@ static void cvid_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { img = this->video_out->get_frame (this->video_out, this->biWidth, this->biHeight, - XINE_ASPECT_RATIO_SQUARE, - IMGFMT_YV12, VO_BOTH_FIELDS); + XINE_VO_ASPECT_SQUARE, + XINE_IMGFMT_YV12, VO_BOTH_FIELDS); img->duration = this->video_step; img->pts = buf->pts; @@ -444,23 +440,13 @@ static void cvid_dispose (video_decoder_t *this_gen) { free (this_gen); } -video_decoder_t *init_video_decoder_plugin (int iface_version, xine_t *xine) { +void *init_video_decoder_plugin (xine_t *xine, void *data) { cvid_decoder_t *this ; - if (iface_version != 10) { - printf(_("cinepak: plugin doesn't support plugin API version %d.\n" - "cinepak: this means there's a version mismatch between xine and this " - "cinepak: decoder plugin.\nInstalling current plugins should help.\n"), - iface_version); - return NULL; - } - this = (cvid_decoder_t *) malloc (sizeof (cvid_decoder_t)); memset(this, 0, sizeof (cvid_decoder_t)); - this->video_decoder.interface_version = iface_version; - this->video_decoder.can_handle = cvid_can_handle; this->video_decoder.init = cvid_init; this->video_decoder.decode_data = cvid_decode_data; this->video_decoder.flush = cvid_flush; @@ -472,3 +458,23 @@ video_decoder_t *init_video_decoder_plugin (int iface_version, xine_t *xine) { return (video_decoder_t *) this; } + +/* + * exported plugin catalog entry + */ + +static uint32_t video_types[] = { + BUF_VIDEO_CINEPAK, + 0 + }; + +static decoder_info_t dec_info_video = { + video_types, /* supported types */ + 5 /* priority */ +}; + +plugin_info_t xine_plugin_info[] = { + /* type, API, "name", version, special_info, init_function */ + { PLUGIN_VIDEO_DECODER, 10, "cinepak", XINE_VERSION_CODE, &dec_info_video, init_video_decoder_plugin }, + { PLUGIN_NONE, 0, "", 0, NULL, NULL } +}; |