IMFSourceReader::SetStreamSelection Method

Selects or deselects one or more streams.

Syntax

public:
HRESULT SetStreamSelection(
         DWORD dwStreamIndex,
         BOOL fSelected
)  

Parameters

dwStreamIndex
Type: DWORD 

[in] The stream to set. The value can be any of the following.

fSelected
Type: BOOL 

[in] Specify TRUE to select streams or FALSE to deselect streams. If a stream is deselected, it will not generate data.

Return value

Type: HRESULT 

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Refer to Media Foundation return codes.

Remarks

There are two common uses for this method:

For an example of deselecting a stream, see Tutorial: Decoding Audio.

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

Header: Declared in mfreadwrite.h.