comparison libmpcodecs/vd_realvid.c @ 31617:91b59ae45d76

100l compialtion fix and use AV_RB32.
author reimar
date Sat, 10 Jul 2010 22:56:58 +0000
parents b40d593a463f
children 4d4ed6c9039c
comparison
equal deleted inserted replaced
31616:3da109629fca 31617:91b59ae45d76
25 #include <dlfcn.h> 25 #include <dlfcn.h>
26 #endif 26 #endif
27 27
28 #include "mp_msg.h" 28 #include "mp_msg.h"
29 #include "help_mp.h" 29 #include "help_mp.h"
30 #include "mpbswap.h" 30 #include "libavutil/intreadwrite.h"
31 #include "path.h" 31 #include "path.h"
32 32
33 #include "vd_internal.h" 33 #include "vd_internal.h"
34 #include "loader/wine/windef.h" 34 #include "loader/wine/windef.h"
35 35
270 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"realvideo: extradata too small (%u)\n", sh->bih->biSize - sizeof(BITMAPINFOHEADER)); 270 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"realvideo: extradata too small (%u)\n", sh->bih->biSize - sizeof(BITMAPINFOHEADER));
271 return 0; 271 return 0;
272 } 272 }
273 init_data = (struct rv_init_t){11, sh->disp_w, sh->disp_h, 0, 0, AV_RB32(extrahdr), 1, AV_RB32(extrahdr + 4)}; // rv30 273 init_data = (struct rv_init_t){11, sh->disp_w, sh->disp_h, 0, 0, AV_RB32(extrahdr), 1, AV_RB32(extrahdr + 4)}; // rv30
274 274
275 mp_msg(MSGT_DECVIDEO,MSGL_V,"realvideo codec id: 0x%08X sub-id: 0x%08X\n",init_data.format,init_data.sub_format); 275 mp_msg(MSGT_DECVIDEO,MSGL_V,"realvideo codec id: 0x%08X sub-id: 0x%08X\n",init_data.format,init_data.subformat);
276 276
277 path = malloc(strlen(codec_path) + strlen(sh->codec->dll) + 2); 277 path = malloc(strlen(codec_path) + strlen(sh->codec->dll) + 2);
278 if (!path) return 0; 278 if (!path) return 0;
279 sprintf(path, "%s/%s", codec_path, sh->codec->dll); 279 sprintf(path, "%s/%s", codec_path, sh->codec->dll);
280 280
306 if (result){ 306 if (result){
307 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Couldn't open RealVideo codec, error code: 0x%X \n",result); 307 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Couldn't open RealVideo codec, error code: 0x%X \n",result);
308 return 0; 308 return 0;
309 } 309 }
310 // setup rv30 codec (codec sub-type and image dimensions): 310 // setup rv30 codec (codec sub-type and image dimensions):
311 if((sh->format<=0x30335652) && (be2me_32(((unsigned int*)extrahdr)[1])>=0x20200002)){ 311 if((sh->format<=0x30335652) && AV_RB32(extrahdr + 4)>=0x20200002){
312 int i, cmsg_cnt; 312 int i, cmsg_cnt;
313 uint32_t cmsg24[16]={sh->disp_w,sh->disp_h}; 313 uint32_t cmsg24[16]={sh->disp_w,sh->disp_h};
314 cmsg_data_t cmsg_data={0x24,1+(extrahdr[1]&7), &cmsg24[0]}; 314 cmsg_data_t cmsg_data={0x24,1+(extrahdr[1]&7), &cmsg24[0]};
315 315
316 mp_msg(MSGT_DECVIDEO,MSGL_V,"realvideo: using cmsg24 with %u elements.\n",extrahdr[1]&7); 316 mp_msg(MSGT_DECVIDEO,MSGL_V,"realvideo: using cmsg24 with %u elements.\n",extrahdr[1]&7);
392 buffer=malloc(bufsz); 392 buffer=malloc(bufsz);
393 if (!buffer) return 0; 393 if (!buffer) return 0;
394 } 394 }
395 395
396 for (i=0; i<2*(chunks+1); i++) 396 for (i=0; i<2*(chunks+1); i++)
397 extra[i] = le2me_32(extra[i]); 397 extra[i] = le2ne_32(extra[i]);
398 398
399 #ifdef CONFIG_WIN32DLL 399 #ifdef CONFIG_WIN32DLL
400 if (dll_type == 1) 400 if (dll_type == 1)
401 result=(*wrvyuv_transform)(dp_data, buffer, &transform_in, 401 result=(*wrvyuv_transform)(dp_data, buffer, &transform_in,
402 transform_out, sh->context); 402 transform_out, sh->context);