[Mplayer-cvslog] CVS: 0_90/libmpcodecs ad_qtaudio.c,1.7,1.8 vd_qtvideo.c,1.13,1.14 ve_qtvideo.c,1.6,1.7

Arpi of Ize arpi at mplayerhq.hu
Mon Mar 10 17:04:59 CET 2003


Update of /cvsroot/mplayer/0_90/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv24121

Modified Files:
	ad_qtaudio.c vd_qtvideo.c ve_qtvideo.c 
Log Message:
backport: macosx support


Index: ad_qtaudio.c
===================================================================
RCS file: /cvsroot/mplayer/0_90/libmpcodecs/ad_qtaudio.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ad_qtaudio.c	29 Dec 2002 13:42:58 -0000	1.7
+++ ad_qtaudio.c	10 Mar 2003 16:04:56 -0000	1.8
@@ -5,15 +5,19 @@
 
 #include "config.h"
 
-#ifdef USE_QTX_CODECS
+#if defined(USE_QTX_CODECS) || defined(MACOSX)
 
 #include "ad_internal.h"
 #include "bswap.h"
 
-#ifdef USE_WIN32DLL
+#ifdef WIN32_LOADER
 #include "ldt_keeper.h"
 #endif
 
+#ifdef MACOSX
+#include <QuickTime/QuickTimeComponents.h>
+#endif
+
 static ad_info_t info =  {
 	"QuickTime Audio Decoder",
 	"qtaudio",
@@ -24,6 +28,7 @@
 
 LIBAD_EXTERN(qtaudio)
 
+#ifdef USE_QTX_CODECS
 typedef struct OpaqueSoundConverter*    SoundConverter;
 typedef unsigned long                   OSType;
 typedef unsigned long                   UnsignedFixed;
@@ -81,7 +86,7 @@
 static int loader_init()
 {
 
-#ifdef USE_WIN32DLL
+#ifdef WIN32_LOADER
     Setup_LDT_Keeper();
 #endif
     qtml_dll = LoadLibraryA("qtmlClient.dll");
@@ -150,6 +155,7 @@
     printf("loader_init DONE???\n");
 	return 0;
 }
+#endif /* USE_QTX_CODECS */
 
 static SoundConverter			   myConverter = NULL;
 static SoundComponentData		   InputFormatInfo,OutputFormatInfo;
@@ -166,7 +172,11 @@
 
     printf("win32 libquicktime loader (c) Sascha Sommer\n");
 
+#ifdef MACOSX
+    EnterMovies();
+#else
     if(loader_init()) return 0; // failed to load DLL
+#endif
     
     printf("loader_init DONE!\n");
 
@@ -258,6 +268,9 @@
 //    FreeLibrary( qtml_dll );
 //    qtml_dll = NULL;
 //    printf("qt dll loader uninit done\n");
+#ifdef MACOSX
+    ExitMovies();
+#endif
 }
 
 static int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen){

Index: vd_qtvideo.c
===================================================================
RCS file: /cvsroot/mplayer/0_90/libmpcodecs/vd_qtvideo.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- vd_qtvideo.c	16 Dec 2002 02:38:37 -0000	1.13
+++ vd_qtvideo.c	10 Mar 2003 16:04:56 -0000	1.14
@@ -3,12 +3,12 @@
 
 #include "config.h"
 
-#ifdef USE_QTX_CODECS
+#if defined(USE_QTX_CODECS) || defined(MACOSX)
 
 #include "mp_msg.h"
 #include "vd_internal.h"
 
-#ifdef USE_WIN32DLL
+#ifdef WIN32_LOADER
 #include "ldt_keeper.h"
 #endif
 
@@ -23,13 +23,21 @@
 LIBVD_EXTERN(qtvideo)
 
 #include "../bswap.h"
+
+#ifdef MACOSX
+#include <QuickTime/ImageCodec.h>
+#define dump_ImageDescription(x)
+#else
 #include "qtx/qtxsdk/components.h"
+#endif
 
+#ifdef USE_QTX_CODECS
 //#include "wine/windef.h"
 
 HMODULE   WINAPI LoadLibraryA(LPCSTR);
 FARPROC   WINAPI GetProcAddress(HMODULE,LPCSTR);
 int       WINAPI FreeLibrary(HMODULE);
+#endif
 
 //static ComponentDescription desc; // for FindNextComponent()
 static ComponentInstance ci=NULL; // codec handle
@@ -46,6 +54,7 @@
 //static HINSTANCE qtml_dll;
 static HMODULE handler;
 
+#ifdef USE_QTX_CODECS
 static    Component (*FindNextComponent)(Component prev,ComponentDescription* desc);
 static    OSErr (*GetComponentInfo)(Component prev,ComponentDescription* desc,Handle h1,Handle h2,Handle h3);
 static    long (*CountComponents)(ComponentDescription* desc);
@@ -80,7 +89,7 @@
                                void *baseAddr,
                                long rowBytes); 
 static    OSErr           (*NewHandleClear)(Size byteCount);                          
-
+#endif
 
 // to set/get/query special features/parameters
 static int control(sh_video_t *sh,int cmd,void* arg,...){
@@ -98,7 +107,11 @@
     CodecInfo cinfo;	// for ImageCodecGetCodecInfo()
     ImageSubCodecDecompressCapabilities icap; // for ImageCodecInitialize()
 
-#ifdef USE_WIN32DLL
+#ifdef MACOSX
+    EnterMovies();
+#else
+
+#ifdef WIN32_LOADER
     Setup_LDT_Keeper();
 #endif
 
@@ -130,6 +143,7 @@
     printf("InitializeQTML returned %i\n",result);
 //    result=EnterMovies();
 //    printf("EnterMovies->%d\n",result);
+#endif /* !MACOSX */
 
 #if 0
     memset(&desc,0,sizeof(desc));
@@ -268,6 +282,9 @@
 
 // uninit driver
 static void uninit(sh_video_t *sh){
+#ifdef MACOSX
+    ExitMovies();
+#endif
 }
 
 // decode a frame

Index: ve_qtvideo.c
===================================================================
RCS file: /cvsroot/mplayer/0_90/libmpcodecs/ve_qtvideo.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ve_qtvideo.c	2 Feb 2003 02:42:58 -0000	1.6
+++ ve_qtvideo.c	10 Mar 2003 16:04:56 -0000	1.7
@@ -12,7 +12,7 @@
 #include "../mp_msg.h"
 #include "../bswap.h"
 
-#ifdef USE_WIN32DLL 
+#ifdef WIN32_LOADER 
 #include "ldt_keeper.h" 
 #endif 
 
@@ -20,10 +20,6 @@
 #include "../loader/qtx/qtxsdk/components.h"
 #include "wine/windef.h"
 
-#ifdef USE_WIN32DLL
-#include "ldt_keeper.h"
-#endif
-
 #include "codec-cfg.h"
 #include "stream.h"
 #include "demuxer.h"
@@ -296,7 +292,9 @@
     mux_v->bih->biBitCount=24;
 
 
+#ifdef WIN32_LOADER
     Setup_LDT_Keeper();
+#endif
     handler = LoadLibraryA("qtmlClient.dll");
     InitializeQTML = (OSErr (*)(long))GetProcAddress(handler, "InitializeQTML");
     GetGWorldPixMap = (PixMapHandle (*)(GWorldPtr))GetProcAddress(handler, "GetGWorldPixMap");



More information about the MPlayer-cvslog mailing list