我在graphedit中可找到一个注册了的avi mux的filter,可以连接实现音视频写入文件,但我在程序中用EnumMatchingFilters一直枚举不到它,它的merit值为0x00200000,很纳闷,不知道该如何解决这问题,我是新手,还望各位大哥指点一下。谢谢
------解决方案--------------------------------------------------------
还要有他的GUID,代码如下:
HRESULT AddFilterByCLSID(
IGraphBuilder *pGraph, // Pointer to the Filter Graph Manager.
const GUID& clsid, // CLSID of the filter to create.
LPCWSTR wszName, // A name for the filter.
IBaseFilter **ppF) // Receives a pointer to the filter.
{
if (!pGraph || ! ppF) return E_POINTER;
*ppF = 0;
IBaseFilter *pF = 0;
HRESULT hr = S_OK;
hr = CoCreateInstance(clsid, 0, CLSCTX_INPROC_SERVER, IID_IBaseFilter, reinterpret_cast<void**>(&pF));
if (SUCCEEDED(hr))
{
hr = pGraph->AddFilter(pF, wszName);
if (SUCCEEDED(hr))
*ppF = pF;
else
pF->Release();
}
return hr;
}