Export (0) Print
Expand All

IMFMediaSink::AddStreamSink method

Adds a new stream sink to the media sink.

Syntax


HRESULT AddStreamSink(
  [in]   DWORD dwStreamSinkIdentifier,
  [in]   IMFMediaType *pMediaType,
  [out]  IMFStreamSink **ppStreamSink
);

Parameters

dwStreamSinkIdentifier [in]

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

pMediaType [in]

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

ppStreamSink [out]

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 codeDescription
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 | Windows Store apps]

Minimum supported server

Windows Server 2008 [desktop apps | Windows Store apps]

Header

Mfidl.h

Library

Mfuuid.lib

See also

IMFMediaSink
Media Sinks

 

 

Community Additions

ADD
Show:
© 2014 Microsoft