summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vd_realvid.c
diff options
context:
space:
mode:
authoralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-12-22 16:21:02 +0000
committeralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-12-22 16:21:02 +0000
commitd8fbdcf56399481e97c948d0d3d325571f3bc7e5 (patch)
tree3fd5aac6062e9416b4357158ca99ee4cf368790e /libmpcodecs/vd_realvid.c
parent9c8fef57bcddd6a5da791d30df67dfa708e8b257 (diff)
downloadmpv-d8fbdcf56399481e97c948d0d3d325571f3bc7e5.tar.bz2
mpv-d8fbdcf56399481e97c948d0d3d325571f3bc7e5.tar.xz
alpha support by Alan Young <ayoung@teleport.com>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8523 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/vd_realvid.c')
-rw-r--r--libmpcodecs/vd_realvid.c40
1 files changed, 31 insertions, 9 deletions
diff --git a/libmpcodecs/vd_realvid.c b/libmpcodecs/vd_realvid.c
index 31736139b5..b770bead81 100644
--- a/libmpcodecs/vd_realvid.c
+++ b/libmpcodecs/vd_realvid.c
@@ -22,11 +22,33 @@ static vd_info_t info = {
LIBVD_EXTERN(realvid)
-static unsigned long (*rvyuv_custom_message)(unsigned long*,void*);
+/*
+ * Structures for data packets. These used to be tables of unsigned ints, but
+ * that does not work on 64 bit platforms (e.g. Alpha). The entries that are
+ * pointers get truncated. Pointers on 64 bit platforms are 8 byte longs.
+ * So we have to use structures so the compiler will assign the proper space
+ * for the pointer.
+ */
+typedef struct cmsg_data_s {
+ uint32_t data1;
+ uint32_t data2;
+ uint32_t* dimensions;
+} cmsg_data_t;
+
+typedef struct transform_in_s {
+ uint32_t len;
+ uint32_t unknown1;
+ uint32_t chunks;
+ uint32_t* extra;
+ uint32_t unknown2;
+ uint32_t timestamp;
+} transform_in_t;
+
+static unsigned long (*rvyuv_custom_message)(cmsg_data_t* ,void*);
static unsigned long (*rvyuv_free)(void*);
static unsigned long (*rvyuv_hive_message)(unsigned long,unsigned long);
static unsigned long (*rvyuv_init)(void*, void*); // initdata,context
-static unsigned long (*rvyuv_transform)(char*, char*,unsigned long*,unsigned long*,void*);
+static unsigned long (*rvyuv_transform)(char*, char*,transform_in_t*,unsigned int*,void*);
static void *rv_handle=NULL;
@@ -167,9 +189,9 @@ static int init(sh_video_t *sh){
}
// setup rv30 codec (codec sub-type and image dimensions):
if(extrahdr[1]>=0x20200002){
- unsigned long cmsg24[4]={sh->disp_w,sh->disp_h,sh->disp_w,sh->disp_h};
- unsigned long cmsg_data[3]={0x24,1+((extrahdr[0]>>16)&7),(unsigned long) &cmsg24};
- (*rvyuv_custom_message)(cmsg_data,sh->context);
+ uint32_t cmsg24[4]={sh->disp_w,sh->disp_h,sh->disp_w,sh->disp_h};
+ cmsg_data_t cmsg_data={0x24,1+((extrahdr[0]>>16)&7), &cmsg24[0]};
+ (*rvyuv_custom_message)(&cmsg_data,sh->context);
}
mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: RealVideo codec init OK!\n");
return 1;
@@ -198,12 +220,12 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
unsigned char* dp_data=((unsigned char*)data)+sizeof(dp_hdr_t);
uint32_t* extra=(uint32_t*)(((char*)data)+dp_hdr->chunktab);
- unsigned long transform_out[5];
- unsigned long transform_in[6]={
+ unsigned int transform_out[5];
+ transform_in_t transform_in={
dp_hdr->len, // length of the packet (sub-packets appended)
0, // unknown, seems to be unused
dp_hdr->chunks, // number of sub-packets - 1
- (unsigned long) extra, // table of sub-packet offsets
+ extra, // table of sub-packet offsets
0, // unknown, seems to be unused
dp_hdr->timestamp,// timestamp (the integer value from the stream)
};
@@ -214,7 +236,7 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
sh->disp_w, sh->disp_h);
if(!mpi) return NULL;
- result=(*rvyuv_transform)(dp_data, mpi->planes[0], transform_in,
+ result=(*rvyuv_transform)(dp_data, mpi->planes[0], &transform_in,
transform_out, sh->context);
return (result?NULL:mpi);