Reading ASF Files

The Windows Media Format SDK can be used to deliver media samples from an ASF file. Two objects are used to retrieve samples, the reader object and the synchronous reader object.

The reader object is the original reading object in the Windows Media Format SDK. The reader object uses an asynchronous architecture to push samples to an application. Applications built using the reader object must implement callback functions that respond to the various messages and events that result from this multi-threaded model. For clarity, this section will refer to the reader object as the asynchronous reader.

The synchronous reader object is new for this version of the Windows Media Format SDK. The synchronous reader does not use multiple threads in processing samples from ASF files. An application built using the synchronous reader retrieves samples on demand, rather than waiting for the reader to send them.

When creating an application to read ASF files, you must choose which reader object to use. In general, applications designed to deliver Windows Media-based content should be created using the asynchronous reader, while applications designed to edit ASF files should be created with the synchronous reader.

The following table lists the major features of both reader objects. Use this table to help determine which object to use for your application.

Feature Async reader Sync reader
Read uncompressed samples by output numberYesYes
Read compressed samples by stream numberYesYes
Read uncompressed samples by stream numberNoYes
Read from Internet siteYesNo
Read metadataYesYes
Seek to presentation timeYesYes
Seek to frameYesYes
Seek to markerYesNo
Switch between compressed and uncompressed sample delivery during playbackNoYes
Open files using IStream interfaceYesYes

 

The following sections provide more information about working with the two reader objects.

Section Description
Working with Outputs Describes how to use and manipulate outputs. Applies to both reader objects.
Allocating Buffers for File Reading Describes how to use your own pool of buffers to hold samples delivered by the reader or synchronous reader.
Reading Metadata at Playback Describes how to take advantage of metadata support at playback. Applies to both reader objects.
Getting Profile Information at Playback Describes how to access profile information for opened files. Applies to both reader objects.
Reading Multichannel Audio Describes how to configure the writer to properly decode multichannel audio.
Rendering Content Discusses the issues related to rendering uncompressed samples. Applies to both reader objects.
Getting the Best Video Seeking Performance Describes ways to improve video seeking performance.
Reading Files with the Asynchronous Reader Describes how to read ASF files using the asynchronous reader object.
Reading Files with the Synchronous Reader Describes how to read ASF files using the synchronous reader object.
Enabling DirectX Video Acceleration Describes how to implement DirectX Video Acceleration to use the hardware acceleration features of some video cards for decoding video.

 

Related topics

Programming Guide
Reader Object
Synchronous Reader Object

 

 

Show: