IMFSourceReader::SetStreamSelection method (mfreadwrite.h)
Selects or deselects one or more streams.
Syntax
HRESULT SetStreamSelection(
[in] DWORD dwStreamIndex,
[in] BOOL fSelected
);
Parameters
[in] dwStreamIndex
The stream to set. The value can be any of the following.
[in] fSelected
Specify TRUE to select streams or FALSE to deselect streams. If a stream is deselected, it will not generate data.
Return value
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Remarks
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.
If a stream is deselected, the IMFSourceReader::ReadSample method returns MF_E_INVALIDREQUEST for that stream. Other IMFSourceReader methods are valid for deselected streams.
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.
Requirements
Requirement | Value |
---|---|
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] |
Target Platform | Windows |
Header | mfreadwrite.h |