[xiph-cvs] r6793 - in trunk/oggdsf/src/lib/core/directshow: dsfAnxDemux dsfOggDemux

illiminable at xiph.org illiminable at xiph.org
Sun May 30 02:37:56 PDT 2004



Author: illiminable
Date: 2004-05-30 05:37:48 -0400 (Sun, 30 May 2004)
New Revision: 6793

Added:
   trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemux.def
   trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/anxdllstuff.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/anxdllstuff.h
Modified:
   trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourceFilter.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourceFilter.h
   trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourcePin.h
   trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/dsfAnxDemux.vcproj
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.cpp
Log:
Adding the project framework and library/COM administrative code.

Added: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemux.def
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemux.def	2004-05-30 08:45:01 UTC (rev 6792)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemux.def	2004-05-30 09:37:48 UTC (rev 6793)
@@ -0,0 +1,7 @@
+LIBRARY	dsfAnxDemux
+EXPORTS 
+	DllMain				PRIVATE
+    DllGetClassObject   PRIVATE
+    DllCanUnloadNow     PRIVATE
+    DllRegisterServer   PRIVATE
+    DllUnregisterServer PRIVATE

Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourceFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourceFilter.cpp	2004-05-30 08:45:01 UTC (rev 6792)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourceFilter.cpp	2004-05-30 09:37:48 UTC (rev 6793)
@@ -1,6 +1,34 @@
 #include "StdAfx.h"
 #include "anxdemuxsourcefilter.h"
 
+
+//-------------------
+// This template lets the Object factory create us properly and work with COM infrastructure.
+CFactoryTemplate g_Templates[] = 
+{
+    { 
+		L"AnxDemuxFilter",						// Name
+	    &CLSID_AnxDemuxSourceFilter,            // CLSID
+	    AnxDemuxSourceFilter::CreateInstance,	// Method to create an instance of MyComponent
+        NULL,									// Initialization function
+        NULL									// Set-up information (for filters)
+    }
+
+};
+
+// Generic way of determining the number of items in the template
+int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]); 
+
+
+
+CUnknown* WINAPI AnxDemuxSourceFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr) 
+{
+	AnxDemuxSourceFilter *pNewObject = new AnxDemuxSourceFilter();
+    if (pNewObject == NULL) {
+        *pHr = E_OUTOFMEMORY;
+    }
+    return pNewObject;
+} 
 AnxDemuxSourceFilter::AnxDemuxSourceFilter(void)
 {
 }
@@ -8,3 +36,17 @@
 AnxDemuxSourceFilter::~AnxDemuxSourceFilter(void)
 {
 }
+
+
+//ANX::: Seek table will need modifying to handle this.
+STDMETHODIMP AnxDemuxSourceFilter::Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType) {
+	//Initialise the file here and setup all the streams
+	CAutoLock locLock(m_pLock);
+	mFileName = inFileName;
+
+	//ANX::: Needs to override ??? Or just modify the seeker.
+	mSeekTable = new AutoOggSeekTable(StringHelper::toNarrowStr(mFileName));
+	mSeekTable->buildTable();
+	
+	return SetUpPins();
+}
\ No newline at end of file

Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourceFilter.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourceFilter.h	2004-05-30 08:45:01 UTC (rev 6792)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourceFilter.h	2004-05-30 09:37:48 UTC (rev 6793)
@@ -1,9 +1,11 @@
 #pragma once
-
+#include "OggDemuxSourceFilter.h"
 class AnxDemuxSourceFilter
         :	public OggDemuxSourceFilter
 {
 public:
         AnxDemuxSourceFilter(void);
         ~AnxDemuxSourceFilter(void);
+
+	STDMETHODIMP Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType)
 };

Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourcePin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourcePin.h	2004-05-30 08:45:01 UTC (rev 6792)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourcePin.h	2004-05-30 09:37:48 UTC (rev 6793)
@@ -1,5 +1,5 @@
 #pragma once
-
+#include "OggDemuxSourcePin.h"
 class AnxDemuxSourcePin
         :	public OggDemuxSourcePin
 {

Added: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/anxdllstuff.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/anxdllstuff.cpp	2004-05-30 08:45:01 UTC (rev 6792)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/anxdllstuff.cpp	2004-05-30 09:37:48 UTC (rev 6793)
@@ -0,0 +1,78 @@
+#include "StdAfx.h"
+#include "anxdllstuff.h"
+
+
+
+extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
+BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+    return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
+}
+
+
+//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
+STDAPI DllRegisterServer()
+{
+	
+	//TO DO::: Should we be releasing the filter mapper even when we return early ?
+    HRESULT hr;
+    IFilterMapper2* locFilterMapper = NULL;
+	
+    hr = AMovieDllRegisterServer2(TRUE);
+	if (FAILED(hr)) {
+		
+        return hr;
+	}
+	
+	
+
+    hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
+
+	
+	if (FAILED(hr)) {
+        return hr;
+	}
+	
+	hr = locFilterMapper->RegisterFilter(
+		CLSID_AnxDemuxSourceFilter,						// Filter CLSID. 
+		L"Annodex Demux Source Filter",							// Filter name.
+        NULL,										// Device moniker. 
+        &CLSID_LegacyAmFilterCategory,				// Direct Show general category
+        L"Annodex Demux Source Filter",							// Instance data. ???????
+        &AnxDemuxSourceFilterReg								// Pointer to filter information.
+    );
+
+
+    locFilterMapper->Release();
+
+    return hr;
+
+}
+
+STDAPI DllUnregisterServer()
+{
+   HRESULT hr;
+    IFilterMapper2* locFilterMapper = NULL;
+
+    hr = AMovieDllRegisterServer2(FALSE);
+	if (FAILED(hr)) {
+		
+        return hr;
+	}
+ 
+    hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
+            IID_IFilterMapper2, (void **)&locFilterMapper);
+
+	if (FAILED(hr)) {
+        return hr;
+	}
+	
+
+    hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, 
+            L"Annodex Demux Source Filter", CLSID_AnxDemuxSourceFilter);
+
+	//
+    locFilterMapper->Release();
+    return hr;
+
+}

Added: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/anxdllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/anxdllstuff.h	2004-05-30 08:45:01 UTC (rev 6792)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/anxdllstuff.h	2004-05-30 09:37:48 UTC (rev 6793)
@@ -0,0 +1,16 @@
+#pragma once
+
+#include "oggdllstuff.h"
+
+
+// {6F767551-E3E1-461f-A8E5-C8ED36342ED1}
+DEFINE_GUID(CLSID_AnxDemuxSourceFilter, 
+0x6f767551, 0xe3e1, 0x461f, 0xa8, 0xe5, 0xc8, 0xed, 0x36, 0x34, 0x2e, 0xd1);
+
+const REGFILTER2 AnxDemuxSourceFilterReg = {
+		1,
+		MERIT_NORMAL,
+		0,
+        NULL
+		
+};
\ No newline at end of file

Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/dsfAnxDemux.vcproj
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/dsfAnxDemux.vcproj	2004-05-30 08:45:01 UTC (rev 6792)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/dsfAnxDemux.vcproj	2004-05-30 09:37:48 UTC (rev 6793)
@@ -19,10 +19,11 @@
                         <Tool
                                 Name="VCCLCompilerTool"
                                 Optimization="0"
+				AdditionalIncludeDirectories=""C:\DXSDK\Samples\C++\DirectShow\BaseClasses";C:\DXSDK\Include;..\..\ogg\libOOOgg;..\..\ogg\libOOOggSeek;..\dsfSeeking;..\dsfOggDemux"
                                 PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DSFANXDEMUX_EXPORTS"
                                 MinimalRebuild="TRUE"
                                 BasicRuntimeChecks="3"
-				RuntimeLibrary="1"
+				RuntimeLibrary="3"
                                 UsePrecompiledHeader="3"
                                 WarningLevel="3"
                                 Detect64BitPortabilityProblems="TRUE"
@@ -31,8 +32,11 @@
                                 Name="VCCustomBuildTool"/>
                         <Tool
                                 Name="VCLinkerTool"
+				AdditionalDependencies="Strmbasd.lib Msvcrtd.lib Winmm.lib Strmiids.lib  Quartz.lib"
                                 OutputFile="$(OutDir)/dsfAnxDemux.dll"
                                 LinkIncremental="2"
+				AdditionalLibraryDirectories=""C:\DXSDK\Samples\C++\DirectShow\BaseClasses\Debug""
+				ModuleDefinitionFile="AnxDemux.def"
                                 GenerateDebugInformation="TRUE"
                                 ProgramDatabaseFile="$(OutDir)/dsfAnxDemux.pdb"
                                 SubSystem="2"
@@ -64,9 +68,10 @@
                                 Optimization="2"
                                 InlineFunctionExpansion="1"
                                 OmitFramePointers="TRUE"
+				AdditionalIncludeDirectories="C:\DXSDK\Include;"C:\DXSDK\Samples\C++\DirectShow\BaseClasses";..\..\ogg\libOOOgg;..\..\ogg\libOOOggSeek;..\dsfSeeking;..\dsfOggDemux"
                                 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;DSFANXDEMUX_EXPORTS"
                                 StringPooling="TRUE"
-				RuntimeLibrary="0"
+				RuntimeLibrary="2"
                                 EnableFunctionLevelLinking="TRUE"
                                 UsePrecompiledHeader="3"
                                 WarningLevel="3"
@@ -76,8 +81,11 @@
                                 Name="VCCustomBuildTool"/>
                         <Tool
                                 Name="VCLinkerTool"
+				AdditionalDependencies="Strmbase.lib Msvcrt.lib Winmm.lib  Strmiids.lib  Quartz.lib"
                                 OutputFile="$(OutDir)/dsfAnxDemux.dll"
                                 LinkIncremental="1"
+				AdditionalLibraryDirectories="C:\DXSDK\Lib;"C:\DXSDK\Samples\C++\DirectShow\BaseClasses\Release""
+				ModuleDefinitionFile="AnxDemux.def"
                                 GenerateDebugInformation="TRUE"
                                 SubSystem="2"
                                 OptimizeReferences="2"
@@ -105,12 +113,18 @@
                         Name="Source Files"
                         Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
                         <File
+				RelativePath="AnxDemux.def">
+			</File>
+			<File
                                 RelativePath="AnxDemuxSourceFilter.cpp">
                         </File>
                         <File
                                 RelativePath="AnxDemuxSourcePin.cpp">
                         </File>
                         <File
+				RelativePath="anxdllstuff.cpp">
+			</File>
+			<File
                                 RelativePath="stdafx.cpp">
                                 <FileConfiguration
                                         Name="Debug|Win32">
@@ -136,6 +150,9 @@
                                 RelativePath="AnxDemuxSourcePin.h">
                         </File>
                         <File
+				RelativePath="anxdllstuff.h">
+			</File>
+			<File
                                 RelativePath="stdafx.h">
                         </File>
                 </Filter>

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp	2004-05-30 08:45:01 UTC (rev 6792)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp	2004-05-30 09:37:48 UTC (rev 6793)
@@ -80,8 +80,9 @@
 
 //------------------
 
+//ANX::: This needs to be changed so these details are passed into the constructor. Or add another parametised constructo
 OggDemuxSourceFilter::OggDemuxSourceFilter()
-	:	CBaseFilter(NAME("OggDemucSourceFilter"), NULL, m_pLock, CLSID_OggDemuxSourceFilter)
+	:	CBaseFilter(NAME("OggDemuxSourceFilter"), NULL, m_pLock, CLSID_OggDemuxSourceFilter)
         ,	mSeekTable(NULL)
 {
         //LEAK CHECK:::Both get deleted in constructor.
@@ -123,6 +124,8 @@
         
         return S_OK;
 }
+
+//ANX::: Seek table will need modifying to handle this.
 STDMETHODIMP OggDemuxSourceFilter::Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType) {
         //Initialise the file here and setup all the streams
         CAutoLock locLock(m_pLock);
@@ -502,6 +505,8 @@
         
         //return value ??
 }
+
+//ANX:::Perhaps override here. Provide a different set-up function.
 HRESULT OggDemuxSourceFilter::SetUpPins() {
         
         CAutoLock locSourceLock(mSourceFileLock);

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.cpp	2004-05-30 08:45:01 UTC (rev 6792)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.cpp	2004-05-30 09:37:48 UTC (rev 6793)
@@ -125,6 +125,7 @@
         }
 }
 
+//ANX::: Need to override here to ensure the anxdata header isn't passed through.
 bool OggStream::processHeaderPacket(StampedOggPacket* inPacket) {
         //FIX::: Return values
 
@@ -188,6 +189,7 @@
         return new CMediaType(locAMMediaType);
 }
 
+//ANX::: Need to override here to create anx pins
 bool OggStream::AddPin() {
         createFormatBlock();
         CMediaType* locMediaType = createMediaType(	getMajorTypeGUID(),
@@ -295,6 +297,8 @@
         }
         return true;
 }
+
+//ANX::: Maybe also needs override. ??
 bool OggStream::dispatchPacket(StampedOggPacket* inPacket) {
         //osDebug<<"Ogg Stream : Packet stamps = "<<inPacket->startTime()<<" - "<<inPacket->endTime()<<endl;
         return mSourcePin->deliverOggPacket(inPacket);

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list