IEnumMediaTypes::Next method (strmif.h)

The Next method retrieves a specified number of media types.

Syntax

HRESULT Next(
  ULONG         cMediaTypes,
  AM_MEDIA_TYPE **ppMediaTypes,
  ULONG         *pcFetched
);

Parameters

cMediaTypes

The number of media types to retrieve.

ppMediaTypes

The address of an array of AM_MEDIA_TYPE pointers. The number of elements in the array is given in the cMediaTypes parameter.

pcFetched

Receives the number of media types returned in ppMediaTypes. This parameter can be NULL if cMediaTypes is 1.

Return value

Returns one of the following HRESULT values.

Return code Description
S_FALSE
Did not retrieve as many media types as requested.
S_OK
Success.
E_INVALIDARG
Invalid argument.
E_POINTER
NULL pointer argument.
VFW_E_ENUM_OUT_OF_SYNC
The pin's state has changed and is now inconsistent with the enumerator.

Remarks

The caller passes an array of AM_MEDIA_TYPE pointers in ppMediaTypes. The method allocates a number AM_MEDIA_TYPE structures equal to cMediaTypes or to the number of media types that remain in the enumeration, whichever is less. The number of structures allocated is returned in pcFetched. Delete each structure by calling the DeleteMediaType function.

If the set of media types changes, the enumerator becomes inconsistent with the owning pin. In that case, 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 IEnumMediaTypes::Reset method. You can then call the Next method safely.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header strmif.h (include Dshow.h)
Library Strmiids.lib

See also

Enumerating Media Types

Error and Success Codes

IEnumMediaTypes Interface