IMFPMediaItem::SetStreamSink method (mfplay.h)
Sets a media sink for the media item. A media sink is an object that consumes the data from one or more streams.
HRESULT SetStreamSink( [in] DWORD dwStreamIndex, [in] IUnknown *pMediaSink );
Zero-based index of a stream on the media source. The media sink will receive the data from this stream.
IUnknown pointer that specifies the media sink. Pass in one of the following:
- A pointer to a stream sink. Every media sink contains one or more stream sinks. Each stream sink receives the data from one stream. The stream sink must expose the IMFStreamSink interface.
- A pointer to an activation object that creates the media sink. The activation object must expose the IMFActivate interface. The media item uses the first stream sink on the media sink (that is, the stream sink at index 0).
- NULL. If you set pMediaSink to NULL, the default media sink for the stream type is used.
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
By default, the MFPlay player object renders audio streams to the Streaming Audio Renderer (SAR) and video streams to the Enhanced Video Renderer (EVR). You can use the SetStreamSink method to provide a different media sink for an audio or video stream; or to support other stream types besides audio and video. You can also use it to configure the SAR or EVR before they are used.
Call this method before calling IMFPMediaPlayer::SetMediaItem. Calling this method after SetMediaItem has no effect, unless you stop playback and call SetMediaItem again.
To reset the media item to use the default media sink, set pMediaSink to NULL.
|Minimum supported client||Windows 7 [desktop apps only]|
|Minimum supported server||Windows Server 2008 R2 [desktop apps only]|