diff options
Diffstat (limited to 'src/libxinevdec/cyuv.c')
-rw-r--r-- | src/libxinevdec/cyuv.c | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/src/libxinevdec/cyuv.c b/src/libxinevdec/cyuv.c index 6bbf39687..79dbdf27f 100644 --- a/src/libxinevdec/cyuv.c +++ b/src/libxinevdec/cyuv.c @@ -18,7 +18,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: cyuv.c,v 1.5 2002/07/15 21:42:34 esnel Exp $ + * $Id: cyuv.c,v 1.6 2002/09/04 23:31:11 guenter Exp $ */ /* And this is the header that came with the CYUV decoder: */ @@ -50,9 +50,9 @@ #include <sys/types.h> #include <unistd.h> +#include "xine_internal.h" #include "video_out.h" #include "buffer.h" -#include "xine_internal.h" #include "xineutils.h" #define VIDEOBUFSIZE 128*1024 @@ -70,10 +70,6 @@ typedef struct cyuv_decoder_s { int height; } cyuv_decoder_t; -static int cyuv_can_handle (video_decoder_t *this_gen, int buf_type) { - return (buf_type == BUF_VIDEO_CYUV); -} - static void cyuv_init (video_decoder_t *this_gen, vo_instance_t *video_out) { cyuv_decoder_t *this = (cyuv_decoder_t *) this_gen; @@ -185,7 +181,7 @@ static void cyuv_decode_data (video_decoder_t *this_gen, if (buf->decoder_flags & BUF_FLAG_FRAME_END) { /* time to decode a frame */ img = this->video_out->get_frame (this->video_out, this->width, - this->height, XINE_ASPECT_RATIO_SQUARE, IMGFMT_YUY2, + this->height, XINE_VO_ASPECT_SQUARE, XINE_IMGFMT_YUY2, VO_BOTH_FIELDS); img->pts = buf->pts; @@ -236,22 +232,12 @@ static void cyuv_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) { cyuv_decoder_t *this ; - if (iface_version != 10) { - printf( "CYUV: plugin doesn't support plugin API version %d.\n" - "CYUV: this means there's a version mismatch between xine and this " - "CYUV: decoder plugin.\nInstalling current plugins should help.\n", - iface_version); - return NULL; - } - this = (cyuv_decoder_t *) malloc (sizeof (cyuv_decoder_t)); - this->video_decoder.interface_version = iface_version; - this->video_decoder.can_handle = cyuv_can_handle; this->video_decoder.init = cyuv_init; this->video_decoder.decode_data = cyuv_decode_data; this->video_decoder.flush = cyuv_flush; @@ -261,5 +247,25 @@ video_decoder_t *init_video_decoder_plugin (int iface_version, xine_t *xine) { this->video_decoder.dispose = cyuv_dispose; this->video_decoder.priority = 1; - return (video_decoder_t *) this; + return this; } + +/* + * exported plugin catalog entry + */ + +static uint32_t video_types[] = { + BUF_VIDEO_CYUV, + 0 + }; + +static decoder_info_t dec_info_video = { + video_types, /* supported types */ + 1 /* priority */ +}; + +plugin_info_t xine_plugin_info[] = { + /* type, API, "name", version, special_info, init_function */ + { PLUGIN_VIDEO_DECODER, 10, "cyuv", XINE_VERSION_CODE, &dec_info_video, init_video_decoder_plugin }, + { PLUGIN_NONE, 0, "", 0, NULL, NULL } +}; |