Directly Accessing the DirectShow Processing Filters

Direct access to the underlying DirectShow audio and video processing filters can be accomplished through the IltmmObjectWrapper interface. This allows the user to programmatically manipulate the individual processor’s properties. Please consult the individual processing filter’s documentation to determine the capabilities of that filter.

For example, let’s assume that you have added 2 video processors to the ltmmPlay object, and you would like to obtain the underlying DirectShow filter for the second processor.

1.

The first step would be to obtain the selected video processors collection from the ltmmPlay object using the following code:

IltmmProcessors* pProcessors;

play->get_SelectedVideoProcessors(&pProcessors); // get the selected video processor collection

2.

Next, you would get the second processor:

IltmmProcessor* pProcessor;

pProcessors->Item(1, &pProcessor);   // get the second processor

pProcessors->Release();      // don’t need the collection anymore

3.

Now, you can obtain the IltmmObjectWrapper interface:

IltmmObjectWrapper* pWrapper;

pProcessor->QueryInterface(IID_IltmmObjectWrapper, (void**) &pWrapper);   // get the wrapper interface

pProcessor->Release();  // don’t need this anymore

4.

And finally, you can get the underlying DirectShow filter:

IUnknown* pObject;

pWrapper->GetWrappedObject(&pObject); // get the DirectShow filter

pWrapper->Release();  // don’t need this anymore

pObject now contains the IUnknown interface pointer to the filter. You can access all of the interfaces that the processor implements through this interface pointer.