CEnumMediaTypes Class
A version of this page is also available for
4/8/2010
This class provides the mechanism for enumerating the pin's preferred media types.
Its constructor must be passed to an object from a class derived from CBasePin.
It uses the virtual member function GetMediaType to retrieve each of the media types in turn.
It also uses the pin's CBasePin::GetMediaTypeVersion member function to determine if the number or type of media types has changed.
The base pin class does not support dynamic media type changes. CBaseFilter::GetPinVersion always returns the same value, for example.
The media type enumerator must fill in a list of pointers to media type structures.
The memory for those media type structures must be released by the callers when they have finished with it.
The memory must not be allocated from any language-specific heap; otherwise, problems might occur between a filter written in C and another written in C++. For this reason, the base classes provide generic functions (not member functions of a class) to create and delete media types: CreateMediaType and DeleteMediaType. These manage memory allocation from the task allocator.
All member functions in this class that return HRESULT and accept a pointer as a parameter return E_POINTER when passed a null pointer.
Member Functions
Member function | Description |
---|---|
Constructs a CEnumMediaTypes object. |
Implemented IUnknown Methods
Method | Description |
---|---|
Increments the reference count. |
|
Retrieves pointers to supported interfaces. |
|
Decrements the reference count. |
Implemented IEnumMediaTypes Methods
Method | Description |
---|---|
Creates a duplicate CEnumMediaTypes object with the same state. |
|
Returns the next media type after the current position. |
|
Sets the current position back to the beginning. |
|
Skips over one or more entries in the enumerator. |
Requirements
Windows Embedded CE | Windows CE 2.12 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |
Note | Microsoft DirectShow applications and DirectShow filters have different include file and Library requirements For more information, see Setting Up the Build Environment |