Microsoft DirectX 8.0 |
Enumerator for pins.
Declaration: Amfilter.h
This class implements the IEnumPins interface. It calls the following CBaseFilter methods:
If the filter dynamically creates or destroys pins, it increments the pin version whenever the pins change. If the version number changes, the enumerator object is no longer synchronized with the filter. Once the enumerator is out of sync, the methods in CEnumPins return VFW_E_ENUM_OUT_OF_SYNC. Call the Reset method to resynchronize the enumerator.
Public Methods | |
---|---|
CEnumPins | Constructor method. |
~CEnumPins | Destructor method. Virtual. |
IEnumPins Methods | |
Clone | Makes a copy of the enumerator with the same enumeration state. |
Next | Retrieves a specified number of pins. |
Reset | Resets the enumeration sequence to the beginning. |
Skip | Skips over a specified number of pins. |
Constructor method.
Syntax
CEnumPins( CBaseFilter *pFilter, CEnumPins *pEnumPins );
Parameters
- pFilter
- Pointer to the filter on which to enumerate the pins.
- pEnumPins
- Pointer to the IEnumPins interface of an enumerator to clone, or NULL.
Remarks
If pEnumPins is NULL, this method initializes the enumerator to the beginning of the enumeration sequence. Otherwise, it duplicates the internal state of the enumerator specified by pEnumPins.
Destructor method.
Syntax
virtual ~CEnumPins(void);
Makes a copy of the enumerator with the same enumeration state. Implements the IEnumPins::Clone method.
Syntax
HRESULT Clone( IEnumPins **ppEnum );
Parameters
- ppEnum
- Address of a variable that receives a pointer to the IEnumPins interface of the new enumerator.
Return Value
Returns one of the HRESULT values shown in the following table.
S_OK Success. E_OUTOFMEMORY Insufficient memory. E_POINTER NULL pointer argument. VFW_E_ENUM_OUT_OF_SYNC The filter's state has changed and is now inconsistent with the enumerator.
Retrieves a specified number of pins in the enumeration sequence. Implements the IEnumPins::Next method.
Syntax
HRESULT Next( ULONG cPins, IPin **ppPins, ULONG *pcFetched );
Parameters
- cPins
- Number of pins to retrieve.
- ppPins
- Array of size cPins that is filled with IPin pointers.
- pcFetched
- Pointer to a variable that receives the number of pins retrieved. Can be NULL if cPins is 1.
Return Value
Returns one of the HRESULT values shown in the following table.
S_FALSE Did not retrieve as many pins as requested. S_OK Success. E_INVALIDARG Invalid argument. E_POINTER NULL pointer argument. VFW_E_ENUM_OUT_OF_SYNC The filter's state has changed and is now inconsistent with the enumerator.
Remarks
This method retrieves pointers to the specified number of pins, starting at the current position in the enumeration, and places them in the specified array.
This method calls the filter's CBaseFilter::GetPin method to retrieve the pins.
If the method succeeds, the IPin pointers all have outstanding reference counts. Be sure to release them when you are done.
Resets the enumeration sequence to the beginning. Implements the IEnumPins::Reset method.
Syntax
HRESULT Reset(void);
Return Value
Returns S_OK.
Skips over a specified number of pins in the enumeration sequence. Implements the IEnumPins::Skip method.
Syntax
HRESULT Skip( ULONG cPins );
Parameters
- cPins
- Number of pins to skip.
Return Value
Returns one of the HRESULT values shown in the following table.
S_FALSE Skipped past the end of the sequence. S_OK Success. VFW_E_ENUM_OUT_OF_SYNC The filter's state has changed and is now inconsistent with the enumerator.