Mercurial > mplayer.hg
changeset 13860:d6f716fdd734
remove mac shlb support to use new helix codec for realvideo support on osx
author | nplourde |
---|---|
date | Wed, 03 Nov 2004 02:50:01 +0000 |
parents | 1b0d5a6ab7dc |
children | 352b1b75a32c |
files | configure etc/codecs.conf libmpcodecs/ad_realaud.c libmpcodecs/vd_realvid.c |
diffstat | 4 files changed, 25 insertions(+), 237 deletions(-) [+] |
line wrap: on
line diff
--- a/configure Wed Nov 03 01:53:56 2004 +0000 +++ b/configure Wed Nov 03 02:50:01 2004 +0000 @@ -193,7 +193,6 @@ --enable-jpeg enable jpeg input/output support [autodetect] --enable-liblzo enable external liblzo support [autodetect] --disable-win32 disable Win32 DLL support [autodetect] - --disable-macshlb disable Mac OS X SHLB support [autodetect] --disable-dshow disable Win32/DirectShow support [autodetect] --disable-qtx disable Quicktime codecs [autodetect] --disable-xanim disable XAnim DLL support [autodetect] @@ -1319,7 +1318,6 @@ _alsa=auto _fastmemcpy=yes _unrarlib=yes -_macshlb=auto _win32=auto _dshow=yes _select=yes @@ -1729,8 +1727,6 @@ --disable-mmx) # 3Dnow! and MMX2 require MMX _3dnow=no _3dnowex=no _mmx=no _mmx2=no ;; - --enable-macshlb) _macshlb=yes ;; - --disable-macshlb) _macshlb=no ;; --enable-win32) _win32=yes ;; --disable-win32) _win32=no _dshow=no ;; --enable-dshow) _win32=yes _dshow=yes ;; @@ -5224,21 +5220,6 @@ _ld_faad= fi -echocheck "MacOS X SHLB (shared lib) support" -if test "$_macshlb" = auto ; then - if test "$_macosx" = yes ; then - _macshlb=yes - else - _macshlb=no - fi -fi -echores "$_macshlb" -if test "$_macshlb" = yes ; then - _def_macshlb='#define USE_MACSHLB 1' -else - _def_macshlb='#undef USE_MACSHLB' -fi - if test "$_win32" = auto ; then if x86 ; then qnx && _win32=no @@ -5382,7 +5363,7 @@ echocheck "RealPlayer DLL" if test "$_real" = auto ; then _real=no - if test "$_dl" = yes || test "$_win32" = yes || test "$_macshlb" = yes ; then + if test "$_dl" = yes || test "$_win32" = yes ; then # if test "$_dl" = yes ; then if linux || freebsd || netbsd || win32 || darwin ; then _real=yes @@ -6846,9 +6827,6 @@ /* Mac OS X specific features */ $_def_macosx -/* Mac OS X SHLB support */ -$_def_macshlb - /* Build our Win32-loader */ $_def_win32_loader
--- a/etc/codecs.conf Wed Nov 03 01:53:56 2004 +0000 +++ b/etc/codecs.conf Wed Nov 03 02:50:01 2004 +0000 @@ -1105,7 +1105,7 @@ status working fourcc RV40,rv40 driver realvid - dll "drv4.shlb" + dll "drvc.bundle/Contents/MacOS/drvc" out I420 videocodec rv30 @@ -1129,7 +1129,7 @@ status working fourcc RV30,rv30 driver realvid - dll "drv3.shlb" + dll "drvc.bundle/Contents/MacOS/drvc" out I420 videocodec rv20 @@ -1153,7 +1153,7 @@ status working fourcc RV20,rv20 driver realvid - dll "drv2.shlb" + dll "drv2.bundle/Contents/MacOS/drv2" out I420 ; others: @@ -1988,7 +1988,7 @@ status working format 0x6B6F6F63 ; "cook" driver realaud - dll "cook.shlb" + dll "cook.bundle/Contents/MacOS/cook" audiocodec rasipr info "RealAudio Sipro" @@ -2009,7 +2009,7 @@ status working format 0x72706973 ; "sipr" driver realaud - dll "sipr.shlb" + dll "sipr.bundle/Contents/MacOS/sipr" audiocodec raatrc info "RealAudio ATRAC3" @@ -2030,7 +2030,7 @@ status working format 0x63727461 ; "atrc" driver realaud - dll "atrc.shlb" + dll "atrc.bundle/Contents/MacOS/atrc" audiocodec imaadpcm info "IMA ADPCM"
--- a/libmpcodecs/ad_realaud.c Wed Nov 03 01:53:56 2004 +0000 +++ b/libmpcodecs/ad_realaud.c Wed Nov 03 02:50:01 2004 +0000 @@ -16,10 +16,6 @@ #include "ad_internal.h" #include "wine/windef.h" -#ifdef USE_MACSHLB -#include <CoreServices/CoreServices.h> -#endif - static ad_info_t info = { "RealAudio decoder", "realaud", @@ -212,112 +208,6 @@ #endif -#ifdef USE_MACSHLB -/* - Helper function to create a function pointer (from a null terminated (!) - pascal string) like GetProcAddress(). Some assembler is required due - to different calling conventions, for further details, see - http://developer.apple.com/ samplecode/CFM_MachO_CFM/listing1.html . - - Caller is expected to DisposePtr(mfp). - N.B.: Code is used by vd_realaud.c as well. -*/ -void *load_one_sym_mac(char *symbolName, CFragConnectionID *connID) { - OSErr err; - Ptr symbolAddr; - CFragSymbolClass symbolClass; - UInt32 *mfp; - char realname[255]; - - if (strlen(symbolName) > 255) - { - mp_msg(MSGT_DECVIDEO, MSGL_V, "FindSymbol symbolname overflow\n"); - return NULL; - } - - snprintf(realname, 255, "%c%s", strlen(symbolName), symbolName); - - if ( (err = FindSymbol( *connID, realname, - &symbolAddr, &symbolClass )) != noErr ) { - mp_msg(MSGT_DECVIDEO,MSGL_V,"FindSymbol( \"%s\" ) failed with error code %d.\n", symbolName + 1, err ); - return NULL; - } - - if ( (mfp = (UInt32 *)NewPtr( 6 * sizeof(UInt32) )) == nil ) - return NULL; - - mfp[0] = 0x3D800000 | ((UInt32)symbolAddr >> 16); - mfp[1] = 0x618C0000 | ((UInt32)symbolAddr & 0xFFFF); - mfp[2] = 0x800C0000; - mfp[3] = 0x804C0004; - mfp[4] = 0x7C0903A6; - mfp[5] = 0x4E800420; - MakeDataExecutable( mfp, 6 * sizeof(UInt32) ); - - return( mfp ); -} - -static int load_syms_mac(char *path) -{ - Ptr mainAddr; - OSStatus status; - FSRef fsref; - FSSpec fsspec; - OSErr err; - Str255 errMessage; - CFragConnectionID *connID; - - mp_msg(MSGT_DECVIDEO, MSGL_INFO, "opening mac shlb '%s'\n", path); - - if ( (connID = (CFragConnectionID *)NewPtr( sizeof( CFragConnectionID ))) == nil ) { - mp_msg(MSGT_DECVIDEO,MSGL_WARN,"NewPtr() failed.\n" ); - return 0; - } - - if ( (status = FSPathMakeRef( path, &fsref, NULL )) != noErr ) { - mp_msg(MSGT_DECVIDEO,MSGL_WARN,"FSPathMakeRef() failed with error %d.\n", status ); - return 0; - } - - if ( (status = FSGetCatalogInfo( &fsref, kFSCatInfoNone, NULL, NULL, &fsspec, NULL )) != noErr ) { - mp_msg(MSGT_DECVIDEO,MSGL_WARN,"FSGetCatalogInfo() failed with error %d.\n", status ); - return 0; - } - - if ( (err = GetDiskFragment( &fsspec, 0, kCFragGoesToEOF, NULL, kPrivateCFragCopy, connID, &mainAddr, errMessage )) != noErr ) { - - p2cstrcpy( errMessage, errMessage ); - mp_msg(MSGT_DECVIDEO,MSGL_WARN,"GetDiskFragment() failed with error %d: %s\n", err, errMessage ); - return 0; - } - - raCloseCodec = load_one_sym_mac( "RACloseCodec", connID); - raDecode = load_one_sym_mac("RADecode", connID); - raFlush = load_one_sym_mac("RAFlush", connID); - raFreeDecoder = load_one_sym_mac("RAFreeDecoder", connID); - raGetFlavorProperty = load_one_sym_mac("RAGetFlavorProperty", connID); - raOpenCodec = load_one_sym_mac("RAOpenCodec", connID); - raOpenCodec2 = load_one_sym_mac("RAOpenCodec2", connID); - raInitDecoder = load_one_sym_mac("RAInitDecoder", connID); - raSetFlavor = load_one_sym_mac("RASetFlavor", connID); - raSetDLLAccessPath = load_one_sym_mac("SetDLLAccessPath", connID); - raSetPwd = load_one_sym_mac("RASetPwd", connID); // optional, used by SIPR - - if (raCloseCodec && raDecode && /*raFlush && */raFreeDecoder && - raGetFlavorProperty && (raOpenCodec || raOpenCodec2) && raSetFlavor && - /*raSetDLLAccessPath &&*/ raInitDecoder) - { - rv_handle = connID; - return 1; - } - - mp_msg(MSGT_DECAUDIO,MSGL_WARN,"Cannot resolve symbols - incompatible shlb: %s\n",path); - (void)CloseConnection(connID); - return 0; -} - -#endif - static int preinit(sh_audio_t *sh){ // let's check if the driver is available, return 0 if not. // (you should do that if you use external lib(s) which is optional) @@ -333,9 +223,6 @@ /* first try to load linux dlls, if failed and we're supporting win32 dlls, then try to load the windows ones */ -#ifdef USE_MACSHLB - if (strstr(sh->codec->dll,".shlb") && !load_syms_mac(path)) -#endif #ifdef HAVE_LIBDL if (strstr(sh->codec->dll,".dll") || !load_syms_linux(path)) #endif @@ -409,7 +296,7 @@ ((short*)(sh->wf+1))[4], // codec data length ((char*)(sh->wf+1))+10 // extras }; -#if defined(USE_WIN32DLL) || defined(USE_MACSHLB) +#ifdef USE_WIN32DLL wra_init_t winit_data={ sh->wf->nSamplesPerSec, sh->wf->wBitsPerSample, @@ -421,16 +308,13 @@ ((char*)(sh->wf+1))+10 // extras }; #endif -#ifdef USE_MACSHLB - result=raInitDecoder(sh->context,&winit_data); -#else #ifdef USE_WIN32DLL if (dll_type == 1) result=wraInitDecoder(sh->context,&winit_data); else #endif result=raInitDecoder(sh->context,&init_data); -#endif + if(result){ mp_msg(MSGT_DECAUDIO,MSGL_WARN,"Decoder init failed, error code: 0x%X\n",result); return 0; @@ -517,20 +401,6 @@ if (raFreeDecoder) raFreeDecoder(sh->context); if (raCloseCodec) raCloseCodec(sh->context); -#ifdef USE_MACSHLB - if (rv_handle){ - (void)CloseConnection(rv_handle); - DisposePtr((Ptr)rv_handle); - } - if (raCloseCodec) DisposePtr((Ptr)raCloseCodec); - if (raDecode) DisposePtr((Ptr)raDecode); - if (raFlush) DisposePtr((Ptr)raFlush); - if (raFreeDecoder) DisposePtr((Ptr)raFreeDecoder); - if (raGetFlavorProperty) DisposePtr((Ptr)raGetFlavorProperty); - if (raOpenCodec) DisposePtr((Ptr)raOpenCodec); - if (raOpenCodec2) DisposePtr((Ptr)raOpenCodec2); - if (raInitDecoder) DisposePtr((Ptr)raInitDecoder); -#endif #ifdef USE_WIN32DLL if (dll_type == 1)
--- a/libmpcodecs/vd_realvid.c Wed Nov 03 01:53:56 2004 +0000 +++ b/libmpcodecs/vd_realvid.c Wed Nov 03 02:50:01 2004 +0000 @@ -14,10 +14,6 @@ #include "vd_internal.h" #include "wine/windef.h" -#ifdef USE_MACSHLB -#include <CoreServices/CoreServices.h> -#endif - static vd_info_t info = { "RealVideo decoder", "realvid", @@ -129,6 +125,22 @@ rv_handle = handle; return 1; } + + rvyuv_custom_message = dlsym(handle, "RV40toYUV420CustomMessage"); + rvyuv_free = dlsym(handle, "RV40toYUV420Free"); + rvyuv_hive_message = dlsym(handle, "RV40toYUV420HiveMessage"); + rvyuv_init = dlsym(handle, "RV40toYUV420Init"); + rvyuv_transform = dlsym(handle, "RV40toYUV420Transform"); + + if(rvyuv_custom_message && + rvyuv_free && + rvyuv_hive_message && + rvyuv_init && + rvyuv_transform) + { + rv_handle = handle; + return 1; + } mp_msg(MSGT_DECVIDEO,MSGL_WARN,"Error resolving symbols! (version incompatibility?)\n"); dlclose(handle); @@ -181,64 +193,6 @@ } #endif -#ifdef USE_MACSHLB -void *load_one_sym_mac(char *symbolName, CFragConnectionID *connID); - -static int load_syms_mac(char *path) { - Ptr mainAddr; - OSStatus status; - FSRef fsref; - FSSpec fsspec; - OSErr err; - Str255 errMessage; - CFragConnectionID *connID; - - mp_msg(MSGT_DECVIDEO,MSGL_INFO, "opening mac shlb '%s'\n", path); - - if ( (connID = (CFragConnectionID *)NewPtr( sizeof( CFragConnectionID ))) == nil ) { - mp_msg(MSGT_DECVIDEO,MSGL_WARN,"NewPtr() failed.\n" ); - return 0; - } - - if ( (status = FSPathMakeRef( path, &fsref, NULL )) != noErr ) { - mp_msg(MSGT_DECVIDEO,MSGL_WARN,"FSPathMakeRef() failed with error %d.\n", status ); - return 0; - } - - if ( (status = FSGetCatalogInfo( &fsref, kFSCatInfoNone, NULL, NULL, &fsspec, NULL )) != noErr ) { - mp_msg(MSGT_DECVIDEO,MSGL_WARN,"FSGetCatalogInfo() failed with error %d.\n", status ); - return 0; - } - - if ( (err = GetDiskFragment( &fsspec, 0, kCFragGoesToEOF, NULL, kPrivateCFragCopy, connID, &mainAddr, errMessage )) != noErr ) { - p2cstrcpy( errMessage, errMessage ); - mp_msg(MSGT_DECVIDEO,MSGL_WARN,"GetDiskFragment() failed with error %d: %s\n", err, errMessage ); - return 0; - } - - rvyuv_custom_message = load_one_sym_mac("RV20toYUV420CustomMessage", connID); - rvyuv_free = load_one_sym_mac("RV20toYUV420Free", connID); - rvyuv_hive_message = load_one_sym_mac("RV20toYUV420HiveMessage", connID); - rvyuv_init = load_one_sym_mac("RV20toYUV420Init", connID); - rvyuv_transform = load_one_sym_mac("RV20toYUV420Transform", connID); - - if(rvyuv_custom_message && - rvyuv_free && - rvyuv_hive_message && - rvyuv_init && - rvyuv_transform) - { - rv_handle = connID; - return 1; - } - - mp_msg(MSGT_DECVIDEO,MSGL_WARN,"Error resolving symbols! (version incompatibility?)\n"); - (void)CloseConnection(connID); - return 0; // error -} -#endif - - /* we need exact positions */ struct rv_init_t { short unk1; @@ -270,9 +224,6 @@ /* first try to load linux dlls, if failed and we're supporting win32 dlls, then try to load the windows ones */ -#ifdef USE_MACSHLB - if (strstr(sh->codec->dll, ".shlb") && !load_syms_mac(path)) -#endif #ifdef HAVE_LIBDL if(strstr(sh->codec->dll,".dll") || !load_syms_linux(path)) #endif @@ -335,17 +286,6 @@ #ifdef HAVE_LIBDL if(rv_handle) dlclose(rv_handle); #endif -#ifdef USE_MACSHLB - if (rv_handle){ - (void)CloseConnection(rv_handle); - DisposePtr((Ptr)rv_handle); - } - if (rvyuv_custom_message) DisposePtr((Ptr)rvyuv_custom_message); - if (rvyuv_free) DisposePtr((Ptr)rvyuv_free); - if (rvyuv_hive_message) DisposePtr((Ptr)rvyuv_hive_message); - if (rvyuv_init) DisposePtr((Ptr)rvyuv_init); - if (rvyuv_transform) DisposePtr((Ptr)rvyuv_transform); -#endif rv_handle=NULL; }