[Mplayer-cvslog] CVS: main/loader/dshow DS_AudioDecoder.c,1.13,1.14 DS_Filter.c,1.17,1.18 DS_VideoDecoder.c,1.26,1.27allocator.c,1.9,1.10

Alex Beregszaszi alex at mplayerhq.hu
Mon Apr 21 23:06:12 CEST 2003


Update of /cvsroot/mplayer/main/loader/dshow
In directory mail:/var/tmp.root/cvs-serv21596/dshow

Modified Files:
	DS_AudioDecoder.c DS_Filter.c DS_VideoDecoder.c allocator.c 
Log Message:
cygwin support patch by Sascha Sommer and some fixes by me

Index: DS_AudioDecoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/dshow/DS_AudioDecoder.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- DS_AudioDecoder.c	25 Feb 2003 16:16:37 -0000	1.13
+++ DS_AudioDecoder.c	21 Apr 2003 21:06:08 -0000	1.14
@@ -4,6 +4,7 @@
 	 Copyright 2001 Eugene Kuznetsov  (divx at euro.ru)
 
 *********************************************************/
+#include "config.h"
 
 #ifndef NOAVIFILE_HEADERS
 #include "audiodecoder.h"
@@ -24,7 +25,9 @@
 };
 
 #include "DS_AudioDecoder.h"
+#ifdef WIN32_LOADER
 #include "../ldt_keeper.h"
+#endif
 
 #include <string.h>
 #include <stdio.h>
@@ -41,8 +44,10 @@
     int sz;
     WAVEFORMATEX* pWF;
 
+#ifdef WIN32_LOADER
     Setup_LDT_Keeper();
     Setup_FS_Segment();
+#endif
         
     this = malloc(sizeof(DS_AudioDecoder));
     
@@ -141,7 +146,9 @@
     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)

Index: DS_Filter.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/dshow/DS_Filter.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- DS_Filter.c	26 Nov 2002 21:00:20 -0000	1.17
+++ DS_Filter.c	21 Apr 2003 21:06:08 -0000	1.18
@@ -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 @@
 
     free(This);
 
+#ifdef WIN32_LOADER
     CodecRelease();
+#else
+    CoUninitialize();
+#endif
 }
 
 DS_Filter* DS_FilterCreate(const char* dllname, const GUID* id,
@@ -92,7 +113,11 @@
     if (!This)
 	return NULL;
 
+#ifdef WIN32_LOADER
     CodecAlloc();
+#else
+    CoInitialize(0L);
+#endif
 
     This->m_pFilter = NULL;
     This->m_pInputPin = NULL;

Index: DS_VideoDecoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/dshow/DS_VideoDecoder.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- DS_VideoDecoder.c	14 Mar 2003 12:46:49 -0000	1.26
+++ DS_VideoDecoder.c	21 Apr 2003 21:06:08 -0000	1.27
@@ -4,7 +4,7 @@
 	Copyright 2000 Eugene Kuznetsov  (divx at euro.ru)
 
 *********************************************************/
-
+#include "config.h"
 #include "guids.h"
 #include "interfaces.h"
 #include "registry.h"
@@ -35,7 +35,9 @@
 #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 @@
     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 @@
     // 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

Index: allocator.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/dshow/allocator.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- allocator.c	25 Feb 2003 16:16:37 -0000	1.9
+++ allocator.c	21 Apr 2003 21:06:08 -0000	1.10
@@ -1,3 +1,4 @@
+#include "config.h"
 #include "allocator.h"
 #include "com.h"
 #include "wine/winerror.h"
@@ -286,8 +287,10 @@
 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 @@
     This->interfaces[0]=IID_IUnknown;
     This->interfaces[1]=IID_IMemAllocator;
 
+#ifdef WIN32_LOADER
     if (AllocatorKeeper++ == 0)
 	RegisterComClass(&CLSID_MemoryAllocator, MemAllocator_CreateAllocator);
+#endif
 
     return This;
 }



More information about the MPlayer-cvslog mailing list