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

📄 cflickerlogo.h

📁 DmoVideoWatermark 这是一个DMO组件
💻 H
字号:
// CFlickerLogo.h: Definition of the CFlickerLogo class
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_CFLICKERLOGO_H__74225CDB_391B_4A15_9A93_698F48F82056__INCLUDED_)
#define AFX_CFLICKERLOGO_H__74225CDB_391B_4A15_9A93_698F48F82056__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "resource.h"       // main symbols
#include "flicker_ids.h"

const LONG cLogoWidth  = 16;
const LONG cLogoHeight = 16;

/////////////////////////////////////////////////////////////////////////////
// CFlickerLogo

class ATL_NO_VTABLE CFlickerLogo : 
//	public IDispatchImpl<IFlickerLogo, &IID_IFlickerLogo, &LIBID_DMOVIDEOWATERMARKLib>, 
//	public ISupportErrorInfo,
	public IMediaObjectImpl<CFlickerLogo, 1, 1>,        // 1 input, 1 outputs
//	public CComObjectRoot,
	public CComObjectRootEx<CComMultiThreadModel>,
	public CComCoClass<CFlickerLogo, &CLSID_FlickerLogo>,
	public IPropertyBag
{
private:
	CComPtr<IUnknown>	mUnkMarshaler;
	IMediaBuffer *		mInputFrame;
	REFERENCE_TIME		mFrameTime;
	REFERENCE_TIME		mFrameDuration;

	BOOL	mIsInputInited;
	DWORD   mFrameCount;  // Count the total frames processed
	LONG	mImageWidth;  // Input image's attributes
	LONG	mImageHeight;
	LONG	mImageStride;
	LONG	mLogoStride;

public:
	CFlickerLogo();
	~CFlickerLogo();

BEGIN_COM_MAP(CFlickerLogo)
//	COM_INTERFACE_ENTRY(IDispatch)
//	COM_INTERFACE_ENTRY(IFlickerLogo)
//	COM_INTERFACE_ENTRY(ISupportErrorInfo)
	COM_INTERFACE_ENTRY(IMediaObject)
	COM_INTERFACE_ENTRY(IPropertyBag)
	COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, mUnkMarshaler.p)
END_COM_MAP()
//DECLARE_NOT_AGGREGATABLE(CFlickerLogo) 
// Remove the comment from the line above if you don't want your object to 
// support aggregation. 

DECLARE_REGISTRY_RESOURCEID(IDR_FlickerLogo)
DECLARE_GET_CONTROLLING_UNKNOWN()
DECLARE_PROTECT_FINAL_CONSTRUCT()
// ISupportsErrorInfo
//	STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);

protected:
	bool TypesMatch(const DMO_MEDIA_TYPE *pmt1, const DMO_MEDIA_TYPE *pmt2);

public:
	HRESULT FinalConstruct();
	void FinalRelease();

	// IMediaObjectImpl callbacks
	HRESULT InternalGetInputStreamInfo(DWORD dwInputStreamIndex, DWORD *pdwFlags);
	HRESULT InternalGetOutputStreamInfo(DWORD dwOutputStreamIndex, DWORD *pdwFlags);
	HRESULT InternalCheckInputType(DWORD dwInputStreamIndex, const DMO_MEDIA_TYPE *pmt);
	HRESULT InternalCheckOutputType(DWORD dwOutputStreamIndex, const DMO_MEDIA_TYPE *pmt);
	HRESULT InternalGetInputType(DWORD dwInputStreamIndex, DWORD dwTypeIndex,
							 DMO_MEDIA_TYPE *pmt);
	HRESULT InternalGetOutputType(DWORD dwOutputStreamIndex, DWORD dwTypeIndex,
							 DMO_MEDIA_TYPE *pmt);
	HRESULT InternalGetInputSizeInfo(DWORD dwInputStreamIndex, DWORD *pcbSize,
							 DWORD *pcbMaxLookahead, DWORD *pcbAlignment);
	HRESULT InternalGetOutputSizeInfo(DWORD dwOutputStreamIndex, DWORD *pcbSize,
							  DWORD *pcbAlignment);
	HRESULT InternalGetInputMaxLatency(DWORD dwInputStreamIndex, REFERENCE_TIME *prtMaxLatency);
	HRESULT InternalSetInputMaxLatency(DWORD dwInputStreamIndex, REFERENCE_TIME rtMaxLatency);
	HRESULT InternalFlush();
	HRESULT InternalDiscontinuity(DWORD dwInputStreamIndex);
	HRESULT InternalAllocateStreamingResources();
	HRESULT InternalFreeStreamingResources();
	HRESULT InternalProcessInput(DWORD dwInputStreamIndex, IMediaBuffer *pBuffer,
								DWORD dwFlags, REFERENCE_TIME rtTimestamp,
								REFERENCE_TIME rtTimelength);
	HRESULT InternalProcessOutput(DWORD dwFlags, DWORD cOutputBufferCount,
								DMO_OUTPUT_DATA_BUFFER *pOutputBuffers,
    						   DWORD *pdwStatus);
	HRESULT InternalAcceptingInput(DWORD dwInputStreamIndex);

	// IPropertyBag
	STDMETHODIMP Read(LPCOLESTR pszPropName, VARIANT *pVar, IErrorLog *pErrorLog);
	STDMETHODIMP Write(LPCOLESTR pszPropName, VARIANT *pVar);
};

#endif // !defined(AFX_CFLICKERLOGO_H__74225CDB_391B_4A15_9A93_698F48F82056__INCLUDED_)

⌨️ 快捷键说明

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