Using the DMO Wrapper Filter (Windows Embedded CE 6.0)
1/6/2010
To create an instance of the DMO Wrapper filter, query the DMO Wrapper filter for the IDMOWrapperFilter interface. Then, call the IDMOWrapperFilter::Init method, which 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();
}
For more information on the use of pGraph in the sample above, see the topic: Playing the File.