2.2.2 Data

The Data packet is used by the server to send streaming media data to the client.

The ASF file header consists of the entire ASF Header Object (as specified in [ASF] section 3.1) plus the 50-byte fixed initial portion of the ASF Data Object (as specified in [ASF] section 5.1).

Data packets are sent over either UDP or TCP, depending on which transport mode the server and the client agree on.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

LocationId

playIncarnation

AFFlags

PacketSize

Payload (variable)

...

LocationId (4 bytes): A 32-bit integer field that specifies the index of the Payload field into the complete object being transferred. If the Payload field contains an ASF file header, LocationId MUST be 0x00000000 for the first payload, and MUST increment by 1 for each payload. If the Payload field contains a packet-pair packet, LocationId MUST be 0xF0F0F000 for the first packet-pair packet, and 0xF0F0F001 for the second packet-pair packet. If the payload contains an ASF data packet, the entire ASF file is considered the object that is being transferred. Thus, for payloads containing an ASF data packet, this field MUST be set to the payload's ASF data packet number. The first ASF data packet in an ASF file MUST have a LocationId of 0x00000000, the second ASF data packet in the file MUST have a LocationId of 0x00000001, and so on. Note that because a server can skip ASF data packets, the value of the LocationId field might not be sequential from one MMS Data packet to the next. If the server does not have access to the ASF file (for example, in the case of live content), the server MUST assume a virtual ASF file, incrementing LocationId (or decrementing it when rewinding the content) exactly as if a real ASF file existed.

playIncarnation (1 byte): An 8-bit field that is set to the least significant 8 bits of the MMS message (see section 2.2.4) that triggered the server to send this Data packet. The value 0x00 is reserved and MUST NOT be used. The value 0xFF MUST be used if the Data packet contains a packet-pair packet.

AFFlags (1 byte): An 8-bit integer field. When the Payload field contains an ASF data packet, the field MUST be treated as a sequence number. The initial value MUST be 0x00, and it MUST increment by 1 for each ASF data packet that is transmitted. If the most recently transmitted Data packet has an AFFlags field value of 0xFE, and the server receives a LinkViewerToMacStartPlaying (section 2.2.4.25) message or a LinkViewerToMacStartStriding (section 2.2.4.26) message, the first Data packet transmitted in response SHOULD have the AFFlags field set to 0x00. When the Payload field contains an ASF file header, the AFFlags field MUST be set to 0x04 if the ASF file header is split into multiple Data packets. AFFlags MUST be set to 0x0C if this is the last Data packet in the sequence. If the Payload field contains a packet-pair packet, AFFlags MUST be set to 0x10.

PacketSize (2 bytes): A 16-bit integer field. MUST be set to the total size of the Data packet in bytes.

Payload (variable): A variable size block of bytes. The content of this field is either an ASF data packet, an ASF file header, or a packet-pair packet, depending on the circumstances under which the Data packet is transmitted. If the Payload field contains an ASF data packet, and if the ASF packet contains a Padding Data field, as specified in [ASF] section 5.2.4, the Padding Data field SHOULD be removed before encapsulating the ASF data packet in the MMS Data packet, except if the client identified itself as Windows Media Services version 4.0 or 4.1 in the LinkViewerToMacConnect (section 2.2.4.17) message. If the Padding Data field is removed, the Padding Length field in the ASF payload parsing information (as specified in [ASF] section 5.2.2) MUST be updated to indicate a non-existent Padding Data field.