diff options
Diffstat (limited to 'src/libreal/xine_real_video_decoder.c')
-rw-r--r-- | src/libreal/xine_real_video_decoder.c | 59 |
1 files changed, 34 insertions, 25 deletions
diff --git a/src/libreal/xine_real_video_decoder.c b/src/libreal/xine_real_video_decoder.c index d68c7390e..314edc489 100644 --- a/src/libreal/xine_real_video_decoder.c +++ b/src/libreal/xine_real_video_decoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2004 the xine project + * Copyright (C) 2000-2008 the xine project * * This file is part of xine, a free video player. * @@ -22,6 +22,10 @@ * code inspired by work from Florian Schneider for the MPlayer Project */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include <stdlib.h> #include <string.h> @@ -63,9 +67,9 @@ typedef struct realdec_decoder_s { uint32_t (*rvyuv_custom_message)(void*, void*); uint32_t (*rvyuv_free)(void*); - uint32_t (*rvyuv_hive_message)(uint32_t, uint32_t); + uint32_t (*rvyuv_hive_message)(uint32_t, void*); uint32_t (*rvyuv_init)(void*, void*); /* initdata,context */ - uint32_t (*rvyuv_transform)(char*, char*, void*, uint32_t*,void*); + uint32_t (*rvyuv_transform)(char*, char*, void*, void*, void*); void *context; @@ -113,13 +117,21 @@ typedef struct cmsg_data_s { typedef struct transform_in_s { uint32_t len; - uint32_t unknown1; - uint32_t chunks; - uint32_t* extra; - uint32_t unknown2; + uint32_t interpolate; + uint32_t nsegments; + void *segments; + uint32_t flags; uint32_t timestamp; } transform_in_t; +typedef struct { + uint32_t frames; + uint32_t notes; + uint32_t timestamp; + uint32_t width; + uint32_t height; +} transform_out_t; + /* * real codec loader */ @@ -169,7 +181,6 @@ static int init_codec (realdec_decoder_t *this, buf_element_t *buf) { int result; rv_init_t init_data = {11, 0, 0, 0, 0, 0, 1, 0}; /* rv30 */ - switch (buf->type) { case BUF_VIDEO_RV20: _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Real Video 2.0"); @@ -258,7 +269,7 @@ static int init_codec (realdec_decoder_t *this, buf_element_t *buf) { #ifdef LOG printf ("libreal: CustomMessage cmsg_data:\n"); - xine_hexdump ((uint8_t *) cmsg_data, sizeof (cmsg_data)); + xine_hexdump ((uint8_t *) &cmsg_data, sizeof (cmsg_data)); printf ("libreal: cmsg24:\n"); xine_hexdump ((uint8_t *) cmsg24, (buf->size - 34 + 2) * sizeof(uint32_t)); #endif @@ -271,7 +282,7 @@ static int init_codec (realdec_decoder_t *this, buf_element_t *buf) { this->frame_size = this->width * this->height; this->frame_buffer = xine_xmalloc (this->width * this->height * 3 / 2); - this->chunk_buffer = xine_xmalloc (BUF_SIZE); + this->chunk_buffer = calloc(1, BUF_SIZE); this->chunk_buffer_max = BUF_SIZE; return 1; @@ -342,7 +353,7 @@ static void realdec_decode_data (video_decoder_t *this_gen, buf_element_t *buf) int result; vo_frame_t *img; - uint32_t transform_out[5]; + transform_out_t transform_out; transform_in_t transform_in = { this->chunk_buffer_size, /* length of the packet (sub-packets appended) */ @@ -369,7 +380,7 @@ static void realdec_decode_data (video_decoder_t *this_gen, buf_element_t *buf) xine_hexdump (this->chunk_buffer, this->chunk_buffer_size); printf ("libreal: transform_in:\n"); - xine_hexdump ((uint8_t *) transform_in, 6 * 4); + xine_hexdump ((uint8_t *) &transform_in, sizeof(rv_xform_in_t)); printf ("libreal: chunk_table:\n"); xine_hexdump ((uint8_t *) buf->decoder_info_ptr[2], @@ -379,21 +390,21 @@ static void realdec_decode_data (video_decoder_t *this_gen, buf_element_t *buf) result = this->rvyuv_transform (this->chunk_buffer, this->frame_buffer, &transform_in, - transform_out, + &transform_out, this->context); lprintf ("transform result: %08x\n", result); lprintf ("transform_out:\n"); - #ifdef LOG - xine_hexdump ((uint8_t *) transform_out, 5 * 4); - #endif +#ifdef LOG + xine_hexdump ((uint8_t *) &transform_out, 5 * 4); +#endif /* Sometimes the stream contains video of a different size * to that specified in the realmedia header */ - if(transform_out[0] && ((transform_out[3] != this->width) || - (transform_out[4] != this->height))) { - this->width = transform_out[3]; - this->height = transform_out[4]; + if(transform_out.frames && ((transform_out.width != this->width) || + (transform_out.height != this->height))) { + this->width = transform_out.width; + this->height = transform_out.height; this->frame_size = this->width * this->height; @@ -489,7 +500,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, real_class_t *cls = (real_class_t *) class_gen; realdec_decoder_t *this ; - this = (realdec_decoder_t *) xine_xmalloc (sizeof (realdec_decoder_t)); + this = (realdec_decoder_t *) calloc(1, sizeof(realdec_decoder_t)); this->video_decoder.decode_data = realdec_decode_data; this->video_decoder.flush = realdec_flush; @@ -526,9 +537,8 @@ static void dispose_class (video_decoder_class_t *this) { void *init_realvdec (xine_t *xine, void *data) { real_class_t *this; - config_values_t *config = xine->config; - this = (real_class_t *) xine_xmalloc (sizeof (real_class_t)); + this = (real_class_t *) calloc(1, sizeof(real_class_t)); this->decoder_class.open_plugin = open_plugin; this->decoder_class.get_identifier = get_identifier; @@ -544,8 +554,7 @@ void *init_realvdec (xine_t *xine, void *data) { * exported plugin catalog entry */ -static uint32_t supported_types[] = { BUF_VIDEO_RV20, - BUF_VIDEO_RV30, +static uint32_t supported_types[] = { BUF_VIDEO_RV30, BUF_VIDEO_RV40, 0 }; |