DMOTest

 

DMO Test Application File Format

This section describes the file format what is used by the DMOTest application. For information about how to create a test file, see Creating a Test File.

This section contains the following topics.

File Format Structure

The file format consists of a globally unique identifier (GUID) followed by a series of packets. Each packet contains data for the DMO to process. Some packets define a media type, other packets contain media samples. The file must have the following format.

  • The first 16 bytes of data contain the following GUID:

    {3A337620-9497-11D3-B30B-444553540000}

  • After the GUID, the file contains media-type packets and data packets. A media-type packet defines the media type for one input stream on the DMO. A data packet contains media samples for an input stream to process.
  • For each input stream, at least one media-type packet must appear before any data packets appear. Otherwise, the test application cannot set the input stream's media type, and the DMO will reject the data.
  • A stream can change media types by including another media-type packet. The new format applies to the subsequent data packets for that stream, until the next media-type packet.
  • Packets for different input streams can be interleaved. The test application does not assume that streams are ordered in any particular way.
  • A media-type packet does not need to be followed by any data packets.
  • The file is not required to have multiple streams, and a stream is not required to have multiple media-type packets.

The following illustration schematizes the file structure.

File Format Structure

Packet Header Description

Each packet starts with a packet header.

Packet headers enable the test application to determine a packet's type, length, and stream index.

Byte OffsetFieldSize (Bytes)
0–3Packet Length4
4–7Packet Type4
8–11Stream Index4
Packet Length (Unsigned Integer)
The number of bytes stored in the packet. For media-type packets, the length includes the optional format structure, which is appended to the end of the packet. For data packets, the length includes the length of the media sample.
Packet Type (Unsigned Integer)
This field contains an ANSI string, which does not include a terminating Null character. The string identifies the packet type.
  • Media-type packet: TYPE
  • Data packet: DATA
Stream Index (Unsigned Integer)
The index of an input stream on the DMO. For a media-type packet, the test application sets the stream's media type to the type specified by the packet. For a data packet, the application calls the DMO to process the packet's media sample. The stream index is zero-based.

Media-Type Packet Description

Media-type packets instruct the test application to set the media type on one of the DMO's input streams. For each input stream, the first packet must be a media-type packet. Otherwise, the DMO cannot decode the information contained in the data packets.

Byte OffsetFieldSize (Bytes)
0–11Packet Header12
12–15Reserved4
16–87Media Type Structure72
88–End of packetOptional Format StructureVariable
Packet Header
For a description of this field, see Packet Header Description.
Reserved (Unsigned Integer)
Must be zero.
Media Type Structure (DMO_MEDIA_TYPE)
This field defines the media type. For a description of the DMO_MEDIA_TYPE structure, refer to the Microsoft® DirectX® documentation. Structure members are stored in the order they are declared. The punk and pbFormat members must equal NULL (zero). If the cbFormat member is not zero, the format structure must be appended to the packet.
Optional Format Structure
If you include this field, specify the size of the field in the cbFormat member of the DMO_MEDIA_TYPE structure. If the cbFormat member is zero, the packet must not include this field. For more information, see the documentation for the DMO_MEDIA_TYPE structure.

Data Packet Description

Data packets contain media samples for the DMO to process. Each data packet also contains the sample's time stamp, duration, and associated flags.

Byte OffsetFieldSize (Bytes)
0–11Packet Header12
12–15Sample Flags4
16–23Sample Start Time8
24–31Sample Duration8
32–End of packetSample DataVariable
Packet Header
For a description of this field, see Packet Header Description.
Sample Flags
This field can have the same values as the dwFlags parameter of the IMediaObject::ProcessInput method. For more information, see the documentation for the IMediaObject interface.
Sample Start Time
This field can have the same values as the rtTimestamp parameter of the IMediaObject::ProcessInput method. For more information, see the documentation for the IMediaObject interface.
Sample Flags
This field can have the same values as the rtTimelength parameter of the IMediaObject::ProcessInput method. For more information, see the documentation for the IMediaObject interface.
Sample Data
The data in the sample, which is processed by DMO. The length of the sample data is equal to the length of the packet (given in the packet header) minus 32. Zero-length samples are invalid.