Share via


IWMReaderCallbackAdvanced::OnStreamSelection method (wmsdkidl.h)

[The feature associated with this page, Windows Media Format 11 SDK, is a legacy feature. It has been superseded by Source Reader and Sink Writer. Source Reader and Sink Writer have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use Source Reader and Sink Writer instead of Windows Media Format 11 SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The OnStreamSelection method notifies the application of stream changes made due to bandwidth restrictions. To have this method called, call IWMReaderAdvanced::SetReceiveSelectionCallbacks.

Syntax

HRESULT OnStreamSelection(
  [in] WORD                 wStreamCount,
  [in] WORD                 *pStreamNumbers,
  [in] WMT_STREAM_SELECTION *pSelections,
  [in] void                 *pvContext
);

Parameters

[in] wStreamCount

WORD containing the number of entries in the pStreamNumbers array.

[in] pStreamNumbers

Pointer to an array of stream numbers.

[in] pSelections

Pointer to an array of members of the WMT_STREAM_SELECTION enumeration type. Each element in this array corresponds to the stream number contained in the corresponding element of the array pointed to by pStreamNumbers.

[in] pvContext

Generic pointer, for use by the application. This pointer is the context pointer given to the IWMReader::Start method.

Return value

To use this method, you must implement it in your application. You can return whatever HRESULT error codes are appropriate to your implementation. For more information about the HRESULT error codes included for use by the Windows Media Format SDK, see Error Codes.

Remarks

Stream numbers are in the range of 1 through 63.

The application can also get callbacks when stream changes due to bandwidth restrictions occur.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only],Windows Media Format 7 SDK, or later versions of the SDK
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header wmsdkidl.h (include Wmsdk.h)

See also

IWMReaderCallbackAdvanced Interface