draft-ietf-cellar-ebml-01.txt   draft-ietf-cellar-ebml-02.txt 
cellar S. Lhomme cellar S. Lhomme
Internet-Draft Internet-Draft
Intended status: Standards Track D. Rice Intended status: Standards Track D. Rice
Expires: April 14, 2017 Expires: August 30, 2017
M. Bunkus M. Bunkus
October 11, 2016 February 26, 2017
Extensible Binary Meta Language Extensible Binary Meta Language
draft-ietf-cellar-ebml-01 draft-ietf-cellar-ebml-02
Abstract Abstract
This document defines the Extensible Binary Meta Language (EBML) This document defines the Extensible Binary Meta Language (EBML)
format as a generalized file format for any type of data in a format as a generalized file format for any type of data in a
hierarchical form. EBML is designed as a binary equivalent to XML hierarchical form. EBML is designed as a binary equivalent to XML
and uses a storage-efficient approach to build nested Elements with and uses a storage-efficient approach to build nested Elements with
identifiers, lengths, and values. Similar to how an XML Schema identifiers, lengths, and values. Similar to how an XML Schema
defines the structure and semantics of an XML Document, this document defines the structure and semantics of an XML Document, this document
defines how EBML Schemas are created to convey the semantics of an defines how EBML Schemas are created to convey the semantics of an
skipping to change at page 1, line 39 skipping to change at page 1, line 39
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on April 14, 2017. This Internet-Draft will expire on August 30, 2017.
Copyright Notice Copyright Notice
Copyright (c) 2016 IETF Trust and the persons identified as the Copyright (c) 2017 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Notation and Conventions . . . . . . . . . . . . . . . . . . 3 2. Notation and Conventions . . . . . . . . . . . . . . . . . . 3
3. Security Considerations . . . . . . . . . . . . . . . . . . . 5 3. Security Considerations . . . . . . . . . . . . . . . . . . . 6
4. Structure . . . . . . . . . . . . . . . . . . . . . . . . . . 7 4. Structure . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5. Variable Size Integer . . . . . . . . . . . . . . . . . . . . 7 5. Variable Size Integer . . . . . . . . . . . . . . . . . . . . 7
5.1. VINT_WIDTH . . . . . . . . . . . . . . . . . . . . . . . 7 5.1. VINT_WIDTH . . . . . . . . . . . . . . . . . . . . . . . 7
5.2. VINT_MARKER . . . . . . . . . . . . . . . . . . . . . . . 7 5.2. VINT_MARKER . . . . . . . . . . . . . . . . . . . . . . . 8
5.3. VINT_DATA . . . . . . . . . . . . . . . . . . . . . . . . 8 5.3. VINT_DATA . . . . . . . . . . . . . . . . . . . . . . . . 8
5.4. VINT Examples . . . . . . . . . . . . . . . . . . . . . . 8 5.4. VINT Examples . . . . . . . . . . . . . . . . . . . . . . 8
6. Element ID . . . . . . . . . . . . . . . . . . . . . . . . . 9 6. Element ID . . . . . . . . . . . . . . . . . . . . . . . . . 9
7. Element Data Size . . . . . . . . . . . . . . . . . . . . . . 10 7. Element Data Size . . . . . . . . . . . . . . . . . . . . . . 10
8. EBML Element Types . . . . . . . . . . . . . . . . . . . . . 12 8. EBML Element Types . . . . . . . . . . . . . . . . . . . . . 12
8.1. Signed Integer Element . . . . . . . . . . . . . . . . . 13 8.1. Signed Integer Element . . . . . . . . . . . . . . . . . 13
8.2. Unsigned Integer Element . . . . . . . . . . . . . . . . 13 8.2. Unsigned Integer Element . . . . . . . . . . . . . . . . 13
8.3. Float Element . . . . . . . . . . . . . . . . . . . . . . 13 8.3. Float Element . . . . . . . . . . . . . . . . . . . . . . 13
8.4. String Element . . . . . . . . . . . . . . . . . . . . . 13 8.4. String Element . . . . . . . . . . . . . . . . . . . . . 13
8.5. UTF-8 Element . . . . . . . . . . . . . . . . . . . . . . 14 8.5. UTF-8 Element . . . . . . . . . . . . . . . . . . . . . . 14
skipping to change at page 2, line 40 skipping to change at page 2, line 40
8.7. Master Element . . . . . . . . . . . . . . . . . . . . . 14 8.7. Master Element . . . . . . . . . . . . . . . . . . . . . 14
8.8. Binary Element . . . . . . . . . . . . . . . . . . . . . 15 8.8. Binary Element . . . . . . . . . . . . . . . . . . . . . 15
9. EBML Document . . . . . . . . . . . . . . . . . . . . . . . . 15 9. EBML Document . . . . . . . . . . . . . . . . . . . . . . . . 15
9.1. EBML Header . . . . . . . . . . . . . . . . . . . . . . . 15 9.1. EBML Header . . . . . . . . . . . . . . . . . . . . . . . 15
9.2. EBML Body . . . . . . . . . . . . . . . . . . . . . . . . 16 9.2. EBML Body . . . . . . . . . . . . . . . . . . . . . . . . 16
10. EBML Stream . . . . . . . . . . . . . . . . . . . . . . . . . 16 10. EBML Stream . . . . . . . . . . . . . . . . . . . . . . . . . 16
11. Elements semantic . . . . . . . . . . . . . . . . . . . . . . 16 11. Elements semantic . . . . . . . . . . . . . . . . . . . . . . 16
11.1. EBML Schema . . . . . . . . . . . . . . . . . . . . . . 16 11.1. EBML Schema . . . . . . . . . . . . . . . . . . . . . . 16
11.1.1. Element . . . . . . . . . . . . . . . . . . . . . . 17 11.1.1. Element . . . . . . . . . . . . . . . . . . . . . . 17
11.1.2. Attributes . . . . . . . . . . . . . . . . . . . . . 17 11.1.2. Attributes . . . . . . . . . . . . . . . . . . . . . 17
11.1.3. Element . . . . . . . . . . . . . . . . . . . . . . 18 11.1.3. Element . . . . . . . . . . . . . . . . . . . . . . 17
11.1.4. Attributes . . . . . . . . . . . . . . . . . . . . . 18 11.1.4. Attributes . . . . . . . . . . . . . . . . . . . . . 18
11.1.5. Element . . . . . . . . . . . . . . . . . . . . . . 23 11.1.5. Element . . . . . . . . . . . . . . . . . . . . . . 22
11.1.6. Attributes . . . . . . . . . . . . . . . . . . . . . 23 11.1.6. Attributes . . . . . . . . . . . . . . . . . . . . . 22
11.1.7. EBML Schema Example . . . . . . . . . . . . . . . . 23 11.1.7. Element . . . . . . . . . . . . . . . . . . . . . . 23
11.1.8. Identically Recurring Elements . . . . . . . . . . . 24 11.1.8. Element . . . . . . . . . . . . . . . . . . . . . . 23
11.1.9. Expression of range . . . . . . . . . . . . . . . . 25 11.1.9. Attributes . . . . . . . . . . . . . . . . . . . . . 23
11.1.10. Textual expression of Floats . . . . . . . . . . . . 25 11.1.10. XML Schema for EBML Schema . . . . . . . . . . . . . 23
11.1.11. Note on the Use of default attributes to define 11.1.11. EBML Schema Example . . . . . . . . . . . . . . . . 25
Mandatory EBML Elements . . . . . . . . . . . . . . 26 11.1.12. Identically Recurring Elements . . . . . . . . . . . 25
11.2. EBML Header Elements . . . . . . . . . . . . . . . . . . 27 11.1.13. Expression of range . . . . . . . . . . . . . . . . 26
11.2.1. EBML Element . . . . . . . . . . . . . . . . . . . . 27 11.1.14. Textual expression of Floats . . . . . . . . . . . . 26
11.2.2. EBMLVersion Element . . . . . . . . . . . . . . . . 27 11.1.15. Note on the Use of default attributes to define
11.2.3. EBMLReadVersion Element . . . . . . . . . . . . . . 28 Mandatory EBML Elements . . . . . . . . . . . . . . 27
11.2.4. EBMLMaxIDLength Element . . . . . . . . . . . . . . 28 11.2. EBML Header Elements . . . . . . . . . . . . . . . . . . 28
11.2.5. EBMLMaxSizeLength Element . . . . . . . . . . . . . 29 11.2.1. EBML Element . . . . . . . . . . . . . . . . . . . . 28
11.2.6. DocType Element . . . . . . . . . . . . . . . . . . 29 11.2.2. EBMLVersion Element . . . . . . . . . . . . . . . . 28
11.2.7. DocTypeVersion Element . . . . . . . . . . . . . . . 30 11.2.3. EBMLReadVersion Element . . . . . . . . . . . . . . 29
11.2.8. DocTypeReadVersion Element . . . . . . . . . . . . . 30 11.2.4. EBMLMaxIDLength Element . . . . . . . . . . . . . . 29
11.3. Global elements (used everywhere in the format) . . . . 30 11.2.5. EBMLMaxSizeLength Element . . . . . . . . . . . . . 30
11.3.1. Void Element . . . . . . . . . . . . . . . . . . . . 31 11.2.6. DocType Element . . . . . . . . . . . . . . . . . . 30
12. References . . . . . . . . . . . . . . . . . . . . . . . . . 31 11.2.7. DocTypeVersion Element . . . . . . . . . . . . . . . 31
12.1. Normative References . . . . . . . . . . . . . . . . . . 31 11.2.8. DocTypeReadVersion Element . . . . . . . . . . . . . 31
12.2. Informative References . . . . . . . . . . . . . . . . . 33 11.3. Global elements (used everywhere in the format) . . . . 31
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 33 11.3.1. Void Element . . . . . . . . . . . . . . . . . . . . 32
12. References . . . . . . . . . . . . . . . . . . . . . . . . . 32
12.1. Normative References . . . . . . . . . . . . . . . . . . 32
12.2. Informative References . . . . . . . . . . . . . . . . . 34
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 34
1. Introduction 1. Introduction
"EBML", short for Extensible Binary Meta Language, specifies a binary "EBML", short for Extensible Binary Meta Language, specifies a binary
and octet (byte) aligned format inspired by the principle of XML (a and octet (byte) aligned format inspired by the principle of XML (a
framework for structuring data). framework for structuring data).
The goal of this document is to define a generic, binary, space- The goal of this document is to define a generic, binary, space-
efficient format that can be used to define more complex formats efficient format that can be used to define more complex formats
(such as containers for multimedia content) using an "EBML Schema". (such as containers for multimedia content) using an "EBML Schema".
skipping to change at page 4, line 5 skipping to change at page 4, line 11
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [RFC2119]. document are to be interpreted as described in [RFC2119].
This document defines specific terms in order to define the format This document defines specific terms in order to define the format
and application of "EBML". Specific terms are defined below: and application of "EBML". Specific terms are defined below:
"Child Element": A "Child Element" is a relative term to describe the "Child Element": A "Child Element" is a relative term to describe the
"EBML Elements" immediately contained within a "Master Element". "EBML Elements" immediately contained within a "Master Element".
"Descendant Element": A "Descendant Element" is a relative term to
describe any "EBML Elements" contained within a "Master Element",
including any of the "Child Elements" of its "Child Elements", and so
on.
"EBML": Extensible Binary Meta Language "EBML": Extensible Binary Meta Language
"Element Data": The value(s) of the "EBML Element" which is "Element Data": The value(s) of the "EBML Element" which is
identified by its "Element ID" and "Element Data Size". The form of identified by its "Element ID" and "Element Data Size". The form of
the "Element Data" is defined by this document and the corresponding the "Element Data" is defined by this document and the corresponding
"EBML Schema" of the Element's "EBML Document Type". "EBML Schema" of the Element's "EBML Document Type".
"Element Data Size": An expression, encoded as a "Variable Size "Element Data Size": An expression, encoded as a "Variable Size
Integer", of the length in octets of "Element Data". Integer", of the length in octets of "Element Data".
"EBML Body": All data of an "EBML Document" following the "EBML "EBML Body": All data of an "EBML Document" following the "EBML
Header" may be considered the "EBML Body". Header" may be considered the "EBML Body".
"EBML Class": An representation of the octet length of an "Element "EBML Class": A representation of the octet length of an "Element
ID". ID".
"EBML Document": An "EBML Document" is a datastream comprised of only "EBML Document": An "EBML Document" is a datastream comprised of only
two components, an "EBML Header" and an "EBML Body". two components, an "EBML Header" and an "EBML Body".
"EBML Document Type": An "EBML Document Type" is a name provided by "EBML Document Type": An "EBML Document Type" is a name provided by
an "EBML Schema" for a particular implementation of "EBML" for a data an "EBML Schema" for a particular implementation of "EBML" for a data
format (examples: matroska and webm). format (examples: matroska and webm).
"EBML Element": A foundation block of data that contains three parts: "EBML Element": A foundation block of data that contains three parts:
an "Element ID", an "Element Data Size", and "Element Data". an "Element ID", an "Element Data Size", and "Element Data".
"EBML Header": The "EBML Header" is a declaration that provides "EBML Header": The "EBML Header" is a declaration that provides
processing instructions and identification of the "EBML Body". The processing instructions and identification of the "EBML Body". The
"EBML Header" may be considered as analogous to an XML Declaration. "EBML Header" may be considered as analogous to an XML Declaration
[W3C.REC-xml-20081126] (see section 2.8 on Prolog and Document Type
Declaration).
"EBML Reader": An "EBML Reader" is a data parser that interprets the
semantics of an "EBML Document" and creates a way for programs to use
"EBML".
"EBML Schema": A standardized definition for the structure of an "EBML Schema": A standardized definition for the structure of an
"EBML Document Type". "EBML Document Type".
"EBML Stream": An "EBML Stream" is a file that consists of one or "EBML Stream": An "EBML Stream" is a file that consists of one or
many "EBML Documents" that are concatenated together. more "EBML Documents" that are concatenated together.
"Element ID": The "Element ID" is a binary value, encoded as a "Element ID": The "Element ID" is a binary value, encoded as a
"Variable Size Integer", used to uniquely identify a defined "EBML "Variable Size Integer", used to uniquely identify a defined "EBML
Element" within a specific "EBML Schema". Element" within a specific "EBML Schema".
"Element Name": The official human-readable name of the "EBML "Element Name": The official human-readable name of the "EBML
Element". Element".
"Element Path": The hierarchy of "Parent Element" where the "EBML "Element Path": The hierarchy of "Parent Element" where the "EBML
Element" is expected to be found in the "EBML Body". Element" is expected to be found in the "EBML Body".
"Empty Element": An "Empty Element" is an "EBML Element" that has an "Empty Element": An "Empty Element" is an "EBML Element" that has an
"Element Data Size" with all VINT_DATA bits set to zero which "Element Data Size" with all "VINT_DATA" bits set to zero which
indicates that the "Element Data" of the Element is zero octets in indicates that the "Element Data" of the Element is zero octets in
length. length.
"Master Element": The "Master Element" contains zero, one, or many "Master Element": The "Master Element" contains zero, one, or many
other "EBML Elements". other "EBML Elements".
"Parent Element": A relative term to describe the "Master Element" "Parent Element": A relative term to describe the "Master Element"
which contains a specified element. which contains a specified element. For any specified "EBML Element"
that is not at "Root Level", the "Parent Element" refers to the
"Master Element" in which that "EBML Element" is contained.
"Root Element": A mandatory, non-repeating "EBML Element" which "Root Element": A mandatory, non-repeating "EBML Element" which
occurs at the top level of the path hierarchy within an "EBML Body" occurs at the top level of the path hierarchy within an "EBML Body"
and contains all other "EBML Elements" of the "EBML Body", excepting and contains all other "EBML Elements" of the "EBML Body", excepting
optional "Void Elements". optional "Void Elements".
"Root Level": The starting level in the hierarchy of an "EBML "Root Level": The starting level in the hierarchy of an "EBML
Document". Document".
"Top-Level Element": An "EBML Element" defined as a "Child Element" "Top-Level Element": An "EBML Element" defined to only occur as a
of the "Root Element". "Child Element" of the "Root Element".
"Unknown-Sized Element": An Element with an unknown "Element Data "Unknown-Sized Element": An Element with an unknown "Element Data
Size". Size".
"Variable Size Integer": A compact variable-length binary value which "Variable Size Integer": A compact variable-length binary value which
defines its own length. defines its own length.
"VINT": Also known as "Variable Size Integer". "VINT": Also known as "Variable Size Integer".
"VINTMAX": The maximum possible value that can be stored as "Element "VINTMAX": The maximum possible value that can be stored as "Element
Data Size". Data Size".
3. Security Considerations 3. Security Considerations
"EBML" itself does not offer any kind of security and does not "EBML" itself does not offer any kind of security and does not
provide confidentiality. "EBML" does not provide any kind of provide confidentiality. "EBML" does not provide any kind of
authorization. EBML only offers marginally useful and effective data authorization. "EBML" only offers marginally useful and effective
integrity options, such as CRC elements. data integrity options, such as CRC elements.
Even if the semantic layer offers any kind of encryption, "EBML" Even if the semantic layer offers any kind of encryption, "EBML"
itself could leak information at both the semantic layer (as declared itself could leak information at both the semantic layer (as declared
via the DocType element) and within the "EBML" structure (you can via the DocType element) and within the "EBML" structure (you can
derive the presence of EBML elements even with an unknown semantic derive the presence of "EBML Elements" even with an unknown semantic
layer with a heuristic approach; not without errors, of course, but layer with a heuristic approach; not without errors, of course, but
with a certain degree of confidence). with a certain degree of confidence).
Attacks on an "EBML Reader" could include: Attacks on an "EBML Reader" could include:
o Invalid "Element IDs" that are longer than the limit stated in the o Invalid "Element IDs" that are longer than the limit stated in the
"EBMLMaxIDLength Element" of the "EBML Header". "EBMLMaxIDLength Element" of the "EBML Header".
o Invalid "Element IDs" that are not encoded in the shortest- o Invalid "Element IDs" that are not encoded in the shortest-
possible way. possible way.
skipping to change at page 6, line 48 skipping to change at page 7, line 19
o The semantic equivalence of "VINT_DATA" within "Element Data Size" o The semantic equivalence of "VINT_DATA" within "Element Data Size"
with to different lengths due to left-padding zero bits. with to different lengths due to left-padding zero bits.
o Data contained within a "Master Element" which is not itself part o Data contained within a "Master Element" which is not itself part
of an "EBML Element". of an "EBML Element".
o Extraneous copies of "Identically Recurring Element". o Extraneous copies of "Identically Recurring Element".
o Copies of "Identically Recurring Element" within a "Parent o Copies of "Identically Recurring Element" within a "Parent
Element" that contains an invalid "CRC-32 Elements". Element" that contain invalid "CRC-32 Elements".
o Use of "Void Elements". o Use of "Void Elements".
4. Structure 4. Structure
"EBML" uses a system of Elements to compose an "EBML Document". "EBML" uses a system of Elements to compose an "EBML Document".
"EBML Elements" incorporate three parts: an "Element ID", an "Element "EBML Elements" incorporate three parts: an "Element ID", an "Element
Data Size", and "Element Data". The "Element Data", which is Data Size", and "Element Data". The "Element Data", which is
described by the "Element ID", includes either binary data, one or described by the "Element ID", includes either binary data, one or
many other "EBML Elements", or both. many other "EBML Elements", or both.
skipping to change at page 10, line 8 skipping to change at page 10, line 12
"1111 1111" is invalid since the "VINT_DATA" section is set to all "1111 1111" is invalid since the "VINT_DATA" section is set to all
one values, whereas an "Element ID" with binary encoding of "0100 one values, whereas an "Element ID" with binary encoding of "0100
0000 0111 1111" stores a semantically equal "VINT_DATA" and is the 0000 0111 1111" stores a semantically equal "VINT_DATA" and is the
shortest "VINT" encoding is possible. shortest "VINT" encoding is possible.
The following table details these specific examples further: The following table details these specific examples further:
+------------+-------------+----------------+-----------------------+ +------------+-------------+----------------+-----------------------+
| VINT_WIDTH | VINT_MARKER | VINT_DATA | Element ID Status | | VINT_WIDTH | VINT_MARKER | VINT_DATA | Element ID Status |
+------------+-------------+----------------+-----------------------+ +------------+-------------+----------------+-----------------------+
| | 1 | 0000000 | Invalid: VINT_DATA | | | 1 | 0000000 | Invalid: "VINT_DATA" |
| | | | MUST NOT be set to | | | | | MUST NOT be set to |
| | | | all 0 | | | | | all 0 |
| 0 | 1 | 00000000000000 | Invalid: VINT_DATA | | 0 | 1 | 00000000000000 | Invalid: "VINT_DATA" |
| | | | MUST NOT be set to | | | | | MUST NOT be set to |
| | | | all 0 | | | | | all 0 |
| | 1 | 0000001 | Valid | | | 1 | 0000001 | Valid |
| 0 | 1 | 00000000000001 | Invalid: A shorter | | 0 | 1 | 00000000000001 | Invalid: A shorter |
| | | | VINT_DATA encoding is | | | | | "VINT_DATA" encoding |
| | | | available. | | | | | is available. |
| | 1 | 0111111 | Valid | | | 1 | 0111111 | Valid |
| 0 | 1 | 00000000111111 | Invalid: A shorter | | 0 | 1 | 00000000111111 | Invalid: A shorter |
| | | | VINT_DATA encoding is | | | | | "VINT_DATA" encoding |
| | | | available. | | | | | is available. |
| | 1 | 1111111 | Invalid: VINT_DATA | | | 1 | 1111111 | Invalid: "VINT_DATA" |
| | | | MUST NOT be set to | | | | | MUST NOT be set to |
| | | | all 1 | | | | | all 1 |
| 0 | 1 | 00000001111111 | Valid | | 0 | 1 | 00000001111111 | Valid |
+------------+-------------+----------------+-----------------------+ +------------+-------------+----------------+-----------------------+
The octet length of an "Element ID" determines its "EBML Class". The octet length of an "Element ID" determines its "EBML Class".
+------------+--------------+--------------------------------+ +------------+--------------+--------------------------------+
| EBML Class | Octet Length | Number of Possible Element IDs | | EBML Class | Octet Length | Number of Possible Element IDs |
+------------+--------------+--------------------------------+ +------------+--------------+--------------------------------+
skipping to change at page 11, line 35 skipping to change at page 11, line 40
"Element Data Size" is referred to as an "Unknown-Sized Element". "Element Data Size" is referred to as an "Unknown-Sized Element".
Only "Master Elements" SHALL be "Unknown-Sized Elements". "Master Only "Master Elements" SHALL be "Unknown-Sized Elements". "Master
Elements" MUST NOT use an unknown size unless the Elements" MUST NOT use an unknown size unless the
"unknownsizeallowed" attribute of their "EBML Schema" is set to true "unknownsizeallowed" attribute of their "EBML Schema" is set to true
(see Section 11.1.4.10). The use of "Unknown-Sized Elements" allows (see Section 11.1.4.10). The use of "Unknown-Sized Elements" allows
for an "EBML Element" to be written and read before the size of the for an "EBML Element" to be written and read before the size of the
"EBML Element" is known. "Unknown-Sized Element" MUST NOT be used or "EBML Element" is known. "Unknown-Sized Element" MUST NOT be used or
defined unnecessarily; however if the "Element Data Size" is not defined unnecessarily; however if the "Element Data Size" is not
known before the "Element Data" is written, such as in some cases of known before the "Element Data" is written, such as in some cases of
data streaming, then "Unknown-Sized Elements" MAY be used. The end data streaming, then "Unknown-Sized Elements" MAY be used. The end
of an "Unknown-Sized Element" is determined by the beginning of the of an "Unknown-Sized Element" is determined by whichever comes first:
next element, defined by this document or the corresponding "EBML the end of the file or the beginning of the next "EBML Element",
Schema", that is not a valid sub-element of the "Unknown-Sized defined by this document or the corresponding "EBML Schema", that is
not independently valid as "Descendant Element" of the "Unknown-Sized
Element". Element".
For "Element Data Sizes" encoded at octet lengths from one to eight, For "Element Data Sizes" encoded at octet lengths from one to eight,
this table depicts the range of possible values that can be encoded this table depicts the range of possible values that can be encoded
as an "Element Data Size". An "Element Data Size" with an octet as an "Element Data Size". An "Element Data Size" with an octet
length of 8 is able to express a size of 2^56-2 or length of 8 is able to express a size of 2^56-2 or
72,057,594,037,927,934 octets (or about 72 petabytes). The maximum 72,057,594,037,927,934 octets (or about 72 petabytes). The maximum
possible value that can be stored as "Element Data Size" is referred possible value that can be stored as "Element Data Size" is referred
to as "VINTMAX". to as "VINTMAX".
skipping to change at page 12, line 39 skipping to change at page 12, line 41
| | | | Status | | | | | Status |
+------------+-------------+----------------+-----------------------+ +------------+-------------+----------------+-----------------------+
| | 1 | 1111111 | Reserved (meaning | | | 1 | 1111111 | Reserved (meaning |
| | | | Unknown) | | | | | Unknown) |
| 0 | 1 | 00000001111111 | Valid (meaning 127 | | 0 | 1 | 00000001111111 | Valid (meaning 127 |
| | | | octets) | | | | | octets) |
+------------+-------------+----------------+-----------------------+ +------------+-------------+----------------+-----------------------+
8. EBML Element Types 8. EBML Element Types
"EBML Element" are defined by an "EBML Schema" which MUST declare one "EBML Elements" are defined by an "EBML Schema" which MUST declare
of the follow "EBML Element Types" for each "EBML Element". An "EBML one of the following "EBML Element Types" for each "EBML Element".
Element Type" defines a concept of storing data within an "EBML An "EBML Element Type" defines a concept of storing data within an
Element" that describes such characteristics as length, endianness, "EBML Element" that describes such characteristics as length,
and definition. endianness, and definition.
"EBML Elements" which are defined as a "Signed Integer Element", "EBML Elements" which are defined as a "Signed Integer Element",
"Unsigned Integer Element", "Float Element", or "Date Element" use "Unsigned Integer Element", "Float Element", or "Date Element" use
big endian storage. big endian storage.
8.1. Signed Integer Element 8.1. Signed Integer Element
A "Signed Integer Element" MUST declare a length from zero to eight A "Signed Integer Element" MUST declare a length from zero to eight
octets. If the "EBML Element" is not defined to have a "default" octets. If the "EBML Element" is not defined to have a "default"
value, then a "Signed Integer Element" with a zero-octet length value, then a "Signed Integer Element" with a zero-octet length
represents an integer value of zero. represents an integer value of zero.
A "Signed Integer Element" stores an integer (meaning that it can be A "Signed Integer Element" stores an integer (meaning that it can be
written without a fractional component) which could be negative, written without a fractional component) which could be negative,
positive, or zero. Signed Integers MUST be stored with two's positive, or zero. Signed Integers MUST be stored with two's
complement notation with the leftmost bit being the sign bit. complement notation with the leftmost bit being the sign bit.
Because "EBML" limits Signed Integers to 8 octets in length a "Signed Because "EBML" limits Signed Integers to 8 octets in length a "Signed
Ingeter Element" stores a number from -9,223,372,036,854,775,808 to Integer Element" stores a number from -9,223,372,036,854,775,808 to
+9,223,372,036,854,775,807. +9,223,372,036,854,775,807.
8.2. Unsigned Integer Element 8.2. Unsigned Integer Element
A "Unsigned Integer Element" MUST declare a length from zero to eight An "Unsigned Integer Element" MUST declare a length from zero to
octets. If the "EBML Element" is not defined to have a "default" eight octets. If the "EBML Element" is not defined to have a
value, then an "Unsigned Integer Element" with a zero-octet length "default" value, then an "Unsigned Integer Element" with a zero-octet
represents an integer value of zero. length represents an integer value of zero.
An "Unsigned Integer Element" stores an integer (meaning that it can An "Unsigned Integer Element" stores an integer (meaning that it can
be written without a fractional component) which could be positive or be written without a fractional component) which could be positive or
zero. Because "EBML" limits Unsigned Integers to 8 octets in length zero. Because "EBML" limits Unsigned Integers to 8 octets in length
an "Unsigned Integer Element" stores a number from 0 to an "Unsigned Integer Element" stores a number from 0 to
18,446,744,073,709,551,615. 18,446,744,073,709,551,615.
8.3. Float Element 8.3. Float Element
A "Float Element" MUST declare a length of either zero octets (0 A "Float Element" MUST declare a length of either zero octets (0
skipping to change at page 13, line 52 skipping to change at page 13, line 52
[IEEE.754.1985]. [IEEE.754.1985].
8.4. String Element 8.4. String Element
A "String Element" MUST declare a length in octets from zero to A "String Element" MUST declare a length in octets from zero to
"VINTMAX". If the "EBML Element" is not defined to have a "default" "VINTMAX". If the "EBML Element" is not defined to have a "default"
value, then a "String Element" with a zero-octet length represents an value, then a "String Element" with a zero-octet length represents an
empty string. empty string.
A "String Element" MUST either be empty (zero-length) or contain A "String Element" MUST either be empty (zero-length) or contain
Printable ASCII characters [RFC0020] in the range of "0x20" to printable ASCII characters [RFC0020] in the range of "0x20" to
"0x7E". Octets with all bits set to zero MAY follow the string value "0x7E". Octets with all bits set to zero MAY follow the string value
when needed, such as reducing the length of a stored string while when needed, such as reducing the length of a stored string while
maintaining the same "Element Data Size". A string with one or more maintaining the same "Element Data Size". A string with one or more
octets with all bits set to zero and a string without one or more octets with all bits set to zero and a string without one or more
octets with all bits set to zero are semantically equal. octets with all bits set to zero are semantically equal.
8.5. UTF-8 Element 8.5. UTF-8 Element
A "UTF-8 Element" MUST declare a length in octets from zero to A "UTF-8 Element" MUST declare a length in octets from zero to
"VINTMAX". If the "EBML Element" is not defined to have a "default" "VINTMAX". If the "EBML Element" is not defined to have a "default"
skipping to change at page 16, line 47 skipping to change at page 16, line 47
"EBML Document Type". The relationship of an "EBML Schema" to an "EBML Document Type". The relationship of an "EBML Schema" to an
"EBML Document" may be considered analogous to the relationship of an "EBML Document" may be considered analogous to the relationship of an
XML Schema [W3C.REC-xmlschema-0-20010502] to an XML Document XML Schema [W3C.REC-xmlschema-0-20010502] to an XML Document
[W3C.REC-xml-20081126]. An "EBML Schema" MUST be clearly associated [W3C.REC-xml-20081126]. An "EBML Schema" MUST be clearly associated
with one or many "EBML Document Types". An "EBML Schema" must be with one or many "EBML Document Types". An "EBML Schema" must be
expressed as well-formed XML. An "EBML Document Type" is identified expressed as well-formed XML. An "EBML Document Type" is identified
by a string stored within the "EBML Header" in the "DocType Element"; by a string stored within the "EBML Header" in the "DocType Element";
for example "matroska" or "webm" (see Section 11.2.6). The "DocType" for example "matroska" or "webm" (see Section 11.2.6). The "DocType"
value for an "EBML Document Type" SHOULD be unique and persistent. value for an "EBML Document Type" SHOULD be unique and persistent.
For any specified "EBML Element" that is not at "Root Level", the
"Parent Element" refers to the "Master Element" in which that "EBML
Element" is contained. For any specified "Master Element" the "Child
Element" refers to the "EBML Element" that is immediately contained
within that "Master Element". For any "EBML Element" that is not
defined at "Root Level", the "Parent Element" is identified by the
"<element>" node which has the "EBMLReferencePath" equals to the
"EBMLParentPath" of that "EBML Element" "Element Path". The only
exception for this rule are "Global Elements" which MAY occur within
any "Parent Element" within the restriction of the "level"
declaration of "Global Element".
An "EBML Schema" MUST declare exactly one "EBML Element" at "Root An "EBML Schema" MUST declare exactly one "EBML Element" at "Root
Level" (referred to as the "Root Element") that MUST occur exactly Level" (referred to as the "Root Element") that MUST occur exactly
once within an "EBML Document". The "Void Element" MAY also occur at once within an "EBML Document". The "Void Element" MAY also occur at
"Root Level" but is not considered to be "Root Elements" (see "Root Level" but is not considered to be "Root Elements" (see
Section 11.3.1). Section 11.3.1).
"EBML Elements" defined to only occur at Level 1 are known as "Top-
Level Elements".
The "EBML Schema" does not itself document the "EBML Header", but The "EBML Schema" does not itself document the "EBML Header", but
documents all data of the "EBML Document" that follows the "EBML documents all data of the "EBML Document" that follows the "EBML
Header". The "EBML Header" itself is documented by this Header". The "EBML Header" itself is documented by this
specification in the "EBML Header Elements" (see Section 11.2). The specification in the "EBML Header Elements" (see Section 11.2). The
"EBML Schema" also does not document "Global Elements" that are "EBML Schema" also does not document "Global Elements" that are
defined by this document (namely the "Void Element" and the "CRC-32 defined by this document (namely the "Void Element" and the "CRC-32
Element"). Element").
11.1.1. Element 11.1.1. Element
skipping to change at page 18, line 22 skipping to change at page 18, line 7
11.1.3. Element 11.1.3. Element
Each "<element>" defines one "EBML Element" through the use of Each "<element>" defines one "EBML Element" through the use of
several attributes that are defined in Section 11.1.2. "EBML several attributes that are defined in Section 11.1.2. "EBML
Schemas" MAY contain additional attributes to extend the semantics Schemas" MAY contain additional attributes to extend the semantics
but MUST NOT conflict with the definitions of the "<element>" but MUST NOT conflict with the definitions of the "<element>"
attributes defined within this document. attributes defined within this document.
The "<element>" nodes contain a description of the meaning and use of The "<element>" nodes contain a description of the meaning and use of
the "EBML Element" stored within one or many "<documentation>" sub- the "EBML Element" stored within one or many "<documentation>" sub-
elements. All "<element>" nodes MUST be sub-elements of the elements and zero or one "<restriction>" sub-element. All
"<EBMLSchema>". "<element>" nodes MUST be sub-elements of the "<EBMLSchema>".
11.1.4. Attributes 11.1.4. Attributes
Within an "EBML Schema" the "<element>" uses the following attributes Within an "EBML Schema" the "<element>" uses the following attributes
to define an "EBML Element": to define an "EBML Element":
11.1.4.1. name 11.1.4.1. name
The "name" provides the official human-readable name of the "EBML The "name" provides the official human-readable name of the "EBML
Element". The value of the name MUST be in the form of characters Element". The value of the name MUST be in the form of characters
skipping to change at page 19, line 5 skipping to change at page 18, line 35
The path defines the allowed storage locations of the "EBML Element" The path defines the allowed storage locations of the "EBML Element"
within an "EBML Document". This path MUST be defined with the full within an "EBML Document". This path MUST be defined with the full
hierarchy of "EBML Elements" separated with a "/". The top "EBML hierarchy of "EBML Elements" separated with a "/". The top "EBML
Element" in the path hierarchy being the first in the value. The Element" in the path hierarchy being the first in the value. The
syntax of the "path" attribute is defined using this Augmented syntax of the "path" attribute is defined using this Augmented
Backus-Naur Form (ABNF) [RFC5234] with the case sensitive update Backus-Naur Form (ABNF) [RFC5234] with the case sensitive update
[RFC7405] notation: [RFC7405] notation:
The "path" attribute is REQUIRED. The "path" attribute is REQUIRED.
EBMLFullPath = EBMLElementOccurence "(" EBMLReferencePath ")" EBMLFullPath = EBMLElementOccurrence "(" EBMLReferencePath ")"
EBMLReferencePath = [EBMLParentPath] EBMLElementPath EBMLReferencePath = [EBMLParentPath] EBMLElementPath
EBMLParentPath = EBMLFixedParent EBMLLastParent EBMLParentPath = EBMLFixedParent EBMLLastParent
EBMLFixedParent = *(EBMLPathAtom) EBMLFixedParent = *(EBMLPathAtom)
EBMLElementPath = EBMLPathAtom / EBMLPathAtomRecursive EBMLElementPath = EBMLPathAtom / EBMLPathAtomRecursive
EBMLPathAtom = PathDelimiter EBMLAtomName EBMLPathAtom = PathDelimiter EBMLAtomName
EBMLPathAtomRecursive = "1*(" EBMLPathAtom ")" EBMLPathAtomRecursive = "(1*(" EBMLPathAtom "))"
EBMLLastParent = EBMLPathAtom / EBMLVariableParent EBMLLastParent = EBMLPathAtom / EBMLVariableParent
EBMLVariableParent = "(" VariableParentOccurence "\)" EBMLVariableParent = "(" VariableParentOccurrence "\)"
EBMLAtomName = 1*(EBMLNameChar) EBMLAtomName = 1*(EBMLNameChar)
EBMLNameChar = ALPHA / DIGIT / "-" / "." EBMLNameChar = ALPHA / DIGIT / "-" / "."
PathDelimiter = "\" PathDelimiter = "\"
EBMLElementOccurence = [EBMLMinOccurence] "*" [EBMLMaxOccurence] EBMLElementOccurrence = [EBMLMinOccurrence] "*" [EBMLMaxOccurrence]
EBMLMinOccurence = 1*DIGIT EBMLMinOccurrence = 1*DIGIT
EBMLMaxOccurence = 1*DIGIT EBMLMaxOccurrence = 1*DIGIT
VariableParentOccurence = [PathMinOccurence] "*" [PathMaxOccurence] VariableParentOccurrence = [PathMinOccurrence] "*" [PathMaxOccurrence]
PathMinOccurence = 1*DIGIT PathMinOccurrence = 1*DIGIT
PathMaxOccurence = 1*DIGIT PathMaxOccurrence = 1*DIGIT
The ""*"", ""("" and "")"" symbols MUST be interpreted as they are The ""*"", ""("" and "")"" symbols MUST be interpreted as they are
defined in the ABNF. defined in the ABNF.
The "EBMLPathAtom" part of the "EBMLElementPath" MUST be equal to the The "EBMLPathAtom" part of the "EBMLElementPath" MUST be equal to the
"name" attribute of the "EBML Schema". "name" attribute of the "EBML Schema".
The starting "PathDelimiter" of the path corresponds to the root of The starting "PathDelimiter" of the path corresponds to the root of
the "EBML Document". the "EBML Document".
The "EBMLElementOccurence" part is interpreted as an ABNF Variable The "EBMLElementOccurrence" part is interpreted as an ABNF Variable
Repetition. The repetition amounts correspond to how many times the Repetition. The repetition amounts correspond to how many times the
"EBML Element" can be found in its parent "Parent Element". "EBML Element" can be found in its "Parent Element".
The "EBMLMinOccurence" represents the minimum number of occurrences The "EBMLMinOccurrence" represents the minimum number of occurrences
of this "EBML Element" within its "Parent Element". Each instance of of this "EBML Element" within its "Parent Element". Each instance of
the "Parent Element" MUST contain at least this many instances of the "Parent Element" MUST contain at least this many instances of
this "EBML Element". If the "EBML Element" has an empty this "EBML Element". If the "EBML Element" has an empty
"EBMLParentPath" then "EBMLMinOccurence" refers to constaints on the "EBMLParentPath" then "EBMLMinOccurrence" refers to constraints on
occurrence of the "EBML Element" within the "EBML Document". If the occurrence of the "EBML Element" within the "EBML Document". If
"EBMLMinOccurence" is not present then that "EBML Element" is "EBMLMinOccurrence" is not present then that "EBML Element" is
considered to have a "EBMLMinOccurence" value of 0. The semantic considered to have a "EBMLMinOccurrence" value of 0. The semantic
meaning of "EBMLMinOccurence" within an "EBML Schema" is considered meaning of "EBMLMinOccurrence" within an "EBML Schema" is considered
analogous to the meaning of "minOccurs" within an "XML Schema". analogous to the meaning of "minOccurs" within an "XML Schema".
"EBML Elements" with "EBMLMinOccurence" set to "1" that also have a "EBML Elements" with "EBMLMinOccurrence" set to "1" that also have a
"default" value (see Section 11.1.4.8) declared are not REQUIRED to "default" value (see Section 11.1.4.8) declared are not REQUIRED to
be stored but are REQUIRED to be interpreted, see Section 11.1.11. be stored but are REQUIRED to be interpreted, see Section 11.1.15.
An "EBML Element" defined with a "EBMLMinOccurence" value greater An "EBML Element" defined with a "EBMLMinOccurrence" value greater
than zero is called a "Mandatory EBML Element". than zero is called a "Mandatory EBML Element".
The "EBMLMaxOccurence" represents the maximum number of occurrences The "EBMLMaxOccurrence" represents the maximum number of occurrences
of this "EBML Element" within its "Parent Element". Each instance of of this "EBML Element" within its "Parent Element". Each instance of
the "Parent Element" MUST contain at most this many instances of this the "Parent Element" MUST contain at most this many instances of this
"EBML Element". If the "EBML Element" has an empty "EBMLParentPath" "EBML Element". If the "EBML Element" has an empty "EBMLParentPath"
then "EBMLMaxOccurence" refers to constaints on the occurrence of the then "EBMLMaxOccurrence" refers to constraints on the occurrence of
"EBML Element" within the "EBML Document". If "EBMLMaxOccurence" is the "EBML Element" within the "EBML Document". If
not present then that "EBML Element" is considered to have an "EBMLMaxOccurrence" is not present then that "EBML Element" is
unbounded "EBMLMaxOccurence" value. The semantic meaning of considered to have no maximum occurrence. The semantic meaning of
"EBMLMaxOccurence" within an "EBML Schema path" is considered "EBMLMaxOccurrence" within an "EBML Schema path" is considered
analogous to the meaning of "maxOccurs" within an "XML Schema". analogous to the meaning of "maxOccurs" within an "XML Schema".
The "VariableParentOccurence" part is interpreted as an ABNF Variable The "VariableParentOccurrence" part is interpreted as an ABNF
Repetition. The repetition amounts correspond to the amount of Variable Repetition. The repetition amounts correspond to the amount
unspecified "Parent Element" levels there can be between the of unspecified "Parent Element" levels there can be between the
"EBMLFixedParent" and the actual "EBMLElementPath". "EBMLFixedParent" and the actual "EBMLElementPath".
If the path contains a "EBMLPathAtomRecursive" part, the "EBML If the path contains a "EBMLPathAtomRecursive" part, the "EBML
Element" can occur within itself recursively (see the Element" can occur within itself recursively (see the
Section 11.1.4.11). Section 11.1.4.11).
11.1.4.3. id 11.1.4.3. id
The "Element ID" encoded as a "Variable Size Integer" expressed in The "Element ID" encoded as a "Variable Size Integer" expressed in
hexadecimal notation prefixed by a "0x" that is read and stored in hexadecimal notation prefixed by a "0x" that is read and stored in
big-endian order. To reduce the risk of false positives while big-endian order. To reduce the risk of false positives while
parsing "EBML Streams", the "Element IDs" of the "Root Element" and parsing "EBML Streams", the "Element IDs" of the "Root Element" and
"Top-Level Elements" SHOULD be at least 4 octets in length. "Element "Top-Level Elements" SHOULD be at least 4 octets in length. "Element
IDs" defined for use at "Root Level" or directly under the "Root IDs" defined for use at "Root Level" or directly under the "Root
Level" MAY use shorter octet lengths to facilitate padding and Level" MAY use shorter octet lengths to facilitate padding and
optimize edits to EBML Documents; for instance, the "Void Element" optimize edits to "EBML Documents"; for instance, the "Void Element"
uses an "Element ID" with a one octet length to allow its usage in uses an "Element ID" with a one octet length to allow its usage in
more writing and editing scenarios. more writing and editing scenarios.
The "id" attribute is REQUIRED. The "id" attribute is REQUIRED.
11.1.4.4. minOccurs 11.1.4.4. minOccurs
An integer expressing the minimum number of occurrences of this "EBML An integer expressing the minimum number of occurrences of this "EBML
Element" within its "Parent Element". The "minOccurs" value MUST be Element" within its "Parent Element". The "minOccurs" value MUST be
equal to the "EBMLMinOccurence" value of the "path". equal to the "EBMLMinOccurrence" value of the "path".
The "minOccurs" attribute is OPTIONAL. If the "minOccurs" attribute The "minOccurs" attribute is OPTIONAL. If the "minOccurs" attribute
is not present then that "EBML Element" is considered to have a is not present then that "EBML Element" is considered to have a
"minOccurs" value of 0. "minOccurs" value of 0.
11.1.4.5. maxOccurs 11.1.4.5. maxOccurs
An integer expressing the maximum number of occurrences of this "EBML An integer expressing the maximum number of occurrences of this "EBML
Element" within its "Parent Element". The "maxOccurs" value MUST be Element" within its "Parent Element". The "maxOccurs" value MUST be
equal to the "EBMLMaxOccurence" value of the "path". equal to the "EBMLMaxOccurrence" value of the "path".
The "maxOccurs" attribute is OPTIONAL. If the "maxOccurs" attribute The "maxOccurs" attribute is OPTIONAL. If the "maxOccurs" attribute
is not present then that "EBML Element" is considered to have a is not present then that "EBML Element" is considered to have no
maxOccurs value of 1. maximum occurrence, similar to "unbounded" in the XML world.
11.1.4.6. range 11.1.4.6. range
A numerical range for "EBML Elements" which are of numerical types A numerical range for "EBML Elements" which are of numerical types
(Unsigned Integer, Signed Integer, Float, and Date). If specified (Unsigned Integer, Signed Integer, Float, and Date). If specified
the value of the EBML Element MUST be within the defined range. See the value of the "EBML Element" MUST be within the defined range.
Section 11.1.9 for rules applied to expression of range values. See Section 11.1.13 for rules applied to expression of range values.
The "range" attribute is OPTIONAL. If the "range" attribute is not The "range" attribute is OPTIONAL. If the "range" attribute is not
present then any value legal for the "type" attribute is valid. present then any value legal for the "type" attribute is valid.
11.1.4.7. size 11.1.4.7. size
A value to express the valid length of the "Element Data" as written A value to express the valid length of the "Element Data" as written
measured in octets. The "size" provides a constraint in addition to measured in octets. The "size" provides a constraint in addition to
the Length value of the definition of the corresponding "EBML Element the Length value of the definition of the corresponding "EBML Element
Type". This "size" MUST be expressed as either a non-negative Type". This "size" MUST be expressed as either a non-negative
integer or a range (see Section 11.1.9) that consists of only non- integer or a range (see Section 11.1.13) that consists of only non-
negative integers and valid operators. negative integers and valid operators.
The "size" attribute is OPTIONAL. If the "size" attribute is not The "size" attribute is OPTIONAL. If the "size" attribute is not
present for that "EBML Element" then that "EBML Element" is only present for that "EBML Element" then that "EBML Element" is only
limited in size by the definition of the associated "EBML Element limited in size by the definition of the associated "EBML Element
Type". Type".
11.1.4.8. default 11.1.4.8. default
If an Element is mandatory (has a "EBMLMinOccurence" value greater If an Element is mandatory (has a "EBMLMinOccurrence" value greater
than zero) but not written within its "Parent Element" or stored as than zero) but not written within its "Parent Element" or stored as
an "Empty Element", then the "EBML Reader" of the "EBML Document" an "Empty Element", then the "EBML Reader" of the "EBML Document"
MUST semantically interpret the "EBML Element" as present with this MUST semantically interpret the "EBML Element" as present with this
specified default value for the "EBML Element". "EBML Elements" that specified default value for the "EBML Element". "EBML Elements" that
are "Master Elements" MUST NOT declare a "default" value. are "Master Elements" MUST NOT declare a "default" value. "EBML
Elements" with a "minOccurs" value greater than 1 MUST NOT declare a
"default" value.
The "default" attribute is OPTIONAL. The "default" attribute is OPTIONAL.
11.1.4.9. type 11.1.4.9. type
The "type" MUST be set to one of the following values: 'integer' The "type" MUST be set to one of the following values: 'integer'
(signed integer), 'uinteger' (unsigned integer), 'float', 'string', (signed integer), 'uinteger' (unsigned integer), 'float', 'string',
'date', 'utf-8', 'master', or 'binary'. The content of each "type" 'date', 'utf-8', 'master', or 'binary'. The content of each "type"
is defined within Section 8. is defined within Section 8.
The "type" attribute is REQUIRED. The "type" attribute is REQUIRED.
11.1.4.10. unknownsizeallowed 11.1.4.10. unknownsizeallowed
A boolean to express if an "EBML Element" MAY be used as an "Unknown- A boolean to express if an "EBML Element" MAY be used as an "Unknown-
Sized Element" (having all "VINT_DATA" bits of "Element Data Size" Sized Element" (having all "VINT_DATA" bits of "Element Data Size"
set to 1). "EBML Elements" that are not "Master Elements" MUST NOT set to 1). "EBML Elements" that are not "Master Elements" MUST NOT
set "unknownsizeallowed" to true. set "unknownsizeallowed" to true. An "EBML Element" that is defined
with an "unknownsizeallowed" attribute set to 1 MUST also have the
"unknownsizeallowed" attribute of its "Parent Element" set to 1.
The "unknownsizeallowed" attribute is OPTIONAL. If the The "unknownsizeallowed" attribute is OPTIONAL. If the
"unknownsizeallowed" attribute is not used then that "EBML Element" "unknownsizeallowed" attribute is not used then that "EBML Element"
is not allowed to use an unknown "Element Data Size". is not allowed to use an unknown "Element Data Size".
11.1.4.11. recursive 11.1.4.11. recursive
A boolean to express if an "EBML Element" MAY be stored recursively. A boolean to express if an "EBML Element" MAY be stored recursively.
In this case the "EBML Element" MAY be stored at levels greater that In this case the "EBML Element" MAY be stored within another "EBML
defined in the "level" attribute if the "EBML Element" is a "Child Element" that has the same "Element ID". Which itself can be stored
Element" of a "Parent Element" with the same "Element ID". "EBML in an "EBML Element" that has the same "Element ID", and so on.
Elements" that are not "Master Elements" MUST NOT set "recursive" to "EBML Elements" that are not "Master Elements" MUST NOT set
true. "recursive" to true.
If the "path" contains a "EBMLPathAtomRecursive" part then the If the "path" contains a "EBMLPathAtomRecursive" part then the
"recursive" value MUST be true and false otherwise. "recursive" value MUST be true and false otherwise.
The "recursive" attribute is OPTIONAL. If the "recursive" attribute The "recursive" attribute is OPTIONAL. If the "recursive" attribute
is not present then the "EBML Element" MUST NOT be used recursively. is not present then the "EBML Element" MUST NOT be used recursively.
11.1.4.12. minver 11.1.4.12. minver
The "minver" (minimum version) attribute stores a non-negative The "minver" (minimum version) attribute stores a non-negative
skipping to change at page 23, line 14 skipping to change at page 22, line 38
11.1.4.13. maxver 11.1.4.13. maxver
The "maxver" (maximum version) attribute stores a non-negative The "maxver" (maximum version) attribute stores a non-negative
integer that represents the last or most recent version of the integer that represents the last or most recent version of the
"docType" to support the element. "maxver" MUST be greater than or "docType" to support the element. "maxver" MUST be greater than or
equal to "minver". equal to "minver".
The "maxver" attribute is OPTIONAL. If the "maxver" attribute is not The "maxver" attribute is OPTIONAL. If the "maxver" attribute is not
present then the "EBML Element" has a maximum version equal to the present then the "EBML Element" has a maximum version equal to the
value stored in the "version" attribute of . value stored in the "version" attribute of "<EBMLSchema>".
11.1.5. Element 11.1.5. Element
The "<documentation>" element provides additional information about The "<documentation>" element provides additional information about
the "EBML Element". the "EBML Element".
11.1.6. Attributes 11.1.6. Attributes
11.1.6.1. lang 11.1.6.1. lang
skipping to change at page 23, line 39 skipping to change at page 23, line 14
11.1.6.2. type 11.1.6.2. type
A "type" attribute distinguishes the meaning of the documentation. A "type" attribute distinguishes the meaning of the documentation.
Values for the "<documentation>" sub-element's "type" attribute MUST Values for the "<documentation>" sub-element's "type" attribute MUST
include one of the following: "definition", "rationale", "usage include one of the following: "definition", "rationale", "usage
notes", and "references". notes", and "references".
The "type" attribute is OPTIONAL. The "type" attribute is OPTIONAL.
11.1.7. EBML Schema Example 11.1.7. Element
The "<restriction>" element provides information about restrictions
to the allowable values for the "EBML Element" which are listed in
"<enum>" elements.
11.1.8. Element
The "<enum>" element stores a list of values allowed for storage in
the "EBML Element". The values MUST match the "type" of the "EBML
Element" (for example "<enum value="Yes">" can not be a valid value
for a "EBML Element" that is defined as an unsigned integer). An
"<enum>" element MAY also store "<documentation>" elements to further
describe the "<enum>".
11.1.9. Attributes
11.1.9.1. label
The "label" provides a concise expression for human consumption that
describes what the "value" of the "<enum>" represents.
The "label" attribute is OPTIONAL.
11.1.9.2. value
The "value" represents data that MAY be stored within the "EBML
Element".
The "value" attribute is REQUIRED.
11.1.10. XML Schema for EBML Schema
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="https://ietf.org/cellar/ebml" targetNamespace="https://ietf.org/cellar/ebml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="01">
<xsd:element name="EBMLSchema" type="EBMLSchemaType"/>
<xsd:complexType name="EBMLSchemaType">
<xsd:sequence>
<xsd:element name="element" type="elementType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="docType" use="required"/>
<xsd:attribute name="version" use="required"/>
</xsd:complexType>
<xsd:complexType name="elementType">
<xsd:sequence>
<xsd:element name="documentation" type="documentationType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="restriction" type="restrictionType" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="name" use="required"/>
<xsd:attribute name="path" use="required"/>
<xsd:attribute name="id" use="required"/>
<xsd:attribute name="minOccurs" default="0"/>
<xsd:attribute name="maxOccurs" default="1"/>
<xsd:attribute name="range"/>
<xsd:attribute name="size"/>
<xsd:attribute name="default"/>
<xsd:attribute name="type" use="required"/>
<xsd:attribute name="unknownsizeallowed"/>
<xsd:attribute name="recursive"/>
<xsd:attribute name="minver" default="1"/>
<xsd:attribute name="maxver"/>
</xsd:complexType>
<xsd:complexType name="restrictionType">
<xsd:sequence>
<xsd:element name="enum" type="enumType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="enumType">
<xsd:sequence>
<xsd:element name="documentation" type="documentationType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="label"/>
<xsd:attribute name="value" use="required"/>
</xsd:complexType>
<xsd:complexType name="documentationType" mixed="true">
<xsd:sequence>
<xsd:any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="lang"/>
<xsd:attribute name="type"/>
</xsd:complexType>
</xsd:schema>
11.1.11. EBML Schema Example
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<EBMLSchema docType="files-in-ebml-demo" version="1"> <EBMLSchema xmlns="https://ietf.org/cellar/ebml" docType="files-in-ebml-demo" version="1">
<!-- Root Element--> <!-- Root Element-->
<element name="Files" path="*1(\Files)" id="0x1946696C" type="master"> <element name="Files" path="*1(\Files)" id="0x1946696C" type="master">
<documentation lang="en" type="definition">Container of data and <documentation lang="en" type="definition">Container of data and
attributes representing one or many files.</documentation> attributes representing one or many files.</documentation>
</element> </element>
<element name="File" path="1*(\Files\File)" id="0x6146" type="master" minOccurs="1" <element name="File" path="1*(\Files\File)" id="0x6146" type="master" minOccurs="1">
maxOccurs="unbounded">
<documentation lang="en" type="definition">An attached file.</documentation> <documentation lang="en" type="definition">An attached file.</documentation>
</element> </element>
<element name="FileName" path="1*1(\Files\File\FileName)" id="0x614E" type="utf-8" <element name="FileName" path="1*1(\Files\File\FileName)" id="0x614E" type="utf-8"
minOccurs="1"> minOccurs="1">
<documentation lang="en" type="definition">Filename of the attached file. <documentation lang="en" type="definition">Filename of the attached file.
</documentation> </documentation>
</element> </element>
<element name="MimeType" path="1*1(\Files\File\MimeType)" id="0x464D" type="string" <element name="MimeType" path="1*1(\Files\File\MimeType)" id="0x464D" type="string"
minOccurs="1"> minOccurs="1">
<documentation lang="en" type="definition">MIME type of the file.</documentation> <documentation lang="en" type="definition">MIME type of the file.</documentation>
skipping to change at page 24, line 35 skipping to change at page 25, line 36
id="0x4654" type="date" minOccurs="1"> id="0x4654" type="date" minOccurs="1">
<documentation lang="en" type="definition">Modification timestamp of the file. <documentation lang="en" type="definition">Modification timestamp of the file.
</documentation> </documentation>
</element> </element>
<element name="Data" path="1*1(\Files\File\Data)" id="0x4664" type="binary" <element name="Data" path="1*1(\Files\File\Data)" id="0x4664" type="binary"
minOccurs="1"> minOccurs="1">
<documentation lang="en" type="definition">The data of the file.</documentation> <documentation lang="en" type="definition">The data of the file.</documentation>
</element> </element>
</EBMLSchema> </EBMLSchema>
11.1.8. Identically Recurring Elements 11.1.12. Identically Recurring Elements
An "Identically Recurring Element" is an "EBML Element" that MAY An "Identically Recurring Element" is an "EBML Element" that MAY
occur within its "Parent Element" more than once but that each occur within its "Parent Element" more than once but that each
recurrence within that "Parent Element" MUST be identical both in recurrence within that "Parent Element" MUST be identical both in
storage and semantics. "Identically Recurring Elements" are storage and semantics. "Identically Recurring Elements" are
permitted to be stored multiple times within the same "Parent permitted to be stored multiple times within the same "Parent
Element" in order to increase data resilience and optimize the use of Element" in order to increase data resilience and optimize the use of
"EBML" in transmission. For instance a pertinent "Top-Level Element" "EBML" in transmission. For instance a pertinent "Top-Level Element"
could be periodically resent within a data stream so that an "EBML could be periodically resent within a data stream so that an "EBML
Reader" which starts reading the stream from the middle could better Reader" which starts reading the stream from the middle could better
skipping to change at page 25, line 11 skipping to change at page 26, line 12
transmission. If a "Parent Element" contains more than one copy of transmission. If a "Parent Element" contains more than one copy of
an "Identically Recurring Element" which includes a "CRC-32 Element" an "Identically Recurring Element" which includes a "CRC-32 Element"
as a "Child Element" then the first instance of the "Identically as a "Child Element" then the first instance of the "Identically
Recurring Element" with a valid CRC-32 value should be used for Recurring Element" with a valid CRC-32 value should be used for
interpretation. If a "Parent Element" contains more than one copy of interpretation. If a "Parent Element" contains more than one copy of
an "Identically Recurring Element" which does not contain a "CRC-32 an "Identically Recurring Element" which does not contain a "CRC-32
Element" or if "CRC-32 Elements" are present but none are valid then Element" or if "CRC-32 Elements" are present but none are valid then
the first instance of the "Identically Recurring Element" should be the first instance of the "Identically Recurring Element" should be
used for interpretation. used for interpretation.
11.1.9. Expression of range 11.1.13. Expression of range
The "range" attribute MUST only be used with EBML Elements that are The "range" attribute MUST only be used with "EBML Elements" that are
either "signed integer", "unsigned integer", "float", or "date". The either "signed integer", "unsigned integer", "float", or "date". The
"range" expression may contain whitespace for readability but "range" expression may contain whitespace for readability but
whitespace within a "range" expression MUST NOT convey meaning. The whitespace within a "range" expression MUST NOT convey meaning. The
expression of the "range" MUST adhere to one of the following forms: expression of the "range" MUST adhere to one of the following forms:
o "x-y" where x and y are integers or floats and "y" MUST be greater o "x-y" where x and y are integers or floats and "y" MUST be greater
than "x", meaning that the value MUST be greater than or equal to than "x", meaning that the value MUST be greater than or equal to
"x" and less than or equal to "y". "x" MUST be less than "y". "x" and less than or equal to "y". "x" MUST be less than "y".
o ">x" where "x" is an integer or float, meaning that the value MUST o ">x" where "x" is an integer or float, meaning that the value MUST
skipping to change at page 25, line 39 skipping to change at page 26, line 40
o "<x" where "x" is an integer or float, meaning that the value MUST o "<x" where "x" is an integer or float, meaning that the value MUST
be less than "x". be less than "x".
o "<=x" where "x" is an integer or float, meaning that the value o "<=x" where "x" is an integer or float, meaning that the value
MUST be less than or equal to "x". MUST be less than or equal to "x".
o "x" where "x" is an integer or float, meaning that the value MUST o "x" where "x" is an integer or float, meaning that the value MUST
be equal "x". be equal "x".
The "range" may use the prefix "not" to indicate that the expressed The "range" may use the prefix "not" to indicate that the expressed
range is negated. Please also see Section 11.1.10. range is negated. Please also see Section 11.1.14.
11.1.10. Textual expression of Floats 11.1.14. Textual expression of Floats
When a float value is represented textually in an "EBML Schema", such When a float value is represented textually in an "EBML Schema", such
as within a "default" or "range" value, the float values MUST be as within a "default" or "range" value, the float values MUST be
expressed as Hexadecimal Floating-Point Constants as defined in the expressed as Hexadecimal Floating-Point Constants as defined in the
C11 standard [ISO.9899.2011] (see section 6.4.4.2 on Floating C11 standard [ISO.9899.2011] (see section 6.4.4.2 on Floating
Constants). The following table provides examples of expressions of Constants). The following table provides examples of expressions of
float ranges. float ranges.
+-------------------+-----------------------------------------+ +-------------------+-----------------------------------------+
| as decimal | as Hexadecimal Floating-Point Constants | | as decimal | as Hexadecimal Floating-Point Constants |
skipping to change at page 26, line 26 skipping to change at page 27, line 26
maximum value permitted by the range. Hexadecimal Floating-Point maximum value permitted by the range. Hexadecimal Floating-Point
Constants also use a "-" (hyphen) when indicating a negative binary Constants also use a "-" (hyphen) when indicating a negative binary
power. Within a float range, when a "-" (hyphen) is immediately power. Within a float range, when a "-" (hyphen) is immediately
preceded by a letter "p", then the "-" (hyphen) is a part of the preceded by a letter "p", then the "-" (hyphen) is a part of the
Hexadecimal Floating-Point Constant which notes negative binary Hexadecimal Floating-Point Constant which notes negative binary
power. Within a float range, when a "-" (hyphen) is not immediately power. Within a float range, when a "-" (hyphen) is not immediately
preceded by a letter "p", then the "-" (hyphen) represents the preceded by a letter "p", then the "-" (hyphen) represents the
separator between the minimal and maximum value permitted by the separator between the minimal and maximum value permitted by the
range. range.
11.1.11. Note on the Use of default attributes to define Mandatory EBML 11.1.15. Note on the Use of default attributes to define Mandatory EBML
Elements Elements
If a "Mandatory EBML Element" has a default value declared by an If a "Mandatory EBML Element" has a default value declared by an
"EBML Schema" and the value of the "EBML Element" is equal to the "EBML Schema" and the value of the "EBML Element" is equal to the
declared default value then that "EBML Element" is not required to be declared default value then that "EBML Element" is not required to be
present within the "EBML Document" if its "Parent Element" is present within the "EBML Document" if its "Parent Element" is
present. In this case, the default value of the "Mandatory EBML present. In this case, the default value of the "Mandatory EBML
Element" MUST be interpreted by the "EBML Reader" although the "EBML Element" MUST be interpreted by the "EBML Reader" although the "EBML
Element" is not present within its "Parent Element". Element" is not present within its "Parent Element".
skipping to change at page 27, line 52 skipping to change at page 28, line 52
name: "EBMLVersion" name: "EBMLVersion"
path: "1*1(\EBML\EBMLVersion)" path: "1*1(\EBML\EBMLVersion)"
id "0x4286" id "0x4286"
minOccurs: 1 minOccurs: 1
maxOccurs: 1 maxOccurs: 1
range: 1 range: not 0
default: 1 default: 1
type: Unsigned Integer type: Unsigned Integer
description: The version of "EBML Writer" used to create the "EBML description: The version of "EBML" specifications used to create the
Document". "EBML Document". The version of "EBML" defined in this document is
1, so "EBMLVersion" SHOULD be 1.
11.2.3. EBMLReadVersion Element 11.2.3. EBMLReadVersion Element
name: "EBMLReadVersion" name: "EBMLReadVersion"
path: "1*1(\EBML\EBMLReadVersion)" path: "1*1(\EBML\EBMLReadVersion)"
id: "0x42F7" id: "0x42F7"
minOccurs: 1 minOccurs: 1
skipping to change at page 31, line 19 skipping to change at page 32, line 19
size: 4 size: 4
type: Binary type: Binary
description: The "CRC-32 Element" contains a 32-bit Cyclic Redundancy description: The "CRC-32 Element" contains a 32-bit Cyclic Redundancy
Check value of all the "Element Data" of the "Parent Element" as Check value of all the "Element Data" of the "Parent Element" as
stored except for the "CRC-32 Element" itself. When the "CRC-32 stored except for the "CRC-32 Element" itself. When the "CRC-32
Element" is present, the "CRC-32 Element" MUST be the first ordered Element" is present, the "CRC-32 Element" MUST be the first ordered
"EBML Element" within its "Parent Element" for easier reading. All "EBML Element" within its "Parent Element" for easier reading. All
"Top-Level Elements" of an "EBML Document" SHOULD include a "CRC-32 "Top-Level Elements" of an "EBML Document" that are "Master Elements"
Element" as a "Child Element". The CRC in use is the IEEE-CRC-32 SHOULD include a "CRC-32 Element" as a "Child Element". The CRC in
algorithm as used in the [ISO.3309.1979] standard and in section use is the IEEE-CRC-32 algorithm as used in the [ISO.3309.1979]
8.1.1.6.2 of [ITU.V42.1994], with initial value of "0xFFFFFFFF". The standard and in section 8.1.1.6.2 of [ITU.V42.1994], with initial
CRC value MUST be computed on a little endian bitstream and MUST use value of "0xFFFFFFFF". The CRC value MUST be computed on a little
little endian storage. endian bitstream and MUST use little endian storage.
11.3.1. Void Element 11.3.1. Void Element
name: Void name: Void
path: "*((*\)\Void)" path: "*((*\)\Void)"
id: "0xEC" id: "0xEC"
minOccurs: 0 minOccurs: 0
maxOccurs: unbounded
type: Binary type: Binary
description: Used to void damaged data, to avoid unexpected behaviors description: Used to void damaged data, to avoid unexpected behaviors
when using damaged data. The content is discarded. Also used to when using damaged data. The content is discarded. Also used to
reserve space in a sub-element for later use. reserve space in a sub-element for later use.
12. References 12. References
12.1. Normative References 12.1. Normative References
 End of changes. 68 change blocks. 
148 lines changed or deleted 236 lines changed or added

This html diff was produced by rfcdiff 1.45. The latest version is available from http://tools.ietf.org/tools/rfcdiff/