diff options
author | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-04-21 21:06:08 +0000 |
---|---|---|
committer | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-04-21 21:06:08 +0000 |
commit | 597c4bf9259a707196273bd6cfe06bb408fb6843 (patch) | |
tree | d0c3bc73a8c113bbdc6d14c2d8f71519f4b95739 /loader/dshow | |
parent | 6d21e908a0cc9fccdcfa0063af05cd1627dcc9bb (diff) | |
download | mpv-597c4bf9259a707196273bd6cfe06bb408fb6843.tar.bz2 mpv-597c4bf9259a707196273bd6cfe06bb408fb6843.tar.xz |
cygwin support patch by Sascha Sommer and some fixes by me
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9968 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'loader/dshow')
-rw-r--r-- | loader/dshow/DS_AudioDecoder.c | 7 | ||||
-rw-r--r-- | loader/dshow/DS_Filter.c | 25 | ||||
-rw-r--r-- | loader/dshow/DS_VideoDecoder.c | 8 | ||||
-rw-r--r-- | loader/dshow/allocator.c | 5 |
4 files changed, 44 insertions, 1 deletions
diff --git a/loader/dshow/DS_AudioDecoder.c b/loader/dshow/DS_AudioDecoder.c index 851854a9df..b3a2021956 100644 --- a/loader/dshow/DS_AudioDecoder.c +++ b/loader/dshow/DS_AudioDecoder.c @@ -4,6 +4,7 @@ Copyright 2001 Eugene Kuznetsov (divx@euro.ru) *********************************************************/ +#include "config.h" #ifndef NOAVIFILE_HEADERS #include "audiodecoder.h" @@ -24,7 +25,9 @@ struct _DS_AudioDecoder }; #include "DS_AudioDecoder.h" +#ifdef WIN32_LOADER #include "../ldt_keeper.h" +#endif #include <string.h> #include <stdio.h> @@ -41,8 +44,10 @@ DS_AudioDecoder * DS_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX* int sz; WAVEFORMATEX* pWF; +#ifdef WIN32_LOADER Setup_LDT_Keeper(); Setup_FS_Segment(); +#endif this = malloc(sizeof(DS_AudioDecoder)); @@ -141,7 +146,9 @@ int DS_AudioDecoder_Convert(DS_AudioDecoder *this, const void* in_data, unsigned if (!in_data || !out_data) return -1; +#ifdef WIN32_LOADER Setup_FS_Segment(); +#endif in_size -= in_size%this->in_fmt.nBlockAlign; while (in_size>0) diff --git a/loader/dshow/DS_Filter.c b/loader/dshow/DS_Filter.c index 8482201317..ccc45bcb89 100644 --- a/loader/dshow/DS_Filter.c +++ b/loader/dshow/DS_Filter.c @@ -1,3 +1,4 @@ +#include "config.h" #include "DS_Filter.h" #include "driver.h" #include "com.h" @@ -8,6 +9,22 @@ typedef long STDCALL (*GETCLASS) (const GUID*, const GUID*, void**); +#ifndef WIN32_LOADER +const GUID IID_IUnknown = +{ + 0x00000000, 0x0000, 0x0000, + {0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +}; +const GUID IID_IClassFactory = +{ + 0x00000001, 0x0000, 0x0000, + {0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +}; + +HRESULT STDCALL CoInitialize(LPVOID pvReserved); +void STDCALL CoUninitialize(void); +#endif + //void trapbug(); static void DS_Filter_Start(DS_Filter* This) @@ -77,7 +94,11 @@ void DS_Filter_Destroy(DS_Filter* This) free(This); +#ifdef WIN32_LOADER CodecRelease(); +#else + CoUninitialize(); +#endif } DS_Filter* DS_FilterCreate(const char* dllname, const GUID* id, @@ -92,7 +113,11 @@ DS_Filter* DS_FilterCreate(const char* dllname, const GUID* id, if (!This) return NULL; +#ifdef WIN32_LOADER CodecAlloc(); +#else + CoInitialize(0L); +#endif This->m_pFilter = NULL; This->m_pInputPin = NULL; diff --git a/loader/dshow/DS_VideoDecoder.c b/loader/dshow/DS_VideoDecoder.c index 231059109d..cab9291929 100644 --- a/loader/dshow/DS_VideoDecoder.c +++ b/loader/dshow/DS_VideoDecoder.c @@ -4,7 +4,7 @@ Copyright 2000 Eugene Kuznetsov (divx@euro.ru) *********************************************************/ - +#include "config.h" #include "guids.h" #include "interfaces.h" #include "registry.h" @@ -35,7 +35,9 @@ struct _DS_VideoDecoder #include "DS_VideoDecoder.h" #include "../wine/winerror.h" +#ifdef WIN32_LOADER #include "../ldt_keeper.h" +#endif #ifndef NOAVIFILE_HEADERS #define VFW_E_NOT_RUNNING 0x80040226 @@ -97,7 +99,9 @@ DS_VideoDecoder * DS_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHEAD this->m_iLastQuality = -1; this->m_iMaxAuto = maxauto; +#ifdef WIN32_LOADER Setup_LDT_Keeper(); +#endif //memset(&m_obh, 0, sizeof(m_obh)); //m_obh.biSize = sizeof(m_obh); @@ -327,7 +331,9 @@ int DS_VideoDecoder_DecodeInternal(DS_VideoDecoder *this, const void* src, int s // crashes inside ...->Receive() fixed now? // // nope - but this is surely helpfull - I'll try some more experiments +#ifdef WIN32_LOADER Setup_FS_Segment(); +#endif #if 0 if (!this->m_pDS_Filter || !this->m_pDS_Filter->m_pImp || !this->m_pDS_Filter->m_pImp->vt diff --git a/loader/dshow/allocator.c b/loader/dshow/allocator.c index 34d453727e..379b859d4c 100644 --- a/loader/dshow/allocator.c +++ b/loader/dshow/allocator.c @@ -1,3 +1,4 @@ +#include "config.h" #include "allocator.h" #include "com.h" #include "wine/winerror.h" @@ -286,8 +287,10 @@ static void MemAllocator_ResetPointer(MemAllocator* This) static void MemAllocator_Destroy(MemAllocator* This) { Debug printf("MemAllocator_Destroy(%p) called (%d, %d)\n", This, This->refcount, AllocatorKeeper); +#ifdef WIN32_LOADER if (--AllocatorKeeper == 0) UnregisterComClass(&CLSID_MemoryAllocator, MemAllocator_CreateAllocator); +#endif free(This->vt); free(This); } @@ -338,8 +341,10 @@ MemAllocator* MemAllocatorCreate() This->interfaces[0]=IID_IUnknown; This->interfaces[1]=IID_IMemAllocator; +#ifdef WIN32_LOADER if (AllocatorKeeper++ == 0) RegisterComClass(&CLSID_MemoryAllocator, MemAllocator_CreateAllocator); +#endif return This; } |