Segment types as delimiters and addressable resource identifiers
An example device for processing media data is configured to parse a bitstream including the media data, the bitstream being formatted according to Common Media Application Format (CMAF), detect, during the parsing, a file type (FTYP) value for a CMAF track file of the bitstream, determine that a CMAF header of the CMAF track file starts with the FTYP value, and process one or more CMAF fragments following the CMAF header of the CMAF track file. The device may additionally be configured to detect one or more segment type (STYP) values in the bitstream, determine that each of the one or more STYP values corresponds to a start of a respective one of the CMAF fragments, and process each of the CMAF fragments starting from the corresponding STYP value.
1. A method of processing media data, the method comprising:
parsing, by a processor implemented in circuitry, a bitstream including data formatted according to Common Media Application Format (CMAF);
detecting, by the processor and during the parsing, a file type (FTYP) value for a CMAF track file of the bitstream;
determining, by the processor, that a CMAF header of the CMAF track file starts with the FTYP value; and
processing, by the processor, one or more CMAF fragments following the CMAF header of the CMAF track file, wherein processing the one or more CMAF fragments comprises:
detecting one or more segment type (STYP) values in the bitstream;
determining that each of the one or more STYP values corresponds to a start of a respective one of the CMAF fragments;
determining that at least one of the STYP values comprises a value indicating presence of a first sample of the respective one of the CMAF fragments; and
processing each of the CMAF fragments starting from the corresponding STYP value, comprising, in response to determining that the at least one of the STYP values comprises the value indicating the presence of the first sample of the respective one of the CMAF fragments, processing data of the bitstream following the at least one of the STYP values as corresponding to samples of the corresponding one of the CMAF fragments.
2. The method of claim 1 , wherein determining that at least one of the STYP values comprises a value indicating presence of a first sample of the respective one of the CMAF fragments comprises determining that the at least one of the STYP values has a value of “cmff”.
3. The method of claim 1 , further comprising:
determining that at least one of the STYP values for a corresponding one of the CMAF fragments has a value indicating that the corresponding one of the CMAF fragments includes a CMAF chunk; and
processing the CMAF chunk in response to determining that the at least one of the STYP values has the value indicating that the corresponding one of the CMAF fragments includes the CMAF chunk.
4. The method of claim 3 , wherein the value for the at least one of the STYP values for the corresponding one of the CMAF fragments comprises “cmfl”.
5. The method of claim 1 , further comprising:
determining that at least one of the STYP values for a corresponding one of the CMAF fragments has a value indicating that the corresponding one of the CMAF fragments is included in a CMAF segment of the CMAF track file; and
processing the CMAF segment in response to determining that the at least one of the STYP values has the value indicating that the corresponding one of the CMAF fragments is included in the CMAF segment.
6. The method of claim 5 , wherein the value for the at least one of the STYP values for the corresponding one of the CMAF fragments comprises “cmfs”.
7. The method of claim 1 , wherein processing each of the CMAF fragments comprises determining that data following the CMAF header represents the one or more CMAF fragments in response to detection of the FTYP value.
8. A device for processing media data, the device comprising:
a memory for storing media data; and
one or more processors implemented in circuitry and configured to:
parse a bitstream including data formatted according to Common Media Application Format (CMAF);
detect, during the parsing, a file type (FTYP) value for a CMAF track file of the bitstream;
determine that a CMAF header of the CMAF track file starts with the FTYP value; and
process one or more CMAF fragments following the CMAF header of the CMAF track file, wherein to process the one or more CMAF fragments, the one or more processors are configured to:
detect one or more segment type (STYP) values in the bitstream;
determine that each of the one or more STYP values corresponds to a start of a respective one of the CMAF fragments;
determine that at least one of the STYP values comprises a value indicating presence of a first sample of the respective one of the CMAF fragments; and
process each of the CMAF fragments starting from the corresponding STYP value, wherein to process each of the CMAF fragments, the one or more processors are configured to, in response to determining that the at least one of the STYP values comprises the value indicating the presence of the first sample of the respective one of the CMAF fragments, process data of the bitstream following the at least one of the STYP values as corresponding to samples of the corresponding one of the CMAF fragments.
9. The device of claim 8 , wherein to determine that at least one of the STYP values comprises a value indicating presence of a first sample of the respective one of the CMAF fragments, the one or more processors are configured to determine that the at least one of the STYP values has a value of “cmff”.
10. The device of claim 8 , wherein the one or more processors are further configured to:
determine that at least one of the STYP values for a corresponding one of the CMAF fragments has a value indicating that the corresponding one of the CMAF fragments includes a CMAF chunk; and
process the CMAF chunk in response to determining that the at least one of the STYP values has the value indicating that the corresponding one of the CMAF fragments includes the CMAF chunk.
11. The device of claim 10 , wherein the value for the at least one of the STYP values for the corresponding one of the CMAF fragments comprises “cmfl.”
12. The device of claim 8 , wherein the one or more processors are further configured to:
determine that at least one of the STYP values for a corresponding one of the CMAF fragments has a value indicating that the corresponding one of the CMAF fragments is included in a CMAF segment of the CMAF track file; and
process the CMAF segment in response to determining that the at least one of the STYP values has the value indicating that the corresponding one of the CMAF fragments is included in the CMAF segment.
13. The device of claim 12 , wherein the value for the at least one of the STYP values for the corresponding one of the CMAF fragments comprises “cmfs”.
14. The device of claim 8 , wherein to process each of the CMAF fragments, the one or more processors are configured to determine that data following the CMAF header represents the one or more CMAF fragments in response to detection of the FTYP value.
15. A computer-readable storage medium having stored thereon instructions that, when executed, cause a processor to:
parse a bitstream including data formatted according to Common Media Application Format (CMAF);
detect, during the parsing, a file type (FTYP) value for a CMAF track file of the bitstream;
determine that a CMAF header of the CMAF track file starts with the FTYP value; and
processing, by the processor, one or more CMAF fragments following the CMAF header of the CMAF track file, wherein the instructions that cause the processor to process the one or more CMAF fragments comprise instructions that cause the processor to:
detect one or more segment type (STYP) values in the bitstream;
determine that each of the one or more STYP values corresponds to a start of a respective one of the CMAF fragments;
determine that at least one of the STYP values comprises a value indicating presence of a first sample of the respective one of the CMAF fragments; and
process each of the CMAF fragments starting from the corresponding STYP value, including instructions that cause the processor to, in response to determining that the at least one of the STYP values comprises the value indicating the presence of the first sample of the respective one of the CMAF fragments, process data of the bitstream following the at least one of the STYP values as corresponding to samples of the corresponding one of the CMAF fragments.
16. The computer-readable storage medium of claim 15 , wherein the instructions that cause the processor to determine that at least one of the STYP values comprises a value indicating presence of a first sample of the respective one of the CMAF fragments comprise instructions that cause the processor to determine that the at least one of the STYP values has a value of “cmff”.
17. The computer-readable storage medium of claim 15 , further comprising instructions that cause the processor to:
determine that at least one of the STYP values for a corresponding one of the CMAF fragments has a value indicating that the corresponding one of the CMAF fragments includes a CMAF chunk; and
process the CMAF chunk in response to determining that the at least one of the STYP values has the value indicating that the corresponding one of the CMAF fragments includes the CMAF chunk.
18. The computer-readable storage medium of claim 15 , further comprising instructions that cause the processor to:
determine that at least one of the STYP values for a corresponding one of the CMAF fragments has a value indicating that the corresponding one of the CMAF fragments is included in a CMAF segment of the CMAF track file; and
process the CMAF segment in response to determining that the at least one of the STYP values has the value indicating that the corresponding one of the CMAF fragments is included in the CMAF segment.
19. The computer-readable storage medium of claim 15 , wherein the instructions that cause the processor to process each of the CMAF fragments comprise instructions that cause the processor to determine that data following the CMAF header represents the one or more CMAF fragments in response to detection of the FTYP value.
20. A device for processing media data, the device comprising:
means for parsing a bitstream including data formatted according to Common Media Application Format (CMAF);
means for detecting, during the parsing, a file type (FTYP) value for a CMAF track file of the bitstream;
means for determining that a CMAF header of the CMAF track file starts with the FTYP value; and
means for processing one or more CMAF fragments following the CMAF header of the CMAF track file, wherein the means for processing the one or more CMAF fragments comprises:
means for detecting one or more segment type (STYP) values in the bitstream;
means for determining that each of the one or more STYP values corresponds to a start of a respective one of the CMAF fragments;
means for determining that at least one of the STYP values comprises a value indicating presence of a first sample of the respective one of the CMAF fragments; and
means for processing each of the CMAF fragments starting from the corresponding STYP value, comprising means for processing, in response to determining that the at least one of the STYP values comprises the value indicating the presence of the first sample of the respective one of the CMAF fragments, data of the bitstream following the at least one of the STYP values as corresponding to samples of the corresponding one of the CMAF fragments.