[xiph-commits] r10296 - branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder

illiminable at svn.xiph.org illiminable at svn.xiph.org
Mon Oct 24 13:52:04 PDT 2005


Author: illiminable
Date: 2005-10-24 13:51:54 -0700 (Mon, 24 Oct 2005)
New Revision: 10296

Modified:
   branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp
   branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.h
   branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeInputPin.cpp
   branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeInputPin.h
   branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.cpp
   branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.h
   branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/theoradecoderdllstuff.h
Log:
* Get rid of a bunch of dead code in theora decoder
* Add the new media type guids

Modified: branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp	2005-10-24 20:22:03 UTC (rev 10295)
+++ branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp	2005-10-24 20:51:54 UTC (rev 10296)
@@ -708,90 +708,3 @@
         return NULL;
     }
 }
-//---------------------------------------
-//OLD IMPLOEMENTATION....
-//---------------------------------------
-//#include "theoradecodefilter.h"
-//
-//
-//
-////COM Factory Template
-//CFactoryTemplate g_Templates[] = 
-//{
-//    { 
-//		L"Theora Decode Filter",					// Name
-//	    &CLSID_TheoraDecodeFilter,				// CLSID
-//	    TheoraDecodeFilter::CreateInstance,		// Method to create an instance of Theora Decoder
-//        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]); 
-//
-//
-//
-////Theora Decode Filter Implementation
-////==================================
-//TheoraDecodeFilter::TheoraDecodeFilter()
-//	:	AbstractVideoDecodeFilter(NAME("Ogg Video Decoder"), CLSID_TheoraDecodeFilter, THEORA)
-//	,	mTheoraFormatInfo(NULL)
-//{
-//
-//	bool locWasConstructed = ConstructPins();
-//}
-//
-//bool TheoraDecodeFilter::ConstructPins() 
-//{
-//	
-//	//Output pin must be done first because it's passed to the input pin.
-//	mOutputPin = new TheoraDecodeOutputPin(this, m_pLock);
-//
-//	CMediaType* locAcceptMediaType = new CMediaType(&MEDIATYPE_Video);
-//	locAcceptMediaType->subtype = MEDIASUBTYPE_Theora;
-//	locAcceptMediaType->formattype = FORMAT_Theora;
-//	mInputPin = new TheoraDecodeInputPin(this, m_pLock, mOutputPin, locAcceptMediaType);
-//	return true;
-//}
-//
-//TheoraDecodeFilter::~TheoraDecodeFilter(void)
-//{
-//	//DestroyPins();
-//	delete mTheoraFormatInfo;
-//}
-//
-//CUnknown* WINAPI TheoraDecodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr) 
-//{
-//	//This routine is the COM implementation to create a new Filter
-//	TheoraDecodeFilter *pNewObject = new TheoraDecodeFilter();
-//    if (pNewObject == NULL) {
-//        *pHr = E_OUTOFMEMORY;
-//    }
-//	return pNewObject;
-//} 
-//
-//STDMETHODIMP TheoraDecodeFilter::GetState(DWORD dw, FILTER_STATE *pState)
-//{
-//    CheckPointer(pState, E_POINTER);
-//    *pState = m_State;
-//	if (m_State == State_Paused) {
-//        return VFW_S_CANT_CUE;
-//	} else {
-//        return S_OK;
-//	}
-//}
-//
-////QUERY::: Do we need these ? Aren't we all friedns here ??
-////RESULT::: Keep them, set function must be kept... get could go... but keep for consistency
-//sTheoraFormatBlock* TheoraDecodeFilter::getTheoraFormatBlock() 
-//{
-//	return mTheoraFormatInfo;
-//}
-//void TheoraDecodeFilter::setTheoraFormat(sTheoraFormatBlock* inFormatBlock) 
-//{
-//	delete mTheoraFormatInfo;
-//	mTheoraFormatInfo = new sTheoraFormatBlock;
-//	*mTheoraFormatInfo = *inFormatBlock;
-//}

Modified: branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.h
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.h	2005-10-24 20:22:03 UTC (rev 10295)
+++ branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.h	2005-10-24 20:51:54 UTC (rev 10296)
@@ -91,51 +91,3 @@
 	sTheoraFormatBlock* mTheoraFormatInfo;
 	fstream debugLog;
 };
-//---------------------------------------
-//OLD IMPLOEMENTATION....
-//---------------------------------------
-////Include Files
-//#include "Theoradecoderdllstuff.h"
-//#include "AbstractVideoDecodeFilter.h"
-//
-////Forward Declarations
-//struct sTheoraFormatBlock;
-//class TheoraDecodeInputPin;
-//class TheoraDecodeOutputPin;
-//
-////Class Interface
-//class TheoraDecodeFilter
-//	//Base Classes
-//	:	public AbstractVideoDecodeFilter
-//{
-//public:
-//	//Friends
-//	friend class TheoraDecodeInputPin;
-//	friend class TheoraDecodeOutputPin;
-//
-//	
-//	
-//
-//	//Constructors and Destructors
-//	TheoraDecodeFilter(void);
-//	virtual ~TheoraDecodeFilter(void);
-//
-//	//COM Creator Function
-//	static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
-//
-//	//IMediaFilter OVerride - This lets us tell the graph we may not produce data in pause state so don't block.
-//	virtual STDMETHODIMP GetState(DWORD dw, FILTER_STATE *pState);
-//
-//	
-//
-//	//VIRTUAL FUNCTIONS - AbstractAudioDecodeFilter
-//	virtual bool ConstructPins();
-//
-//	//FIX::: Do we need these ? Aren't they all friends ??
-//	virtual sTheoraFormatBlock* getTheoraFormatBlock();
-//	virtual void setTheoraFormat(sTheoraFormatBlock* inFormatBlock);
-//
-//protected:
-//	//Format Block
-//	sTheoraFormatBlock* mTheoraFormatInfo;
-//};

Modified: branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeInputPin.cpp
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeInputPin.cpp	2005-10-24 20:22:03 UTC (rev 10295)
+++ branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeInputPin.cpp	2005-10-24 20:51:54 UTC (rev 10296)
@@ -74,367 +74,3 @@
 	return CTransformInputPin::CompleteConnect(inReceivePin);
 }
 
-//----------------------
-//OLD IMPLEMENTATION
-//----------------------
-//TheoraDecodeInputPin::TheoraDecodeInputPin(AbstractVideoDecodeFilter* inFilter, CCritSec* inFilterLock, AbstractVideoDecodeOutputPin* inOutputPin, CMediaType* inAcceptMediaType)
-//	:	AbstractVideoDecodeInputPin(inFilter, inFilterLock, inOutputPin, NAME("TheoraDecodeInputPin"), L"Theora In", inAcceptMediaType)
-//	,	mXOffset(0)
-//	,	mYOffset(0)
-//
-//{
-//	debugLog.open("G:\\logs\\theoInputPin.log", ios_base::out);
-//	ConstructCodec();
-//}
-//
-//STDMETHODIMP TheoraDecodeInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-//{
-//	if (riid == IID_IMediaSeeking) {
-//		*ppv = (IMediaSeeking*)this;
-//		((IUnknown*)*ppv)->AddRef();
-//		return NOERROR;
-//	}
-//
-//	return CBaseInputPin::NonDelegatingQueryInterface(riid, ppv); 
-//}
-//bool TheoraDecodeInputPin::ConstructCodec() {
-//
-//
-//	mTheoraDecoder = new TheoraDecoder;
-//	mTheoraDecoder->initCodec();
-//	return true;
-//}
-//void TheoraDecodeInputPin::DestroyCodec() {
-//	delete mTheoraDecoder;
-//}
-//TheoraDecodeInputPin::~TheoraDecodeInputPin(void)
-//{
-//	debugLog.close();
-//	DestroyCodec();
-//	
-//}
-//
-//
-//
-//int TheoraDecodeInputPin::TheoraDecoded (yuv_buffer* inYUVBuffer) 
-//{
-//	DbgLog((LOG_TRACE,1,TEXT("Decoded... Sending...")));
-//	
-//	debugLog<<"TheoraDecoded... "<<endl;
-//	
-//	TheoraDecodeFilter* locFilter = reinterpret_cast<TheoraDecodeFilter*>(m_pFilter);
-//	//
-//	if (!mBegun) {
-//	
-//	
-//	
-//		mBegun = true;
-//		
-//		//How many UNITS does one frame take.
-//		mFrameDuration = (UNITS * locFilter->mTheoraFormatInfo->frameRateDenominator) / (locFilter->mTheoraFormatInfo->frameRateNumerator);
-//		mFrameSize = (mHeight * mWidth * 3) / 2;
-//		mFrameCount = 0;
-//	}
-//
-//
-//
-//	////FIX::: Most of this will be obselete... the demux does it all.
-//	//
-//
-//	////TO DO::: Fix this up... needs to move around order and some only needs to be done once, move it into the block aboce and use member data
-//
-//	////Make the start timestamp
-//	////FIX:::Abstract this calculation
-//	DbgLog((LOG_TRACE,1,TEXT("Frame Count = %d"), mFrameCount));
-//	//REFERENCE_TIME locFrameStart = CurrentStartTime() + (mFrameCount * mFrameDuration);
-//
-//	//Timestamp hacks start here...
-//	unsigned long locMod = (unsigned long)pow(2, locFilter->mTheoraFormatInfo->maxKeyframeInterval);
-//	DbgLog((LOG_TRACE,1,TEXT("locSeenGranPos = %d"), mLastSeenStartGranPos));
-//	DbgLog((LOG_TRACE,1,TEXT("locMod = %d"), locMod));
-//	unsigned long locInterFrameNo = (mLastSeenStartGranPos) % locMod;
-//	DbgLog((LOG_TRACE,1,TEXT("InterFrameNo = %d"), locInterFrameNo));
-//	LONGLONG locAbsFramePos = ((mLastSeenStartGranPos >> locFilter->mTheoraFormatInfo->maxKeyframeInterval)) + locInterFrameNo;
-//	DbgLog((LOG_TRACE,1,TEXT("AbsFrameNo = %d"), locAbsFramePos));
-//	DbgLog((LOG_TRACE,1,TEXT("mSeekTimeBase = %d"), mSeekTimeBase));
-//	REFERENCE_TIME locTimeBase = (locAbsFramePos * mFrameDuration) - mSeekTimeBase;
-//	DbgLog((LOG_TRACE,1,TEXT("locTimeBase = %d"), locTimeBase));
-//	//
-//	//
-//
-//	REFERENCE_TIME locFrameStart = locTimeBase + (mFrameCount * mFrameDuration);
-//	//Increment the frame counter
-//	mFrameCount++;
-//	
-//	//Make the end frame counter
-//	//REFERENCE_TIME locFrameEnd = CurrentStartTime() + (mFrameCount * mFrameDuration);
-//	REFERENCE_TIME locFrameEnd = locTimeBase + (mFrameCount * mFrameDuration);
-//
-//	DbgLog((LOG_TRACE,1,TEXT("Frame Runs From %d"), locFrameStart));
-//	DbgLog((LOG_TRACE,1,TEXT("Frame Runs To %d"), locFrameEnd));
-//
-//	IMediaSample* locSample = NULL;
-//	debugLog<<"Sample times = "<<locFrameStart<<" to "<<locFrameEnd<<endl;
-//	DWORD locFlags = 0;//AM_GBF_PREVFRAMESKIPPED | AM_GBF_NOTASYNCPOINT;
-//
-//	FILTER_STATE locFS;
-//	mParentFilter->GetState(0, &locFS);
-//	debugLog<<"State Before = "<<locFS<<endl;
-//	HRESULT locHR = mOutputPin->GetDeliveryBuffer(&locSample, &locFrameStart, &locFrameEnd, locFlags);
-//	mParentFilter->GetState(0, &locFS);
-//	debugLog<<"State After = "<<locFS<<endl;
-//	if (locHR != S_OK) {
-//		debugLog<<"Get DeliveryBuffer FAILED with "<<locHR<<endl;
-//		debugLog<<"locSample is "<<(unsigned long)locSample<<endl;
-//		//We get here when the application goes into stop mode usually.
-//
-//		switch (locHR) {
-//			case VFW_E_SIZENOTSET:
-//				debugLog<<"SIZE NOT SET"<<endl;
-//				break;
-//			case VFW_E_NOT_COMMITTED:
-//				debugLog<<"NOT COMMITTED"<<endl;
-//				break;
-//			case VFW_E_TIMEOUT:
-//				debugLog<<"TIMEOUT"<<endl;
-//				break;
-//			case VFW_E_STATE_CHANGED:
-//				debugLog<<"STATE CHANGED"<<endl;
-//				return S_OK;
-//			default:
-//				debugLog<<"SOMETHING ELSE !!!"<<endl;
-//				break;
-//		}
-//		return locHR;
-//	}	
-//	
-//	debugLog<<"GetDeliveryBuffer &** SUCCEEDED **"<<endl;
-//
-//	//Debuggin code
-//	AM_MEDIA_TYPE* locMediaType = NULL;
-//	locSample->GetMediaType(&locMediaType);
-//	if (locMediaType == NULL) {
-//		debugLog<<"No dynamic change..."<<endl;
-//	} else {
-//		debugLog<<"Attempting dynamic change..."<<endl;
-//		if (locMediaType->majortype == MEDIATYPE_Video) {
-//			debugLog<<"Still MEDIATYPE_Video"<<endl;
-//		}
-//
-//		if (locMediaType->subtype == MEDIASUBTYPE_YV12) {
-//			debugLog<<"Still MEDIASUBTYPE_YV12"<<endl;
-//		}
-//
-//		if (locMediaType->formattype == FORMAT_VideoInfo) {
-//			debugLog<<"Still FORMAT_VideoInfo"<<endl;
-//			VIDEOINFOHEADER* locVF = (VIDEOINFOHEADER*)locMediaType->pbFormat;
-//			debugLog<<"Size = "<<locVF->bmiHeader.biSizeImage<<endl;
-//			debugLog<<"Dim   = "<<locVF->bmiHeader.biWidth<<" x " <<locVF->bmiHeader.biHeight<<endl;
-//		}
-//
-//		debugLog<<"Major  : "<<DSStringer::GUID2String(&locMediaType->majortype);
-//		debugLog<<"Minor  : "<<DSStringer::GUID2String(&locMediaType->subtype);
-//		debugLog<<"Format : "<<DSStringer::GUID2String(&locMediaType->formattype);
-//		debugLog<<"Form Sz: "<<locMediaType->cbFormat;
-//
-//
-//	}
-//	//
-//
-//	////Create pointers for the samples buffer to be assigned to
-//	BYTE* locBuffer = NULL;
-//	
-//	//
-//	////Make our pointers set to point to the samples buffer
-//	locSample->GetPointer(&locBuffer);
-//	
-//
-//
-//	//Fill the buffer with yuv data...
-//	//	
-//
-//
-//
-//	//Set up the pointers
-//	unsigned char* locDestUptoPtr = locBuffer;
-//	char* locSourceUptoPtr = inYUVBuffer->y;
-//
-//	//
-//	//Y DATA
-//	//
-//
-//	//NEW WAY with offsets Y Data
-//	long locTopPad = inYUVBuffer->y_height - mHeight - mYOffset;
-//	ASSERT(locTopPad >= 0);
-//	if (locTopPad < 0) {
-//		locTopPad = 0;
-//	}
-//
-//	//Skip the top padding
-//	locSourceUptoPtr += (locTopPad * inYUVBuffer->y_stride);
-//
-//	for (long line = 0; line < mHeight; line++) {
-//		memcpy((void*)(locDestUptoPtr), (const void*)(locSourceUptoPtr + mXOffset), mWidth);
-//		locSourceUptoPtr += inYUVBuffer->y_stride;
-//		locDestUptoPtr += mWidth;
-//	}
-//
-//	locSourceUptoPtr += (mYOffset * inYUVBuffer->y_stride);
-//
-//	//Source advances by (y_height * y_stride)
-//	//Dest advances by (mHeight * mWidth)
-//
-//	//
-//	//V DATA
-//	//
-//
-//	//Half the padding for uv planes... is this correct ? 
-//	locTopPad = locTopPad /2;
-//	
-//	locSourceUptoPtr = inYUVBuffer->v;
-//
-//	//Skip the top padding
-//	locSourceUptoPtr += (locTopPad * inYUVBuffer->y_stride);
-//
-//	for (long line = 0; line < mHeight / 2; line++) {
-//		memcpy((void*)(locDestUptoPtr), (const void*)(locSourceUptoPtr + (mXOffset / 2)), mWidth / 2);
-//		locSourceUptoPtr += inYUVBuffer->uv_stride;
-//		locDestUptoPtr += (mWidth / 2);
-//	}
-//	locSourceUptoPtr += ((mYOffset/2) * inYUVBuffer->uv_stride);
-//
-//	//Source advances by (locTopPad + mYOffset/2 + mHeight /2) * uv_stride
-//	//where locTopPad for uv = (inYUVBuffer->y_height - mHeight - mYOffset) / 2
-//	//						=	(inYUVBuffer->yheight/2 - mHeight/2 - mYOffset/2)
-//	// so source advances by (y_height/2) * uv_stride
-//	//Dest advances by (mHeight * mWidth) /4
-//
-//
-//	//
-//	//U DATA
-//	//
-//
-//	locSourceUptoPtr = inYUVBuffer->u;
-//
-//	//Skip the top padding
-//	locSourceUptoPtr += (locTopPad * inYUVBuffer->y_stride);
-//
-//	for (long line = 0; line < mHeight / 2; line++) {
-//		memcpy((void*)(locDestUptoPtr), (const void*)(locSourceUptoPtr + (mXOffset / 2)), mWidth / 2);
-//		locSourceUptoPtr += inYUVBuffer->uv_stride;
-//		locDestUptoPtr += (mWidth / 2);
-//	}
-//	locSourceUptoPtr += ((mYOffset/2) * inYUVBuffer->uv_stride);
-//
-//
-//	////Y Data.
-//	//for ( long line = 0; line < inYUVBuffer->y_height; line++) {
-//	//	memcpy((void*)locBuffer, (const void*)(inYUVBuffer->y + (inYUVBuffer->y_stride * (line))), inYUVBuffer->y_width);
-//	//	locBuffer += inYUVBuffer->y_width;
-//
-//	//	if (mWidth > inYUVBuffer->y_width) {
-//	//		memset((void*)locBuffer, 0, mWidth - inYUVBuffer->y_width);
-//	//	}
-//	//	locBuffer += mWidth - inYUVBuffer->y_width;
-//	//}
-//
-//	////Pad height...
-//	//for ( long line = 0; line < mHeight - inYUVBuffer->y_height; line++) {
-//	//	memset((void*)locBuffer, 0, mWidth);
-//	//	locBuffer += mWidth;
-//	//}
-//
-//	////V Data
-//	//for ( long line = 0; line < inYUVBuffer->uv_height; line++) {
-//	//	memcpy((void*)locBuffer, (const void*)(inYUVBuffer->v + (inYUVBuffer->uv_stride * (line))), inYUVBuffer->uv_width);
-//	//	locBuffer += inYUVBuffer->uv_width;
-//
-//	//	if (mWidth/2 > inYUVBuffer->uv_width) {
-//	//		memset((void*)locBuffer, 0, (mWidth/2) - inYUVBuffer->uv_width);
-//	//	}
-//	//	locBuffer += (mWidth/2) - inYUVBuffer->uv_width;
-//	//}
-//
-//	////Pad height...
-//	//for ( long line = 0; line < (mHeight/2) - inYUVBuffer->uv_height; line++) {
-//	//	memset((void*)locBuffer, 0, mWidth/2);
-//	//	locBuffer += mWidth/2;
-//	//}
-//
-//	////U Data
-//	//for (long line = 0; line < inYUVBuffer->uv_height; line++) {
-//	//	memcpy((void*)locBuffer, (const void*)(inYUVBuffer->u + (inYUVBuffer->uv_stride * (line))), inYUVBuffer->uv_width);
-//	//	locBuffer += inYUVBuffer->uv_width;
-//
-//	//	if (mWidth/2 > inYUVBuffer->uv_width) {
-//	//		memset((void*)locBuffer, 0, (mWidth/2) - inYUVBuffer->uv_width);
-//	//	}
-//	//	locBuffer += (mWidth/2) - inYUVBuffer->uv_width;
-//	//}
-//
-//	////Pad height...
-//	//for ( long line = 0; line < (mHeight/2) - inYUVBuffer->uv_height; line++) {
-//	//	memset((void*)locBuffer, 0, mWidth/2);
-//	//	locBuffer += mWidth/2;
-//	//}
-//
-//
-//
-//
-//
-//	//Set the sample parameters.
-//	SetSampleParams(locSample, mFrameSize, &locFrameStart, &locFrameEnd);
-//
-//	{
-//
-//		//Add a reerence to the sample so it isn't deleted in the queue.
-//		//locSample->AddRef();
-//		HRESULT locHR = mOutputPin->mDataQueue->Receive(locSample);						//->DownstreamFilter()->Receive(locSample);
-//		if (locHR != S_OK) {
-//			debugLog<<"Data Q rejects sample... with "<<locHR<<endl;
-//			return -1;
-//
-//		}
-//	}
-//
-//	
-//	return 0;
-//
-//
-//}
-//
-//
-//
-//long TheoraDecodeInputPin::decodeData(BYTE* inBuf, long inNumBytes, LONGLONG inStart, LONGLONG inEnd) 
-//{
-//	DbgLog((LOG_TRACE,1,TEXT("decodeData")));
-//																	//Not truncated or continued... it's a full packet
-//	StampedOggPacket* locPacket = new StampedOggPacket(inBuf, inNumBytes, false, false, inStart, inEnd, StampedOggPacket::OGG_END_ONLY);
-//	yuv_buffer* locYUV = mTheoraDecoder->decodeTheora(locPacket);
-//	if (locYUV != NULL) {
-//		if (TheoraDecoded(locYUV) != 0) {
-//			return -1;
-//		}
-//	}
-//
-//	return 0;
-//}
-//
-//
-//
-//HRESULT TheoraDecodeInputPin::SetMediaType(const CMediaType* inMediaType) {
-//
-//	if (inMediaType->subtype == MEDIASUBTYPE_Theora) {
-//		((TheoraDecodeFilter*)mParentFilter)->setTheoraFormat((sTheoraFormatBlock*)inMediaType->pbFormat);
-//		mParentFilter->mVideoFormat = AbstractVideoDecodeFilter::THEORA;
-//		//Set some other stuff here too...
-//		mXOffset = ((sTheoraFormatBlock*)inMediaType->pbFormat)->xOffset;
-//		mYOffset = ((sTheoraFormatBlock*)inMediaType->pbFormat)->yOffset;
-//
-//	} else {
-//		//Failed... should never be here !
-//		throw 0;
-//	}
-//	return CBaseInputPin::SetMediaType(inMediaType);
-//}
-//

Modified: branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeInputPin.h
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeInputPin.h	2005-10-24 20:22:03 UTC (rev 10295)
+++ branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeInputPin.h	2005-10-24 20:51:54 UTC (rev 10296)
@@ -54,52 +54,3 @@
 
 	//fstream debugLog;
 };
-//----------------------
-//OLD IMPLEMENTATION
-//----------------------
-//
-//#include "Theoradecoderdllstuff.h"
-////#include "AbstractVideoDecodeInputPin.h"
-////#include "TheoraDecodeInputPin.h"
-//
-////#include "TheoraDecodeFilter.h"
-//#include "DSStringer.h"
-//#include "TheoraDecoder.h"
-//#include <math.h>
-//#include <fstream>
-//using namespace std;
-//
-//
-//class TheoraDecodeOutputPin;
-//
-//class TheoraDecodeInputPin 
-//	:	public AbstractVideoDecodeInputPin
-//{
-//public:
-//	TheoraDecodeInputPin(AbstractVideoDecodeFilter* inFilter, CCritSec* inFilterLock, AbstractVideoDecodeOutputPin* inOutputPin, CMediaType* inAcceptMediaType);
-//	virtual ~TheoraDecodeInputPin(void);
-//	int TheoraDecoded (yuv_buffer* inYUVBuffer);
-//
-//		DECLARE_IUNKNOWN
-//	STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-//
-//	HRESULT SetMediaType(const CMediaType* inMediaType);
-//
-//	//VIRTUAL FUNCTIONS - AbstractAudioDecodeInputPin
-//	//FIX:::These should be protected.
-//	virtual bool ConstructCodec();
-//	virtual void DestroyCodec();
-//
-//	long decodeData(BYTE* inBuf, long inNumBytes, LONGLONG inStart, LONGLONG inEnd) ;
-//
-//protected:
-//	fstream debugLog;
-//	//FishSound* mFishSound;
-//	//FishSoundInfo mFishInfo; 
-//	TheoraDecoder* mTheoraDecoder;
-//	unsigned long mXOffset;
-//	unsigned long mYOffset;
-//	
-//
-//
-//};

Modified: branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.cpp
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.cpp	2005-10-24 20:22:03 UTC (rev 10295)
+++ branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.cpp	2005-10-24 20:51:54 UTC (rev 10296)
@@ -82,176 +82,3 @@
 STDMETHODIMP TheoraDecodeOutputPin::Notify(IBaseFilter* inMessageSource, Quality inQuality) {
 	return E_NOTIMPL;
 }
-//----------------------
-//OLD IMPLEMENTATION
-//----------------------
-//TheoraDecodeOutputPin::TheoraDecodeOutputPin(TheoraDecodeFilter* inParentFilter, CCritSec* inFilterLock)
-//	: AbstractVideoDecodeOutputPin(inParentFilter, inFilterLock,NAME("TheoraDecodeOutputPin"), L"YV12 Out")
-//{
-//
-//		
-//}
-//TheoraDecodeOutputPin::~TheoraDecodeOutputPin(void)
-//{
-//	
-//	
-//}
-//STDMETHODIMP TheoraDecodeOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-//{
-//	if (riid == IID_IMediaSeeking) {
-//		*ppv = (IMediaSeeking*)this;
-//		((IUnknown*)*ppv)->AddRef();
-//		return NOERROR;
-//	//} else if (riid == IID_IStreamBuilder) {
-//	//	*ppv = (IStreamBuilder*)this;
-//	//	((IUnknown*)*ppv)->AddRef();
-//	//	return NOERROR;
-//	}
-//
-//	return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv); 
-//}
-//
-//
-//STDMETHODIMP TheoraDecodeOutputPin::Notify(IBaseFilter *pSelf, Quality q) {
-//	return S_OK;
-//
-//}
-//
-//bool TheoraDecodeOutputPin::FillVideoInfoHeader(VIDEOINFOHEADER* inFormatBuffer) {
-//	TheoraDecodeFilter* locFilter = ((TheoraDecodeFilter*)m_pFilter);
-//
-//	inFormatBuffer->AvgTimePerFrame = (UNITS * locFilter->mTheoraFormatInfo->frameRateDenominator) / locFilter->mTheoraFormatInfo->frameRateNumerator;
-//	inFormatBuffer->dwBitRate = locFilter->mTheoraFormatInfo->targetBitrate;
-//	
-//	inFormatBuffer->bmiHeader.biBitCount = 12;   //12 bits per pixel
-//	inFormatBuffer->bmiHeader.biClrImportant = 0;   //All colours important
-//	inFormatBuffer->bmiHeader.biClrUsed = 0;        //Use max colour depth
-//	inFormatBuffer->bmiHeader.biCompression = MAKEFOURCC('Y','V','1','2');
-//	inFormatBuffer->bmiHeader.biHeight = locFilter->mTheoraFormatInfo->frameHeight;   //Not sure
-//	inFormatBuffer->bmiHeader.biPlanes = 1;    //Must be 1
-//	inFormatBuffer->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);    //????? Size of what ?
-//	inFormatBuffer->bmiHeader.biSizeImage = ((locFilter->mTheoraFormatInfo->frameHeight * locFilter->mTheoraFormatInfo->frameWidth) * 3)/2;    //Size in bytes of image ??
-//	inFormatBuffer->bmiHeader.biWidth = locFilter->mTheoraFormatInfo->frameWidth;
-//	inFormatBuffer->bmiHeader.biXPelsPerMeter = 2000;   //Fuck knows
-//	inFormatBuffer->bmiHeader.biYPelsPerMeter = 2000;   //" " " " " 
-//	
-//	inFormatBuffer->rcSource.top = 0;
-//	inFormatBuffer->rcSource.bottom = locFilter->mTheoraFormatInfo->frameHeight;
-//	inFormatBuffer->rcSource.left = 0;
-//	inFormatBuffer->rcSource.right = locFilter->mTheoraFormatInfo->frameWidth;
-//
-//	inFormatBuffer->rcTarget.top = 0;
-//	inFormatBuffer->rcTarget.bottom = locFilter->mTheoraFormatInfo->frameHeight;
-//	inFormatBuffer->rcTarget.left = 0;
-//	inFormatBuffer->rcTarget.right = locFilter->mTheoraFormatInfo->frameWidth;
-//
-//	inFormatBuffer->dwBitErrorRate=0;
-//	return true;
-//}
-//
-////STDMETHODIMP TheoraDecodeOutputPin::Render(IPin* inOutputPin, IGraphBuilder* inGraphBuilder) {
-////	if (inOutputPin == NULL || inGraphBuilder == NULL) {
-////		return E_POINTER;
-////	}
-////
-////	
-////    IBaseFilter* locRenderer = NULL;
-////
-////    // Create the VMR9
-////	//FIX::: Probably should check if it's already in the graph.
-////	//  Also should let it connect to other VMR's
-////
-////
-////    HRESULT locHR = S_OK;
-////	locHR = inGraphBuilder->FindFilterByName(L"Video Mixing Renderer", &locRenderer);
-////	/*IEnumFilters* locEnumFilters = NULL;
-////	locHR = S_OK;
-////	locHR = inGraphBuilder->EnumFilters(&locEnumFilters);
-////	IBaseFilter* locFilter = NULL;
-////	CLSID locCLSID;
-////	while (locHR ==S_OK) {
-////	locHR = locEnumFilters->Next(1, &locFilter, 0);
-////			locFilter->GetClassID(&locCLSID);
-////			if (locCLSID == CLSID_VideoMixingRenderer9) {
-////				locHR=locHR;
-////			}
-////	}*/
-////
-////	if (locRenderer == NULL) {
-////		locHR= CoCreateInstance(CLSID_VideoMixingRenderer9, NULL, CLSCTX_INPROC, IID_IBaseFilter, (void **)&locRenderer);
-////		if (locHR != S_OK) {
-////	        return locHR;
-////	    }
-////    
-////	    //Add the VMR9 to the graph
-////	    locHR = inGraphBuilder->AddFilter(locRenderer, L"Video Mixing Renderer");
-////	    if (locHR != S_OK) {
-////			locRenderer->Release();
-////			return locHR;
-////		}
-////		IVMRFilterConfig9* locVMRConfig = NULL;
-////		locHR = locRenderer->QueryInterface(IID_IVMRFilterConfig9, (void**)&locVMRConfig);
-////		if(locHR == S_OK) {
-////			//locHR = locVMRConfig->SetRenderingMode(VMR9Mode_Renderless);
-////		}
-////	}
-////
-////	IEnumPins* locEnumPins;
-////	IPin* locRendererInputPin = NULL;
-////	locHR = locRenderer->EnumPins(&locEnumPins);
-////
-////	if (SUCCEEDED(locHR)) {
-////		if (S_OK != locEnumPins->Next(1, &locRendererInputPin, 0)) {
-////			locHR = E_UNEXPECTED;
-////		}
-////	}
-////
-////	if (SUCCEEDED(locHR)) {
-////		// CConnect VMR9 to the output of the theora decoder
-////		CMediaType* locMediaType = new CMediaType;
-////		
-////		FillMediaType(locMediaType);
-////		//Fixes the null format block error
-////		VIDEOINFOHEADER* locVideoFormat = (VIDEOINFOHEADER*)locMediaType->AllocFormatBuffer(sizeof(VIDEOINFOHEADER));
-////		FillVideoInfoHeader(locVideoFormat);
-////		locHR = inGraphBuilder->ConnectDirect(inOutputPin, locRendererInputPin, locMediaType);
-////		locRendererInputPin->Release();
-////	}
-////	if (FAILED(locHR)) 
-////	{
-////		// Could not connect to the VMR9 renderer. Remove it from the graph.
-////		inGraphBuilder->RemoveFilter(locRenderer);
-////	}
-////	locRenderer->Release();
-////	
-////    return locHR;
-////
-////
-////}
-////STDMETHODIMP TheoraDecodeOutputPin::Backout(IPin* inOutputPin, IGraphBuilder* inGraphBuilder) {
-////   //HRESULT locHR = S_OK;
-////   // if (m_Connected != NULL) // Pointer to the pin we're connected to.
-////   // {
-////   //     // Find the filter that owns the pin connected to us.
-////   //     FILTER_INFO fi;
-////   //     hr = m_Connected->QueryFilterInfo(&fi);
-////   //     if (SUCCEEDED(hr)) 
-////   //     {
-////   //         if (fi.pFilter != NULL) 
-////   //         {
-////   //             //  Disconnect the pins.
-////   //             pGraph->Disconnect(m_Connected);
-////   //             pGraph->Disconnect(pPin);
-////   //             // Remove the filter from the graph.
-////   //             pGraph->RemoveFilter(fi.pFilter);
-////   //             fi.pFilter->Release();
-////   //         } 
-////   //         else 
-////   //         {
-////   //             hr = E_UNEXPECTED;
-////   //         }
-////   //     }
-////   // }
-////   // return hr;
-////	return S_OK;
-////}
\ No newline at end of file

Modified: branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.h
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.h	2005-10-24 20:22:03 UTC (rev 10295)
+++ branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.h	2005-10-24 20:51:54 UTC (rev 10296)
@@ -57,44 +57,3 @@
 
 	//fstream debugLog;
 };
-//----------------------
-//OLD IMPLEMENTATION
-//----------------------
-//#include <d3d9.h>
-//#include <vmr9.h>
-//#include "Theoradecoderdllstuff.h"
-//#include "AbstractVideoDecodeOutputPin.h"
-//
-//
-//class TheoraDecodeFilter;
-//class TheoraDecodeOutputPin 
-//	:	public AbstractVideoDecodeOutputPin
-//	//,	public IStreamBuilder
-//{
-//public:
-//	friend class TheoraDecodeInputPin;
-//
-//		DECLARE_IUNKNOWN
-//	STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-//	TheoraDecodeOutputPin(TheoraDecodeFilter* inParentFilter,CCritSec* inFilterLock);
-//	virtual ~TheoraDecodeOutputPin(void);
-//
-//	STDMETHODIMP Notify(IBaseFilter *pSelf, Quality q);
-//
-//	//Implements IStreamBuilder to force the pin to connect to VMR9
-//	//STDMETHODIMP Render(IPin* inOutputPin, IGraphBuilder* inGraphBuilder);
-//	//STDMETHODIMP Backout(IPin* inOutputPin, IGraphBuilder* inGraphBuilder);
-//
-//
-//
-//
-//	
-//
-//
-//	//virtual bool FillWaveFormatExBuffer(WAVEFORMATEX* inFormatBuffer);
-//	virtual bool FillVideoInfoHeader(VIDEOINFOHEADER* inFormatBuffer);
-//	
-//
-//};
-//
-//

Modified: branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/theoradecoderdllstuff.h
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/theoradecoderdllstuff.h	2005-10-24 20:22:03 UTC (rev 10295)
+++ branches/oggdsf_new_demux/src/lib/codecs/theora/filters/dsfTheoraDecoder/theoradecoderdllstuff.h	2005-10-24 20:51:54 UTC (rev 10296)
@@ -52,22 +52,35 @@
 DEFINE_GUID(CLSID_TheoraDecodeFilter, 
 0x5187161, 0x5c36, 0x4324, 0xa7, 0x34, 0x22, 0xbf, 0x37, 0x50, 0x9f, 0x2d);
 
-// {D124B2B1-8968-4ae8-B288-FE16EA34B0CE}
-DEFINE_GUID(MEDIASUBTYPE_Theora, 
-0xd124b2b1, 0x8968, 0x4ae8, 0xb2, 0x88, 0xfe, 0x16, 0xea, 0x34, 0xb0, 0xce);
+//// {D124B2B1-8968-4ae8-B288-FE16EA34B0CE}
+//DEFINE_GUID(MEDIASUBTYPE_Theora, 
+//0xd124b2b1, 0x8968, 0x4ae8, 0xb2, 0x88, 0xfe, 0x16, 0xea, 0x34, 0xb0, 0xce);
+//
+//// {A99F116C-DFFA-412c-95DE-725F99874826}
+//DEFINE_GUID(FORMAT_Theora, 
+//0xa99f116c, 0xdffa, 0x412c, 0x95, 0xde, 0x72, 0x5f, 0x99, 0x87, 0x48, 0x26);
 
-// {A99F116C-DFFA-412c-95DE-725F99874826}
-DEFINE_GUID(FORMAT_Theora, 
-0xa99f116c, 0xdffa, 0x412c, 0x95, 0xde, 0x72, 0x5f, 0x99, 0x87, 0x48, 0x26);
 
+// {60891713-C24F-4767-B6C9-6CA05B3338FC}
+DEFINE_GUID(MEDIATYPE_OggPacketStream, 
+0x60891713, 0xc24f, 0x4767, 0xb6, 0xc9, 0x6c, 0xa0, 0x5b, 0x33, 0x38, 0xfc);
+
+// {95388704-162C-42a9-8149-C3577C12AAF9}
+DEFINE_GUID(FORMAT_OggIdentHeader, 
+0x95388704, 0x162c, 0x42a9, 0x81, 0x49, 0xc3, 0x57, 0x7c, 0x12, 0xaa, 0xf9);
+
+// {43F0F818-10B0-4c86-B9F1-F6B6E2D33462}
+DEFINE_GUID(IID_IOggDecoder, 
+0x43f0f818, 0x10b0, 0x4c86, 0xb9, 0xf1, 0xf6, 0xb6, 0xe2, 0xd3, 0x34, 0x62);
+
 const REGPINTYPES TheoraDecodeOutputTypes = {
     &MEDIATYPE_Video,
 	&MEDIASUBTYPE_YV12
 };
 
 const REGPINTYPES TheoraDecodeInputTypes = {
-	&MEDIATYPE_Video,
-	&MEDIASUBTYPE_Theora
+	&MEDIATYPE_OggPacketStream,
+	&MEDIASUBTYPE_None
 };
 const REGFILTERPINS TheoraDecodePinReg[] = {
 	{



More information about the commits mailing list