Media Foundation Attributes for ASF Header Objects
The top-level ASF Header Object for a file contains several ASF sub-header objects. The ContentInfo object stores information from all of these Header Objects and exposes certain values to an application through attributes.
This header object is present in all ASF files. These fields describe the file-level attributes of the entire presentation. The following table lists the fields in the File Properties Object and the corresponding presentation descriptor attributes.
|File Properties Object field||Presentation descriptor attribute||Description|
|File ID||MF_PD_ASF_FILEPROPERTIES_FILE_ID||Unique identifier for this file.|
|File Size||MF_PD_TOTAL_FILE_SIZE||Size of the file, in bytes.|
|Creation Date||MF_PD_ASF_FILEPROPERTIES_CREATION_TIME||The file creation date and time.|
|Data Packets Count||MF_PD_ASF_FILEPROPERTIES_PACKETS||Number of data packets in the ASF Data Object.|
|Play Duration||MF_PD_ASF_FILEPROPERTIES_PLAY_DURATION||Time required to play the file, in 100-nanosecond units. This value includes the preroll time.|
|Send Duration||MF_PD_ASF_FILEPROPERTIES_SEND_DURATION||Time required to send the file, in 100-nanosecond units.|
|Preroll||MF_PD_ASF_FILEPROPERTIES_PREROLL||Length of time to buffer data before the playing the file, in 100-nanosecond units.|
|Flags||MF_PD_ASF_FILEPROPERTIES_FLAGS||Flags indicating whether the file is broadcast or seekable.|
|Minimum Data Packet Size||MF_PD_ASF_FILEPROPERTIES_MIN_PACKET_SIZE||Minimum size of the data packets in the file, in bytes.|
|Maximum Data Packet Size||MF_PD_ASF_FILEPROPERTIES_MAX_PACKET_SIZE||Maximum size of the data packets in the file, in bytes.|
|Maximum Bitrate||MF_PD_ASF_FILEPROPERTIES_MAX_BITRATE||Maximum instantaneous bit rate, in bits per second.|
This header object describes the properties of the streams in the ASF file. In Media Foundation, this is managed by the profile object and the stream configuration object. For more information, see Creating and Configuring ASF Streams.
If this header object is present, the MF_PD_ASF_CODECLIST attribute provides a list of codecs that were used to encode the streams within the ASF file. Each stream should have its codec information in this object.
If this header object is present, it specifies a list of script commands that are supported in the ASF file. A script command consists of a command type, a command name, and a presentation time. The command type and command name are wide-character strings. These commands can be used to notify the client to perform an action at a certain point in the presentation. For example, an application can use the command type "FILENAME" to play a continuous sequence of ASF files.
To get the list of script commands, get the MF_PD_ASF_SCRIPT attribute from the presentation descriptor. An application should retrieve all of the script commands before starting playback.
A marker is a bookmark within an ASF file. An application can use markers to seek to various points within the content. Each marker consists of a marker name, the associated presentation time, and the offset from the start of the file. The MF_PD_ASF_MARKER attribute provides a list of markers that are available for the file.
This header stores the average bit rate of each stream present in the ASF file. This value is stored on the stream descriptor for the stream in the MF_SD_ASF_STREAMBITRATES_BITRATE attribute.
This header object is present if the content provider has protected the content by using Microsoft Digital Rights Management. The following table lists the fields in the Content Encryption Object and the corresponding presentation descriptor attributes:
|Content Encryption Object field||Presentation descriptor attribute||Description|
|Secret Data||MF_PD_ASF_CONTENTENCRYPTION_SECRET_DATA||Byte array containing secret data.|
|Protection Type||MF_PD_ASF_CONTENTENCRYPTION_TYPE||Null-terminated string that has value "DRM".|
|Key ID||MF_PD_ASF_CONTENTENCRYPTION_KEYID||Null-terminated string that describes the key identifier.|
|License URL||MF_PD_ASF_CONTENTENCRYPTION_LICENSE_URL||Null-terminated string that contains the URL from which to acquire the license to use the content.|
This header object is present if the content provider has protected the content by using the Windows Media Rights Manager 7 SDK. The MF_PD_ASF_CONTENTENCRYPTION_LICENSE_URL attribute provides a byte array that corresponds to the Data field of the header object. This field is required to use the content.
This header is part of the Header Extension Object. The Extended Stream Properties Object provides properties of the stream that are not defined in the Stream Properties Object. These properties are used mainly to determine the "leaky bucket" parameters, which are used by the decoder. These properties are also used by the encoder when compressing data. This is managed by the profile object and the stream configuration object. For more information, see Creating and Configuring ASF Streams.
The following table lists the Extended Stream Properties Object fields and the corresponding stream descriptor attributes.
|Extended Stream Properties field||Stream descriptor attribute||Description|
|Data Bitrate||MF_SD_ASF_EXTSTRMPROP_AVG_DATA_BITRATE||Average data rate, in bits per second.|
|Buffer Size||MF_SD_ASF_EXTSTRMPROP_AVG_BUFFERSIZE||Leaky bucket size. Value is the number of milliseconds of data that can fit in the buffer at the average data rate.|
|Alternate Data Bitrate||MF_SD_ASF_EXTSTRMPROP_MAX_DATA_BITRATE||Peak data rate, in bites per second. The peak data rate is used for streams with a variable bit rate.|
|Alternate Buffer Size||MF_SD_ASF_EXTSTRMPROP_MAX_BUFFERSIZE||Maximum leaky bucket size. Value is the number of milliseconds of data that can fit in the buffer at the peak data rate.|
|Stream Language ID||MF_SD_ASF_EXTSTRMPROP_LANGUAGE_ID_INDEX||The language that the stream uses, specified as an index into the list of languages in the Language List Object.|
This header object is part of the Header Extension Object. If present, the MF_PD_ASF_LANGLIST attribute provides a list of language identifiers that are supported in the file. The identifiers are compliant with RFC 1766 for specifying languages.
This header specifies groups of streams and their properties, only one of which will be delivered at a time. For more information, see Using Mutual Exclusion for ASF Streams.