标签:
Filter的类型,如以下示图:
Filter是一种COM组件。为了实现在Filter Graph中的统一操作,每个Filter上都至少实现了IBaseFilter接口。IBaseFilter继承自IMediaFilter。Filter Graph Manager正是通过IMediaFilter的接口方法来控制Filter Graph的状态(运行、暂停、停止)转换。实现Filter的文件一般是一个DLL,扩展名可以是.dll。Filter的创建是通过API函数CoCreateInstance来完成的,代码如下:
HRESULT CoCreateInstance( __in REFCLSID rclsid, //The CLSID associated with the data and code that will be used to create the object. __in LPUNKNOWN pUnkOuter, //If NULL, indicates that the object is not being created as part of an aggregate. If non-NULL, pointer to the aggregate object‘s IUnknown interface (the controlling IUnknown). __in DWORD dwClsContext, //Context in which the code that manages the newly created object will run. The values are taken from the enumeration CLSCTX. __in REFIID riid, //A reference to the identifier of the interface to be used to communicate with the object. __out LPVOID *ppv //Address of pointer variable that receives the interface pointer requested in riid. Upon successful return, * ppv contains the requested interface pointer. Upon failure, * ppv contains NULL. );
标签:
原文地址:http://www.cnblogs.com/stemon/p/4564506.html