Microsoft DirectX 8.0 |
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 methods Description QueryInterface Retrieves pointers to supported interfaces. AddRef Increments the reference count. Release Decrements the reference count. IEnumFilters methods Description 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.
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_OK Success. E_OUTOFMEMORY Insufficient memory. E_POINTER NULL pointer argument.
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_FALSE Did not retrieve as many filters as requested. S_OK Success. E_INVALIDARG Invalid argument. E_POINTER Null pointer argument. VFW_E_ENUM_OUT_OF_SYNC The 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.
Resets the enumeration sequence to the beginning.
Syntax
HRESULT Reset(void);
Return Value
Returns S_OK, which indicates success.
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_FALSE Skipped past the end of the sequence. S_OK Success. VFW_E_ENUM_OUT_OF_SYNC The 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.