From: d7o3g4q <d7...@us...> - 2004-09-23 15:35:59
|
Update of /cvsroot/tyshow/TyShow/basesplitter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2241/basesplitter Modified Files: BaseSplitter.cpp BaseSplitter.h Log Message: Lots of changes. Biggest difference is the support for streaming. many bugfixes Index: BaseSplitter.cpp =================================================================== RCS file: /cvsroot/tyshow/TyShow/basesplitter/BaseSplitter.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BaseSplitter.cpp 31 Oct 2003 16:37:59 -0000 1.2 --- BaseSplitter.cpp 23 Sep 2004 15:35:49 -0000 1.3 *************** *** 2,5 **** --- 2,6 ---- #include "..\DSUtil\DSUtil.h" #include <initguid.h> + #include "..\include\IPreRead.h" #include "BaseSplitter.h" *************** *** 64,67 **** --- 65,77 ---- } + HRESULT CBaseSplitterInputPin::GetPreRead(IPreRead** ppPreRead) + { + CheckPointer(ppPreRead, E_POINTER); + *ppPreRead = NULL; + CheckPointer(m_pPreRead, VFW_E_NOT_CONNECTED); + (*ppPreRead = m_pPreRead)->AddRef(); + return S_OK; + } + STDMETHODIMP CBaseSplitterInputPin::NonDelegatingQueryInterface(REFIID riid, void** ppv) { *************** *** 89,100 **** return hr; ! if(CComQIPtr<IAsyncReader> pAsyncReader = pPin) ! { hr = S_OK; ! } ! else ! { ! hr = E_NOINTERFACE; ! } return hr; --- 99,110 ---- return hr; ! // if(CComQIPtr<IAsyncReader> pAsyncReader = pPin) ! // { hr = S_OK; ! // } ! // else ! // { ! // hr = E_NOINTERFACE; ! // } return hr; *************** *** 112,115 **** --- 122,126 ---- m_pAsyncReader.Release(); + m_pPreRead.Release(); return S_OK; *************** *** 125,129 **** CheckPointer(pPin, E_POINTER); m_pAsyncReader = pPin; ! CheckPointer(m_pAsyncReader, E_NOINTERFACE); if(FAILED(hr = ((CBaseSplitterFilter*)m_pFilter)->CompleteConnect(PINDIR_INPUT, this))) --- 136,141 ---- CheckPointer(pPin, E_POINTER); m_pAsyncReader = pPin; ! m_pPreRead = pPin; ! CheckPointer(m_pAsyncReader || m_pPreRead, E_NOINTERFACE); if(FAILED(hr = ((CBaseSplitterFilter*)m_pFilter)->CompleteConnect(PINDIR_INPUT, this))) *************** *** 630,639 **** CBaseSplitterInputPin* pIn = (CBaseSplitterInputPin*)pPin; ! HRESULT hr; CComPtr<IAsyncReader> pAsyncReader; ! if(FAILED(hr = pIn->GetAsyncReader(&pAsyncReader)) ! || FAILED(hr = CreateOutputs(pAsyncReader))) return hr; } else if(dir == PINDIR_OUTPUT) --- 642,662 ---- CBaseSplitterInputPin* pIn = (CBaseSplitterInputPin*)pPin; ! HRESULT hr = S_OK; CComPtr<IAsyncReader> pAsyncReader; ! CComPtr<IPreRead> pPreRead; ! if(SUCCEEDED(pIn->GetPreRead(&pPreRead))) ! { ! hr = CreateOutputs(pPreRead); ! pPreRead.Release(); ! if( SUCCEEDED(hr) ) ! return hr; ! } ! if(SUCCEEDED(hr) && SUCCEEDED(pIn->GetAsyncReader(&pAsyncReader))) ! { ! hr = CreateOutputs(pAsyncReader); ! pAsyncReader.Release(); return hr; + } } else if(dir == PINDIR_OUTPUT) Index: BaseSplitter.h =================================================================== RCS file: /cvsroot/tyshow/TyShow/basesplitter/BaseSplitter.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BaseSplitter.h 31 Oct 2003 16:37:59 -0000 1.2 --- BaseSplitter.h 23 Sep 2004 15:35:49 -0000 1.3 *************** *** 44,47 **** --- 44,48 ---- protected: CComQIPtr<IAsyncReader> m_pAsyncReader; + CComQIPtr<IPreRead> m_pPreRead; public: *************** *** 50,53 **** --- 51,55 ---- HRESULT GetAsyncReader(IAsyncReader** ppAsyncReader); + HRESULT GetPreRead(IPreRead** ppPreRead); DECLARE_IUNKNOWN; *************** *** 133,137 **** CAutoPtrList<CBaseSplitterOutputPin> m_pOutputs; CMap<DWORD, DWORD, CBaseSplitterOutputPin*, CBaseSplitterOutputPin*> m_pPinMap; ! LONGLONG m_nOpenProgress; bool m_fAbort; --- 135,139 ---- CAutoPtrList<CBaseSplitterOutputPin> m_pOutputs; CMap<DWORD, DWORD, CBaseSplitterOutputPin*, CBaseSplitterOutputPin*> m_pPinMap; ! LONGLONG m_nOpenProgress; bool m_fAbort; *************** *** 152,155 **** --- 154,158 ---- // override this ... virtual HRESULT CreateOutputs(IAsyncReader* pAsyncReader) = 0; + virtual HRESULT CreateOutputs(IPreRead* pPreRead) = 0; protected: *************** *** 159,163 **** // ... and also override all these too virtual bool InitDeliverLoop() = 0; ! virtual void SeekDeliverLoop(REFERENCE_TIME rt) = 0; virtual void DoDeliverLoop() = 0; --- 162,166 ---- // ... and also override all these too virtual bool InitDeliverLoop() = 0; ! virtual void SeekDeliverLoop(REFERENCE_TIME& rt) = 0; virtual void DoDeliverLoop() = 0; |