summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authoralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-02-25 15:39:36 +0000
committeralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-02-25 15:39:36 +0000
commite8f2dabe9bb31b0edc69254ed83dbe6479499171 (patch)
tree4a6dbeec7aa0902aac6279790bb4e606497b731a /libmpcodecs
parent2639766080f6b7185b78e8788b7b6dccd36e8891 (diff)
downloadmpv-e8f2dabe9bb31b0edc69254ed83dbe6479499171.tar.bz2
mpv-e8f2dabe9bb31b0edc69254ed83dbe6479499171.tar.xz
MACOSX support patch, based on Dan Christiansens work
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9503 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/ad.c2
-rw-r--r--libmpcodecs/ad_qtaudio.c15
-rw-r--r--libmpcodecs/vd.c2
-rw-r--r--libmpcodecs/vd_qtvideo.c21
4 files changed, 35 insertions, 5 deletions
diff --git a/libmpcodecs/ad.c b/libmpcodecs/ad.c
index 1041655977..1bbcfd777e 100644
--- a/libmpcodecs/ad.c
+++ b/libmpcodecs/ad.c
@@ -67,7 +67,7 @@ ad_functions_t* mpcodecs_ad_drivers[] =
#endif
&mpcodecs_ad_acm,
#endif
-#ifdef USE_QTX_CODECS
+#if defined(USE_QTX_CODECS) || defined(MACOSX)
&mpcodecs_ad_qtaudio,
#endif
#ifdef HAVE_FAAD
diff --git a/libmpcodecs/ad_qtaudio.c b/libmpcodecs/ad_qtaudio.c
index b40fef2693..f10ff407cd 100644
--- a/libmpcodecs/ad_qtaudio.c
+++ b/libmpcodecs/ad_qtaudio.c
@@ -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 @@ static ad_info_t info = {
LIBAD_EXTERN(qtaudio)
+#ifdef USE_QTX_CODECS
typedef struct OpaqueSoundConverter* SoundConverter;
typedef unsigned long OSType;
typedef unsigned long UnsignedFixed;
@@ -150,6 +155,7 @@ static int loader_init()
printf("loader_init DONE???\n");
return 0;
}
+#endif /* USE_QTX_CODECS */
static SoundConverter myConverter = NULL;
static SoundComponentData InputFormatInfo,OutputFormatInfo;
@@ -166,7 +172,11 @@ static int preinit(sh_audio_t *sh){
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 @@ static void uninit(sh_audio_t *sh){
// 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){
diff --git a/libmpcodecs/vd.c b/libmpcodecs/vd.c
index 8ac8d81ac7..a97ae0b33c 100644
--- a/libmpcodecs/vd.c
+++ b/libmpcodecs/vd.c
@@ -118,7 +118,7 @@ vd_functions_t* mpcodecs_vd_drivers[] = {
&mpcodecs_vd_libdv,
#endif
&mpcodecs_vd_lcl,
-#ifdef USE_QTX_CODECS
+#if defined(USE_QTX_CODECS) || defined(MACOSX)
&mpcodecs_vd_qtvideo,
#endif
NULL
diff --git a/libmpcodecs/vd_qtvideo.c b/libmpcodecs/vd_qtvideo.c
index 56358f4be9..ad8de4df70 100644
--- a/libmpcodecs/vd_qtvideo.c
+++ b/libmpcodecs/vd_qtvideo.c
@@ -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 @@ static vd_info_t info = {
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 ImageDescriptionHandle framedescHandle;
//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 @@ static OSErr (*QTNewGWorldFromPtr)(GWorldPtr *gw,
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 @@ static int init(sh_video_t *sh){
CodecInfo cinfo; // for ImageCodecGetCodecInfo()
ImageSubCodecDecompressCapabilities icap; // for ImageCodecInitialize()
+#ifdef MACOSX
+ EnterMovies();
+#else
+
#ifdef WIN32_LOADER
Setup_LDT_Keeper();
#endif
@@ -130,6 +143,7 @@ static int init(sh_video_t *sh){
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 @@ static int init(sh_video_t *sh){
// uninit driver
static void uninit(sh_video_t *sh){
+#ifdef MACOSX
+ ExitMovies();
+#endif
}
// decode a frame