Microsoft DirectX 8.1 (C++) |
Start by creating an instance of the DMO Wrapper filter. Query the DMO Wrapper filter for the IDMOWrapperFilter interface. Then call the IDMOWrapperFilter::Init method. This method takes the CLSID of the DMO and the GUID of the DMO's category.
You can use the DMOEnum function to enumerate DMOs registered on the user's system. DMOs are registered using a different set of category GUIDs from the ones used for DirectShow filters. For a list of DMO categories, see DMO GUIDs.
The following code example shows how to use the IDMOWrapperFilter interface:
// IMediaObject
// Create the DMO Wrapper filter.
IBaseFilter *pFilter;
HRESULT hr = CoCreateInstance(CLSID_DMOWrapperFilter, NULL,
CLSCTX_INPROC, IID_IBaseFilter, (void **)&pFilter);
if (SUCCEEDED(hr))
{
IDMOWrapperFilter *pWrap;
hr = pFilter->QueryInterface(IID_IDMOWrapperFilter, (void **)&pWrap);
if (SUCCEEDED(hr)) { // Initialize the filter.
hr = pWrap->Init(CLSID_MyDMO, CLSID_MyDMOCategory);
pWrap->Release();
}
if (SUCCEEDED(hr)) { // Add the filter to the graph.
hr = pGraph->AddFilter(pFilter, L"My DMO");
}
pFilter->Release();
}