MFCreateAggregateSource function
Creates a media source that aggregates a collection of media sources.
Syntax
HRESULT MFCreateAggregateSource( _In_ IMFCollection *pSourceCollection, _Out_ IMFMediaSource **ppAggSource );
Parameters
- pSourceCollection [in]
-
A pointer to the IMFCollection interface of the collection object that contains a list of media sources.
- ppAggSource [out]
-
Receives a pointer to the IMFMediaSource interface of the aggregated media source. The caller must release the interface.
Return value
The function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
| Return code | Description |
|---|---|
|
The method succeeded. |
|
The pSourceCollection collection does not contain any elements. |
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.
Examples
HRESULT CreateAggregatedSource(
IMFMediaSource *pSource1,
IMFMediaSource *pSource2,
IMFMediaSource **ppAggSource
)
{
*ppAggSource = NULL;
IMFCollection *pCollection = NULL;
HRESULT hr = MFCreateCollection(&pCollection);
if (SUCCEEDED(hr))
{
hr = pCollection->AddElement(pSource1);
}
if (SUCCEEDED(hr))
{
hr = pCollection->AddElement(pSource2);
}
if (SUCCEEDED(hr))
{
hr = MFCreateAggregateSource(pCollection, ppAggSource);
}
SafeRelease(&pCollection);
return hr;
}
Requirements
|
Minimum supported client |
Windows 7 [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server |
Windows Server 2008 R2 [desktop apps | Windows Store apps] |
|
Minimum supported phone |
Windows Phone 8.1 |
|
Header |
|
|
Library |
|
|
DLL |
|
See also