Mercurial > mplayer.hg
comparison libmpcodecs/vd_qtvideo.c @ 26216:e402c7730fcf
Introduce HAVE_QUICKTIME definition and use it where appropriate.
author | diego |
---|---|
date | Sat, 15 Mar 2008 11:31:28 +0000 |
parents | afa125da85cf |
children | 3a2e8ae7c548 |
comparison
equal
deleted
inserted
replaced
26215:ff1cf41e0dc0 | 26216:e402c7730fcf |
---|---|
2 #include <stdlib.h> | 2 #include <stdlib.h> |
3 #include <inttypes.h> | 3 #include <inttypes.h> |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 | 6 |
7 #ifdef MACOSX | 7 #ifdef HAVE_QUICKTIME |
8 #include <QuickTime/ImageCodec.h> | 8 #include <QuickTime/ImageCodec.h> |
9 #define dump_ImageDescription(x) | 9 #define dump_ImageDescription(x) |
10 #endif | 10 #endif |
11 | 11 |
12 #include "loader/wine/windef.h" | 12 #include "loader/wine/windef.h" |
28 | 28 |
29 LIBVD_EXTERN(qtvideo) | 29 LIBVD_EXTERN(qtvideo) |
30 | 30 |
31 #include "bswap.h" | 31 #include "bswap.h" |
32 | 32 |
33 #ifndef MACOSX | 33 #ifndef HAVE_QUICKTIME |
34 #include "loader/qtx/qtxsdk/components.h" | 34 #include "loader/qtx/qtxsdk/components.h" |
35 | 35 |
36 HMODULE WINAPI LoadLibraryA(LPCSTR); | 36 HMODULE WINAPI LoadLibraryA(LPCSTR); |
37 FARPROC WINAPI GetProcAddress(HMODULE,LPCSTR); | 37 FARPROC WINAPI GetProcAddress(HMODULE,LPCSTR); |
38 int WINAPI FreeLibrary(HMODULE); | 38 int WINAPI FreeLibrary(HMODULE); |
51 static GWorldPtr OutBufferGWorld = NULL;//a GWorld is some kind of description for a drawing environment | 51 static GWorldPtr OutBufferGWorld = NULL;//a GWorld is some kind of description for a drawing environment |
52 static ImageDescriptionHandle framedescHandle; | 52 static ImageDescriptionHandle framedescHandle; |
53 static HINSTANCE qtime_qts; // handle to the preloaded quicktime.qts | 53 static HINSTANCE qtime_qts; // handle to the preloaded quicktime.qts |
54 static HMODULE handler; | 54 static HMODULE handler; |
55 | 55 |
56 #if !defined(MACOSX) | 56 #ifndef HAVE_QUICKTIME |
57 static Component (*FindNextComponent)(Component prev,ComponentDescription* desc); | 57 static Component (*FindNextComponent)(Component prev,ComponentDescription* desc); |
58 static OSErr (*GetComponentInfo)(Component prev,ComponentDescription* desc,Handle h1,Handle h2,Handle h3); | 58 static OSErr (*GetComponentInfo)(Component prev,ComponentDescription* desc,Handle h1,Handle h2,Handle h3); |
59 static long (*CountComponents)(ComponentDescription* desc); | 59 static long (*CountComponents)(ComponentDescription* desc); |
60 static OSErr (*InitializeQTML)(long flags); | 60 static OSErr (*InitializeQTML)(long flags); |
61 static OSErr (*EnterMovies)(void); | 61 static OSErr (*EnterMovies)(void); |
86 /*GDHandle*/void* aGDevice, //unused anyway | 86 /*GDHandle*/void* aGDevice, //unused anyway |
87 GWorldFlags flags, | 87 GWorldFlags flags, |
88 void *baseAddr, | 88 void *baseAddr, |
89 long rowBytes); | 89 long rowBytes); |
90 static OSErr (*NewHandleClear)(Size byteCount); | 90 static OSErr (*NewHandleClear)(Size byteCount); |
91 #endif /* #if !defined(MACOSX) */ | 91 #endif /* #ifndef HAVE_QUICKTIME */ |
92 | 92 |
93 // to set/get/query special features/parameters | 93 // to set/get/query special features/parameters |
94 static int control(sh_video_t *sh,int cmd,void* arg,...){ | 94 static int control(sh_video_t *sh,int cmd,void* arg,...){ |
95 return CONTROL_UNKNOWN; | 95 return CONTROL_UNKNOWN; |
96 } | 96 } |
105 Component prev=NULL; | 105 Component prev=NULL; |
106 CodecInfo cinfo; // for ImageCodecGetCodecInfo() | 106 CodecInfo cinfo; // for ImageCodecGetCodecInfo() |
107 ImageSubCodecDecompressCapabilities icap; // for ImageCodecInitialize() | 107 ImageSubCodecDecompressCapabilities icap; // for ImageCodecInitialize() |
108 | 108 |
109 codec_initialized = 0; | 109 codec_initialized = 0; |
110 #ifdef MACOSX | 110 #ifdef HAVE_QUICKTIME |
111 EnterMovies(); | 111 EnterMovies(); |
112 #else | 112 #else |
113 | 113 |
114 #ifdef WIN32_LOADER | 114 #ifdef WIN32_LOADER |
115 Setup_LDT_Keeper(); | 115 Setup_LDT_Keeper(); |
152 result=InitializeQTML(6+16); | 152 result=InitializeQTML(6+16); |
153 // result=InitializeQTML(0); | 153 // result=InitializeQTML(0); |
154 mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"InitializeQTML returned %li\n",result); | 154 mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"InitializeQTML returned %li\n",result); |
155 // result=EnterMovies(); | 155 // result=EnterMovies(); |
156 // printf("EnterMovies->%d\n",result); | 156 // printf("EnterMovies->%d\n",result); |
157 #endif /* MACOSX */ | 157 #endif /* HAVE_QUICKTIME */ |
158 | 158 |
159 #if 0 | 159 #if 0 |
160 memset(&desc,0,sizeof(desc)); | 160 memset(&desc,0,sizeof(desc)); |
161 while((prev=FindNextComponent(prev,&desc))){ | 161 while((prev=FindNextComponent(prev,&desc))){ |
162 ComponentDescription desc2; | 162 ComponentDescription desc2; |
291 return 1; | 291 return 1; |
292 } | 292 } |
293 | 293 |
294 // uninit driver | 294 // uninit driver |
295 static void uninit(sh_video_t *sh){ | 295 static void uninit(sh_video_t *sh){ |
296 #ifdef MACOSX | 296 #ifdef HAVE_QUICKTIME |
297 ExitMovies(); | 297 ExitMovies(); |
298 #endif | 298 #endif |
299 } | 299 } |
300 | 300 |
301 // decode a frame | 301 // decode a frame |