[Mplayer-cvslog] CVS: main/libmpcodecs vd_realvid.c,1.17,1.18
Alex Beregszaszi
alex at mplayerhq.hu
Sun Dec 22 17:21:21 CET 2002
Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv28865
Modified Files:
vd_realvid.c
Log Message:
alpha support by Alan Young <ayoung at teleport.com>
Index: vd_realvid.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_realvid.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- vd_realvid.c 13 Oct 2002 21:26:00 -0000 1.17
+++ vd_realvid.c 22 Dec 2002 16:21:02 -0000 1.18
@@ -22,11 +22,33 @@
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 @@
}
// 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 @@
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 @@
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);
More information about the MPlayer-cvslog
mailing list