MFCreateAggregateSource

Creates a media source that aggregates a collection of media sources.

Syntax

HRESULT MFCreateAggregateSource(
         IMFCollection *pSourceCollection,
         _Outptr_ IMFMediaSource **ppAggSource
)  

Parameters

pSourceCollection
Type: IMFCollection *

A pointer to the IMFCollection interface of the collection object that contains a list of media sources.

ppAggSource
Type: Outptr IMFMediaSource **

Receives a pointer to the IMFMediaSource interface of the aggregated media source. The caller must release the interface.

Return value

Type: HRESULT 

The function returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return codes
Return code Description
S_OK The method succeeded.
E_INVALIDARG The pSourceCollection collection does not contain any elements.

Refer to Media Foundation return codes.

Remarks

The aggregated media source is useful for combining streams from separate media sources. For example, you can use it to combine a video capture source and an audio capture source.

Requirements

Header: Declared in mfidl.h.

Library: Use mf.lib.