[xiph-commits] r6880 -

illiminable at dactyl.lonelymoon.com illiminable
Sat Jun 26 00:18:10 PDT 2004


trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder
Message-ID: <20040626071810.6A4079AAAB at dactyl.lonelymoon.com>

Author: illiminable
Date: Sat Jun 26 00:18:10 2004
New Revision: 6880

Modified:
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.cpp
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.h
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/stdafx.h
Log:
* Reverted some of the graph forcing not to enforce VMR9... was an attempt to fix the WMP9/10 bugs... didn't work.

Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.cpp	2004-06-26 02:09:42 UTC (rev 6879)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.cpp	2004-06-26 07:18:08 UTC (rev 6880)
@@ -49,6 +49,10 @@
*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);
@@ -92,80 +96,109 @@
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 = 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;
-    }
-
-    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);
-        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
+//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: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.h	2004-06-26 02:09:42 UTC (rev 6879)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.h	2004-06-26 07:18:08 UTC (rev 6880)
@@ -30,7 +30,8 @@
//===========================================================================

#pragma once
-
+#include <d3d9.h>
+#include <vmr9.h>
#include "Theoradecoderdllstuff.h"
#include "AbstractVideoDecodeOutputPin.h"

@@ -38,7 +39,7 @@
class TheoraDecodeFilter;
class TheoraDecodeOutputPin
:	public AbstractVideoDecodeOutputPin
-	,	public IStreamBuilder
+	//,	public IStreamBuilder
{
public:
friend class TheoraDecodeInputPin;
@@ -51,8 +52,8 @@
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);
+	//STDMETHODIMP Render(IPin* inOutputPin, IGraphBuilder* inGraphBuilder);
+	//STDMETHODIMP Backout(IPin* inOutputPin, IGraphBuilder* inGraphBuilder);




Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/stdafx.h	2004-06-26 02:09:42 UTC (rev 6879)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/stdafx.h	2004-06-26 07:18:08 UTC (rev 6880)
@@ -40,6 +40,7 @@
// Windows Header Files:
#include <windows.h>

+
// TODO: reference additional headers your program requires here
#include "AbstractVideoDecodeFilter.h"
#include "AbstractVideoDecodeInputPin.h"



More information about the commits mailing list