3.1.5.2 Fragment Request and Fragment Response

When a Fragment Request is sent to the server, the client MUST wait for a Fragment Response message to arrive. If the underlying transport returns an error, the client MUST enter the Final state. Processing makes use of the following variables:

Current Sample Start: The offset of the beginning of the current sample, in bytes. This value of Current Sample Start is initialized to 0.

Sparse Stream Notifications: A collection in which each entry contains two data points:

  • Stream Description Reference: A reference to the Stream Description data element for which a new fragment is available.

  • Timestamp: A 64-bit, unsigned integer that represents the timestamp of the new fragment.

If the underlying transport returns a Response that adheres to the syntax of the Fragment Response message, the message is processed to yield a Presentation Description, subject to the following processing rules:

  • The Fragment Description data element is using data in the FragmentMetadata field, as specified in section 2.2.4, subject to the field mapping rules that are specified in section 3.1.1.2.

  • The Sample Collection data element is populated by creating a Sample Description data element per instance of the TrunBoxPerSampleFields field, specified in section 2.2.4.5.

  • Each Sample Description data element is populated by using data in the FragmentMetadata field, as specified in section 2.2.4.5, subject to the field mapping rules that are specified in section 3.1.1.1.2.

After the population of the Fragment Description, the following rules MUST be applied:

  • If the FirstSampleFlags field of the Fragment Description is not set, the value of this field is set to the value of the DefaultSampleFlags field.

  • In each Fragment Description data element, the client MUST iterate through the Fragment Collection in order and apply the following rules for each Fragment Description data element:

    • If the current Sample Description data element is the first in the collection and the value of the SampleFlags field is not set, the value of the SampleFlags field is set to the value of the FirstSampleFlags field in the Fragment Description data element.

    • If the value of the SampleDuration field of the current Sample Description data element is not set, the value is set to the value of the DefaultSampleDuration field in the Fragment Description data element.

    • If the value of the SampleSize field of the current Sample Description data element is not set, the value is set to the value of the DefaultSampleSize field in the Fragment Description data element.

If the underlying transport returns a Response that does not adhere to the syntax of the Fragment Response message, the client MUST enter the Final state without yielding a Fragment Description data element and stop further processing of these rules.

If the Sparse Track Flag in the Stream Description data element that is used to generate the Fragment Request is true, the client MUST update the Last Downloaded Fragment field of the Stream Description by setting the Last Downloaded Timestamp value to match the timestamp of the Fragment Request.

The client MUST attempt to match the HTTP header [RFC2616] whose name matches the value of the Sparse Stream Pointer Header field, specified in section 3.1.1, to the syntax of the Sparse Stream Pointer message, specified in section 2.2.5. If a match is found, the following additional processing is performed:

  • For each SparseStreamFragment field in the Sparse Stream Pointer message, the client MUST perform the following operations:

    • Search the Stream Collection data element in the Active Presentation data element to locate the Stream Description whose Name field matches the SparseStreamName field.

      • If no match can be found or if the Sparse Stream Flag of the matching Stream Description data element is false, the client MUST enter the Final state without yielding a Fragment Description data element.

      • Compare the value of the SparseStreamTimeStamp field to the Last Downloaded Timestamp field of the Stream Description data element.

    • If the Last Downloaded Timestamp field is not set, or if the value of the SparseStreamTimeStamp field is greater than the Last Downloaded Timestamp field, add an entry to the Sparse Stream Notifications collection for which the Stream Description Reference field is set to the matching Stream Description, and the Timestamp field is set to the value of the SparseStreamTimeStamp field.

If the Sparse Stream Notifications collection is not empty, the client yields this collection to the higher layer in addition to the Fragment Description.

Show: