Microsoft DirectX 8.0

CEnumPins Class

CEnumPins class hierarchy

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
CEnumPinsConstructor method.
~CEnumPinsDestructor method. Virtual.
IEnumPins Methods
CloneMakes a copy of the enumerator with the same enumeration state.
NextRetrieves a specified number of pins.
ResetResets the enumeration sequence to the beginning.
SkipSkips over a specified number of pins.

CEnumPins::CEnumPins

CEnumPins Class

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.

CEnumPins::~CEnumPins

CEnumPins Class

Destructor method.

Syntax

virtual ~CEnumPins(void);

CEnumPins::Clone

CEnumPins Class

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_OKSuccess.
E_OUTOFMEMORYInsufficient memory.
E_POINTERNULL pointer argument.
VFW_E_ENUM_OUT_OF_SYNCThe filter's state has changed and is now inconsistent with the enumerator.

CEnumPins::Next

CEnumPins Class

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_FALSEDid not retrieve as many pins as requested.
S_OKSuccess.
E_INVALIDARGInvalid argument.
E_POINTERNULL pointer argument.
VFW_E_ENUM_OUT_OF_SYNCThe 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.

CEnumPins::Reset

CEnumPins Class

Resets the enumeration sequence to the beginning. Implements the IEnumPins::Reset method.

Syntax

HRESULT Reset(void);

Return Value

Returns S_OK.

CEnumPins::Skip

CEnumPins Class

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_FALSESkipped past the end of the sequence.
S_OKSuccess.
VFW_E_ENUM_OUT_OF_SYNCThe filter's state has changed and is now inconsistent with the enumerator.