IFilterMapper2 is an interface for registering and locating DirectShow filters with greater flexibility than IFilterMapper allowed. Applications and filters should use IFilterMapper2 instead of IFilterMapper, although both interfaces can find filters registered with the other interface.
One major change from IFilterMapper to IFilterMapper2 is that IFilterMapper2 provides support for filter categories. A filter can appear in one or more categories (e.g. Video Compressors) to restrict the search space. The RegisterFilter method takes a category, and the EnumMatchingFilters method searches across categories.
Other changes include:
When to Implement
This interface is implemented on the filter graph and is not intended to be implemented by developers.
When to Use
Applications and filters should use IFlterMapper2 when they need to register or unregister filters. IFilterMapper2 should be used instead of IFilterMapper.
Methods in Vtable Order
IUnknown methods | Description |
QueryInterface | Retrieves pointers to supported interfaces. |
AddRef | Increments the reference count. |
Release | Decrements the reference count. |
IFilterMapper2 methods | Description |
CreateCategory | Adds a new category to the list of ActiveMovie categories (CLSID_ActiveMovieCategories). |
UnregisterFilter | Removes the registration of this filter from the registry. |
RegisterFilter | Register a filter, pins, and media types under a category. |
EnumMatchingFilters | Provides an enumerator that enumerates registered filters that meet specified requirements. |
Adds a new category to the list of ActiveMovie categories (CLSID_ActiveMovieCategories).
HRESULT CreateCategory(
REFCLSID clsidCategory,
DWORD dwCategoryMerit,
LPCWSTR Description );
Returns S_OK on success; HRESULT_FROM_WIN32 on failure.
The Graph builder initially skips all categories with merit less than DO_NOT_USE to speed up the IGraphBuilder::RenderFile method. Categories of filters that should not be considered for playback should be marked DO_NOT_USE. For more information on "merit" see the remarks section of the IFilterMapper::RegisterFilter method.
A filter can appear in one or more categories (e.g. Video Compressors) to restrict the search space.
Removes the registration of this filter from the registry.
HRESULT UnregisterFilter(
const CLSID *pclsidCategory,
const OLECHAR *szInstance,
REFCLSID Filter );
Returns S_OK on success; HRESULT_FROM_WIN32 on failure.
If szInstance is null, this method uses the filter guid passed in Filter.
This method might return an error if the filter was not registered.
Register a filter, pins, and media types under a category.
HRESULT RegisterFilter(
REFCLSID clsidFilter,
LPCWSTR Name,
IMoniker **ppMoniker,
const CLSID *pclsidCategory,
const OLECHAR *szInstance,
const REGFILTER2 *prf2 );
Returns one of the following values:
Value | Meaning |
VFW_E_BAD_KEY | Couldn't get registry key. |
HRESULT_FROM_WIN32 | Failure. |
NOERROR | Success. |
Specify the moniker in the ppMoniker parameter if you are registering a filter for a WDM/PnP Device. If ppMoniker is not null, the moniker returned can be used to write additional private values in the property bag.
The pclsidCategory parameter defaults to CLSID_ActiveMovieFilters if NULL is passed in.
Set ppMoniker to NULL if you don't want to provide or receive the moniker
Provides an enumerator that enumerates registered filters that meet specified requirements.
HRESULT EnumMatchingFilters(
IEnumMoniker **ppEnum,
DWORD dwFlags,
BOOL bExactMatch,
DWORD dwMerit,
BOOL bInputNeeded,
DWORD cInputTypes,
const GUID *pInputTypes,
const REGPINMEDIUM *pMedIn,
const CLSID *pPinCategoryIn,
BOOL bRender,
BOOL bOutputNeeded,
DWORD cOutputTypes,
const GUID *pOutputTypes,
const REGPINMEDIUM *pMedOut,
const CLSID *pPinCategoryOut,);
Returns S_OK if successful.
If a pin hasn't registered any media types, this method will not consider a match for the media type passed in for the pInputTypes or pOutputTypes parameters.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.