Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[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.]
Microsoft DirectShow supports Web streams (see Web Streams for more information) in file playback scenarios through the WM ASF Reader filter, but you must write your own DirectShow filter to capture and persist the stream.
Note
To play back Web streams in content that is being streamed from a server running Windows Media Services, use the Windows Media Player 9 Series ActiveX® control embedded in a Web page.
When given a file containing streams of type WMMEDIATYPE_FileTransfer, the WM ASF Reader will create an output pin for it. The format block will be a WMT_WEBSTREAM_FORMAT structure. If no downstream filter is available that can handle that media type, then the pin will remain unconnected, but the file will still play the audio and/or video streams.
It is important to understand that each media sample in a Web stream contains a WMT_WEBSTREAM_SAMPLE_HEADER structure, which has a variable length depending on the length of its wszURL member. The pointer to the sample data initially points to this structure, and you must advance the pointer past the structure in order to access the actual data in the stream. Your Web stream handler filter should be based on the CBaseRenderer class. In the DoRenderSample method, the filter will need to parse the structure for information about the Web stream, and then perform the appropriate action. Typically, this will involve saving the file to disk, and then calling CommitUrlCacheEntry and CreateUrlCacheEntry to place the files into the Internet Explorer cache. The filter must handle multipart files, that is, files that are larger than one sample, and also must handle render commands, which are specified by the WMT_WEBSTREAM_SAMPLE_HEADER.wSampleType member. The filter sends an EC_OLE_EVENT to the application, along with the text of the WMT_WEBSTREAM_SAMPLE_HEADER.wszURL string which contains the name of the file to be rendered. The application then causes the browser to display the specified page. If the Web stream has been authored correctly, the file should already be in the cache.
For more information on CBaseRenderer, DoRenderSample, and EC_OLE_EVENT, see the DirectShow SDK documentation.
Related topics