⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cdecodedstream.h

📁 mpeg2 decoder filter过滤服务端
💻 H
字号:
//
// CDecodedStream.h
//

#ifndef __H_CDecodedStream__
#define __H_CDecodedStream__

class CFilterMpeg2Dec;
class CMpeg2Controller;
class CDecodedStream : public CSourceStream
{
	friend class CFilterMpeg2Dec;

private:
	CFilterMpeg2Dec *     mDecodeFilter;
	CMpeg2Controller *    mMpeg2Controller;
	 
	// implement IMediaPosition by passing upstream
    IUnknown *   mPosition;
	BOOL         mFlushing;
	ULONG        mSamplesSent;
	CCritSec     mDataAccess;

public:
	CDecodedStream(TCHAR * inObjectName, HRESULT * outResult, CFilterMpeg2Dec * inFilter);
	~CDecodedStream();

	void SetController(CMpeg2Controller * inController);
	// override to expose IMediaPosition
    STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
	STDMETHODIMP BeginFlush(void);
	STDMETHODIMP EndFlush(void);
	STDMETHODIMP EndOfStream(void);

	HRESULT StopThreadSafely(void);
	HRESULT RunThreadSafely(void);

protected:
	// Override this to provide the worker thread a means
    // of processing a buffer
    virtual HRESULT FillBuffer(IMediaSample *pSample); // PURE
	virtual HRESULT DecideBufferSize(IMemAllocator * pAllocator,
									ALLOCATOR_PROPERTIES *pprop); // PURE

	virtual HRESULT CheckMediaType(const CMediaType *mtOut);
	virtual HRESULT GetMediaType(int iPosition, CMediaType *pMediaType);
	// IQualityControl
	STDMETHODIMP Notify(IBaseFilter * pSender, Quality q);

	HRESULT CompleteConnect(IPin *pReceivePin);
	STDMETHODIMP QueryId(LPWSTR * Id);

	virtual HRESULT DoBufferProcessingLoop(void);
	virtual HRESULT OnThreadStartPlay(void);
	virtual HRESULT OnThreadDestroy(void);
	
	HRESULT DeliverCurrentPicture(IMediaSample * pSample);

	// Media type
public:
    CMediaType& CurrentMediaType(void) { return m_mt; }
};

#endif // __H_CDecodedStream__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -