[xiph-commits] r7722 - trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Thu Sep 9 07:27:04 PDT 2004


Author: illiminable
Date: 2004-09-09 07:27:04 -0700 (Thu, 09 Sep 2004)
New Revision: 7722

Modified:
   trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp
   trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.h
Log:
* Added MediaType negotiation.

Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp	2004-09-09 14:03:00 UTC (rev 7721)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp	2004-09-09 14:27:04 UTC (rev 7722)
@@ -125,7 +125,18 @@
 	}
 }
 HRESULT TheoraDecodeFilter::CheckTransform(const CMediaType* inInputMediaType, const CMediaType* inOutputMediaType) {
-	return S_OK;
+	if ((CheckInputType(inInputMediaType) == S_OK) &&
+		((inOutputMediaType->majortype == MEDIATYPE_Video) && (inOutputMediaType->subtype == MEDIASUBTYPE_YV12) && (inOutputMediaType->formattype == FORMAT_VideoInfo)
+		)) {
+
+		VIDEOINFOHEADER* locVideoHeader = (VIDEOINFOHEADER*)inOutputMediaType->Format();
+		mHeight = (unsigned long)abs(locVideoHeader->bmiHeader.biHeight);
+		mWidth = (unsigned long)abs(locVideoHeader->bmiHeader.biWidth);
+		mFrameSize = (unsigned long)locVideoHeader->bmiHeader.biSizeImage;
+		return S_OK;
+	} else {
+		return S_FALSE;
+	}
 }
 HRESULT TheoraDecodeFilter::DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES* inPropertyRequest) {
 	debugLog<<endl;
	debugLog<<"DecideBufferSize :"<<endl;
	//FIX::: Abstract this out properly	

Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.h	2004-09-09 14:03:00 UTC (rev 7721)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.h	2004-09-09 14:27:04 UTC (rev 7722)
@@ -56,6 +56,9 @@
 protected:
 	void FillMediaType(CMediaType* outMediaType, unsigned long inSampleSize);
 	bool FillVideoInfoHeader(VIDEOINFOHEADER* inFormatBuffer);
+	unsigned long mHeight;
+	unsigned long mWidth;
+	unsigned long mFrameSize;
 	//Format Block
 	sTheoraFormatBlock* mTheoraFormatInfo;
 	fstream debugLog;



More information about the commits mailing list