IMFMediaSink::AddStreamSink method

Adds a new stream sink to the media sink.

Syntax

HRESULT AddStreamSink(
  DWORD         dwStreamSinkIdentifier,
  IMFMediaType  *pMediaType,
  IMFStreamSink **ppStreamSink
);

Parameters

dwStreamSinkIdentifier

Identifier for the new stream. The value is arbitrary but must be unique.

pMediaType

Pointer to the IMFMediaType interface, specifying the media type for the stream. This parameter can be NULL.

ppStreamSink

Receives a pointer to the new stream sink's IMFStreamSink interface. The caller must release the interface.

Return Value

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

Return code Description
S_OK
The method succeeded.
MF_E_INVALIDSTREAMNUMBER
The specified stream identifier is not valid.
MF_E_SHUTDOWN
The media sink's Shutdown method has been called.
MF_E_STREAMSINK_EXISTS
There is already a stream sink with the same stream identifier.
MF_E_STREAMSINKS_FIXED
This media sink has a fixed set of stream sinks. New stream sinks cannot be added.

Remarks

Not all media sinks support this method. If the media sink does not support this method, the IMFMediaSink::GetCharacteristics method returns the MEDIASINK_FIXED_STREAMS flag.

If pMediaType is NULL, use the IMFMediaTypeHandler interface to set the media type. Call IMFStreamSink::GetMediaTypeHandler to get a pointer to the interface.

Requirements

   
Minimum supported client Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header mfidl.h
Library Mfuuid.lib

See Also

IMFMediaSink

Media Sinks