IFilterMapper::RegisterFilter
A version of this page is also available for
4/8/2010
This method adds a filter to the registry; the filter can then be enumerated.
Syntax
HRESULT RegisterFilter(
CLSID clsid,
LPCWSTR Name,
DWORD dwMerit
);
Parameters
- clsid
[in] Globally unique identifier (GUID) of the filter.
- Name
[in] Descriptive name for the filter.
- dwMerit
[in] Position in the order of enumeration. Filters with higher merit are enumerated first.
Return Value
Returns an HRESULT value.
Remarks
The merit (as defined by the dwMerit parameter) controls the order in which the filter graph manager tries filters when performing an operation as a result of a call to IGraphBuilder::Connect, IGraphBuilder::Render, or IGraphBuilder::RenderFile. The filter graph manager finds all filters registered with the correct media type and then tries the one with the highest merit, using other criteria in the registration to choose between filters with equal merit.
The following predefined values exist for the dwMerit parameter. Other values, such as MERIT_NORMAL-1, can be used. Using the formula (MERIT_NORMAL+MERIT_UNLIKELY)/2 to calculate the merit value is advisable, because it leaves some low-order bits available for making even finer distinctions.
Value | Description |
---|---|
0x900000 |
Hardware renderer filter. Filters with this merit value are tried first. |
MERIT_PREFERRED (0x800000) |
Filter, such as a renderer, that is likely to complete the operation directly. |
0x680000 |
MPEG decompression filter. These are tried before AVI decompressors because the latter require more time to determine if they work in the filter graph. |
MERIT_NORMAL (0x600000) |
Filter that may contribute to the completion of a connection. AVI decompression filters and splitter transform filters are registered to this value. |
MERIT_UNLIKELY (0x400000) |
Filter that may contribute to the completion of a connection (a color space conversion filter, for example). The filter graph manager uses this filter only if other options have failed. Register source filters with this value. |
MERIT_DO_NOT_USE (0x200000) |
Filter that will never contribute to the completion of a connection. Filters registered with this value (or less) will never be tried by the filter graph manager when automatically building a filter graph. Use this to register filters that must be added explicitly, either as part of a predefined filter graph or by adding them using IFilterGraph::AddFilter. Examples include tee filters or effects filters. |
MERIT_HW_COMPRESSOR (0x100050) |
Hardware compressor filter. Filters registered with this value will never be tried by the filter graph manager when automatically building a filter graph. |
MERIT_SW_COMPRESSOR (0x100000) |
Software compressor filter. Filters registered with this value will never be tried by the filter graph manager when automatically building a filter graph. |
Requirements
Windows Embedded CE | Windows CE 2.12 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |
Note | Microsoft DirectShow applications and DirectShow filters have different include file and Library requirements For more information, see Setting Up the Build Environment, Version 2.12 requires DXPAK 1.0 or later |