MF_TOPOLOGY_ENUMERATE_SOURCE_TYPES attribute

Specifies whether the topology loader enumerates the media types provided by the media source.

Data type

UINT32

Use one of the following values.

Value Meaning
FALSE
Do not enumerate the source media types.
TRUE
Enumerate the source media types.

 

Get/set

To get this attribute, call IMFAttributes::GetUINT32.

To set this attribute, call IMFAttributes::SetUINT32.

Applies to

IMFTopology

Remarks

Each stream on a media source can offer more than one media type. The list of types is enumerated through the IMFMediaTypeHandler interface on the stream descriptor.

The order in which the topology loader tries a media source's media types is controlled by two attributes:

If the MF_TOPOLOGY_ENUMERATE_SOURCE_TYPES attribute is FALSE or not set, the topology loader uses the stream's current media type. It does not enumerate the list of possible types. If the current media type is incompatible with the downstream topology node, and no combination of decoders/converters can be found, topology resolution fails.

If the MF_TOPOLOGY_ENUMERATE_SOURCE_TYPES attribute is TRUE, the topology loader enumerates the source's media types until it finds a compatible type. In that case, the exact order of operations depends on whether the MF_TOPONODE_CONNECT_METHOD attribute on the source node includes the MF_CONNECT_RESOLVE_INDEPENDENT_OUTPUTTYPES flag.

If MF_TOPOLOGY_ENUMERATE_SOURCE_TYPES is TRUE and the MF_CONNECT_RESOLVE_INDEPENDENT_OUTPUTTYPES flag is set, the topology loader exhausts each media type before moving to the next, as follows:

foreach media type T
    connect directly using T
    if failed, connect with converters using T
    if failed, connect with decoders using T

If MF_TOPOLOGY_ENUMERATE_SOURCE_TYPES is TRUE but MF_CONNECT_RESOLVE_INDEPENDENT_OUTPUTTYPES is not set, the topology loader tries a direct connection with each media type, then tries each media type with converters, and finally tries each media type with decoders:

foreach media type T
    connect directly using T
if failed,
    foreach media type T
        connect with converters using T
if failed
    foreach media type T
        connect with decoders using T

If MF_TOPOLOGY_ENUMERATE_SOURCE_TYPES is FALSE, the MF_CONNECT_RESOLVE_INDEPENDENT_OUTPUTTYPES flag is ignored.

The default value of MF_TOPOLOGY_ENUMERATE_SOURCE_TYPES is FALSE, for compatibility with existing applications.

The GUID constant for this attribute is exported from mfuuid.lib.

Example

Here is an example that illustrates the MF_CONNECT_RESOLVE_INDEPENDENT_OUTPUTTYPES flag. Assume the topology has the MF_TOPOLOGY_ENUMERATE_SOURCE_TYPES attribute set to TRUE.

The media source offers the following types:

  • T1, T2, T3

The media sink accepts the following types:

  • T3, T4

Case 1: The MF_CONNECT_RESOLVE_INDEPENDENT_OUTPUTTYPES flag is set.

  1. The topology loader tries a direct connection with T1. The sink rejects T1.
  2. The topology loader inserts a decoder that accepts T1 and outputs T4. The sink accepts T4.
  3. The final topology contains: media source → decoder → media sink.

Case 2: The flag is not set.

  1. The topology loader tries a direct connection with T1. The sink rejects T1.
  2. The topology loader tries a direct connection with T2. The sink rejects T2.
  3. The topology loader tries a direct connection with T3. The sink accepts T3.
  4. The final topology contains: media source → media sink.

Requirements

Requirement Value
Minimum supported client
Windows 7 [desktop apps only]
Minimum supported server
Windows Server 2008 R2 [desktop apps only]
Header
Mfidl.h

See also

Alphabetical List of Media Foundation Attributes

Topology Attributes