www.pudn.com > FilterTSSource.rar > CFilterTSSource.h


// 
// CFilterTSSource.h 
// 
 
#ifndef __H_CFilterTSSource__ 
#define __H_CFilterTSSource__ 
 
#include "CTSOutPin.h" 
 
class CFilterTSSource : public CSource, public IFileSourceFilter 
{ 
private: 
	CFilterTSSource(LPUNKNOWN lpunk, HRESULT *phr); 
	~CFilterTSSource(); 
 
public: 
	static CUnknown * WINAPI CreateInstance(LPUNKNOWN lpunk, HRESULT *phr); 
	DECLARE_IUNKNOWN; 
	// Basic COM - used here to reveal our own interfaces 
	STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void ** ppv); 
 
	// you need to supply these to access the pins from the enumerator 
	// and for default Stop and Pause/Run activation. 
	virtual int GetPinCount(); 
	virtual CBasePin *GetPin(int n); 
	STDMETHODIMP FindPin(LPCWSTR Id, IPin ** ppPin); 
 
	// --- IFileSourceFilter methods --- 
	STDMETHODIMP Load(LPCOLESTR pszFileName, const AM_MEDIA_TYPE *pmt); 
	STDMETHODIMP GetCurFile(LPOLESTR *ppszFileName, AM_MEDIA_TYPE *pmt);	 
 
protected: 
	CTSOutPin * OutPin() {return (CTSOutPin *)m_paStreams[0];}; 
}; 
 
#endif // __H_CFilterTSSource__