[xiph-commits] r11038 - in branches/oggdsf_ce_port: build/oggcodecs_wm5 src/lib/core/directshow/dsfOggDemux2 src/tests/testLoadLib

illiminable at svn.xiph.org illiminable at svn.xiph.org
Mon Mar 20 08:12:53 PST 2006


Author: illiminable
Date: 2006-03-20 08:12:33 -0800 (Mon, 20 Mar 2006)
New Revision: 11038

Modified:
   branches/oggdsf_ce_port/build/oggcodecs_wm5/oggcodecs_wm5.vddproj
   branches/oggdsf_ce_port/src/lib/core/directshow/dsfOggDemux2/DataSourceFactory.cpp
   branches/oggdsf_ce_port/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.cpp
   branches/oggdsf_ce_port/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.h
   branches/oggdsf_ce_port/src/lib/core/directshow/dsfOggDemux2/ds_guids.h
   branches/oggdsf_ce_port/src/lib/core/directshow/dsfOggDemux2/dsfOggDemux2.vcproj
   branches/oggdsf_ce_port/src/tests/testLoadLib/testLoadLib.cpp
   branches/oggdsf_ce_port/src/tests/testLoadLib/testLoadLib.vcproj
Log:
* Fix bug in pin type specification for demux in WM5, did say 0 pin types, really is 1
* Change the dodgy test app, to try and load up a directshow graph in an event handler where it can be debugged somewhat
* Fix bug where if the data source factory returned null, it crashed rather than returning the correct error code
* Add conditional code for WinCE to the data source factory so that it's file path naming convention (ie unix like but with backslashes, everything from a common root) is properly handled.

Modified: branches/oggdsf_ce_port/build/oggcodecs_wm5/oggcodecs_wm5.vddproj
===================================================================
--- branches/oggdsf_ce_port/build/oggcodecs_wm5/oggcodecs_wm5.vddproj	2006-03-20 15:32:26 UTC (rev 11037)
+++ branches/oggdsf_ce_port/build/oggcodecs_wm5/oggcodecs_wm5.vddproj	2006-03-20 16:12:33 UTC (rev 11038)
@@ -62,6 +62,12 @@
         }
         "Entry"
         {
+        "MsmKey" = "8:_99D03DD0E510464783D60DEE08696E18"
+        "OwnerKey" = "8:_UNDEFINED"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
         "MsmKey" = "8:_A426EE6EF354441D95FE7C65861866C6"
         "OwnerKey" = "8:_UNDEFINED"
         "MsmSig" = "8:_UNDEFINED"
@@ -152,6 +158,24 @@
             "IsDependency" = "11:FALSE"
             "IsolateTo" = "8:"
             }
+            "{BA458234-9B71-4F46-8107-E91156377184}:_99D03DD0E510464783D60DEE08696E18"
+            {
+            "SourcePath" = "8:V:\\Program Files\\Microsoft Visual Studio 8\\VC\\ce\\Dll\\armv4i\\msvcr80d.dll"
+            "TargetName" = "8:msvcr80d.dll"
+            "Tag" = "8:"
+            "Folder" = "8:_8BE9216FDC6E4FB1B98829D8873DE833"
+            "Condition" = "8:"
+            "Vital" = "11:TRUE"
+            "ReadOnly" = "11:FALSE"
+            "Hidden" = "11:FALSE"
+            "System" = "11:FALSE"
+            "Permanent" = "11:FALSE"
+            "SharedLegacy" = "11:FALSE"
+            "Register" = "3:0"
+            "Exclude" = "11:FALSE"
+            "IsDependency" = "11:FALSE"
+            "IsolateTo" = "8:"
+            }
         }
         "Folder"
         {
@@ -199,7 +223,7 @@
         {
             "{605BE39E-5046-48BD-AEC0-63C3A46626D5}:_07061F9B96124E73928A0D625D4EAC43"
             {
-            "SourcePath" = "8:..\\..\\src\\lib\\core\\ogg\\liboooggseek\\windows mobile 5.0 pocket pc sdk (armv4i)\\release_wm5_ppc_arm\\libOOOggSeek.dll"
+            "SourcePath" = "8:..\\..\\src\\lib\\core\\ogg\\libOOOggSeek\\Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\\Debug_WM5_PPC_ARM\\libOOOggSeek.dll"
             "TargetName" = "8:"
             "Tag" = "8:"
             "Folder" = "8:_8BE9216FDC6E4FB1B98829D8873DE833"
@@ -225,7 +249,7 @@
             }
             "{605BE39E-5046-48BD-AEC0-63C3A46626D5}:_3C1ED3991BEE4DE79ABEF31F6AEBC705"
             {
-            "SourcePath" = "8:..\\..\\src\\lib\\core\\directshow\\dsfoggdemux2\\windows mobile 5.0 pocket pc sdk (armv4i)\\release_wm5_ppc_arm\\dsfOggDemux2.dll"
+            "SourcePath" = "8:..\\..\\src\\lib\\core\\directshow\\dsfOggDemux2\\Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\\Debug_WM5_PPC_ARM\\dsfOggDemux2.dll"
             "TargetName" = "8:"
             "Tag" = "8:"
             "Folder" = "8:_8BE9216FDC6E4FB1B98829D8873DE833"
@@ -251,7 +275,7 @@
             }
             "{605BE39E-5046-48BD-AEC0-63C3A46626D5}:_3DF217B99DB14F3CB0C18118683DDE25"
             {
-            "SourcePath" = "8:..\\..\\src\\tests\\testloadlib\\windows mobile 5.0 pocket pc sdk (armv4i)\\release_wm5_ppc_arm\\testLoadLib.exe"
+            "SourcePath" = "8:..\\..\\src\\tests\\testLoadLib\\Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\\Debug\\testLoadLib.exe"
             "TargetName" = "8:"
             "Tag" = "8:"
             "Folder" = "8:_8BE9216FDC6E4FB1B98829D8873DE833"
@@ -277,7 +301,7 @@
             }
             "{605BE39E-5046-48BD-AEC0-63C3A46626D5}:_4811BCC1ADF5454F89B779DF82058CA2"
             {
-            "SourcePath" = "8:..\\..\\src\\lib\\codecs\\vorbis\\filters\\dsfvorbisdecoder\\windows mobile 5.0 pocket pc sdk (armv4i)\\release_wm5_ppc_arm\\dsfVorbisDecoder.dll"
+            "SourcePath" = "8:..\\..\\src\\lib\\codecs\\vorbis\\filters\\dsfVorbisDecoder\\Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\\Debug_WM5_PPC_ARM\\dsfVorbisDecoder.dll"
             "TargetName" = "8:"
             "Tag" = "8:"
             "Folder" = "8:_8BE9216FDC6E4FB1B98829D8873DE833"
@@ -303,7 +327,7 @@
             }
             "{605BE39E-5046-48BD-AEC0-63C3A46626D5}:_78B83888966E4D28897A832EC1CB59EB"
             {
-            "SourcePath" = "8:..\\..\\src\\lib\\core\\ogg\\libooogg\\windows mobile 5.0 pocket pc sdk (armv4i)\\release_wm5_ppc_arm\\libOOOgg.dll"
+            "SourcePath" = "8:..\\..\\src\\lib\\core\\ogg\\libOOOgg\\Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\\Debug_WM5_PPC_ARM\\libOOOgg.dll"
             "TargetName" = "8:"
             "Tag" = "8:"
             "Folder" = "8:_8BE9216FDC6E4FB1B98829D8873DE833"
@@ -329,7 +353,7 @@
             }
             "{605BE39E-5046-48BD-AEC0-63C3A46626D5}:_7CC0F388C7734C2B8ECED59713F156C7"
             {
-            "SourcePath" = "8:..\\..\\src\\lib\\codecs\\theora\\libs\\libootheora\\windows mobile 5.0 pocket pc sdk (armv4i)\\release_wm5_ppc_arm\\libOOTheora.dll"
+            "SourcePath" = "8:..\\..\\src\\lib\\codecs\\theora\\libs\\libOOTheora\\Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\\Debug_WM5_PPC_ARM\\libOOTheora.dll"
             "TargetName" = "8:"
             "Tag" = "8:"
             "Folder" = "8:_8BE9216FDC6E4FB1B98829D8873DE833"
@@ -355,7 +379,7 @@
             }
             "{605BE39E-5046-48BD-AEC0-63C3A46626D5}:_898F68EFD6EB479185D2277F89249261"
             {
-            "SourcePath" = "8:..\\..\\src\\lib\\codecs\\theora\\filters\\dsftheoradecoder\\windows mobile 5.0 pocket pc sdk (armv4i)\\release_wm5_ppc_arm\\dsfTheoraDecoder.dll"
+            "SourcePath" = "8:..\\..\\src\\lib\\codecs\\theora\\filters\\dsfTheoraDecoder\\Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\\Debug_WM5_PPC_ARM\\dsfTheoraDecoder.dll"
             "TargetName" = "8:"
             "Tag" = "8:"
             "Folder" = "8:_8BE9216FDC6E4FB1B98829D8873DE833"
@@ -381,7 +405,7 @@
             }
             "{605BE39E-5046-48BD-AEC0-63C3A46626D5}:_A426EE6EF354441D95FE7C65861866C6"
             {
-            "SourcePath" = "8:..\\..\\src\\lib\\codecs\\speex\\filters\\dsfspeexdecoder\\windows mobile 5.0 pocket pc sdk (armv4i)\\release_wm5_ppc_arm\\dsfSpeexDecoder.dll"
+            "SourcePath" = "8:..\\..\\src\\lib\\codecs\\speex\\filters\\dsfSpeexDecoder\\Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\\Debug_WM5_PPC_ARM\\dsfSpeexDecoder.dll"
             "TargetName" = "8:"
             "Tag" = "8:"
             "Folder" = "8:_8BE9216FDC6E4FB1B98829D8873DE833"
@@ -407,7 +431,7 @@
             }
             "{605BE39E-5046-48BD-AEC0-63C3A46626D5}:_BC04D4D4A1EE423EBFA34E91DF63319A"
             {
-            "SourcePath" = "8:..\\..\\src\\lib\\codecs\\vorbis\\libs\\libvorbis\\win32\\windows mobile 5.0 pocket pc sdk (armv4i)\\release_wm5_ppc_arm\\vorbis.dll"
+            "SourcePath" = "8:..\\..\\src\\lib\\codecs\\vorbis\\libs\\libvorbis\\win32\\Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\\Debug_WM5_PPC_ARM\\vorbis_d.dll"
             "TargetName" = "8:"
             "Tag" = "8:"
             "Folder" = "8:_8BE9216FDC6E4FB1B98829D8873DE833"
@@ -433,7 +457,7 @@
             }
             "{605BE39E-5046-48BD-AEC0-63C3A46626D5}:_FC0F711C0A9A47699D526C0B5B30DF9E"
             {
-            "SourcePath" = "8:..\\..\\src\\lib\\codecs\\helper\\libfishsound\\win32\\windows mobile 5.0 pocket pc sdk (armv4i)\\release_wm5_ppc_arm\\libfishsound.dll"
+            "SourcePath" = "8:..\\..\\src\\lib\\codecs\\helper\\libfishsound\\win32\\Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\\Debug_WM5_PPC_ARM\\libfishsound.dll"
             "TargetName" = "8:"
             "Tag" = "8:"
             "Folder" = "8:_8BE9216FDC6E4FB1B98829D8873DE833"

Modified: branches/oggdsf_ce_port/src/lib/core/directshow/dsfOggDemux2/DataSourceFactory.cpp
===================================================================
--- branches/oggdsf_ce_port/src/lib/core/directshow/dsfOggDemux2/DataSourceFactory.cpp	2006-03-20 15:32:26 UTC (rev 11037)
+++ branches/oggdsf_ce_port/src/lib/core/directshow/dsfOggDemux2/DataSourceFactory.cpp	2006-03-20 16:12:33 UTC (rev 11038)
@@ -52,6 +52,11 @@
 		//Http stream
 		//return new HTTPFileSource;
 		return new HTTPStreamingFileSource;
+#ifdef WINCE
+	} else if (locType == "\\") {
+		//WinCE absolute file path
+		return new FilterFileSource;
+#endif
 	} else {
 		//Something else
 		return NULL;
@@ -70,6 +75,14 @@
 				//A "\\" is a network share
 				return retStr;
 			} else {
+#ifdef WINCE
+				retStr = inSourceLocation.substr(0,1);
+
+				if (retStr == "\\") {
+					//WinCE absolute path
+					return retStr;
+				}
+#endif
 				//Not a network share.
 				return "";
 			}

Modified: branches/oggdsf_ce_port/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.cpp
===================================================================
--- branches/oggdsf_ce_port/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.cpp	2006-03-20 15:32:26 UTC (rev 11037)
+++ branches/oggdsf_ce_port/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.cpp	2006-03-20 16:12:33 UTC (rev 11038)
@@ -140,6 +140,9 @@
 	,	mUsingCustomSource(false)
 
 {
+	debugLog.open(L"\\Storage Card\\demuxfilt.txt", ios_base::out);
+	debugLog<<L"Constructor"<<endl;
+
 	//Why do we do this, should the base class do it ?
 	m_pLock = new CCritSec;
 
@@ -154,6 +157,8 @@
 
 OggDemuxPacketSourceFilter::~OggDemuxPacketSourceFilter(void)
 {
+	debugLog<<L"Destructor"<<endl;
+	debugLog.close();
 	delete mStreamMapper;
 	delete mSeekTable;
 	//TODO::: Delete the locks
@@ -314,9 +319,11 @@
 }
 HRESULT OggDemuxPacketSourceFilter::SetUpPins()
 {
+	debugLog<<L"Setup Pins - Pre lock"<<endl;
 	CAutoLock locDemuxLock(mDemuxLock);
 	CAutoLock locSourceLock(mSourceFileLock);
 	
+	debugLog<<L"Setup Pins - Post lock"<<endl;
 	unsigned short locRetryCount = 0;
 	const unsigned short RETRY_THRESHOLD = 3;
 
@@ -324,7 +331,13 @@
 	if (!mUsingCustomSource) {
 		//Create and open a data source if we are using the standard source.
 
+		debugLog<<"Pre data source creation"<<endl;
 		mDataSource = DataSourceFactory::createDataSource(StringHelper::toNarrowStr(mFileName).c_str());
+		debugLog<<"Post data source creation"<<endl;
+		if (mDataSource == NULL) {
+			return VFW_E_CANNOT_RENDER;
+		}
+		
 		mDataSource->open(StringHelper::toNarrowStr(mFileName).c_str());
 	} else {
 		//For custom sources seek to the start, just in case
@@ -443,13 +456,17 @@
 
 STDMETHODIMP OggDemuxPacketSourceFilter::Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType) 
 {
+	debugLog<<L"Load - pre lock"<<endl;
 	////Initialise the file here and setup all the streams
 	CAutoLock locLock(m_pLock);
 
+	debugLog<<L"Load - post lock"<<endl;
 
-
+	
 	mFileName = inFileName;
 
+	debugLog<<L"File :"<<mFileName<<endl;
+
 	if (mFileName.find(L"XsZZfQ__WiiPFD.anx") == mFileName.size() - 18){
 		mFileName = mFileName.substr(0, mFileName.size() - 18);
 		
@@ -475,8 +492,11 @@
 		//	mSeekTable->addStream(locPin->getSerialNo(), locPin->getDecoderInterface());
 		//}
 		//mSeekTable->buildTable();
+
+		debugLog<<L"Load OK"<<endl;
 		return S_OK;
 	} else {
+		debugLog<<L"Load Fail "<<locHR<<endl;
 		return locHR;
 	}
 
@@ -514,14 +534,17 @@
 
 void OggDemuxPacketSourceFilter::notifyPinConnected()
 {
+	debugLog<<L"Notify pin connected"<<endl;
 	if (mStreamMapper->allStreamsReady()) {
 		//Setup the seek table.
 		if (mSeekTable == NULL) {
 			//CUSTOM SOURCE:::
 			if (!mUsingCustomSource) {
+				debugLog<<"Setting up seek table"<<endl;
 				//ZZUNICODE:::
 				//mSeekTable = new AutoOggChainGranuleSeekTable(StringHelper::toNarrowStr(mFileName));
 				mSeekTable = new AutoOggChainGranuleSeekTable(mFileName);
+				debugLog<<"After Setting up seek table"<<endl;
 			} else {
 				mSeekTable = new CustomOggChainGranuleSeekTable(mDataSource);
 			}

Modified: branches/oggdsf_ce_port/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.h
===================================================================
--- branches/oggdsf_ce_port/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.h	2006-03-20 15:32:26 UTC (rev 11037)
+++ branches/oggdsf_ce_port/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.h	2006-03-20 16:12:33 UTC (rev 11038)
@@ -172,5 +172,7 @@
 	//HHHH:::
 	__int64 mGlobalBaseTime;
 
+	wfstream debugLog;
+
 	//double mPlaybackRate;
 };

Modified: branches/oggdsf_ce_port/src/lib/core/directshow/dsfOggDemux2/ds_guids.h
===================================================================
--- branches/oggdsf_ce_port/src/lib/core/directshow/dsfOggDemux2/ds_guids.h	2006-03-20 15:32:26 UTC (rev 11037)
+++ branches/oggdsf_ce_port/src/lib/core/directshow/dsfOggDemux2/ds_guids.h	2006-03-20 16:12:33 UTC (rev 11038)
@@ -149,7 +149,7 @@
     &CLSID_OggDemuxPacketSourceFilter,      // Filter CLSID.
     L"Ogg Demux Packet Source Filter",              // Filter name.
     MERIT_NORMAL,           // Merit.
-    0,                      // Number of pin types.
+    1,                      // Number of pin types.
     &OggDemuxPacketSourcePinReg                // Pointer to pin information.
 };
 #else

Modified: branches/oggdsf_ce_port/src/lib/core/directshow/dsfOggDemux2/dsfOggDemux2.vcproj
===================================================================
--- branches/oggdsf_ce_port/src/lib/core/directshow/dsfOggDemux2/dsfOggDemux2.vcproj	2006-03-20 15:32:26 UTC (rev 11037)
+++ branches/oggdsf_ce_port/src/lib/core/directshow/dsfOggDemux2/dsfOggDemux2.vcproj	2006-03-20 16:12:33 UTC (rev 11038)
@@ -982,7 +982,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="strmbase.lib strmiids.lib winsock.lib"
+				AdditionalDependencies="strmbase.lib strmiids.lib ws2.lib"
 				OutputFile="$(OutDir)/dsfOggDemux2.dll"
 				LinkIncremental="2"
 				AdditionalLibraryDirectories=""

Modified: branches/oggdsf_ce_port/src/tests/testLoadLib/testLoadLib.cpp
===================================================================
--- branches/oggdsf_ce_port/src/tests/testLoadLib/testLoadLib.cpp	2006-03-20 15:32:26 UTC (rev 11037)
+++ branches/oggdsf_ce_port/src/tests/testLoadLib/testLoadLib.cpp	2006-03-20 16:12:33 UTC (rev 11038)
@@ -3,9 +3,15 @@
 
 #include "stdafx.h"
 #include "testLoadLib.h"
+#include <dshow.h>
 #include <windows.h>
 #include <commctrl.h>
 
+
+static const GUID CLSID_XX_OggDemux =  
+{ 0xc9361f5a, 0x3282, 0x4944, { 0x98, 0x99, 0x6d, 0x99, 0xcd, 0xc5, 0x37, 0xb } };
+
+
 #define MAX_LOADSTRING 100
 
 // Global Variables:
@@ -246,46 +252,143 @@
         case WM_COMMAND:
             if (LOWORD(wParam) == IDOK)
             {
-				HINSTANCE locLib;
-				DWORD locErr;
-				//FARPROC locProc;
-				HRESULT (__stdcall*locProc)(); 
-				HRESULT locRes;
+				//HINSTANCE locLib;
+				//DWORD locErr;
+				////FARPROC locProc;
+				//HRESULT (__stdcall*locProc)(); 
+				//HRESULT locRes;
 
-				locErr = GetLastError();
-				locLib = LoadLibrary(L"dsfVorbisDecoder.dll");
-				locErr = GetLastError();
-				//locProc = (HRESULT (__stdcall*)())GetProcAddress(locLib, L"DllRegisterServer");
-				//locRes = locProc();
-				FreeLibrary(locLib);
+				//locErr = GetLastError();
+				//locLib = LoadLibrary(L"dsfVorbisDecoder.dll");
+				//locErr = GetLastError();
+				////locProc = (HRESULT (__stdcall*)())GetProcAddress(locLib, L"DllRegisterServer");
+				////locRes = locProc();
+				//FreeLibrary(locLib);
 
-				locErr = GetLastError();
-				locLib = LoadLibrary(L"dsfSpeexDecoder.dll");
-				locErr = GetLastError();
-				//locProc = (HRESULT (__stdcall*)())GetProcAddress(locLib, L"DllRegisterServer");
-				//locRes = locProc();
-				FreeLibrary(locLib);
+				//locErr = GetLastError();
+				//locLib = LoadLibrary(L"dsfSpeexDecoder.dll");
+				//locErr = GetLastError();
+				////locProc = (HRESULT (__stdcall*)())GetProcAddress(locLib, L"DllRegisterServer");
+				////locRes = locProc();
+				//FreeLibrary(locLib);
 
-				locErr = GetLastError();
-				locLib = LoadLibrary(L"dsfTheoraDecoder.dll");
-				locErr = GetLastError();
+				//locErr = GetLastError();
+				//locLib = LoadLibrary(L"dsfTheoraDecoder.dll");
+				//locErr = GetLastError();
+				////locProc = (HRESULT (__stdcall*)())GetProcAddress(locLib, L"DllRegisterServer");
+				////locRes = locProc();
+				//FreeLibrary(locLib);
+
+				//locErr = GetLastError();
+				//locLib = LoadLibrary(L"dsfOggDemux2.dll");
+				//locErr = GetLastError();
 				//locProc = (HRESULT (__stdcall*)())GetProcAddress(locLib, L"DllRegisterServer");
 				//locRes = locProc();
-				FreeLibrary(locLib);
+				//FreeLibrary(locLib);
 
-				locErr = GetLastError();
-				locLib = LoadLibrary(L"dsfOggDemux2.dll");
-				locErr = GetLastError();
-				locProc = (HRESULT (__stdcall*)())GetProcAddress(locLib, L"DllRegisterServer");
-				locRes = locProc();
-				FreeLibrary(locLib);
 
+
+				//IGraphBuilder* locGraphBuilder = NULL;
+				//IMediaControl* locMediaControl = NULL;
+				//HRESULT locHR = S_FALSE;;
+				//CoInitialize(NULL);
+				//locHR = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&locGraphBuilder);
+				//
+				//IBaseFilter* locDemux = NULL;
+				////locHR = CoCreateInstance(CLSID_XX_OggDemux, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void **)&locDemux);
+				//locHR = locGraphBuilder->RenderFile(L"\\Storage Card\\do_you_see.ogg", NULL);
+
+
+				IGraphBuilder* locGraphBuilder = NULL;
+				IMediaControl* locMediaControl = NULL;
+				IBaseFilter* locDemuxer = NULL;
+				//ICustomSource* locCustomSourceSetter = NULL;
+				IFileSourceFilter* locFS = NULL;
+				HRESULT locHR = S_FALSE;;
+				CoInitialize(NULL);
+				locHR = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&locGraphBuilder);
+
+				locHR = CoCreateInstance(CLSID_XX_OggDemux, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&locDemuxer);
+
+				locHR = locGraphBuilder->AddFilter(locDemuxer, L"Custom Ogg Source");
+
+				locHR = locDemuxer->QueryInterface(IID_IFileSourceFilter, (void**)&locFS);
+
+				locHR = locFS->Load(L"\\Storage Card\\do_you_see.ogg", NULL);
+
+
+				//CustomSourceClass* locCustomFileSourceInterface = new CustomSourceClass;
+				//locCustomFileSourceInterface->open("D:\\testfile.ogg");
+				//
+				//locCustomSourceSetter->setCustomSourceAndLoad(locCustomFileSourceInterface);
+
+				//Do not release, it's not really a COM interface
+				//locCustomSourceSetter->Release();
+
+				IEnumPins* locPinEnum = NULL;
+
+				locDemuxer->EnumPins(&locPinEnum);
+
 				
-				if (locRes == 0) {
-					MessageBox(NULL, L"Worked", L"GetProc", MB_OK);
-				} else {
-					MessageBox(NULL, L"Failed", L"GetProc", MB_OK);
+
+				IPin* locPin = NULL;
+				ULONG locHowMany = 0;
+				while (locPinEnum->Next(1, &locPin, &locHowMany) == S_OK) {
+					locHR = locGraphBuilder->Render(locPin);
+					locPin->Release();
+					locPin = NULL;
 				}
+
+
+
+
+
+
+				locHR = locGraphBuilder->QueryInterface(IID_IMediaControl, (void**)&locMediaControl);
+
+
+				locHR = locMediaControl->Run();
+
+				IMediaEvent* locMediaEvent = NULL;
+				locHR = locGraphBuilder->QueryInterface(IID_IMediaEvent, (void**)&locMediaEvent);
+				
+				HANDLE  hEvent; 
+				long    evCode, param1, param2;
+				BOOLEAN bDone = FALSE;
+				HRESULT hr = S_OK;
+				hr = locMediaEvent->GetEventHandle((OAEVENT*)&hEvent);
+				if (FAILED(hr))
+				{
+					/* Insert failure-handling code here. */
+				}
+				while(!bDone) 
+				{
+					if (WAIT_OBJECT_0 == WaitForSingleObject(hEvent, 100))
+					{ 
+						while (hr = locMediaEvent->GetEvent(&evCode, &param1, &param2, 0), SUCCEEDED(hr)) 
+						{
+							//printf("Event code: %#04x\n Params: %d, %d\n", evCode, param1, param2);
+							//cout<<"Event : "<<evCode<<" Params : "<<param1<<", "<<param2<<endl;
+							locMediaEvent->FreeEventParams(evCode, param1, param2);
+							bDone = (EC_COMPLETE == evCode);
+						}
+					}
+				} 
+
+				//cout<<"Finished..."<<endl;
+				int x;
+				//cin>>x;
+				locMediaControl->Release();
+				locGraphBuilder->Release();
+				CoUninitialize();
+
+
+
+
+
+
+				
+	
                 EndDialog(hDlg, LOWORD(wParam));
                 return TRUE;
             }

Modified: branches/oggdsf_ce_port/src/tests/testLoadLib/testLoadLib.vcproj
===================================================================
--- branches/oggdsf_ce_port/src/tests/testLoadLib/testLoadLib.vcproj	2006-03-20 15:32:26 UTC (rev 11037)
+++ branches/oggdsf_ce_port/src/tests/testLoadLib/testLoadLib.vcproj	2006-03-20 16:12:33 UTC (rev 11038)
@@ -63,6 +63,7 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalOptions=" /subsystem:windowsce,5.01"
+				AdditionalDependencies="strmiids.lib"
 				OutputFile="$(OutDir)/testLoadLib.exe"
 				LinkIncremental="2"
 				DelayLoadDLLs="$(NOINHERIT)"
@@ -223,6 +224,7 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalOptions=" /subsystem:windowsce,5.01"
+				AdditionalDependencies="strmiids.lib"
 				OutputFile="$(OutDir)/testLoadLib.exe"
 				LinkIncremental="2"
 				DelayLoadDLLs="$(NOINHERIT)"



More information about the commits mailing list