[xiph-commits] r18869 - trunk/oggdsf/src/lib/core/directshow/dsfOggMux

cristianadam at svn.xiph.org cristianadam at svn.xiph.org
Mon Mar 11 17:41:44 PDT 2013


Author: cristianadam
Date: 2013-03-11 17:41:44 -0700 (Mon, 11 Mar 2013)
New Revision: 18869

Added:
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/FilterRegistration.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/FilterRegistration.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMux.vcxproj
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMux.vcxproj.filters
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/Precompiled.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/Precompiled.h
Removed:
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/dsfOggMux.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/stdafx.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/stdafx.h
Modified:
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMux.def
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/PropsOggMux.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/PropsOggMux.h
Log:
Code cleanup. Removed CMML support. A bit of refactoring

Copied: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/FilterRegistration.cpp (from rev 18861, trunk/oggdsf/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.cpp)
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/FilterRegistration.cpp	                        (rev 0)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/FilterRegistration.cpp	2013-03-12 00:41:44 UTC (rev 18869)
@@ -0,0 +1,94 @@
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//          (C) 2013 Cristian Adam
+//
+//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 "Precompiled.h"
+#include "FilterRegistration.h"
+#include "common/util.h"
+
+extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
+BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+    util::ConfigureLogSettings((HMODULE)hModule);
+    return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
+}
+
+STDAPI DllRegisterServer()
+{	
+    HRESULT hr = S_OK;
+    try
+    {
+        CComPtr<IFilterMapper2> filterMapper;
+	
+        CHECK_HR( AMovieDllRegisterServer2(TRUE) );
+	
+        CHECK_HR( CoCreateInstance(CLSID_FilterMapper2, NULL, 
+                                   CLSCTX_INPROC_SERVER, IID_IFilterMapper2, 
+                                   (void **)&filterMapper) );
+
+		CHECK_HR( filterMapper->RegisterFilter(
+		                        CLSID_OggMuxFilter,
+		                        L"Xiph.Org Ogg Muxer",
+                                NULL,
+                                &CLSID_LegacyAmFilterCategory,
+                                NULL,
+                                &OggMuxFilterReg) );
+    }
+    catch (const CAtlException& ex)
+    {
+        hr = ex;
+    }
+
+    return hr;
+}
+
+STDAPI DllUnregisterServer()
+{
+    HRESULT hr = S_OK;
+    try
+    {
+        CComPtr<IFilterMapper2> filterMapper;
+
+        CHECK_HR( AMovieDllRegisterServer2(FALSE) );
+ 
+        CHECK_HR( CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
+                IID_IFilterMapper2, (void **)&filterMapper) );
+	
+        CHECK_HR( filterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, 
+                NULL, CLSID_OggMuxFilter) );
+    } 
+    catch (const CAtlException& ex)
+    {
+        hr = ex;
+    }
+
+    return hr;
+ }

Copied: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/FilterRegistration.h (from rev 18861, trunk/oggdsf/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.h)
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/FilterRegistration.h	                        (rev 0)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/FilterRegistration.h	2013-03-12 00:41:44 UTC (rev 18869)
@@ -0,0 +1,113 @@
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//          (C) 2013 Cristian Adam
+//
+//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>
+
+#include "common/OggTypes.h"
+#include "common/VorbisTypes.h"
+#include "common/TheoraTypes.h"
+#include "common/FlacTypes.h"
+#include "common/SpeexTypes.h"
+
+// {BBCD12AC-0000-0010-8000-00aa00389b71}
+DEFINE_GUID(MEDIASUBTYPE_Schroedinger, 
+0xBBCD12AC, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
+
+// {BBCD12AC-c356-11ce-bf01-00aa0055595a}
+DEFINE_GUID(FORMAT_Schroedinger,
+0xBBCD12AC, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a);
+
+// {37535B3C-F068-4f93-9763-E7208277D71F}
+DEFINE_GUID(MEDIASUBTYPE_RawOggAudio, 
+0x37535b3c, 0xf068, 0x4f93, 0x97, 0x63, 0xe7, 0x20, 0x82, 0x77, 0xd7, 0x1f);
+
+// {232D3C8F-16BF-404b-99AE-296F3DBB77EE}
+DEFINE_GUID(FORMAT_RawOggAudio, 
+0x232d3c8f, 0x16bf, 0x404b, 0x99, 0xae, 0x29, 0x6f, 0x3d, 0xbb, 0x77, 0xee);
+const REGPINTYPES OggMuxInputTypes[] = {
+	{	
+		&MEDIATYPE_Audio,
+		&MEDIASUBTYPE_Speex
+	},
+	{
+		&MEDIATYPE_Audio,
+		&MEDIASUBTYPE_Vorbis
+	},
+	{
+		&MEDIATYPE_Audio,
+		&MEDIASUBTYPE_OggFLAC_1_0
+	},
+	{
+		&MEDIATYPE_Video,
+		&MEDIASUBTYPE_Theora
+	},
+	{
+		&MEDIATYPE_Audio,
+		&MEDIASUBTYPE_FLAC
+	},
+	{
+		&MEDIATYPE_Audio,
+		&MEDIASUBTYPE_RawOggAudio
+	}
+};
+const REGFILTERPINS OggMuxPinReg = {
+	
+    L"Ogg Packet Input",				//Name (obsoleted)
+	TRUE,								//Renders from this pin ?? Not sure about this.
+	FALSE,								//Not an output pin
+	FALSE,								//Cannot have zero instances of this pin
+	FALSE,								//Cannot have more than one instance of this pin
+	NULL,								//Connects to filter (obsoleted)
+	NULL,								//Connects to pin (obsoleted)
+	6,									//Support two media type
+	OggMuxInputTypes					//Pointer to media type (Audio/Vorbis or Audio/Speex)
+};
+
+const REGFILTER2 OggMuxFilterReg = 
+{
+	1,
+	MERIT_DO_NOT_USE,
+	1,
+    &OggMuxPinReg		
+};
+
+struct OGGRAWAUDIOFORMAT 
+{
+	unsigned long samplesPerSec;
+	unsigned long numHeaders;
+	unsigned long numChannels;
+	unsigned long bitsPerSample;
+	unsigned long maxFramesPerPacket;
+};

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMux.def
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMux.def	2013-03-11 07:47:05 UTC (rev 18868)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMux.def	2013-03-12 00:41:44 UTC (rev 18869)
@@ -1,4 +1,4 @@
-LIBRARY	dsfOggMux
+LIBRARY	OggMux
 EXPORTS 
 	DllMain				PRIVATE
     DllGetClassObject   PRIVATE

Added: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMux.vcxproj
===================================================================
(Binary files differ)


Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMux.vcxproj
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + application/xml

Added: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMux.vcxproj.filters
===================================================================
(Binary files differ)


Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMux.vcxproj.filters
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + application/xml

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp	2013-03-11 07:47:05 UTC (rev 18868)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp	2013-03-12 00:41:44 UTC (rev 18869)
@@ -1,5 +1,6 @@
 //===========================================================================
 //Copyright (C) 2003, 2004 Zentaro Kavanagh
+//          (C) 2013 Cristian Adam
 //
 //Redistribution and use in source and binary forms, with or without
 //modification, are permitted provided that the following conditions
@@ -28,30 +29,27 @@
 //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 "Precompiled.h"
 #include "oggmuxfilter.h"
 
 
-//+++++++++++++++++++++++++++++++++
-//-------------------
-// This template lets the Object factory create us properly and work with COM infrastructure.
 CFactoryTemplate g_Templates[] = 
 {
     { 
 		L"Xiph.Org Ogg Muxer",			// Name
 	    &CLSID_OggMuxFilter,            // CLSID
 	    OggMuxFilter::CreateInstance,	// Method to create an instance of MyComponent
-        NULL,									// Initialization function
-        NULL									// Set-up information (for filters)
+        NULL,							// Initialization function
+        NULL							// Set-up information (for filters)
     }
-	//,
- //   { 
-	//	L"Ogg Muxer Properties",						// Name
-	//    &CLSID_PropsOggMux,            // CLSID
-	//    PropsOggMux::CreateInstance,	// Method to create an instance of MyComponent
- //       NULL,									// Initialization function
- //       NULL									// Set-up information (for filters)
- //   }
+//	,
+//   { 
+//		L"Ogg Muxer Properties",		// Name
+//	    &CLSID_PropsOggMux,             // CLSID
+//	     PropsOggMux::CreateInstance,	// Method to create an instance of MyComponent
+//       NULL,							// Initialization function
+//       NULL							// Set-up information (for filters)
+//   }
 
 };
 
@@ -59,82 +57,85 @@
 int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]); 
 
 
-
 CUnknown* WINAPI OggMuxFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr) 
 {
 	OggMuxFilter *pNewObject = new OggMuxFilter();
-    if (pNewObject == NULL) {
+    if (pNewObject == NULL) 
+    {
         *pHr = E_OUTOFMEMORY;
     }
     return pNewObject;
 } 
 
-void OggMuxFilter::NotifyComplete() {
+void OggMuxFilter::NotifyComplete() 
+{
 	HRESULT locHR = NotifyEvent(EC_COMPLETE, S_OK, NULL);
     UNREFERENCED_PARAMETER(locHR);
-
 }
 
 STDMETHODIMP OggMuxFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv)
 {
-	if (riid == IID_IFileSinkFilter) {
-		*ppv = (IFileSinkFilter*)this;
-		((IUnknown*)*ppv)->AddRef();
-		return NOERROR;
-	} else if (riid == IID_IAMFilterMiscFlags) {
-		debugLog<<"Queried for IAMMiscFlags"<<endl;
-		*ppv = (IAMFilterMiscFlags*)this;
-		((IUnknown*)*ppv)->AddRef();
-		return NOERROR;
-	} else if (riid == IID_IMediaSeeking) {
-		debugLog<<"Queried for IMediaSeeking"<<endl;
-		*ppv = (IMediaSeeking*)this;
-		((IUnknown*)*ppv)->AddRef();
-		return NOERROR;
-	} else if (riid == IID_IOggMuxProgress) {
-		debugLog<<"Queried for IMediaSeeking"<<endl;
-		*ppv = (IOggMuxProgress*)this;
-		((IUnknown*)*ppv)->AddRef();
-		return NOERROR;
-	} else if (riid == IID_IOggMuxSettings) {
-		*ppv = (IOggMuxSettings*)this;
-		((IUnknown*)*ppv)->AddRef();
-		return NOERROR;
+	if (riid == IID_IFileSinkFilter) 
+    {
+        return GetInterface((IFileSinkFilter*)this, ppv);
+	} 
+    else if (riid == IID_IAMFilterMiscFlags) 
+    {
+		LOG(logDEBUG)<<"Queried for IAMMiscFlags"<<endl;
+		return GetInterface((IAMFilterMiscFlags*)this, ppv);
+	} 
+    else if (riid == IID_IMediaSeeking) 
+    {
+		LOG(logDEBUG)<<"Queried for IMediaSeeking"<<endl;
+		return GetInterface((IMediaSeeking*)this, ppv);
+	} 
+    else if (riid == IID_IOggMuxProgress) 
+    {
+		LOG(logDEBUG)<<"Queried for IOggMuxProgress"<<endl;
+		return GetInterface((IOggMuxProgress*)this, ppv);
+	} 
+    else if (riid == IID_IOggMuxSettings) 
+    {
+		return GetInterface((IOggMuxSettings*)this, ppv);
 	}
-	//else if (riid == IID_ISpecifyPropertyPages) {
-	//	*ppv = (ISpecifyPropertyPages*)this;
-	//	((IUnknown*)*ppv)->AddRef();
-	//	return NOERROR;
+	//else if (riid == IID_ISpecifyPropertyPages) 
+    //{
+	//	return GetInterface((ISpecifyPropertyPages*)this, ppv);
 	//}
 
 	return CBaseFilter::NonDelegatingQueryInterface(riid, ppv); 
 }
 
-STDMETHODIMP_(LONGLONG) OggMuxFilter::getProgressTime() 
+LONGLONG __stdcall OggMuxFilter::getProgressTime() 
 {
-	if (mInterleaver != NULL) {
+	if (mInterleaver != NULL) 
+    {
 		return mInterleaver->progressTime();
-	} else {
+	} 
+    else 
+    {
 		return -1;
 	}
-
 }
 
-STDMETHODIMP_(LONGLONG) OggMuxFilter::getBytesWritten() {
-	if (mInterleaver != NULL) {
+LONGLONG __stdcall OggMuxFilter::getBytesWritten() 
+{
+	if (mInterleaver != NULL) 
+    {
 		return mInterleaver->bytesWritten();
-	} else {
+	} 
+    else 
+    {
 		return -1;
 	}
-
 }
-ULONG OggMuxFilter::GetMiscFlags(void) 
+
+ULONG OggMuxFilter::GetMiscFlags() 
 {
-	debugLog<<"GetMiscflags"<<endl;
+	LOG(logDEBUG)<<"GetMiscflags"<<endl;
 	return AM_FILTER_MISC_FLAGS_IS_RENDERER;
 }
 
-//------------------
 
 OggMuxFilter::OggMuxFilter()
 	:	CBaseFilter(NAME("Xiph.Org Ogg Muxer"), NULL, m_pLock, CLSID_OggMuxFilter)
@@ -147,99 +148,65 @@
 	mStreamLock = new CCritSec;
 	mInputPins.push_back(new OggMuxInputPin(this, m_pLock, &mHR, mInterleaver->newStream()));
 
-#ifdef OGGCODECS_LOGGING
-	debugLog.open("g:\\logs\\muxer.log", ios_base::out);
-#endif
-	////Make our delegate pin[0], the top pin... we send all out requests there.
-	//IMediaSeeking* locSeeker = NULL;
-	//mInputPins[0]->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
-	//SetDelegate(locSeeker);
-
 	//To avoid a circular reference... we do this without the addref.
 	// This is safe because we control the lifetime of this pin, and it won't be deleted until we are.
 	IMediaSeeking* locSeeker = (IMediaSeeking*)mInputPins[0];
-	SetDelegate(locSeeker);
-	
+	SetDelegate(locSeeker);	
 }
 
 OggMuxFilter::OggMuxFilter(REFCLSID inFilterGUID)
 	:	CBaseFilter(NAME("OggMuxFilter"), NULL, m_pLock, inFilterGUID)
 	,	mInterleaver(NULL)
-{
-	//Do this in derived class
-	//mInterleaver = new OggPageInterleaver(this, this);
-	
-
+{	
 	m_pLock = new CCritSec;
-	mStreamLock = new CCritSec;
-
-	//In the derived class
-	//mInputPins.push_back(new OggMuxInputPin(this, m_pLock, &mHR, mInterleaver->newStream()));
-	//debugLog.open("C:\\temp\\muxer.log", ios_base::out);
-
-	//Make our delegate pin[0], the top pin... we send all out requests there.
-	//IMediaSeeking* locSeeker = NULL;
-	//mInputPins[0]->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
-	//SetDelegate(locSeeker);
-
-
-
-	
+	mStreamLock = new CCritSec;	
 }
 
-OggMuxFilter::~OggMuxFilter(void)
+OggMuxFilter::~OggMuxFilter()
 {
-	//debugLog.close();
-	//DbgLog((LOG_ERROR, 1, TEXT("****************** DESTRUCTOR **********************")));
-
-	//ReleaseDelegate();
-
 	//This is not a leak !! We just don't want it to be released... we never addreffed it.. see constructor.
 	SetDelegate(NULL);
 	
 	delete mInterleaver;
-	for (size_t i = 0; i < mInputPins.size(); i++) {
+	for (size_t i = 0; i < mInputPins.size(); i++) 
+    {
 		delete mInputPins[i];
 	}
 
-
 	delete m_pLock;
 	delete mStreamLock;
-	
-	//Need to delete the pins !!
-
-	
-	//if (ThreadExists() == TRUE) {
-	//	//DbgLog((LOG_ERROR, 1, TEXT("******** Thread exists - closing *****")));
-	//	Close();
-	//}
-
 }
 
-HRESULT OggMuxFilter::addAnotherPin() {
+HRESULT OggMuxFilter::addAnotherPin() 
+{
 	mInputPins.push_back(new OggMuxInputPin(this, m_pLock, &mHR, mInterleaver->newStream()));
 	return S_OK;
 }
 
-	//IFileSinkFilter Implementation
-HRESULT OggMuxFilter::SetFileName(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType) {
+//IFileSinkFilter Implementation
+HRESULT OggMuxFilter::SetFileName(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType) 
+{
 	CAutoLock locLock(m_pLock);
 	mFileName = inFileName;
 
 	SetupOutput();
 	return S_OK;
 }
-HRESULT OggMuxFilter::GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType) {
+
+HRESULT OggMuxFilter::GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType) 
+{
 	//Return the filename and mediatype of the raw data
 
     CheckPointer(outFileName, E_POINTER);
     *outFileName = NULL;
 
-    if (!mFileName.empty()) {
+    if (!mFileName.empty()) 
+    {
     	unsigned int size  = sizeof(WCHAR) * (mFileName.size() + 1);
 
         *outFileName = (LPOLESTR) CoTaskMemAlloc(size);
-        if (*outFileName != NULL) {
+        if (*outFileName != NULL) 
+        {
               CopyMemory(*outFileName, mFileName.c_str(), size);
         }
     }
@@ -247,8 +214,10 @@
 	return S_OK;
 }
 
-bool OggMuxFilter::acceptOggPage(OggPage* inOggPage) {			//Deletes Page correctly.
-	//debugLog<<"Page accepted... writing..."<<endl;
+bool OggMuxFilter::acceptOggPage(OggPage* inOggPage) 
+{			
+    //Deletes Page correctly.
+	//LOG(logDEBUG)<<"Page accepted... writing..."<<endl;
 	unsigned char* locPageData = inOggPage->createRawPageData();
 	mOutputFile.write((char*)locPageData, inOggPage->pageSize());
 
@@ -256,209 +225,82 @@
 	delete[] locPageData;
 	return true;
 }
-bool OggMuxFilter::SetupOutput() {
+
+bool OggMuxFilter::SetupOutput() 
+{
 	mOutputFile.open(StringHelper::toNarrowStr(mFileName).c_str(), ios_base::out | ios_base::binary);
 	return mOutputFile.is_open();
 }
-bool OggMuxFilter::CloseOutput() {
+
+bool OggMuxFilter::CloseOutput() 
+{
 	mOutputFile.close();
 	return true;
-
 }
 
-//	//IFileSource Interface
-//STDMETHODIMP OggMuxFilter::GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType) {
-//	//Return the filename and mediatype of the raw data
-//
-//	 
-//	LPOLESTR x = SysAllocString(mFileName.c_str());
-//	*outFileName = x;
-//	
-//	return S_OK;
-//}
-//STDMETHODIMP OggMuxFilter::Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType) {
-//	//Initialise the file here and setup all the streams
-//	CAutoLock locLock(m_pLock);
-//	mFileName = inFileName;
-//	
-//	return SetUpPins();
-//}
-
 //BaseFilter Interface
-int OggMuxFilter::GetPinCount() {
+int OggMuxFilter::GetPinCount() 
+{
 	//TO DO::: Change this for multiple streams
 	return (int)mInputPins.size();
 }
-CBasePin* OggMuxFilter::GetPin(int inPinNo) {
 
-	if ((inPinNo >= 0) && ((size_t)inPinNo < mInputPins.size()) ) {
+CBasePin* OggMuxFilter::GetPin(int inPinNo) 
+{
+	if ((inPinNo >= 0) && ((size_t)inPinNo < mInputPins.size()) ) 
+    {
 		return mInputPins[inPinNo];
-	} else {
-		return NULL;
-	}
-	//if (inPinNo >= 0 && inPinNo < mStreamMapper->numStreams()) {
-	//	return mStreamMapper->getOggStream(inPinNo)->getPin();
-	//} else {
-	//	return NULL;
-	//}
+	} 
+    
+    return NULL;
 }
 
-//CAMThread Stuff
-//DWORD OggMuxFilter::ThreadProc(void) {
-//	while(true) {
-//		DWORD locThreadCommand = GetRequest();
-//		switch(locThreadCommand) {
-//			case THREAD_EXIT:
-//				Reply(S_OK);
-//				return S_OK;
-//
-//			//case THREAD_PAUSE:
-//			//	// we are paused already
-//			//	Reply(S_OK);
-//			//	break;
-//
-//			case THREAD_RUN:
-//				Reply(S_OK);
-//				DataProcessLoop();
-//				break;
-//		}
-//	
-//	
-//	}
-//	return S_OK;
-//}
 
-//Helper methods
-
-//void OggMuxFilter::resetStream() {
-//
-//	mSourceFile.clear();
-//	mSourceFile.close();
-//	mOggBuffer.clearData();
-//	mSourceFile.open(StringHelper::toNarrowStr(mFileName).c_str(), ios_base::in|ios_base::binary);
-//
-//	mSourceFile.seekg(mStreamMapper->startOfData(), ios_base::beg);
-//	for (unsigned long i = 0; i < mStreamMapper->numStreams(); i++) {
-//		mStreamMapper->getOggStream(i)->setSendExcess(true);	
-//	}
-//}
-
-//HRESULT OggMuxFilter::DataProcessLoop() {
-//	DWORD locCommand = 0;
-//	char* locBuff = new  char[4096];
-//	bool locKeepGoing = true;;
-//	while (!mSourceFile.eof() && locKeepGoing) {
-//		if(CheckRequest(&locCommand) == TRUE) {
-//			return S_OK;
-//		}
-//
-//		mSourceFile.read(locBuff, 4096);
-//		unsigned long locBytesRead = mSourceFile.gcount();
-//		locKeepGoing = mOggBuffer.feed(locBuff, locBytesRead);
-//	}
-//	DeliverEOS();
-//	delete locBuff;
-//	//Memory leak
-//	//FIXED
-//	
-//	
-//}
-//HRESULT OggMuxFilter::SetUpPins() {
-//	mSourceFile.open(StringHelper::toNarrowStr(mFileName).c_str(), ios_base::in|ios_base::binary);
-//	//Error check
-//	
-//	//Register a callback
-//	mOggBuffer.registerVirtualCallback(this);
-//
-//	char* locBuff = new char[RAW_BUFFER_SIZE];
-//	
-//	//Feed the data in until we have seen all BOS pages.
-//	while(!mStreamMapper->isReady()) {
-//		mSourceFile.read(locBuff, RAW_BUFFER_SIZE);
-//		mOggBuffer.feed(locBuff, RAW_BUFFER_SIZE);
-//
-//	}
-//	//Memory leak
-//	//FIXED
-//	delete locBuff;
-//	return S_OK;
-//}
-//IOggCallback Interface
-
-//bool OggMuxFilter::acceptOggPage(OggPage* inOggPage) {
-//	return mStreamMapper->acceptOggPage(inOggPage);
-//}
-
 //IMEdiaStreaming
-STDMETHODIMP OggMuxFilter::Run(REFERENCE_TIME tStart) {
-	//const REFERENCE_TIME A_LONG_TIME = UNITS * 1000;
+HRESULT __stdcall OggMuxFilter::Run(REFERENCE_TIME tStart) 
+{
 	CAutoLock locLock(m_pLock);
-	//DeliverNewSegment(tStart, tStart + A_LONG_TIME, 1.0);
 	return CBaseFilter::Run(tStart);
-	
-
 }
-STDMETHODIMP OggMuxFilter::Pause(void) {
+
+HRESULT __stdcall OggMuxFilter::Pause(void) 
+{
 	CAutoLock locLock(m_pLock);
-	//if (m_State == State_Stopped) {
-	//	if (ThreadExists() == FALSE) {
-	//		Create();
-	//	}
-	//	CallWorker(THREAD_RUN);
-	//}
 	
-	HRESULT locHR = CBaseFilter::Pause();
-	
+	HRESULT locHR = CBaseFilter::Pause();	
 	return locHR;
-	
 }
-STDMETHODIMP OggMuxFilter::Stop(void) {
+
+HRESULT __stdcall OggMuxFilter::Stop() 
+{
 	CAutoLock locLock(m_pLock);
-	//CallWorker(THREAD_EXIT);
-	//Close();
-	//DeliverBeginFlush();
-	//DeliverEndFlush();
 
 	CloseOutput();
 	return CBaseFilter::Stop();
 }
 
-STDMETHODIMP OggMuxFilter::GetPositions(LONGLONG *pCurrent, LONGLONG *pStop) {
+STDMETHODIMP OggMuxFilter::GetPositions(LONGLONG *pCurrent, LONGLONG *pStop) 
+{
 	HRESULT locHR = BasicSeekPassThrough::GetPositions(pCurrent, pStop);
-	debugLog<<"GetPos Before : "<<*pCurrent<<" - "<<*pStop<<endl;
+	LOG(logDEBUG)<<"GetPos Before : "<<*pCurrent<<" - "<<*pStop<<endl;
 	*pCurrent = mInterleaver->progressTime();
-	debugLog<<"GetPos After : "<<*pCurrent<<" - "<<*pStop<<endl;
+	LOG(logDEBUG)<<"GetPos After : "<<*pCurrent<<" - "<<*pStop<<endl;
 	return locHR;
 }
 
-STDMETHODIMP OggMuxFilter::GetCurrentPosition(LONGLONG *pCurrent) {
+STDMETHODIMP OggMuxFilter::GetCurrentPosition(LONGLONG *pCurrent) 
+{
 	*pCurrent = mInterleaver->progressTime();
-	debugLog<<"GetCurrentPos : "<<*pCurrent<<endl;
+	LOG(logDEBUG)<<"GetCurrentPos : "<<*pCurrent<<endl;
 	return S_OK;
 }
 
-//SpecifyPropertyPages Implementation
-//STDMETHODIMP OggMuxFilter::GetPages(CAUUID* outPropPages) {
-//	if (outPropPages == NULL) return E_POINTER;
-//
-//	const int NUM_PROP_PAGES = 1;
-//    outPropPages->cElems = NUM_PROP_PAGES;
-//    outPropPages->pElems = (GUID*)(CoTaskMemAlloc(sizeof(GUID) * NUM_PROP_PAGES));
-//    if (outPropPages->pElems == NULL) 
-//    {
-//        return E_OUTOFMEMORY;
-//    }
-//
-//	outPropPages->pElems[0] = CLSID_PropsOggMux;
-//    
-//    return S_OK;
-//
-//}
-
-STDMETHODIMP_(bool) OggMuxFilter::setMaxPacketsPerPage(unsigned long inMaxPacketsPerPage) {
+bool __stdcall OggMuxFilter::setMaxPacketsPerPage(unsigned long inMaxPacketsPerPage) 
+{
 	for (std::vector<OggMuxInputPin*>::iterator locPinIterator = mInputPins.begin();
 		 locPinIterator != mInputPins.end();
-		 locPinIterator++) {
+		 locPinIterator++) 
+    {
 		OggMuxInputPin* locPin = *locPinIterator;
 		locPin->SetPaginatorMaximumPacketsPerPage(inMaxPacketsPerPage);
 	}
@@ -466,19 +308,21 @@
 	return true;
 }
 
-STDMETHODIMP_(unsigned long) OggMuxFilter::maxPacketsPerPage() {
+unsigned long __stdcall OggMuxFilter::maxPacketsPerPage() 
+{
 	unsigned long locCurrentMaximumPacketsPerPage = 0;
 
 	for (std::vector<OggMuxInputPin*>::iterator locPinIterator = mInputPins.begin();
 		 locPinIterator != mInputPins.end();
-		 locPinIterator++) {
-		
+		 locPinIterator++) 
+    {		
 		OggMuxInputPin* locPin = *locPinIterator;
 
 		unsigned long locMaximumPacketsPerPageForThisPin =
 			locPin->PaginatorMaximumPacketsPerPage();
 
-		if (locMaximumPacketsPerPageForThisPin > locCurrentMaximumPacketsPerPage) {
+		if (locMaximumPacketsPerPageForThisPin > locCurrentMaximumPacketsPerPage) 
+        {
 			locCurrentMaximumPacketsPerPage = locMaximumPacketsPerPageForThisPin;
 		}
 	}

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.h	2013-03-11 07:47:05 UTC (rev 18868)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.h	2013-03-12 00:41:44 UTC (rev 18869)
@@ -1,5 +1,6 @@
 //===========================================================================
 //Copyright (C) 2003, 2004 Zentaro Kavanagh
+//          (C) 2013 Cristian Adam
 //
 //Redistribution and use in source and binary forms, with or without
 //modification, are permitted provided that the following conditions
@@ -30,7 +31,7 @@
 //===========================================================================
 
 #pragma once
-#include "oggmuxdllstuff.h"
+#include "FilterRegistration.h"
 #include "OggMuxInputPin.h"
 #include "IOggMuxProgress.h"
 #include "IOggMuxSettings.h"
@@ -40,14 +41,14 @@
 #include <libOOOgg/INotifyComplete.h>
 
 #include <string>
-
 #include <fstream>
+
 #include <libOOOgg/IOggCallback.h>
-using namespace std;
 #include <libilliCore/StringHelper.h>
+
 class OggMuxInputPin;
 
-class OGG_MUX_API OggMuxFilter
+class OggMuxFilter
 	:	public IFileSinkFilter
 	,	public CBaseFilter
 	,	public IOggCallback
@@ -59,44 +60,35 @@
 	//,	public ISpecifyPropertyPages
 {
 public:
-	OggMuxFilter(void);
+	OggMuxFilter();
 	OggMuxFilter(REFCLSID inFilterGUID);
-	virtual ~OggMuxFilter(void);
+	virtual ~OggMuxFilter();
 
-
 	friend class OggMuxInputPin;
-	//Com Stuff
 	DECLARE_IUNKNOWN
+
 	STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
 	static CUnknown * WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
 
-	// *********************************************
-	// ***** IAMFilterMiscFlags Implementation *****
-	// *********************************************
+	// IAMFilterMiscFlags Implementation
 
 	/// Allows the filter to return a flag to tell the graph it's a renderer.
-	ULONG STDMETHODCALLTYPE GetMiscFlags(void);
+	ULONG __stdcall GetMiscFlags();
 
-	// ***************************************
-	// ***** IOggCallback Implementation *****
-	// ***************************************
+	// IOggCallback Implementation
 
 	/// Takes an incoming page, usually from the interleaver.
 	virtual bool acceptOggPage(OggPage* inOggPage);
 	
-	// ******************************************
-	// ***** IFileSinkFilter Implementation *****
-	// ******************************************
+	// IFileSinkFilter Implementation
 
 	/// Sets the filename to be used to output to
-	STDMETHODIMP SetFileName(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType);
+	HRESULT __stdcall SetFileName(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType);
 
 	/// Gets the output filename this filter is currently using.
-	STDMETHODIMP GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType);
+	HRESULT __stdcall GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType);
 
-	// *************************************
-	// ***** CBaseFilter Pure Virtuals *****
-	// *************************************
+	// CBaseFilter Pure virtuals
 
 	/// Returns the number of pins this filter has
 	virtual int GetPinCount();
@@ -104,43 +96,38 @@
 	/// Returns the indexed pin or NULL.
 	virtual CBasePin* GetPin(int inPinNo);
 
-	// **********************************
-	// ***** IMediaFilter Overrides *****
-	// **********************************
+	// IMediaFilter Overrides
 
 	/// Called when the graph starts playing
-	STDMETHODIMP Run(REFERENCE_TIME tStart);
+	HRESULT __stdcall Run(REFERENCE_TIME tStart);
 
 	/// Called when the graph pauses
-	STDMETHODIMP Pause(void);
+	HRESULT __stdcall Pause(void);
 
 	/// Called when the graph stops
-	STDMETHODIMP Stop(void);
+	HRESULT __stdcall Stop(void);
 
-	// ******************************************
-	// ***** IOggMuxProgress Implementation *****
-	// ******************************************
+	// IOggMuxProgress Implementation
 
 	/// Returns the time in 100 nanosecond units of the last page that was written.
-	virtual STDMETHODIMP_(LONGLONG) getProgressTime();
+	virtual LONGLONG __stdcall getProgressTime();
 
 	/// Returns the number of bytes written so far.
-	virtual STDMETHODIMP_(LONGLONG) getBytesWritten();
+	virtual LONGLONG __stdcall getBytesWritten();
 
-
 	//Helpers
 	virtual HRESULT addAnotherPin();
 	virtual void NotifyComplete();
 
-	//IMediaSeeking Override to give progress. - This is unreliable !!
-	virtual STDMETHODIMP GetPositions(LONGLONG *pCurrent, LONGLONG *pStop);
-	virtual STDMETHODIMP GetCurrentPosition(LONGLONG *pCurrent);
+	// IMediaSeeking Override to give progress. - This is unreliable !!
+	virtual HRESULT __stdcall GetPositions(LONGLONG *pCurrent, LONGLONG *pStop);
+	virtual HRESULT __stdcall GetCurrentPosition(LONGLONG *pCurrent);
 
-	//IOggMuxSettings Implementation
-	STDMETHODIMP_(unsigned long) maxPacketsPerPage();
-	STDMETHODIMP_(bool) setMaxPacketsPerPage(unsigned long inMaxPacketsPerPage);
+	// IOggMuxSettings Implementation
+	unsigned long __stdcall maxPacketsPerPage();
+	bool __stdcall setMaxPacketsPerPage(unsigned long inMaxPacketsPerPage);
 
-	//SpecifyPropertyPages Implementation
+	// SpecifyPropertyPages Implementation
 	//STDMETHODIMP OggMuxFilter::GetPages(CAUUID* outPropPages);
 
 protected:
@@ -148,16 +135,13 @@
 	bool SetupOutput();
 	bool CloseOutput();
 
-	wstring mFileName;
-	vector<OggMuxInputPin*> mInputPins;
+	std::wstring mFileName;
+	std::vector<OggMuxInputPin*> mInputPins;
 
 	OggPageInterleaver* mInterleaver;
 
 	CCritSec* mStreamLock;
 
-	fstream mOutputFile;
-	fstream debugLog;
+	std::fstream mOutputFile;
 	HRESULT mHR;
-
-
 };

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.cpp	2013-03-11 07:47:05 UTC (rev 18868)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.cpp	2013-03-12 00:41:44 UTC (rev 18869)
@@ -1,5 +1,6 @@
 //===========================================================================
 //Copyright (C) 2003, 2004 Zentaro Kavanagh
+//          (C) 2013 Cristian Adam
 //
 //Redistribution and use in source and binary forms, with or without
 //modification, are permitted provided that the following conditions
@@ -28,7 +29,8 @@
 //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 "Precompiled.h"
 #include "oggmuxinputpin.h"
 
 OggMuxInputPin::OggMuxInputPin(OggMuxFilter* inParentFilter, CCritSec* inFilterLock, HRESULT* inHR, OggMuxStream* inMuxStream)
@@ -37,10 +39,7 @@
 	,	mMuxStream(inMuxStream)
 	,	mNeedsFLACHeaderTweak(false)
 	,	mNeedsFLACHeaderCount(false)
-
 {
-
-	
 	OggPaginatorSettings* locSettings = new OggPaginatorSettings;
 	locSettings->mMinPageSize = 4096;
 	locSettings->mMaxPageSize = 8192;
@@ -49,108 +48,101 @@
 	QueryPerformanceCounter(&locTicks);
 	srand((unsigned int)locTicks.LowPart);
 	locSettings->mSerialNo = ((unsigned long)(rand() + 1)) * ((unsigned long)(rand() + 1));
-	//string x = "G:\\logs\\muxinput_";
-	//char* ser = new char[10];
-	//itoa(locSettings->mSerialNo, ser, 10);
-	//x = x + ser;
-	//x = x +".log";
 
-	//debugLog.open(x.c_str(), ios_base::out);
-	//locSettings->mSerialNo = 13130;
-	
 	mPaginator.setParameters(locSettings);
 	mPaginator.setPageCallback(mMuxStream);
-
-	
 }
 
-OggMuxInputPin::~OggMuxInputPin(void)
+OggMuxInputPin::~OggMuxInputPin()
 {
-	//debugLog.close();
 }
 
 STDMETHODIMP OggMuxInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
 {
-	if (riid == IID_IMediaSeeking) {
-		*ppv = (IMediaSeeking*)this;
-		((IUnknown*)*ppv)->AddRef();
-		return NOERROR;
+	if (riid == IID_IMediaSeeking) 
+    {
+        return GetInterface((IMediaSeeking*)this, ppv);
 	}
 
 	return CBaseInputPin::NonDelegatingQueryInterface(riid, ppv); 
 }
 
 //ANX::: Override and insert an anxdata into the stream.
-HRESULT OggMuxInputPin::SetMediaType(const CMediaType* inMediaType) {
-	//debugLog.open("G:\\logs\\oggmuxinpin.log", ios_base::out);
-	//debugLog<<"Set media type..."<<endl;
-	if (inMediaType->majortype == MEDIATYPE_Video) {
-		if (inMediaType->subtype == MEDIASUBTYPE_Theora) {
+HRESULT OggMuxInputPin::SetMediaType(const CMediaType* inMediaType) 
+{
+	//LOG(logDEBUG)<<"Set media type..."<<endl;
+	if (inMediaType->majortype == MEDIATYPE_Video) 
+    {
+		if (inMediaType->subtype == MEDIASUBTYPE_Theora) 
+        {
 			//Theora	
 			THEORAFORMAT* locTheora = (THEORAFORMAT*)inMediaType->pbFormat;
-			//debugLog<<"Theo sample rate = "<<locTheora->frameRateNumerator<<" / "<<locTheora->frameRateDenominator<<endl;
-			//debugLog<<"Theo KFI = "<<locTheora->maxKeyframeInterval<<endl;
+			//LOG(logDEBUG)<<"Theo sample rate = "<<locTheora->frameRateNumerator<<" / "<<locTheora->frameRateDenominator<<endl;
+			//LOG(logDEBUG)<<"Theo KFI = "<<locTheora->maxKeyframeInterval<<endl;
 			mMuxStream->setConversionParams(locTheora->frameRateNumerator, locTheora->frameRateDenominator, 10000000, locTheora->maxKeyframeInterval);
 			mMuxStream->setNumHeaders(3);
 			mPaginator.setNumHeaders(3);
 		}
-		else if (inMediaType->subtype == MEDIASUBTYPE_Schroedinger) {
+		else if (inMediaType->subtype == MEDIASUBTYPE_Schroedinger) 
+        {
 			mMuxStream->setConversionParams(*((unsigned *)inMediaType->pbFormat), *(((unsigned *)inMediaType->pbFormat) + 1), 10000000, 32);
 			mMuxStream->setNumHeaders(1);
 			mPaginator.setNumHeaders(1);
 		} 
-	} else if (inMediaType->majortype == MEDIATYPE_Audio) {
-		if (inMediaType->subtype == MEDIASUBTYPE_Vorbis) {
+	} else if (inMediaType->majortype == MEDIATYPE_Audio) 
+    {
+		if (inMediaType->subtype == MEDIASUBTYPE_Vorbis) 
+        {
 			//Vorbis
 			VORBISFORMAT* locVorbis = (VORBISFORMAT*)inMediaType->pbFormat;
-			//debugLog<<"Vorbis sample rate = "<<locVorbis->samplesPerSec<<endl;
+			//LOG(logDEBUG)<<"Vorbis sample rate = "<<locVorbis->samplesPerSec<<endl;
 			mMuxStream->setConversionParams(locVorbis->samplesPerSec, 1, 10000000);
 			mMuxStream->setNumHeaders(3);
 			mPaginator.setNumHeaders(3);
 			
-		} else if (inMediaType->subtype == MEDIASUBTYPE_Speex) {
+		} 
+        else if (inMediaType->subtype == MEDIASUBTYPE_Speex) 
+        {
 			//Speex
 			SPEEXFORMAT* locSpeex = (SPEEXFORMAT*)inMediaType->pbFormat;
 			mMuxStream->setConversionParams(locSpeex->samplesPerSec, 1, 10000000);
 			mMuxStream->setNumHeaders(2);
 			mPaginator.setNumHeaders(2);
-		} else if (inMediaType->subtype == MEDIASUBTYPE_OggFLAC_1_0) {
+		} 
+        else if (inMediaType->subtype == MEDIASUBTYPE_OggFLAC_1_0) 
+        {
 			//We are connected to the encoder nd getting individual metadata packets.
 			FLACFORMAT* locFLAC = (FLACFORMAT*)inMediaType->pbFormat;
 			mMuxStream->setConversionParams(locFLAC->samplesPerSec, 1, 10000000);
-			//debugLog<<"FLAC sample rate = "<<locFLAC->samplesPerSec<<endl;
+			//LOG(logDEBUG)<<"FLAC sample rate = "<<locFLAC->samplesPerSec<<endl;
 			//mNeedsFLACHeaderTweak = true;
 			mNeedsFLACHeaderCount = true;
-		} else if (inMediaType->subtype == MEDIASUBTYPE_FLAC) {
+		} 
+        else if (inMediaType->subtype == MEDIASUBTYPE_FLAC) 
+        {
 			//We are connected directly to the demux and are getting metadata in one block
 			// Need to use the header splitter class.
 			FLACFORMAT* locFLAC = (FLACFORMAT*)inMediaType->pbFormat;
 			mMuxStream->setConversionParams(locFLAC->samplesPerSec, 1, 10000000);
-			//debugLog<<"FLAC sample rate = "<<locFLAC->samplesPerSec<<endl;
+			//LOG(logDEBUG)<<"FLAC sample rate = "<<locFLAC->samplesPerSec<<endl;
 			mNeedsFLACHeaderTweak = true;
-		} else if (inMediaType->subtype == MEDIASUBTYPE_RawOggAudio) {
+		} 
+        else if (inMediaType->subtype == MEDIASUBTYPE_RawOggAudio) 
+        {
 			OGGRAWAUDIOFORMAT* locRawAudio = (OGGRAWAUDIOFORMAT*)inMediaType->pbFormat;
 			mMuxStream->setConversionParams(locRawAudio->samplesPerSec, 1, 10000000);
 			mMuxStream->setNumHeaders(locRawAudio->numHeaders);
 			mPaginator.setNumHeaders(locRawAudio->numHeaders);
-		}
+		}		
+	} 
 
-		
-	} else if (inMediaType->majortype == MEDIATYPE_Text) {
-		if (inMediaType->subtype == MEDIASUBTYPE_CMML) {
-			CMMLFORMAT* locCMML = (CMMLFORMAT*)inMediaType->pbFormat;
-			mMuxStream->setConversionParams(locCMML->granuleNumerator,locCMML->granuleDenominator, 10000000);
-			mMuxStream->setNumHeaders(1);
-			mPaginator.setNumHeaders(1);
-
-		}
-
-	}
 	return S_OK;
 }
 
-HRESULT OggMuxInputPin::GetMediaType(int inPosition, CMediaType* outMediaType) {
-	switch(inPosition) {
+HRESULT OggMuxInputPin::GetMediaType(int inPosition, CMediaType* outMediaType) 
+{
+	switch(inPosition) 
+    {
 		case 0:
 			outMediaType->majortype = MEDIATYPE_Video;
 			outMediaType->subtype = MEDIASUBTYPE_Theora;
@@ -177,22 +169,17 @@
 			return S_OK;
 
 		case 6:
-			outMediaType->majortype = MEDIATYPE_Text;
-			outMediaType->subtype = MEDIASUBTYPE_CMML;
-			return S_OK;
-
-		case 7:
 			outMediaType->majortype = MEDIATYPE_Audio;
 			outMediaType->subtype = MEDIASUBTYPE_RawOggAudio;
 			return S_OK;
 
-
 		default:
-			return VFW_S_NO_MORE_ITEMS;
-	
+			return VFW_S_NO_MORE_ITEMS;	
 	}
 }
-HRESULT OggMuxInputPin::CheckMediaType(const CMediaType* inMediaType) {
+
+HRESULT OggMuxInputPin::CheckMediaType(const CMediaType* inMediaType) 
+{
 	if	(	(inMediaType->majortype == MEDIATYPE_Video 
 				&& inMediaType->subtype == MEDIASUBTYPE_Theora 
 				&& inMediaType->formattype == FORMAT_Theora) 
@@ -220,19 +207,18 @@
 			(inMediaType->majortype == MEDIATYPE_Audio
 				&&	inMediaType->subtype == MEDIASUBTYPE_RawOggAudio
 				&&	inMediaType->formattype == FORMAT_RawOggAudio)
-			||
-			(inMediaType->majortype == MEDIATYPE_Text
-				&&	inMediaType->subtype == MEDIASUBTYPE_CMML
-				&&	inMediaType->formattype == FORMAT_CMML)
-
-		) {
+    )
+    {
 		return S_OK;
-	} else {
+	} 
+    else 
+    {
 		return E_FAIL;
 	}
 }
 
-STDMETHODIMP OggMuxInputPin::Receive(IMediaSample* inSample) {
+STDMETHODIMP OggMuxInputPin::Receive(IMediaSample* inSample) 
+{
 	CAutoLock locLock(mParentFilter->mStreamLock);
 	LONGLONG locStart = 0;
 	LONGLONG locEnd = 0;
@@ -241,18 +227,22 @@
 	HRESULT locHR = inSample->GetTime(&locStart, &locEnd);
     UNREFERENCED_PARAMETER(locHR);
 
-	//debugLog <<"Received "<<locStart<<" - "<<locEnd<<endl;
+	//LOG(logDEBUG) <<"Received "<<locStart<<" - "<<locEnd<<endl;
 	long locBuffSize = inSample->GetActualDataLength();
 	unsigned char* locBuff = new unsigned char[locBuffSize];
 	memcpy((void*)locBuff, (const void*)locSampleBuff, inSample->GetActualDataLength());
-	StampedOggPacket* locPacket = new StampedOggPacket(locBuff, inSample->GetActualDataLength(), false, false, locStart, locEnd, StampedOggPacket::OGG_END_ONLY);
+	StampedOggPacket* locPacket = new StampedOggPacket(locBuff, inSample->GetActualDataLength(), 
+                                        false, false, locStart, locEnd, StampedOggPacket::OGG_END_ONLY);
 	
-	if (mNeedsFLACHeaderCount) {
+	if (mNeedsFLACHeaderCount) 
+    {
 		mNeedsFLACHeaderCount = false;
 		//This is to set the number of headers on the paginator for OggFLAC_1_0
 		mPaginator.setNumHeaders( (locPacket->packetData()[8]) + 1 );
 	}
-	if ((mNeedsFLACHeaderTweak)) {
+
+    if ((mNeedsFLACHeaderTweak)) 
+    {
 		//The first packet in FLAC has all the metadata in one block...
 		// It needs to be broken up for correct muxing....
 
@@ -275,56 +265,54 @@
 		//This could be to mux multi stream flac.
 		//Alternatively this configuration could be used to convert the old format to the new.
 
-		//debugLog<<"In the header tweak section..."<<endl;
+		//LOG(logDEBUG)<<"In the header tweak section..."<<endl;
 		FLACMetadataSplitter* locFLACSplitter = new FLACMetadataSplitter;
 
-		//debugLog<<"Feeding metadata..."<<endl;
+		//LOG(logDEBUG)<<"Feeding metadata..."<<endl;
 		locFLACSplitter->loadMetadata(locPacket->clone());
 		
 		//delete locPacket;		//Don't delete the splitter will delete when it's done.
 
-		for (unsigned long i = 0; i < locFLACSplitter->numHeaders(); i++) {
-			//debugLog<<"Giving pager, packet "<<i<<endl;
-			//debugLog<<locFLACSplitter->getHeader(i)->toPackDumpString()<<endl;		//This is a leak !!
-			if (i == 0) {
+		for (unsigned long i = 0; i < locFLACSplitter->numHeaders(); i++) 
+        {
+			//LOG(logDEBUG)<<"Giving pager, packet "<<i<<endl;
+			//LOG(logDEBUG)<<locFLACSplitter->getHeader(i)->toPackDumpString()<<endl;		//This is a leak !!
+			if (i == 0) 
+            {
 				//Set the number of headers in the paginator for FLAC classic.
 				StampedOggPacket* locHeadPack = locFLACSplitter->getHeader(i);
 				mPaginator.setNumHeaders((locHeadPack->packetData()[8]) + 1);
 				delete locHeadPack;
 			}
 			mPaginator.acceptStampedOggPacket(locFLACSplitter->getHeader(i));		//This get function returns our copy which we give away.
-			//debugLog<<"After paginator feed..."<<endl;
+			//LOG(logDEBUG)<<"After paginator feed..."<<endl;
 		}
 		mNeedsFLACHeaderTweak = false;
-		//debugLog<<"Pre delete of splitter..."<<endl;
+		//LOG(logDEBUG)<<"Pre delete of splitter..."<<endl;
 		delete locFLACSplitter;
-		//debugLog<<"Post delete of splitter"<<endl;
+		//LOG(logDEBUG)<<"Post delete of splitter"<<endl;
 
-	} else {
+	} 
+    else 
+    {
 		//Not truncated or contuned... its a full packet.
 		
-		//debugLog<<"Normal add packet..."<<endl;
+		//LOG(logDEBUG)<<"Normal add packet..."<<endl;
 		mPaginator.acceptStampedOggPacket(locPacket);
 	}
 
 	return S_OK;
-	 
-
-
 }
 
-HRESULT OggMuxInputPin::CompleteConnect(IPin* inReceivePin) {
-	
+HRESULT OggMuxInputPin::CompleteConnect(IPin* inReceivePin) 
+{	
 	//Set our delegate to the pin that is connecting to us... we'll send them our seek messages.
 	IMediaSeeking* locSeeker = NULL;
 	inReceivePin->QueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
 	SetDelegate(locSeeker);
 	
-	
 	mMuxStream->setIsActive(true);
 	return mParentFilter->addAnotherPin();
-
-
 }
 
 HRESULT OggMuxInputPin::BreakConnect() 
@@ -335,18 +323,14 @@
 	return CBaseInputPin::BreakConnect();
 }
 
-
-
-
-STDMETHODIMP OggMuxInputPin::EndOfStream(void) {
-	CAutoLock locLock(mParentFilter->mStreamLock);
+STDMETHODIMP OggMuxInputPin::EndOfStream(void) 
+{	
+    CAutoLock locLock(mParentFilter->mStreamLock);
 	mPaginator.finishStream();
 	mMuxStream->setIsEOS(true);
 	
-	
 	//HRESULT locHR = mParentFilter->NotifyEvent(EC_COMPLETE, S_OK, NULL);
 	return S_OK;
-	
 }
 
 unsigned long OggMuxInputPin::PaginatorMaximumPacketsPerPage()
@@ -358,4 +342,3 @@
 {
 	mPaginator.parameters()->mMaxPacksPerPage = inMaxPacketsPerPage;
 }
-

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.h	2013-03-11 07:47:05 UTC (rev 18868)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.h	2013-03-12 00:41:44 UTC (rev 18869)
@@ -1,5 +1,6 @@
 //===========================================================================
 //Copyright (C) 2003, 2004 Zentaro Kavanagh
+//          (C) 2013 Cristian Adam
 //
 //Redistribution and use in source and binary forms, with or without
 //modification, are permitted provided that the following conditions
@@ -29,7 +30,8 @@
 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 //===========================================================================
 #pragma once
-#include "oggmuxdllstuff.h"
+
+#include "FilterRegistration.h"
 #include "OggMuxFilter.h"
 #include <libOOOgg/OggPaginator.h>
 #include <libOOOgg/OggMuxStream.h>
@@ -37,12 +39,10 @@
 #include "FLACMetadataSplitter.h"
 #include <time.h>
 #include <fstream>
-#include <windows.h>
-using namespace std;
 
 class OggMuxFilter;
 
-class OGG_MUX_API OggMuxInputPin
+class OggMuxInputPin
 	:	public CBaseInputPin
 	,	public BasicSeekPassThrough
 {
@@ -50,23 +50,16 @@
 	OggMuxInputPin(OggMuxFilter* inParentFilter, CCritSec* inFilterLock, HRESULT* inHR, OggMuxStream* inMuxStream);
 	virtual ~OggMuxInputPin(void);
 
-	//COM Setup
 	DECLARE_IUNKNOWN
-	STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+	
+    STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
 
-	/// Gets an indexed media type, that this pin will accept.
 	virtual HRESULT GetMediaType(int inPosition, CMediaType* outMediaType);
-
-	/// Checks whether this pin will accepted the proposed media type.
 	virtual HRESULT CheckMediaType(const CMediaType* inMediaType);
-
-	/// Notification that this media type has been selected for the connection.
 	virtual HRESULT SetMediaType(const CMediaType* inMediaType);
 
-	/// Receives a sample from an upstream filter.
 	STDMETHODIMP Receive(IMediaSample* inSample);
 
-	/// Notification that the stream has ended
 	virtual STDMETHODIMP EndOfStream();
 
 	/// Notification that the output pin of an upstream filter has connected.
@@ -92,5 +85,4 @@
 	
 	OggPaginator mPaginator;
 	OggMuxStream* mMuxStream;
-	//fstream debugLog;
 };

Copied: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/Precompiled.cpp (from rev 18861, trunk/oggdsf/src/lib/core/directshow/dsfOggMux/stdafx.cpp)
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/Precompiled.cpp	                        (rev 0)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/Precompiled.cpp	2013-03-12 00:41:44 UTC (rev 18869)
@@ -0,0 +1,33 @@
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//          (C) 2013 Cristian Adam
+//
+//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 "Precompiled.h"

Copied: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/Precompiled.h (from rev 18861, trunk/oggdsf/src/lib/core/directshow/dsfOggMux/stdafx.h)
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/Precompiled.h	                        (rev 0)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/Precompiled.h	2013-03-12 00:41:44 UTC (rev 18869)
@@ -0,0 +1,49 @@
+//===========================================================================
+//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.
+//===========================================================================
+
+// 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>
+
+#include "FilterRegistration.h"
+#include <libilliCore/StringHelper.h>
+
+#include <atlbase.h>
+#include <atlcom.h>
+
+#include "common/Log.h"
\ No newline at end of file

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/PropsOggMux.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/PropsOggMux.cpp	2013-03-11 07:47:05 UTC (rev 18868)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/PropsOggMux.cpp	2013-03-12 00:41:44 UTC (rev 18869)
@@ -1,33 +1,31 @@
-#include "stdafx.h"
+#include "Precompiled.h"
 #include "PropsOggMux.h"
 
 PropsOggMux::PropsOggMux(LPUNKNOWN inUnk, HRESULT* outHR)
-	:	CBasePropertyPage(NAME("illiminable Directshow Filters"), inUnk, IDD_OGG_MUX_SETTINGS, IDS_OGG_MUX_PROPS_STRING)
-	,	mOggMuxSettings(NULL)
+	:	CBasePropertyPage(NAME("Xiph.Org Directshow Filters"), inUnk, IDD_OGG_MUX_SETTINGS, IDS_OGG_MUX_PROPS_STRING)
 
 {
-	//debugLog.open("G:\\logs\\TheoProps.log", ios_base::out);
 	*outHR = S_OK;
 }
 
-PropsOggMux::~PropsOggMux(void)
+PropsOggMux::~PropsOggMux()
 {
-	//debugLog.close();
 }
 
 CUnknown* PropsOggMux::CreateInstance(LPUNKNOWN inUnk, HRESULT* outHR)
 {
-    return new PropsOggMux(inUnk, outHR);
+    return new (std::nothrow) PropsOggMux(inUnk, outHR);
 }
 
 
 HRESULT PropsOggMux::OnApplyChanges(void)
 {
-	if (mOggMuxSettings == NULL) {
+	if (!oggMuxSettings_) 
+    {
 		return E_POINTER;
 	}
 
-	mOggMuxSettings->setMaxPacketsPerPage(SendDlgItemMessage(m_hwnd,IDC_SLIDER_MAX_PACKETS_PER_PAGE, TBM_GETPOS, NOT_USED, NOT_USED));
+	oggMuxSettings_->setMaxPacketsPerPage(SendDlgItemMessage(m_hwnd,IDC_SLIDER_MAX_PACKETS_PER_PAGE, TBM_GETPOS, NOT_USED, NOT_USED));
 	SetClean();
     return S_OK;
 }
@@ -35,16 +33,13 @@
 HRESULT PropsOggMux::OnActivate(void)
 {
     char* locStrBuff = new char[16];
-
-	//SetupBitrateCombo();
-	//SetupKeyframeFreqCombo();
 	
 	//Set up the sliders
     SendDlgItemMessage(m_Dlg, IDC_SLIDER_MAX_PACKETS_PER_PAGE, TBM_SETRANGE, TRUE, MAKELONG(0, 64));
     SendDlgItemMessage(m_Dlg, IDC_SLIDER_MAX_PACKETS_PER_PAGE, TBM_SETTICFREQ, 1, 0);
-	SendDlgItemMessage(m_Dlg, IDC_SLIDER_MAX_PACKETS_PER_PAGE, TBM_SETPOS, 1, mOggMuxSettings->maxPacketsPerPage());
+	SendDlgItemMessage(m_Dlg, IDC_SLIDER_MAX_PACKETS_PER_PAGE, TBM_SETPOS, 1, oggMuxSettings_->maxPacketsPerPage());
 
-	itoa(mOggMuxSettings->maxPacketsPerPage(), locStrBuff, 10);
+	itoa(oggMuxSettings_->maxPacketsPerPage(), locStrBuff, 10);
 	SendDlgItemMessage(m_Dlg, IDC_LABEL_MAX_PACKETS_PER_PAGE, WM_SETTEXT, NOT_USED, (LPARAM)locStrBuff);
 
 	delete[] locStrBuff;
@@ -53,26 +48,28 @@
 
 HRESULT PropsOggMux::OnConnect(IUnknown *pUnk)
 {
-    
-	if (mOggMuxSettings != NULL) {
-		//mOggMuxSettings->Release();
-		mOggMuxSettings = NULL;
-	}
+	oggMuxSettings_ = 0;
 
-    HRESULT locHR;
-    // Query pUnk for the filter's custom interface.
-    locHR = pUnk->QueryInterface(IID_IOggMuxSettings, (void**)(&mOggMuxSettings));
-    return locHR;
+    HRESULT hr = S_OK;
+    try
+    {
+        CHECK_HR( pUnk->QueryInterface(IID_IOggMuxSettings, (void**)(&oggMuxSettings_)) );
+    }
+    catch (const CAtlException& ex)
+    {
+        hr = ex;
+    }
+
+    return hr;
 }
 
 HRESULT PropsOggMux::OnDisconnect(void)
 {
-	if (mOggMuxSettings != NULL) {
-		//mTheoraEncodeSettings->Release();
-		mOggMuxSettings = NULL;
-	}
+	oggMuxSettings_ = 0;
+
     return S_OK;
 }
+
 void PropsOggMux::SetDirty()
 {
     m_bDirty = TRUE;
@@ -93,20 +90,21 @@
 INT_PTR PropsOggMux::OnReceiveMessage(HWND hwnd,  UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
 	char locBuff[16];
-    switch (uMsg)    {
-		case WM_COMMAND:
-		
+    switch (uMsg)    
+    {
+		case WM_COMMAND:		
 		case WM_HSCROLL:
-			if (HWND(lParam) == GetDlgItem(m_hwnd, IDC_SLIDER_MAX_PACKETS_PER_PAGE)) {
+			if (HWND(lParam) == GetDlgItem(m_hwnd, IDC_SLIDER_MAX_PACKETS_PER_PAGE)) 
+            {
 				SetDirty();
 				itoa(SendDlgItemMessage(m_hwnd,IDC_SLIDER_MAX_PACKETS_PER_PAGE, TBM_GETPOS, NOT_USED, NOT_USED), (char*)&locBuff, 10);
 				SendDlgItemMessage(m_hwnd, IDC_LABEL_MAX_PACKETS_PER_PAGE, WM_SETTEXT, NOT_USED, (LPARAM)&locBuff);
-                 return (INT_PTR)TRUE;
+                
+                return (INT_PTR)TRUE;
 			}
 
 			break;
-	} // switch
+	}
 
-    // Did not handle the message.
     return CBasePropertyPage::OnReceiveMessage(hwnd, uMsg, wParam, lParam);
 }

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/PropsOggMux.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/PropsOggMux.h	2013-03-11 07:47:05 UTC (rev 18868)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/PropsOggMux.h	2013-03-12 00:41:44 UTC (rev 18869)
@@ -4,20 +4,15 @@
 #include "resource.h"
 
 #include <commctrl.h>
-//Debug
-//#include <fstream>
-using namespace std;
-//
 
-
-class PropsOggMux
-	:	public CBasePropertyPage
+class PropsOggMux:	public CBasePropertyPage
 {
 public:
 	static const UINT NOT_USED = 0;
-	PropsOggMux(LPUNKNOWN inUnk, HRESULT* outHR);
-	virtual ~PropsOggMux(void);
 
+    PropsOggMux(LPUNKNOWN inUnk, HRESULT* outHR);
+	virtual ~PropsOggMux();
+
 	static CUnknown* WINAPI CreateInstance(LPUNKNOWN inUnk, HRESULT* outHR);
 
 	//CBasePropertyPage Virtual Overrides
@@ -28,14 +23,8 @@
 	HRESULT OnApplyChanges(void);
 
 protected:
-
 	void SetDirty();
 	void SetClean();
-	//
-	IOggMuxSettings* mOggMuxSettings;
 
-	//Debug
-
-	//fstream debugLog;
-	//
+    CComPtr<IOggMuxSettings> oggMuxSettings_;
 };

Deleted: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/dsfOggMux.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/dsfOggMux.cpp	2013-03-11 07:47:05 UTC (rev 18868)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/dsfOggMux.cpp	2013-03-12 00:41:44 UTC (rev 18869)
@@ -1,43 +0,0 @@
-//===========================================================================
-//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.
-//===========================================================================
-
-// dsfOggMux.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-//BOOL APIENTRY DllMain( HANDLE hModule, 
-//                       DWORD  ul_reason_for_call, 
-//                       LPVOID lpReserved
-//					 )
-//{
-//    return TRUE;
-//}
-//

Deleted: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.cpp	2013-03-11 07:47:05 UTC (rev 18868)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.cpp	2013-03-12 00:41:44 UTC (rev 18869)
@@ -1,105 +0,0 @@
-//===========================================================================
-//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 "oggmuxdllstuff.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()
-{
-	
-    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_OggMuxFilter,						// Filter CLSID. 
-		L"Xiph.Org Ogg Muxer",					// Filter name.
-        NULL,										// Device moniker. 
-        &CLSID_LegacyAmFilterCategory,				// Direct Show general category
-        NULL,							// Instance data. ???????
-        &OggMuxFilterReg								// 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, 
-            NULL, CLSID_OggMuxFilter);
-
-	//
-    locFilterMapper->Release();
-    return hr;
-
-}

Deleted: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.h	2013-03-11 07:47:05 UTC (rev 18868)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.h	2013-03-12 00:41:44 UTC (rev 18869)
@@ -1,151 +0,0 @@
-//===========================================================================
-//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 DSFOGGMUX_EXPORTS
-#pragma message("----> Exporting from Ogg Mux...")
-#define OGG_MUX_API __declspec(dllexport)
-#else
-#pragma message("<---- Importing from Ogg Mux...")
-#define OGG_MUX_API __declspec(dllimport)
-#endif
-
-
-#ifndef OGGMUX_DLL
-    #define LIBOOOGG_API
-#else
-    #ifdef LIBOOOGG_EXPORTS
-        #define LIBOOOGG_API __declspec(dllexport)
-    #else
-        #define LIBOOOGG_API __declspec(dllimport)
-    #endif
-#endif
-
-#include "common/OggTypes.h"
-#include "common/VorbisTypes.h"
-#include "common/TheoraTypes.h"
-#include "common/FlacTypes.h"
-#include "common/SpeexTypes.h"
-
-// {BBCD12AC-0000-0010-8000-00aa00389b71}
-DEFINE_GUID(MEDIASUBTYPE_Schroedinger, 
-0xBBCD12AC, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
-
-// {BBCD12AC-c356-11ce-bf01-00aa0055595a}
-DEFINE_GUID(FORMAT_Schroedinger,
-0xBBCD12AC, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a);
-
-// {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);
-
-// {37535B3C-F068-4f93-9763-E7208277D71F}
-DEFINE_GUID(MEDIASUBTYPE_RawOggAudio, 
-0x37535b3c, 0xf068, 0x4f93, 0x97, 0x63, 0xe7, 0x20, 0x82, 0x77, 0xd7, 0x1f);
-
-// {232D3C8F-16BF-404b-99AE-296F3DBB77EE}
-DEFINE_GUID(FORMAT_RawOggAudio, 
-0x232d3c8f, 0x16bf, 0x404b, 0x99, 0xae, 0x29, 0x6f, 0x3d, 0xbb, 0x77, 0xee);
-const REGPINTYPES OggMuxInputTypes[] = {
-	{	
-		&MEDIATYPE_Audio,
-		&MEDIASUBTYPE_Speex
-	},
-	{
-		&MEDIATYPE_Audio,
-		&MEDIASUBTYPE_Vorbis
-	},
-	{
-		&MEDIATYPE_Audio,
-		&MEDIASUBTYPE_OggFLAC_1_0
-	},
-	{
-		&MEDIATYPE_Video,
-		&MEDIASUBTYPE_Theora
-	},
-	{
-		&MEDIATYPE_Audio,
-		&MEDIASUBTYPE_FLAC
-	},
-	{
-		&MEDIATYPE_Audio,
-		&MEDIASUBTYPE_RawOggAudio
-	},
-	{
-		&MEDIATYPE_Text,
-		&MEDIASUBTYPE_CMML
-	}
-
-};
-const REGFILTERPINS OggMuxPinReg = {
-	
-    L"Ogg Packet Input",				//Name (obsoleted)
-	TRUE,								//Renders from this pin ?? Not sure about this.
-	FALSE,								//Not an output pin
-	FALSE,								//Cannot have zero instances of this pin
-	FALSE,								//Cannot have more than one instance of this pin
-	NULL,								//Connects to filter (obsoleted)
-	NULL,								//Connects to pin (obsoleted)
-	7,									//upport two media type
-	OggMuxInputTypes					//Pointer to media type (Audio/Vorbis or Audio/Speex)
-};
-
-const REGFILTER2 OggMuxFilterReg = {
-		1,
-		MERIT_DO_NOT_USE,
-		1,
-        &OggMuxPinReg
-		
-};
-
-struct OGGRAWAUDIOFORMAT {
-	unsigned long samplesPerSec;
-	unsigned long numHeaders;
-	unsigned long numChannels;
-	unsigned long bitsPerSample;
-	unsigned long maxFramesPerPacket;
-};
-
-struct CMMLFORMAT {
-	__int64 granuleNumerator;
-	__int64 granuleDenominator;
-	unsigned short granuleSplitBits;
-};
\ No newline at end of file

Deleted: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/stdafx.cpp	2013-03-11 07:47:05 UTC (rev 18868)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/stdafx.cpp	2013-03-12 00:41:44 UTC (rev 18869)
@@ -1,40 +0,0 @@
-//===========================================================================
-//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.
-//===========================================================================
-
-
-// stdafx.cpp : source file that includes just the standard includes
-// dsfOggMux.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

Deleted: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/stdafx.h	2013-03-11 07:47:05 UTC (rev 18868)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/stdafx.h	2013-03-12 00:41:44 UTC (rev 18869)
@@ -1,49 +0,0 @@
-//===========================================================================
-//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.
-//===========================================================================
-
-// 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 "oggmuxdllstuff.h"
-#include <libilliCore/StringHelper.h>
-
-#include <atlbase.h>
-#include <atlcom.h>
-



More information about the commits mailing list