[Mplayer-cvslog] CVS: main/libmpcodecs ad.c,1.14,1.15 ad_qtaudio.c,1.8,1.9 vd.c,1.65,1.66 vd_qtvideo.c,1.14,1.15
Alex Beregszaszi
alex at mplayerhq.hu
Tue Feb 25 16:36:49 CET 2003
Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv22692
Modified Files:
ad.c ad_qtaudio.c vd.c vd_qtvideo.c
Log Message:
MACOSX support patch, based on Dan Christiansens work
Index: ad.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ad.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- ad.c 1 Dec 2002 16:40:05 -0000 1.14
+++ ad.c 25 Feb 2003 15:36:30 -0000 1.15
@@ -67,7 +67,7 @@
#endif
&mpcodecs_ad_acm,
#endif
-#ifdef USE_QTX_CODECS
+#if defined(USE_QTX_CODECS) || defined(MACOSX)
&mpcodecs_ad_qtaudio,
#endif
#ifdef HAVE_FAAD
Index: ad_qtaudio.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ad_qtaudio.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ad_qtaudio.c 12 Feb 2003 15:39:59 -0000 1.8
+++ ad_qtaudio.c 25 Feb 2003 15:36:30 -0000 1.9
@@ -5,7 +5,7 @@
#include "config.h"
-#ifdef USE_QTX_CODECS
+#if defined(USE_QTX_CODECS) || defined(MACOSX)
#include "ad_internal.h"
#include "bswap.h"
@@ -14,6 +14,10 @@
#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;
@@ -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.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -r1.65 -r1.66
--- vd.c 4 Feb 2003 17:50:30 -0000 1.65
+++ vd.c 25 Feb 2003 15:36:30 -0000 1.66
@@ -118,7 +118,7 @@
&mpcodecs_vd_libdv,
#endif
&mpcodecs_vd_lcl,
-#ifdef USE_QTX_CODECS
+#if defined(USE_QTX_CODECS) || defined(MACOSX)
&mpcodecs_vd_qtvideo,
#endif
NULL
Index: vd_qtvideo.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_qtvideo.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- vd_qtvideo.c 12 Feb 2003 15:39:59 -0000 1.14
+++ vd_qtvideo.c 25 Feb 2003 15:36:30 -0000 1.15
@@ -3,7 +3,7 @@
#include "config.h"
-#ifdef USE_QTX_CODECS
+#if defined(USE_QTX_CODECS) || defined(MACOSX)
#include "mp_msg.h"
#include "vd_internal.h"
@@ -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,6 +107,10 @@
CodecInfo cinfo; // for ImageCodecGetCodecInfo()
ImageSubCodecDecompressCapabilities icap; // for ImageCodecInitialize()
+#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
More information about the MPlayer-cvslog
mailing list