[xiph-commits] r7660 - in trunk/oggdsf: sln/oggdsf_all src/lib/codecs/cmml src/lib/codecs/cmml/dsfCMMLRawSource src/lib/core/directshow/dsfAnxDemux src/lib/core/directshow/dsfOggDemux

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Sun Aug 29 09:56:07 PDT 2004


Author: illiminable
Date: 2004-08-29 09:56:07 -0700 (Sun, 29 Aug 2004)
New Revision: 7660

Added:
   trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/
   trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourceFilter.cpp
   trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourceFilter.h
   trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourcePin.cpp
   trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourcePin.h
   trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/ReadMe.txt
   trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/cmmlrawsourcedllstuff.cpp
   trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/cmmlrawsourcedllstuff.h
   trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/dsfCMMLRawSource.cpp
   trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/dsfCMMLRawSource.h
   trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/dsfCMMLRawSource.vcproj
   trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/stdafx.cpp
   trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/stdafx.h
Modified:
   trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln
   trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLSourcePin.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.h
Log:
* Skeleton of a cmml source filter.

Modified: trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln
===================================================================
--- trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln	2004-08-29 15:17:14 UTC (rev 7659)
+++ trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln	2004-08-29 16:56:07 UTC (rev 7660)
@@ -1117,6 +1117,10 @@
 		{FB373486-0E6E-4BB6-8BF2-1F92EACA1468} = {FB373486-0E6E-4BB6-8BF2-1F92EACA1468}
 	EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfCMMLRawSource", "..\..\src\lib\codecs\cmml\dsfCMMLRawSource\dsfCMMLRawSource.vcproj", "{35D263B8-C0C4-4F28-AC6D-07F8C82A01B8}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
 Global
 	GlobalSection(SolutionConfiguration) = preSolution
 		Debug = Debug
@@ -1670,6 +1674,16 @@
 		{13BFE1FF-00A7-4741-B550-95445D9E0561}.Release.Build.0 = Release|Win32
 		{13BFE1FF-00A7-4741-B550-95445D9E0561}.Release Unicode.ActiveCfg = Release|Win32
 		{13BFE1FF-00A7-4741-B550-95445D9E0561}.Release Unicode.Build.0 = Release|Win32
+		{35D263B8-C0C4-4F28-AC6D-07F8C82A01B8}.Debug.ActiveCfg = Debug|Win32
+		{35D263B8-C0C4-4F28-AC6D-07F8C82A01B8}.Debug.Build.0 = Debug|Win32
+		{35D263B8-C0C4-4F28-AC6D-07F8C82A01B8}.Debug Unicode.ActiveCfg = Debug|Win32
+		{35D263B8-C0C4-4F28-AC6D-07F8C82A01B8}.Debug Unicode.Build.0 = Debug|Win32
+		{35D263B8-C0C4-4F28-AC6D-07F8C82A01B8}.MakeFile.ActiveCfg = Release|Win32
+		{35D263B8-C0C4-4F28-AC6D-07F8C82A01B8}.MakeFile.Build.0 = Release|Win32
+		{35D263B8-C0C4-4F28-AC6D-07F8C82A01B8}.Release.ActiveCfg = Release|Win32
+		{35D263B8-C0C4-4F28-AC6D-07F8C82A01B8}.Release.Build.0 = Release|Win32
+		{35D263B8-C0C4-4F28-AC6D-07F8C82A01B8}.Release Unicode.ActiveCfg = Release|Win32
+		{35D263B8-C0C4-4F28-AC6D-07F8C82A01B8}.Release Unicode.Build.0 = Release|Win32
 	EndGlobalSection
 	GlobalSection(SolutionItems) = postSolution
 	EndGlobalSection

Added: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourceFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourceFilter.cpp	2004-08-29 15:17:14 UTC (rev 7659)
+++ trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourceFilter.cpp	2004-08-29 16:56:07 UTC (rev 7660)
@@ -0,0 +1,49 @@
+#include "StdAfx.h"
+#include ".\cmmlrawsourcefilter.h"
+
+CFactoryTemplate g_Templates[] = 
+{
+    { 
+		L"CMMLRawDemuxFilter",						// Name
+	    &CLSID_CMMLRawSourceFilter,            // CLSID
+	    CMMLRawSourceFilter::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 CMMLRawSourceFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr) 
+{
+	CMMLRawSourceFilter *pNewObject = new CMMLRawSourceFilter();
+    if (pNewObject == NULL) {
+        *pHr = E_OUTOFMEMORY;
+    }
+    return pNewObject;
+} 
+
+CMMLRawSourceFilter::CMMLRawSourceFilter(void)
+	:	CBaseFilter(NAME("CMMLRawSourceFilter"), NULL, m_pLock, CLSID_CMMLRawSourceFilter)
+{
+}
+
+CMMLRawSourceFilter::~CMMLRawSourceFilter(void)
+{
+}
+
+//BaseFilter Interface
+int CMMLRawSourceFilter::GetPinCount() {
+	return 1;
+}
+CBasePin* CMMLRawSourceFilter::GetPin(int inPinNo) {
+
+	if (inPinNo == 0) {
+		return mCMMLSourcePin;
+	} else {
+		return NULL;
+	}
+}
\ No newline at end of file

Added: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourceFilter.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourceFilter.h	2004-08-29 15:17:14 UTC (rev 7659)
+++ trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourceFilter.h	2004-08-29 16:56:07 UTC (rev 7660)
@@ -0,0 +1,20 @@
+#pragma once
+
+
+
+class CMMLRawSourcePin;
+
+class CMMLRawSourceFilter
+	:	public CBaseFilter
+{
+public:
+	CMMLRawSourceFilter(void);
+	virtual ~CMMLRawSourceFilter(void);
+
+	static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+
+	virtual int GetPinCount();
+	virtual CBasePin* GetPin(int inPinNo);
+protected:
+	CMMLRawSourcePin* mCMMLSourcePin;
+};

Added: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourcePin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourcePin.cpp	2004-08-29 15:17:14 UTC (rev 7659)
+++ trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourcePin.cpp	2004-08-29 16:56:07 UTC (rev 7660)
@@ -0,0 +1,120 @@
+#include "StdAfx.h"
+#include ".\cmmlrawsourcepin.h"
+
+CMMLRawSourcePin::CMMLRawSourcePin(CMMLRawSourceFilter* inParentFilter, CCritSec* inFilterLock)
+	:	CBaseOutputPin(NAME("CMML Raw Source Pin"), inParentFilter, inFilterLock, &mFilterHR, L"CMML Source")
+{
+}
+
+CMMLRawSourcePin::~CMMLRawSourcePin(void)
+{
+}
+
+STDMETHODIMP CMMLRawSourcePin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+	
+	return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv); 
+}
+
+HRESULT CMMLRawSourcePin::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
+{
+	
+	mDataQueue->NewSegment(tStart, tStop, dRate);
+
+	return S_OK;
+}
+HRESULT CMMLRawSourcePin::DeliverEndOfStream(void)
+{
+	
+	mDataQueue->EOS();
+    return S_OK;
+}
+
+HRESULT CMMLRawSourcePin::DeliverEndFlush(void)
+{
+	mDataQueue->EndFlush();
+    return S_OK;
+}
+
+HRESULT CMMLRawSourcePin::DeliverBeginFlush(void)
+{
+	
+	mDataQueue->BeginFlush();
+    return S_OK;
+}
+
+HRESULT CMMLRawSourcePin::CompleteConnect (IPin *inReceivePin)
+{
+	mFilterHR = S_OK;
+	//Set the delegate for seeking
+	//((BasicSeekable*)(inReceivePin))->SetDelegate(this);
+	//This may cause issue if pins are disconnected and reconnected
+	//DELETE in DEStructor
+	mDataQueue = new COutputQueue (inReceivePin, &mFilterHR, FALSE, TRUE,1,TRUE, NUM_BUFFERS);
+	if (FAILED(mFilterHR)) {
+		mFilterHR = mFilterHR;
+	}
+	
+	return CBaseOutputPin::CompleteConnect(inReceivePin);
+}
+
+HRESULT CMMLRawSourcePin::BreakConnect(void) {
+	delete mDataQueue;
+	mDataQueue = NULL;
+	return CBaseOutputPin::BreakConnect();
+}
+
+	//CSourceStream virtuals
+HRESULT CMMLRawSourcePin::GetMediaType(int inPosition, CMediaType* outMediaType) {
+	//Put it in from the info we got in the constructor.
+	//NOTE::: May have missed some fields ????
+	//NOTE::: May want to check for null pointers
+	//outMediaType->SetFormat(mMediaType->Format(), mMediaType->FormatLength());
+	if (inPosition == 0) {
+		CMediaType locMediaType;
+
+		locMediaType.majortype = MEDIATYPE_Text;
+		locMediaType.subtype = MEDIASUBTYPE_CMML;
+		locMediaType.formattype = FORMAT_CMML;
+		locMediaType.cbFormat = sizeof(sCMMLFormatBlock); //0;//sizeof(sSpeexFormatBlock);
+		locMediaType.pbFormat = (BYTE*)mCMMLFormatBlock; //(BYTE*)locSpeexFormatInfo;
+		locMediaType.pUnk = NULL;
+		*outMediaType = locMediaType;
+		return S_OK;
+	} else {
+		return VFW_S_NO_MORE_ITEMS;
+	}
+}
+HRESULT CMMLRawSourcePin::CheckMediaType(const CMediaType* inMediaType) {
+	if ((inMediaType->majortype == MEDIATYPE_Text) && (inMediaType->subtype == MEDIASUBTYPE_CMML) && (inMediaType->formattype == FORMAT_CMML)) {
+		return S_OK;
+	} else {
+		return E_FAIL;
+	}
+}
+HRESULT CMMLRawSourcePin::DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest) {
+
+	HRESULT locHR = S_OK;
+
+	ALLOCATOR_PROPERTIES locReqAlloc;
+	ALLOCATOR_PROPERTIES locActualAlloc;
+
+
+	locReqAlloc.cbAlign = 1;
+	locReqAlloc.cbBuffer = BUFFER_SIZE;
+	locReqAlloc.cbPrefix = 0;
+	locReqAlloc.cBuffers = NUM_BUFFERS;
+
+	locHR = inoutAllocator->SetProperties(&locReqAlloc, &locActualAlloc);
+
+	if (locHR != S_OK) {
+		return locHR;
+	}
+	
+	locHR = inoutAllocator->Commit();
+
+	return locHR;
+
+}
+
+

Added: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourcePin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourcePin.h	2004-08-29 15:17:14 UTC (rev 7659)
+++ trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourcePin.h	2004-08-29 16:56:07 UTC (rev 7660)
@@ -0,0 +1,73 @@
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Copyright (C) 2003, 2004 Commonwealth Scientific and Industrial Research
+//   Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+//  notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors 
+//  may be used to endorse or promote products derived from this software 
+//  without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "cmmlrawsourcedllstuff.h"
+
+#include <fstream>
+using namespace std;
+class CMMLRawSourcePin
+	:	public CBaseOutputPin
+{
+public:
+
+	DECLARE_IUNKNOWN
+	STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+	CMMLRawSourcePin(	CMMLRawSourceFilter* inParentFilter, CCritSec* inFilterLock);
+					
+	virtual ~CMMLRawSourcePin(void);
+
+	static const unsigned long BUFFER_SIZE = 65536;			//What should this be ????
+	static const unsigned long NUM_BUFFERS = 10;
+
+	//CBaseOutputPin virtuals
+	virtual HRESULT GetMediaType(int inPosition, CMediaType* outMediaType);
+	virtual HRESULT CheckMediaType(const CMediaType* inMediaType);
+	virtual HRESULT DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest);
+
+
+	//IPin
+	virtual HRESULT CompleteConnect (IPin *inReceivePin);
+	virtual HRESULT BreakConnect(void);
+	virtual HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
+	virtual HRESULT DeliverEndOfStream(void);
+	virtual HRESULT DeliverEndFlush(void);
+	virtual HRESULT DeliverBeginFlush(void);
+protected:
+	fstream debugLog;
+	HRESULT mFilterHR;
+	COutputQueue* mDataQueue;
+	sCMMLFormatBlock* mCMMLFormatBlock;
+};

Added: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/ReadMe.txt
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/ReadMe.txt	2004-08-29 15:17:14 UTC (rev 7659)
+++ trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/ReadMe.txt	2004-08-29 16:56:07 UTC (rev 7660)
@@ -0,0 +1,32 @@
+========================================================================
+    DYNAMIC LINK LIBRARY : dsfCMMLRawSource Project Overview
+========================================================================
+
+AppWizard has created this dsfCMMLRawSource DLL for you.  
+This file contains a summary of what you will find in each of the files that
+make up your dsfCMMLRawSource application.
+
+
+dsfCMMLRawSource.vcproj
+    This is the main project file for VC++ projects generated using an Application Wizard. 
+    It contains information about the version of Visual C++ that generated the file, and 
+    information about the platforms, configurations, and project features selected with the
+    Application Wizard.
+
+dsfCMMLRawSource.cpp
+    This is the main DLL source file.
+
+/////////////////////////////////////////////////////////////////////////////
+Other standard files:
+
+StdAfx.h, StdAfx.cpp
+    These files are used to build a precompiled header (PCH) file
+    named dsfCMMLRawSource.pch and a precompiled types file named StdAfx.obj.
+
+/////////////////////////////////////////////////////////////////////////////
+Other notes:
+
+AppWizard uses "TODO:" comments to indicate parts of the source code you
+should add to or customize.
+
+/////////////////////////////////////////////////////////////////////////////

Added: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/cmmlrawsourcedllstuff.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/cmmlrawsourcedllstuff.cpp	2004-08-29 15:17:14 UTC (rev 7659)
+++ trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/cmmlrawsourcedllstuff.cpp	2004-08-29 16:56:07 UTC (rev 7660)
@@ -0,0 +1,113 @@
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+//  notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors 
+//  may be used to endorse or promote products derived from this software 
+//  without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "cmmlrawsourcedllstuff.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_CMMLRawSourceFilter,						// Filter CLSID. 
+		L"CMML Raw Source Filter",							// Filter name.
+        NULL,										// Device moniker. 
+        &CLSID_LegacyAmFilterCategory,				// Direct Show general category
+        L"CMML Raw Source Filter",							// Instance data. ???????
+        &CMMLRawSourceFilterReg								// Pointer to filter information.
+    );
+
+
+	
+    locFilterMapper->Release();
+
+    return hr;
+
+}
+
+STDAPI DllUnregisterServer()
+{
+	//This is not a general purpose function.
+	//RegWrap::removeMediaDesc();
+
+   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"CMML Raw Source Filter", CLSID_CMMLRawSourceFilter);
+
+	//
+    locFilterMapper->Release();
+    return hr;
+
+}

Added: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/cmmlrawsourcedllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/cmmlrawsourcedllstuff.h	2004-08-29 15:17:14 UTC (rev 7659)
+++ trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/cmmlrawsourcedllstuff.h	2004-08-29 16:56:07 UTC (rev 7660)
@@ -0,0 +1,69 @@
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+//  notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors 
+//  may be used to endorse or promote products derived from this software 
+//  without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+#include <streams.h>
+#include <pullpin.h>
+#include <initguid.h>
+
+#ifdef DSFCMMLRAWSOURCE_EXPORTS
+#define DSFCMMLRAWSOURCE_API __declspec(dllexport)
+#else
+#define DSFCMMLRAWSOURCE_API __declspec(dllimport)
+#endif
+
+// {B78032F1-DCC8-4af4-91AD-FB98E806130D}
+DEFINE_GUID(CLSID_CMMLRawSourceFilter, 
+0xb78032f1, 0xdcc8, 0x4af4, 0x91, 0xad, 0xfb, 0x98, 0xe8, 0x6, 0x13, 0xd);
+
+
+// {53696C76-6961-40b2-B136-436F6E726164}
+DEFINE_GUID(FORMAT_CMML, 
+0x53696c76, 0x6961, 0x40b2, 0xb1, 0x36, 0x43, 0x6f, 0x6e, 0x72, 0x61, 0x64);
+
+
+// {5A656E74-6172-6F26-B79C-D6416E647282}
+DEFINE_GUID(MEDIASUBTYPE_CMML, 
+0x5a656e74, 0x6172, 0x6f26, 0xb7, 0x9c, 0xd6, 0x41, 0x6e, 0x64, 0x72, 0x82);
+
+//Structure defining the registration details of the filter
+const REGFILTER2 CMMLRawSourceFilterReg = {
+		1,
+		MERIT_NORMAL,
+		0,
+        NULL
+		
+};
+
+
+struct sCMMLFormatBlock {
+	__int64 granuleNumerator;
+	__int64 granuleDenominator;
+};

Added: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/dsfCMMLRawSource.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/dsfCMMLRawSource.cpp	2004-08-29 15:17:14 UTC (rev 7659)
+++ trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/dsfCMMLRawSource.cpp	2004-08-29 16:56:07 UTC (rev 7660)
@@ -0,0 +1,36 @@
+// dsfCMMLRawSource.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+#include "dsfCMMLRawSource.h"
+BOOL APIENTRY DllMain( HANDLE hModule, 
+                       DWORD  ul_reason_for_call, 
+                       LPVOID lpReserved
+					 )
+{
+	switch (ul_reason_for_call)
+	{
+	case DLL_PROCESS_ATTACH:
+	case DLL_THREAD_ATTACH:
+	case DLL_THREAD_DETACH:
+	case DLL_PROCESS_DETACH:
+		break;
+	}
+    return TRUE;
+}
+
+// This is an example of an exported variable
+DSFCMMLRAWSOURCE_API int ndsfCMMLRawSource=0;
+
+// This is an example of an exported function.
+DSFCMMLRAWSOURCE_API int fndsfCMMLRawSource(void)
+{
+	return 42;
+}
+
+// This is the constructor of a class that has been exported.
+// see dsfCMMLRawSource.h for the class definition
+CdsfCMMLRawSource::CdsfCMMLRawSource()
+{ 
+	return; 
+}

Added: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/dsfCMMLRawSource.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/dsfCMMLRawSource.h	2004-08-29 15:17:14 UTC (rev 7659)
+++ trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/dsfCMMLRawSource.h	2004-08-29 16:56:07 UTC (rev 7660)
@@ -0,0 +1,22 @@
+// The following ifdef block is the standard way of creating macros which make exporting 
+// from a DLL simpler. All files within this DLL are compiled with the DSFCMMLRAWSOURCE_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see 
+// DSFCMMLRAWSOURCE_API functions as being imported from a DLL, whereas this DLL sees symbols
+// defined with this macro as being exported.
+#ifdef DSFCMMLRAWSOURCE_EXPORTS
+#define DSFCMMLRAWSOURCE_API __declspec(dllexport)
+#else
+#define DSFCMMLRAWSOURCE_API __declspec(dllimport)
+#endif
+
+// This class is exported from the dsfCMMLRawSource.dll
+class DSFCMMLRAWSOURCE_API CdsfCMMLRawSource {
+public:
+	CdsfCMMLRawSource(void);
+	// TODO: add your methods here.
+};
+
+extern DSFCMMLRAWSOURCE_API int ndsfCMMLRawSource;
+
+DSFCMMLRAWSOURCE_API int fndsfCMMLRawSource(void);

Added: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/dsfCMMLRawSource.vcproj
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/dsfCMMLRawSource.vcproj	2004-08-29 15:17:14 UTC (rev 7659)
+++ trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/dsfCMMLRawSource.vcproj	2004-08-29 16:56:07 UTC (rev 7660)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="dsfCMMLRawSource"
+	ProjectGUID="{35D263B8-C0C4-4F28-AC6D-07F8C82A01B8}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="Debug"
+			IntermediateDirectory="Debug"
+			ConfigurationType="2"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="&quot;C:\DXSDK\Samples\C++\DirectShow\BaseClasses&quot;;C:\DXSDK\Include;..\..\..\helper\libilliCore"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DSFCMMLRAWSOURCE_EXPORTS"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="3"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"
+				CallingConvention="2"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="Strmbasd.lib Winmm.lib Strmiids.lib  Quartz.lib"
+				OutputFile="$(OutDir)/dsfCMMLRawSource.dll"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;C:\DXSDK\Samples\C++\DirectShow\BaseClasses\Debug&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/dsfCMMLRawSource.pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/dsfCMMLRawSource.lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="Release"
+			IntermediateDirectory="Release"
+			ConfigurationType="2"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="&quot;C:\DXSDK\Samples\C++\DirectShow\BaseClasses&quot;;C:\DXSDK\Include;..\..\..\helper\libilliCore"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;DSFCMMLRAWSOURCE_EXPORTS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="3"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"
+				CallingConvention="2"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="Strmbase.lib Winmm.lib  Strmiids.lib  Quartz.lib"
+				OutputFile="$(OutDir)/dsfCMMLRawSource.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="C:\DXSDK\Lib;&quot;C:\DXSDK\Samples\C++\DirectShow\BaseClasses\Release&quot;"
+				GenerateDebugInformation="TRUE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/dsfCMMLRawSource.lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\cmmlrawsourcedllstuff.cpp">
+			</File>
+			<File
+				RelativePath=".\CMMLRawSourceFilter.cpp">
+			</File>
+			<File
+				RelativePath=".\CMMLRawSourcePin.cpp">
+			</File>
+			<File
+				RelativePath=".\stdafx.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+			<File
+				RelativePath=".\cmmlrawsourcedllstuff.h">
+			</File>
+			<File
+				RelativePath=".\CMMLRawSourceFilter.h">
+			</File>
+			<File
+				RelativePath=".\CMMLRawSourcePin.h">
+			</File>
+			<File
+				RelativePath=".\stdafx.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+		<File
+			RelativePath=".\ReadMe.txt">
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>

Added: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/stdafx.cpp	2004-08-29 15:17:14 UTC (rev 7659)
+++ trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/stdafx.cpp	2004-08-29 16:56:07 UTC (rev 7660)
@@ -0,0 +1,8 @@
+// stdafx.cpp : source file that includes just the standard includes
+// dsfCMMLRawSource.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file

Added: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/stdafx.h	2004-08-29 15:17:14 UTC (rev 7659)
+++ trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/stdafx.h	2004-08-29 16:56:07 UTC (rev 7660)
@@ -0,0 +1,16 @@
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+// TODO: reference additional headers your program requires here
+#include "cmmlrawsourcedllstuff.h"
+#include "CMMLRawSourceFilter.h"
+#include "CMMLRawSourcePin.H"
\ No newline at end of file

Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLSourcePin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLSourcePin.h	2004-08-29 15:17:14 UTC (rev 7659)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLSourcePin.h	2004-08-29 16:56:07 UTC (rev 7660)
@@ -43,7 +43,7 @@
 {
 public:
 
-		DECLARE_IUNKNOWN
+	DECLARE_IUNKNOWN
 	STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
 
 	CMMLSourcePin(	TCHAR* inObjectName, 
@@ -52,7 +52,7 @@
 										StreamHeaders* inHeaderSource, 
 										CMediaType* inMediaType,
 										wstring inPinName);
-	~CMMLSourcePin(void);
+	virtual ~CMMLSourcePin(void);
 
 	//Implements IStreamBuilder to force the pin tothe cmml filter
 	STDMETHODIMP Render(IPin* inOutputPin, IGraphBuilder* inGraphBuilder);

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.h	2004-08-29 15:17:14 UTC (rev 7659)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.h	2004-08-29 16:56:07 UTC (rev 7660)
@@ -84,7 +84,7 @@
 	virtual STDMETHODIMP GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType);
 	virtual STDMETHODIMP Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType);
 
-	//IPin Interface (i Think ?? From CBAseFilter)
+	//PURE VIRTUALS From CBaseFilter
 	virtual int GetPinCount();
 	virtual CBasePin* GetPin(int inPinNo);
 



More information about the commits mailing list