Microsoft DirectX 8.0

IEnumFilters Interface

The IFilterGraph::EnumFilters method returns this interface, which provides access to a standard Component Object Model (COM) collection object that contains the filters currently in the filter graph. For more information on COM collections, see the IEnumXXXX topic in the Platform SDK. For more information on enumerating filters, see Enumerating Objects in a Filter Graph.

If the set of filters in the graph changes, some methods on this interface return VFW_E_ENUM_OUT_OF_SYNC. Call the Reset method to resynchronize the enumerator.

Methods in Vtable Order

IUnknown methodsDescription
QueryInterface Retrieves pointers to supported interfaces.
AddRef Increments the reference count.
Release Decrements the reference count.
IEnumFilters methodsDescription
Next Retrieves the specified number of filters in the enumeration sequence.
Skip Skips over a specified number of filters.
Reset Resets the enumeration sequence to the beginning.
Clone Makes a copy of the enumerator with the same enumeration state.

IEnumFilters::Clone

IEnumFilters Interface

Makes a copy of the enumerator with the same enumeration state.

Syntax

HRESULT Clone(
    IEnumFilters **ppEnum
);

Parameters

ppEnum
[out] Address of a variable that receives a pointer to the IEnumFilters interface of the new enumerator.

Return Value

Returns one of the following HRESULT values.

S_OKSuccess.
E_OUTOFMEMORYInsufficient memory.
E_POINTERNULL pointer argument.

IEnumFilters::Next

IEnumFilters Interface

Retrieves the specified number of filters in the enumeration sequence.

Syntax

HRESULT Next(
    ULONG cFilters,
    IBaseFilter **ppFilter,
    ULONG *pcFetched
);

Parameters

cFilters
[in] Number of filters to retrieve.
ppFilter
[out] Array of size cFilters that is filled with IBaseFilter pointers.
pcFetched
[out] Pointer to a variable that receives the number of filters retrieved. Can be NULL if cFilters is 1.

Return Value

Returns one of the following HRESULT values.

S_FALSEDid not retrieve as many filters as requested.
S_OK Success.
E_INVALIDARGInvalid argument.
E_POINTERNull pointer argument.
VFW_E_ENUM_OUT_OF_SYNCThe graph has changed and is now inconsistent with the enumerator.

Remarks

If the method succeeds, the IBaseFilter pointers all have outstanding reference counts. Be sure to release them when you are done.

If the filter graph changes (for example, the application removes a filter), the enumerator is no longer be consistent with the graph, and the method returns VFW_E_ENUM_OUT_OF_SYNC. Discard any data obtained from previous calls to the enumerator, because it might be invalid. Update the enumerator by calling the Reset method. You can then call the Next method safely.

IEnumFilters::Reset

IEnumFilters Interface

Resets the enumeration sequence to the beginning.

Syntax

HRESULT Reset(void);

Return Value

Returns S_OK, which indicates success.

IEnumFilters::Skip

IEnumFilters Interface

Skips over a specified number of filters.

Syntax

HRESULT Skip(
    ULONG cFilter
);

Parameters

cFilter
[in] Number of filters to skip.

Return Value

Returns one of the following HRESULT values.

S_FALSESkipped past the end of the sequence.
S_OKSuccess.
VFW_E_ENUM_OUT_OF_SYNCThe graph has changed and is now inconsistent with the enumerator.

Remarks

If the filter graph changes (for example, the application removes a filter), the enumerator is no longer be consistent with the graph, and the method returns VFW_E_ENUM_OUT_OF_SYNC. Discard any data obtained from previous calls to the enumerator, because it might be invalid. Update the enumerator by calling the Reset method. You can then call the Skip method safely.