Export (0) Print
Expand All

IFilterMapper2::EnumMatchingFilters method

The EnumMatchingFilters method enumerates registered filters that meet specified requirements.

Syntax


HRESULT EnumMatchingFilters(
  [out]       IEnumMoniker **ppEnum,
  [in]        DWORD        dwFlags,
  [in]        BOOL         bExactMatch,
  [in]        DWORD        dwMerit,
  [in]        BOOL         bInputNeeded,
  [in]        DWORD        cInputTypes,
  [in]  const GUID         *pInputTypes,
  [in]  const REGPINMEDIUM *pMedIn,
  [in]  const CLSID        *pPinCategoryIn,
  [in]        BOOL         bRender,
  [in]        BOOL         bOutputNeeded,
  [in]        DWORD        cOutputTypes,
  [in]  const GUID         *pOutputTypes,
  [in]  const REGPINMEDIUM *pMedOut,
  [in]  const CLSID        *pPinCategoryOut
);

Parameters

ppEnum [out]

Receives a pointer to the IEnumMoniker interface. Use this interface pointer to retrieve filter monikers from the enumeration. The caller must release the interface.

dwFlags [in]

Reserved, must be zero.

bExactMatch [in]

Boolean value indicating whether an exact match is required. See Remarks for more information.

dwMerit [in]

Minimum merit value. The enumeration exludes filters with a lesser merit value. For a list of merit values, see Merit. If dwMerit is higher than MERIT_DO_NOT_USE, the enumeration also excludes filters whose category has a merit less than or equal to MERIT_DO_NOT_USE. (See Filter Categories.)

bInputNeeded [in]

Boolean value indicating whether the filter must have an input pin. If the value is TRUE, the filter must have at least one input pin.

cInputTypes [in]

Number of input media types specified in pInputTypes.

pInputTypes [in]

Pointer to an array of GUID pairs that specify major types and subtypes, for the input pins to match. The size of the array is 2 * cInputTypes. The array can be NULL. Individual array members can be GUID_NULL, which matches any type. (See Media Types.)

pMedIn [in]

Pointer to a REGPINMEDIUM structure specifying the medium for the input pins. Set to NULL if not needed.

pPinCategoryIn [in]

Pointer to a GUID that specifies the input pin category. (See Pin Property Set.) Set to NULL if not needed.

bRender [in]

Boolean value that specifies whether the filter must render its input. If TRUE, the specified filter must render its input. (This value corresponds to the bRendered field in the REGFILTERPINS structure, which is used to register information about the filter's pins.)

bOutputNeeded [in]

Boolean value specifying whether the filter must have an output pin. If TRUE, the filter must have at least one output pin.

cOutputTypes [in]

Number of input media types specified in pOutputTypes.

pOutputTypes [in]

Pointer to an array of GUID pairs that specify major types and subtypes, for the output pins to match. The size of the array is 2 * cOutputTypes. The array can be NULL. Individual array members can be GUID_NULL, which matches any type.

pMedOut [in]

Pointer to a REGPINMEDIUM structure specifying the medium for the output pins. Set to NULL if not needed.

pPinCategoryOut [in]

Pointer to a GUID that specifies the output pin category. (See Pin Property Set.) Set to NULL if not needed.

Return value

Returns an HRESULT value. Possible values include those shown in the following table.

Return codeDescription
S_OK

Success

E_FAIL

Failure

E_OUTOFMEMORY

Insufficient memory

E_POINTER

NULL pointer argument

 

Remarks

To find filters whose input pins match a given set of media types, declare an array with major-type GUIDs and subtype GUIDs ordered in pairs. Pass the array address in the pInputTypes parameter, and set the cInputTypes parameter equal to the number of pairs (that is, half the array size):



GUID arrayInTypes[2];
arrayInTypes[0] = MEDIATYPE_Video;
arrayInTypes[1] = GUID_NULL;

DWORD cInTypes = 1;


For output pins, pass a similar array in the pOutputTypes parameter, and specify the number of GUID pairs in the cOutputTypes parameter.

If the value of the bExactMatch parameter is TRUE, this method looks for filters that exactly match the values you specify for media type, pin category, and pin medium. If the value is FALSE, filters that register a value of NULL for any of these items are considered a match. (In effect, a NULL value in the registry acts as a wildcard.)

If you specify NULL for media type, pin category, or pin medium, any filter is considered a match for that parameter.

If a pin did not register any media types, this method will not consider it a match for the media type.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Strmif.h (include Dshow.h)

Library

Strmiids.lib

See also

Error and Success Codes
IFilterMapper2 Interface

 

 

Community Additions

ADD
Show:
© 2015 Microsoft