To Use Writer Postview
[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 writer object provides postviewing capabilities so that you can verify written content without having to set up the reader object. The writer object does not support postviewing for audio content.
The writer postviewer works in much the same way as the asynchronous reader object, only with fewer features. For detailed information about reading digital media, see Reading ASF Files.
To implement the postviewer, perform the following steps.
- Implement the IWMWriterPostViewCallback::OnPostViewSample callback. This method is essentially the same as IWMReaderCallback::OnSample except that it specifies stream numbers instead of outputs.
- Set up for writing as usual.
- Obtain a pointer to the IWMWriterPostView interface of the writer object by calling IWMWriter::QueryInterface.
- Set the callback for the postviewer to use by calling IWMWriterPostView::SetPostViewCallback.
- For each stream for which you want to receive postview samples, call IWMWriterPostView::SetReceivePostViewSamples. You can check to see whether a stream is set to receive postview samples by calling IWMWriterPostView::GetReceivePostViewSamples.
- You can manipulate the sample formats, just like you would the output formats in the reader object or synchronous reader object.
- When you start writing the file, you will begin to receive samples in your implementation of the OnPostViewSample callback method.
Related topics