[xiph-commits] r11054 - branches/oggdsf_ce_port/src/lib/codecs/theora/filters/dsfTheoraDecoder

illiminable at svn.xiph.org illiminable at svn.xiph.org
Fri Mar 24 22:28:06 PST 2006


Author: illiminable
Date: 2006-03-24 22:27:58 -0800 (Fri, 24 Mar 2006)
New Revision: 11054

Modified:
   branches/oggdsf_ce_port/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp
   branches/oggdsf_ce_port/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.h
   branches/oggdsf_ce_port/src/lib/codecs/theora/filters/dsfTheoraDecoder/theoradecoderdllstuff.h
Log:
* Some changes in constrctor of theora decode filter to start preparing for allowing alternate output types than yv12.
* Some comments to mark where changes need to be made

Modified: branches/oggdsf_ce_port/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp
===================================================================
--- branches/oggdsf_ce_port/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp	2006-03-24 07:46:36 UTC (rev 11053)
+++ branches/oggdsf_ce_port/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp	2006-03-25 06:27:58 UTC (rev 11054)
@@ -76,12 +76,30 @@
 #ifdef OGGCODECS_LOGGING
 	debugLog.open("G:\\logs\\newtheofilter.log", ios_base::out);
 #endif
+
+	CMediaType* locAcceptMediaType = new CMediaType(&MEDIATYPE_Video);		//Deleted in pin destructor
+	locAcceptMediaType->subtype = MEDIASUBTYPE_YV12;
+	locAcceptMediaType->formattype = FORMAT_VideoInfo;
+	mOutputMediaTypes.push_back(locAcceptMediaType);
+
+	locAcceptMediaType = new CMediaType(&MEDIATYPE_Video);		//Deleted in pin destructor
+	locAcceptMediaType->subtype = MEDIASUBTYPE_YUY2;
+	locAcceptMediaType->formattype = FORMAT_VideoInfo;
+	mOutputMediaTypes.push_back(locAcceptMediaType);
+
+
 	mTheoraDecoder = new TheoraDecoder;
 	mTheoraDecoder->initCodec();
 
 }
 
-TheoraDecodeFilter::~TheoraDecodeFilter() {
+TheoraDecodeFilter::~TheoraDecodeFilter() 
+{
+	
+	for (size_t i = 0; i < mOutputMediaTypes.size(); i++) {
+		delete mOutputMediaTypes[i];
+	}
+
 	delete mTheoraDecoder;
 	mTheoraDecoder = NULL;
 
@@ -101,6 +119,7 @@
 	return pNewObject;
 } 
 void TheoraDecodeFilter::FillMediaType(CMediaType* outMediaType, unsigned long inSampleSize) {
+	//MTS::: Needs alternate media types
 	outMediaType->SetType(&MEDIATYPE_Video);
 	outMediaType->SetSubtype(&MEDIASUBTYPE_YV12);
 	outMediaType->SetFormatType(&FORMAT_VideoInfo);
@@ -108,7 +127,9 @@
 	outMediaType->SetSampleSize(inSampleSize);		
 
 }
-bool TheoraDecodeFilter::FillVideoInfoHeader(VIDEOINFOHEADER* inFormatBuffer) {
+bool TheoraDecodeFilter::FillVideoInfoHeader(VIDEOINFOHEADER* inFormatBuffer) 
+{
+	//MTS::: Needs changes for alternate media types. FOURCC and bitCOunt
 	TheoraDecodeFilter* locFilter = this;
 
 	inFormatBuffer->AvgTimePerFrame = (UNITS * locFilter->mTheoraFormatInfo->frameRateDenominator) / locFilter->mTheoraFormatInfo->frameRateNumerator;
@@ -160,6 +181,7 @@
 	
 }
 HRESULT TheoraDecodeFilter::CheckTransform(const CMediaType* inInputMediaType, const CMediaType* inOutputMediaType) {
+	//MTS::: Needs multiple media types
 	if ((CheckInputType(inInputMediaType) == S_OK) &&
 		((inOutputMediaType->majortype == MEDIATYPE_Video) && (inOutputMediaType->subtype == MEDIASUBTYPE_YV12) && (inOutputMediaType->formattype == FORMAT_VideoInfo)
 		)) {
@@ -198,6 +220,7 @@
 	//debugLog<<"DecideBufferSize : Prefix    : "<<inPropertyRequest->cbPrefix<<endl;
 	//debugLog<<"DecideBufferSize : NumBuffs  : "<<inPropertyRequest->cBuffers<<endl;
 
+	//MTS::: Maybe this needs to be reconsidered for other output types... ie rgb32 will be much bigger
 
 	const unsigned long MIN_BUFFER_SIZE = 16*16;			//What should this be ????
 	const unsigned long DEFAULT_BUFFER_SIZE = 1024*1024 * 2;
@@ -317,7 +340,7 @@
 	if (inPosition < 0) {
 		return E_INVALIDARG;
 	}
-	
+	//MTS::: Needs alternate types.
 	if (inPosition == 0) {
 		
 		VIDEOINFOHEADER* locVideoFormat = (VIDEOINFOHEADER*)outOutputMediaType->AllocFormatBuffer(sizeof(VIDEOINFOHEADER));
@@ -647,6 +670,8 @@
 	};
 	SetSampleParams(outSample, mBMIFrameSize, &locStart, &locEnd, locIsKeyFrame);
 
+	//MTS::: Either need alternates in this method, or easier is to default out to yv12, then post convert to yuy2/rgb/etc
+
 	
 	
 	return S_OK;

Modified: branches/oggdsf_ce_port/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.h
===================================================================
--- branches/oggdsf_ce_port/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.h	2006-03-24 07:46:36 UTC (rev 11053)
+++ branches/oggdsf_ce_port/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.h	2006-03-25 06:27:58 UTC (rev 11054)
@@ -102,6 +102,8 @@
 
 	HRESULT TheoraDecoded (yuv_buffer* inYUVBuffer, IMediaSample* outSample, bool inIsKeyFrame, REFERENCE_TIME inStart, REFERENCE_TIME inEnd);
 
+	vector<CMediaType*> mOutputMediaTypes;
+
 	REFERENCE_TIME mSegStart;
 	REFERENCE_TIME mSegEnd;
 	double mPlaybackRate;

Modified: branches/oggdsf_ce_port/src/lib/codecs/theora/filters/dsfTheoraDecoder/theoradecoderdllstuff.h
===================================================================
--- branches/oggdsf_ce_port/src/lib/codecs/theora/filters/dsfTheoraDecoder/theoradecoderdllstuff.h	2006-03-24 07:46:36 UTC (rev 11053)
+++ branches/oggdsf_ce_port/src/lib/codecs/theora/filters/dsfTheoraDecoder/theoradecoderdllstuff.h	2006-03-25 06:27:58 UTC (rev 11054)
@@ -105,6 +105,8 @@
 //DEFINE_GUID(IID_IOggOutputPin, 
 //0x83d7f506, 0x53ed, 0x4f15, 0xb6, 0xd8, 0x7d, 0x8e, 0x9e, 0x72, 0xa9, 0x18);
 
+
+//MTS::: Need multiple types
 const REGPINTYPES TheoraDecodeOutputTypes = {
     &MEDIATYPE_Video,
 	&MEDIASUBTYPE_YV12
@@ -127,6 +129,7 @@
 	&TheoraDecodeInputTypes				//Pointer to media type (Video/Theora)
 	} ,
 
+	//MTS::: Needs better name
 	{
 	L"YV12 Output",						//Name (obsoleted)
 	FALSE,								//Renders from this pin ?? Not sure about this.



More information about the commits mailing list