Selects or deselects one or more streams.
HRESULT SetStreamSelection( DWORD dwStreamIndex, BOOL fSelected );
The stream to set. The value can be any of the following.
Specify TRUE to select streams or FALSE to deselect streams. If a stream is deselected, it will not generate data.
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
There are two common uses for this method:
- To change the default stream selection. Some media files contain multiple streams of the same type. For example, a file might include audio streams for multiple languages. You can use this method to change which of the streams is selected. To get information about each stream, call IMFSourceReader::GetPresentationAttribute or IMFSourceReader::GetNativeMediaType.
- If you will not need data from one of the streams, it is a good idea to deselect that stream. If the stream is selected, the media source might hold onto a queue of unread data, and the queue might grow indefinitely, consuming memory.
Stream selection does not affect how the source reader loads or unloads decoders in memory. In particular, deselecting a stream does not force the source reader to unload the decoder for that stream.
This interface is available on Windows Vista if Platform Update Supplement for Windows Vista is installed.
|Minimum supported client||Windows 7, Windows Vista and Platform Update Supplement for Windows Vista [desktop apps | UWP apps]|
|Minimum supported server||Windows Server 2008 R2 [desktop apps | UWP apps]|