cdecodedstream.h

来自「DIRECTSHOW 开发指南电子书」· C头文件 代码 · 共 64 行

H
64
字号
//
// CDecodedStream.h
//

#ifndef __H_CDecodedStream__
#define __H_CDecodedStream__

class CFilterMpeg2VD;
class CMpegController;
class CDecodedStream : public CSourceStream
{
	friend class CFilterMpeg2VD;

private:
	CFilterMpeg2VD *     mDecodeFilter;
	CMpegController *    mMpegController;
	 
	// implement IMediaPosition by passing upstream
    IUnknown *   mPosition;
	BOOL         mFlushing;
	ULONG        mSamplesSent;
	CCritSec     mDataAccess;

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

	void SetController(CMpegController * 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 + =
减小字号Ctrl + -
显示快捷键?