Another interesting question on tanvon Yahoo Group is,
” Could any one tell me how to go about listing all the DirectShow
Filter Categories so that i can list the filters under each category.”
There are two ways to enumerate the filters the Filter Mapper way and the System Device Enumerator way.
Here I will explain the System Device Enumerator.
The System Device Enumerator is a COM object, which implements the ICreateDevEnum interface,
this intreface exposes only a single method CreateClassEnumerator. This is the method which creates the enumerator object and returns its IEnumMoniker interface, but enumerate what
HRESULT CreateClassEnumerator(
REFCLSID clsidDeviceClass,
IEnumMoniker **ppEnumMoniker,
DWORD dwFlags
);
The first parameter is the class identifier (CLSID) of the device category. these categories are defined in the Dshow.h header file. (e.g. CLSID_LegacyAmFilterCategory , CLSID_AudioRendererCategory ). This is the place to notice that you have to specify which category you want to enumerate.
Once you have the IEnumMoniker, now you can use its methods to easily enumerate the device category. Just call IEnumMoniker::Next method, this will return an IMoniker interface with this interface you can get the “Friendly Name” of the filter or you can instanciate the filter itself.
For an example see http://msdn.microsoft.com/en-us/library/ms787871(VS.85).aspx
For the URDU version see http://directshow.wordpress.com/2008/08/16/system-device-enumerator/