[xiph-commits] r10785 - branches/oggdsf_new_demux/src/lib/codecs/ogm/filters/dsfOGMDecoder

illiminable at svn.xiph.org illiminable at svn.xiph.org
Sun Feb 5 15:01:09 PST 2006


Author: illiminable
Date: 2006-02-05 15:01:04 -0800 (Sun, 05 Feb 2006)
New Revision: 10785

Modified:
   branches/oggdsf_new_demux/src/lib/codecs/ogm/filters/dsfOGMDecoder/OGMDecodeFilter.cpp
   branches/oggdsf_new_demux/src/lib/codecs/ogm/filters/dsfOGMDecoder/OGMDecodeInputPin.h
Log:
* Fix places where the only expected OGM was the video stream so it handles the audio and text streams too.

Modified: branches/oggdsf_new_demux/src/lib/codecs/ogm/filters/dsfOGMDecoder/OGMDecodeFilter.cpp
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/ogm/filters/dsfOGMDecoder/OGMDecodeFilter.cpp	2006-02-05 22:36:51 UTC (rev 10784)
+++ branches/oggdsf_new_demux/src/lib/codecs/ogm/filters/dsfOGMDecoder/OGMDecodeFilter.cpp	2006-02-05 23:01:04 UTC (rev 10785)
@@ -157,15 +157,44 @@
 	if ((inPosition == 0) && (mInputPin != NULL) && (mInputPin->IsConnected())) {
 
 		//VIDSPEC:::This needs cases for audio and text
-		
-		VIDEOINFOHEADER* locVideoFormat = (VIDEOINFOHEADER*)outMediaType->AllocFormatBuffer(sizeof(VIDEOINFOHEADER));
-		*locVideoFormat = *mInputPin->getVideoFormatBlock();
-		//FillMediaType(outMediaType, locVideoFormat->bmiHeader.biSizeImage);
-		outMediaType->majortype = MEDIATYPE_Video;
-		outMediaType->subtype = (GUID)(FOURCCMap(locVideoFormat->bmiHeader.biCompression));;
-		outMediaType->formattype = FORMAT_VideoInfo;
-		//TODO:::Handle temproal compression and variable size field
+		switch(mInputPin->getOGMMediaType()) {
+			case OGMDecodeInputPin::OGM_VIDEO_TYPE:
+			{
+				VIDEOINFOHEADER* locVideoFormat = (VIDEOINFOHEADER*)outMediaType->AllocFormatBuffer(sizeof(VIDEOINFOHEADER));
+				*locVideoFormat = *mInputPin->getVideoFormatBlock();
+				//FillMediaType(outMediaType, locVideoFormat->bmiHeader.biSizeImage);
+				outMediaType->majortype = MEDIATYPE_Video;
+				outMediaType->subtype = (GUID)(FOURCCMap(locVideoFormat->bmiHeader.biCompression));;
+				outMediaType->formattype = FORMAT_VideoInfo;
+				//TODO:::Handle temproal compression and variable size field
 
+			}
+			break;
+				
+			case OGMDecodeInputPin::OGM_AUDIO_TYPE:
+			{
+				WAVEFORMATEX* locAudioFormat = (WAVEFORMATEX*)outMediaType->AllocFormatBuffer(sizeof(WAVEFORMATEX));
+				*locAudioFormat = *mInputPin->getAudioFormatBlock();
+				outMediaType->majortype = MEDIATYPE_Audio;
+				outMediaType->subtype = MEDIASUBTYPE_PCM;
+				outMediaType->subtype.Data1 = locAudioFormat->wFormatTag;
+				outMediaType->formattype = FORMAT_WaveFormatEx;
+			}
+
+			break;
+			case OGMDecodeInputPin::OGM_TEXT_TYPE:
+
+				outMediaType->majortype = MEDIATYPE_Text;
+				outMediaType->subtype = MEDIASUBTYPE_None;
+				outMediaType->formattype = FORMAT_None;
+				break;
+
+			default:
+				return E_FAIL;
+
+		}
+
+
 		return S_OK;
 	} else {
 		return VFW_S_NO_MORE_ITEMS;

Modified: branches/oggdsf_new_demux/src/lib/codecs/ogm/filters/dsfOGMDecoder/OGMDecodeInputPin.h
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/ogm/filters/dsfOGMDecoder/OGMDecodeInputPin.h	2006-02-05 22:36:51 UTC (rev 10784)
+++ branches/oggdsf_new_demux/src/lib/codecs/ogm/filters/dsfOGMDecoder/OGMDecodeInputPin.h	2006-02-05 23:01:04 UTC (rev 10785)
@@ -65,7 +65,10 @@
 		OGM_TEXT_TYPE,
 		OGM_UNKNOWN_TYPE
 	};
+
+	eOGMMediaType getOGMMediaType()				{		return mOGMMediaType;		}
 	VIDEOINFOHEADER* getVideoFormatBlock()		{		return mVideoFormatBlock;	}
+	WAVEFORMATEX* getAudioFormatBlock()			{		return mAudioFormatBlock;	}
 protected:
 	enum eOGMSetupState {
 		VSS_SEEN_NOTHING,



More information about the commits mailing list