IMFMediaSink::RemoveStreamSink method (mfidl.h)

Removes a stream sink from the media sink.

Syntax

HRESULT RemoveStreamSink(
  [in] DWORD dwStreamSinkIdentifier
);

Parameters

[in] dwStreamSinkIdentifier

Identifier of the stream to remove. The stream identifier is defined when you call IMFMediaSink::AddStreamSink to add the stream sink.

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.
E_INVALIDARG
This particular stream sink cannot be removed.
MF_E_INVALIDSTREAMNUMBER
The stream number is not valid.
MF_E_NOT_INITIALIZED
The media sink has not been initialized.
MF_E_SHUTDOWN
The media sink's Shutdown method has been called.
MF_E_STREAMSINKS_FIXED
This media sink has a fixed set of stream sinks. Stream sinks cannot be removed.

Remarks

After this method is called, the corresponding stream sink object is no longer valid. The IMFMediaSink::GetStreamSinkByIndex and IMFMediaSink::GetStreamSinkById methods will no longer return that stream sink. You can re-use the stream identifier if you add another stream (by calling AddStreamSink).

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.

In some cases, the media sink supports this method but does not allow every stream sink to be removed. (For example, it might not allow stream 0 to be removed.)

Requirements

Requirement Value
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