To Retrieve Media Samples with the Asynchronous Reader

[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.]

After you have received the WMT_OPENED status message in your implementation of IWMStatusCallback::OnStatus, you can begin receiving samples by calling IWMReader::Start. The asynchronous reader delivers samples to your implementation of IWMReaderCallback::OnSample. Samples are delivered in presentation-time order.

Start is an asynchronous call. It will return almost immediately and continue to run on separate threads. The asynchronous reader uses multiple threads when decoding content and delivering samples. When the end of the file is reached, the reader sends a WMT_EOF status message to your implementation of the OnStatus callback. When WMT_EOF is sent, the reader stops its own processing; you do not need to respond to WMT_EOF with a call to IWMReader::Stop.

IWMReader Interface

To Implement Reader Messages in the OnStatus Callback

To Implement the OnSample Callback