idnits 2.17.1 draft-ietf-cellar-ebml-17.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (27 January 2020) is 1550 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'EBMLParents' is mentioned on line 1024, but not defined == Missing Reference: 'IsRecursive' is mentioned on line 1031, but not defined == Missing Reference: 'PathMinOccurrence' is mentioned on line 1039, but not defined == Missing Reference: 'PathMaxOccurrence' is mentioned on line 1039, but not defined == Missing Reference: '0-9A-F' is mentioned on line 1614, but not defined -- Possible downref: Non-RFC (?) normative reference: ref. 'ITU.V42.1994' -- Possible downref: Non-RFC (?) normative reference: ref. 'IEEE.754.1985' Summary: 0 errors (**), 0 flaws (~~), 6 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 cellar S. Lhomme 3 Internet-Draft 4 Intended status: Standards Track D. Rice 5 Expires: 30 July 2020 6 M. Bunkus 7 27 January 2020 9 Extensible Binary Meta Language 10 draft-ietf-cellar-ebml-17 12 Abstract 14 This document defines the Extensible Binary Meta Language (EBML) 15 format as a binary container format designed for audio/video storage. 16 EBML is designed as a binary equivalent to XML and uses a storage- 17 efficient approach to build nested Elements with identifiers, 18 lengths, and values. Similar to how an XML Schema defines the 19 structure and semantics of an XML Document, this document defines how 20 EBML Schemas are created to convey the semantics of an EBML Document. 22 Status of This Memo 24 This Internet-Draft is submitted in full conformance with the 25 provisions of BCP 78 and BCP 79. 27 Internet-Drafts are working documents of the Internet Engineering 28 Task Force (IETF). Note that other groups may also distribute 29 working documents as Internet-Drafts. The list of current Internet- 30 Drafts is at https://datatracker.ietf.org/drafts/current/. 32 Internet-Drafts are draft documents valid for a maximum of six months 33 and may be updated, replaced, or obsoleted by other documents at any 34 time. It is inappropriate to use Internet-Drafts as reference 35 material or to cite them other than as "work in progress." 37 This Internet-Draft will expire on 30 July 2020. 39 Copyright Notice 41 Copyright (c) 2020 IETF Trust and the persons identified as the 42 document authors. All rights reserved. 44 This document is subject to BCP 78 and the IETF Trust's Legal 45 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 46 license-info) in effect on the date of publication of this document. 47 Please review these documents carefully, as they describe your rights 48 and restrictions with respect to this document. Code Components 49 extracted from this document must include Simplified BSD License text 50 as described in Section 4.e of the Trust Legal Provisions and are 51 provided without warranty as described in the Simplified BSD License. 53 Table of Contents 55 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 56 2. Notation and Conventions . . . . . . . . . . . . . . . . . . 4 57 3. Structure . . . . . . . . . . . . . . . . . . . . . . . . . . 6 58 4. Variable Size Integer . . . . . . . . . . . . . . . . . . . . 7 59 4.1. VINT_WIDTH . . . . . . . . . . . . . . . . . . . . . . . 7 60 4.2. VINT_MARKER . . . . . . . . . . . . . . . . . . . . . . . 7 61 4.3. VINT_DATA . . . . . . . . . . . . . . . . . . . . . . . . 7 62 4.4. VINT Examples . . . . . . . . . . . . . . . . . . . . . . 8 63 5. Element ID . . . . . . . . . . . . . . . . . . . . . . . . . 9 64 6. Element Data Size . . . . . . . . . . . . . . . . . . . . . . 11 65 6.1. Data Size Format . . . . . . . . . . . . . . . . . . . . 11 66 6.2. Unknown Data Size . . . . . . . . . . . . . . . . . . . . 12 67 6.3. Data Size Values . . . . . . . . . . . . . . . . . . . . 14 68 7. EBML Element Types . . . . . . . . . . . . . . . . . . . . . 15 69 7.1. Signed Integer Element . . . . . . . . . . . . . . . . . 15 70 7.2. Unsigned Integer Element . . . . . . . . . . . . . . . . 16 71 7.3. Float Element . . . . . . . . . . . . . . . . . . . . . . 16 72 7.4. String Element . . . . . . . . . . . . . . . . . . . . . 16 73 7.5. UTF-8 Element . . . . . . . . . . . . . . . . . . . . . . 16 74 7.6. Date Element . . . . . . . . . . . . . . . . . . . . . . 17 75 7.7. Master Element . . . . . . . . . . . . . . . . . . . . . 17 76 7.8. Binary Element . . . . . . . . . . . . . . . . . . . . . 17 77 8. EBML Document . . . . . . . . . . . . . . . . . . . . . . . . 18 78 8.1. EBML Header . . . . . . . . . . . . . . . . . . . . . . . 18 79 8.2. EBML Body . . . . . . . . . . . . . . . . . . . . . . . . 18 80 9. EBML Stream . . . . . . . . . . . . . . . . . . . . . . . . . 19 81 10. EBML Versioning . . . . . . . . . . . . . . . . . . . . . . . 19 82 10.1. EBML Header Version . . . . . . . . . . . . . . . . . . 19 83 10.2. EBML Document Version . . . . . . . . . . . . . . . . . 19 84 11. Elements semantic . . . . . . . . . . . . . . . . . . . . . . 19 85 11.1. EBML Schema . . . . . . . . . . . . . . . . . . . . . . 19 86 11.1.1. EBML Schema Example . . . . . . . . . . . . . . . . 20 87 11.1.2. Element . . . . . . . . . . . . . . . . 21 88 11.1.3. Attributes . . . . . . . . . . . . . . 21 89 11.1.4. Element . . . . . . . . . . . . . . . . . 22 90 11.1.5. Attributes . . . . . . . . . . . . . . . . 22 91 11.1.6. Element . . . . . . . . . . . . . . 30 92 11.1.7. Attributes . . . . . . . . . . . . . 30 93 11.1.8. Element . . . . . . . . . . . 31 94 11.1.9. Attributes . . . . . . . . . . 32 95 11.1.10. Element . . . . . . . . . . . . . . . 33 96 11.1.11. Element . . . . . . . . . . . . . . . . . . . 33 97 11.1.12. Attributes . . . . . . . . . . . . . . . . . 34 98 11.1.13. Element . . . . . . . . . . . . . . . . 34 99 11.1.14. Attributes . . . . . . . . . . . . . . . 34 100 11.1.15. XML Schema for EBML Schema . . . . . . . . . . . . . 35 101 11.1.16. Identically Recurring Elements . . . . . . . . . . . 38 102 11.1.17. Textual expression of floats . . . . . . . . . . . . 39 103 11.1.18. Note on the use of default attributes to define 104 Mandatory EBML Elements . . . . . . . . . . . . . . . 40 105 11.2. EBML Header Elements . . . . . . . . . . . . . . . . . . 41 106 11.2.1. EBML Element . . . . . . . . . . . . . . . . . . . . 41 107 11.2.2. EBMLVersion Element . . . . . . . . . . . . . . . . 41 108 11.2.3. EBMLReadVersion Element . . . . . . . . . . . . . . 41 109 11.2.4. EBMLMaxIDLength Element . . . . . . . . . . . . . . 42 110 11.2.5. EBMLMaxSizeLength Element . . . . . . . . . . . . . 42 111 11.2.6. DocType Element . . . . . . . . . . . . . . . . . . 43 112 11.2.7. DocTypeVersion Element . . . . . . . . . . . . . . . 43 113 11.2.8. DocTypeReadVersion Element . . . . . . . . . . . . . 44 114 11.2.9. DocTypeExtension Element . . . . . . . . . . . . . . 44 115 11.2.10. DocTypeExtensionName Element . . . . . . . . . . . . 45 116 11.2.11. DocTypeExtensionVersion Element . . . . . . . . . . 45 117 11.3. Global Elements . . . . . . . . . . . . . . . . . . . . 46 118 11.3.1. CRC-32 Element . . . . . . . . . . . . . . . . . . . 46 119 11.3.2. Void Element . . . . . . . . . . . . . . . . . . . . 47 120 12. Considerations for Reading EBML Data . . . . . . . . . . . . 47 121 13. Terminating Elements . . . . . . . . . . . . . . . . . . . . 48 122 14. Guidelines for Updating Elements . . . . . . . . . . . . . . 49 123 14.1. Reducing a Element Data in Size . . . . . . . . . . . . 49 124 14.1.1. Adding a Void Element . . . . . . . . . . . . . . . 49 125 14.1.2. Extending the Element Data Size . . . . . . . . . . 49 126 14.1.3. Terminating Element Data . . . . . . . . . . . . . . 50 127 14.2. Considerations when Updating Elements with Cyclic 128 Redundancy Check (CRC) . . . . . . . . . . . . . . . . . 51 129 15. Backward and Forward Compatibility . . . . . . . . . . . . . 51 130 15.1. Backward Compatibility . . . . . . . . . . . . . . . . . 51 131 15.2. Forward Compatibility . . . . . . . . . . . . . . . . . 52 132 16. Security Considerations . . . . . . . . . . . . . . . . . . . 52 133 17. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 53 134 17.1. EBML Element ID Registry . . . . . . . . . . . . . . . . 54 135 17.2. EBML DocType Registry . . . . . . . . . . . . . . . . . 57 136 18. Normative References . . . . . . . . . . . . . . . . . . . . 57 137 19. Informative References . . . . . . . . . . . . . . . . . . . 59 138 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 59 140 1. Introduction 142 EBML, short for Extensible Binary Meta Language, specifies a binary 143 and octet (byte) aligned format inspired by the principle of XML (a 144 framework for structuring data). 146 The goal of this document is to define a generic, binary, space- 147 efficient format that can be used to define more complex formats 148 using an EBML Schema. EBML is used by the multimedia container, 149 Matroska [Matroska]. The applicability of EBML for other use cases 150 is beyond the scope of this document. 152 The definition of the EBML format recognizes the idea behind HTML and 153 XML as a good one: separate structure and semantics allowing the same 154 structural layer to be used with multiple, possibly widely differing 155 semantic layers. Except for the EBML Header and a few Global 156 Elements this specification does not define particular EBML format 157 semantics; however this specification is intended to define how other 158 EBML-based formats can be defined, such as the audio-video container 159 formats Matroska and WebM [WebM]. 161 EBML uses a simple approach of building Elements upon three pieces of 162 data (tag, length, and value) as this approach is well known, easy to 163 parse, and allows selective data parsing. The EBML structure 164 additionally allows for hierarchical arrangement to support complex 165 structural formats in an efficient manner. 167 A typical EBML file has the following structure: 169 EBML Header (master) 170 + DocType (string) 171 + DocTypeVersion (unsigned integer) 172 EBML Body Root (master) 173 + ElementA (utf-8) 174 + Parent (master) 175 + ElementB (integer) 176 + Parent (master) 177 + ElementB (integer) 179 2. Notation and Conventions 181 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 182 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 183 "OPTIONAL" in this document are to be interpreted as described in BCP 184 14 [RFC2119] [RFC8174] when, and only when, they appear in all 185 capitals, as shown here. 187 This document defines specific terms in order to define the format 188 and application of "EBML". Specific terms are defined below: 190 "EBML": Extensible Binary Meta Language 192 "EBML Document Type": A name provided by an "EBML Schema" to 193 designate a particular implementation of "EBML" for a data format 194 (e.g.: matroska and webm). 196 "EBML Schema": A standardized definition for the structure of an 197 "EBML Document Type". 199 "EBML Document": A datastream comprised of only two components, an 200 "EBML Header" and an "EBML Body". 202 "EBML Reader": A data parser that interprets the semantics of an 203 "EBML Document" and creates a way for programs to use "EBML". 205 "EBML Stream": A file that consists of one or more "EBML Documents" 206 that are concatenated together. 208 "EBML Header": A declaration that provides processing instructions 209 and identification of the "EBML Body". The "EBML Header" is 210 analogous to an XML Declaration [W3C.REC-xml-20081126] (see section 211 2.8 on Prolog and Document Type Declaration). 213 "EBML Body": All data of an "EBML Document" following the "EBML 214 Header". 216 "Variable Size Integer": A compact variable-length binary value which 217 defines its own length. 219 "VINT": Also known as "Variable Size Integer". 221 "EBML Element": A foundation block of data that contains three parts: 222 an "Element ID", an "Element Data Size", and "Element Data". 224 "Element ID": The "Element ID" is a binary value, encoded as a 225 "Variable Size Integer", used to uniquely identify a defined "EBML 226 Element" within a specific "EBML Schema". 228 "Element Data Size": An expression, encoded as a "Variable Size 229 Integer", of the length in octets of "Element Data". 231 "VINTMAX": The maximum possible value that can be stored as "Element 232 Data Size". 234 "Unknown-Sized Element": An "Element" with an unknown "Element Data 235 Size". 237 "Element Data": The value(s) of the "EBML Element" which is 238 identified by its "Element ID" and "Element Data Size". The form of 239 the "Element Data" is defined by this document and the corresponding 240 "EBML Schema" of the Element's "EBML Document Type". 242 "Root Level": The starting level in the hierarchy of an "EBML 243 Document". 245 "Root Element": A mandatory, non-repeating "EBML Element" which 246 occurs at the top level of the path hierarchy within an "EBML Body" 247 and contains all other "EBML Elements" of the "EBML Body", excepting 248 optional "Void Elements". 250 "Top-Level Element": An "EBML Element" defined to only occur as a 251 "Child Element" of the "Root Element". 253 "Master Element": The "Master Element" contains zero, one, or many 254 other "EBML Elements". 256 "Child Element": A "Child Element" is a relative term to describe the 257 "EBML Elements" immediately contained within a "Master Element". 259 "Parent Element": A relative term to describe the "Master Element" 260 which contains a specified element. For any specified "EBML Element" 261 that is not at "Root Level", the "Parent Element" refers to the 262 "Master Element" in which that "EBML Element" is directly contained. 264 "Descendant Element": A relative term to describe any "EBML Elements" 265 contained within a "Master Element", including any of the "Child 266 Elements" of its "Child Elements", and so on. 268 "Void Element": A "Void Element" is an "Element" used to overwrite 269 data or reserve space within a "Master Element" for later use. 271 "Element Name": The human-readable name of the "EBML Element". 273 "Element Path": The hierarchy of "Parent Element" where the "EBML 274 Element" is expected to be found in the "EBML Body". 276 "Empty Element": An "EBML Element" that has an "Element Data Size" 277 with all "VINT_DATA" bits set to zero, which indicates that the 278 "Element Data" of the "Element" is zero octets in length. 280 3. Structure 282 EBML uses a system of Elements to compose an EBML Document. EBML 283 Elements incorporate three parts: an Element ID, an Element Data 284 Size, and Element Data. The Element Data, which is described by the 285 Element ID, includes either binary data, one or more other EBML 286 Elements, or both. 288 4. Variable Size Integer 290 The Element ID and Element Data Size are both encoded as a Variable 291 Size Integer. The Variable Size Integer is composed of a VINT_WIDTH, 292 VINT_MARKER, and VINT_DATA, in that order. Variable Size Integers 293 MUST left-pad the VINT_DATA value with zero bits so that the whole 294 Variable Size Integer is octet-aligned. Variable Size Integer will 295 be referred to as VINT for shorthand. 297 4.1. VINT_WIDTH 299 Each Variable Size Integer starts with a VINT_WIDTH followed by a 300 VINT_MARKER. VINT_WIDTH is a sequence of zero or more bits of value 301 "0", and is terminated by the VINT_MARKER, which is a single bit of 302 value "1". The total length in bits of both VINT_WIDTH and 303 VINT_MARKER is the total length in octets in of the Variable Size 304 Integer. 306 The single bit "1" starts a Variable Size Integer with a length of 307 one octet. The sequence of bits "01" starts a Variable Size Integer 308 with a length of two octets. "001" starts a Variable Size Integer 309 with a length of three octets, and so on, with each additional 0-bit 310 adding one octet to the length of the Variable Size Integer. 312 4.2. VINT_MARKER 314 The VINT_MARKER serves as a separator between the VINT_WIDTH and 315 VINT_DATA. Each Variable Size Integer MUST contain exactly one 316 VINT_MARKER. The VINT_MARKER is one bit in length and contain a bit 317 with a value of one. The first bit with a value of one within the 318 Variable Size Integer is the VINT_MARKER. 320 4.3. VINT_DATA 322 The VINT_DATA portion of the Variable Size Integer includes all data 323 that follows (but not including) the VINT_MARKER until end of the 324 Variable Size Integer whose length is derived from the VINT_WIDTH. 325 The bits required for the VINT_WIDTH and the VINT_MARKER use one out 326 of every eight bits of the total length of the Variable Size Integer. 327 Thus a Variable Size Integer of 1 octet length supplies 7 bits for 328 VINT_DATA, a 2 octet length supplies 14 bits for VINT_DATA, and a 3 329 octet length supplies 21 bits for VINT_DATA. If the number of bits 330 required for VINT_DATA are less than the bit size of VINT_DATA, then 331 VINT_DATA MUST be zero-padded to the left to a size that fits. The 332 VINT_DATA value MUST be expressed as a big-endian unsigned integer. 334 4.4. VINT Examples 336 Table 1 shows examples of Variable Size Integers with lengths from 1 337 to 5 octets. The Usable Bits column refers to the number of bits 338 that can be used in the VINT_DATA. The Representation column depicts 339 a binary expression of Variable Size Integers where VINT_WIDTH is 340 depicted by "0", the VINT_MARKER as "1", and the VINT_DATA as "x". 342 +--------------+-------------+-------------------------------+ 343 | Octet Length | Usable Bits | Representation | 344 +==============+=============+===============================+ 345 | 1 | 7 | 1xxx xxxx | 346 +--------------+-------------+-------------------------------+ 347 | 2 | 14 | 01xx xxxx xxxx xxxx | 348 +--------------+-------------+-------------------------------+ 349 | 3 | 21 | 001x xxxx xxxx xxxx xxxx xxxx | 350 +--------------+-------------+-------------------------------+ 351 | 4 | 28 | 0001 xxxx xxxx xxxx xxxx xxxx | 352 | | | xxxx xxxx | 353 +--------------+-------------+-------------------------------+ 354 | 5 | 35 | 0000 1xxx xxxx xxxx xxxx xxxx | 355 | | | xxxx xxxx xxxx xxxx | 356 +--------------+-------------+-------------------------------+ 358 Table 1: VINT examples depicting usable bits 360 A Variable Size Integer may be rendered at octet lengths larger than 361 needed to store the data in order to facilitate overwriting it at a 362 later date, e.g. when its final size isn't known in advance. In 363 Table 2 an integer "2" (with a corresponding binary value of 0b10) is 364 shown encoded as different Variable Size Integers with lengths from 365 one octet to four octets. All four encoded examples have identical 366 semantic meaning though the VINT_WIDTH and the padding of the 367 VINT_DATA vary. 369 +---------+--------------+---------------------+--------------------+ 370 | Integer | Octet | As Represented in | As Represented in | 371 | | Length | VINT (binary) | VINT (hexadecimal) | 372 +=========+==============+=====================+====================+ 373 | 2 | 1 | 1000 0010 | 0x82 | 374 +---------+--------------+---------------------+--------------------+ 375 | 2 | 2 | 0100 0000 0000 0010 | 0x4002 | 376 +---------+--------------+---------------------+--------------------+ 377 | 2 | 3 | 0010 0000 0000 0000 | 0x200002 | 378 | | | 0000 0010 | | 379 +---------+--------------+---------------------+--------------------+ 380 | 2 | 4 | 0001 0000 0000 0000 | 0x10000002 | 381 | | | 0000 0000 0000 0010 | | 382 +---------+--------------+---------------------+--------------------+ 384 Table 2: VINT examples depicting the same integer value rendered 385 at different VINT lengths 387 5. Element ID 389 An Element ID is a Variable Size Integer. By default, Element IDs 390 are from one octet to four octets in length, although Element IDs of 391 greater lengths MAY be used if the EBMLMaxIDLength Element of the 392 EBML Header is set to a value greater than four (see Section 11.2.4). 393 The bits of the VINT_DATA component of the Element ID MUST NOT be all 394 "0" values or all "1" values. The VINT_DATA component of the Element 395 ID MUST be encoded at the shortest valid length. For example, an 396 Element ID with binary encoding of "1011 1111" is valid, whereas an 397 Element ID with binary encoding of "0100 0000 0011 1111" stores a 398 semantically equal VINT_DATA but is invalid because a shorter VINT 399 encoding is possible. Additionally, an Element ID with binary 400 encoding of "1111 1111" is invalid since the VINT_DATA section is set 401 to all one values, whereas an Element ID with binary encoding of 402 "0100 0000 0111 1111" stores a semantically equal VINT_DATA and is 403 the shortest possible VINT encoding. 405 Table 3 details these specific examples further: 407 +------------+-------------+----------------+--------------------+ 408 | VINT_WIDTH | VINT_MARKER | VINT_DATA | Element ID Status | 409 +============+=============+================+====================+ 410 | | 1 | 0000000 | Invalid: VINT_DATA | 411 | | | | MUST NOT be set to | 412 | | | | all 0 | 413 +------------+-------------+----------------+--------------------+ 414 | 0 | 1 | 00000000000000 | Invalid: VINT_DATA | 415 | | | | MUST NOT be set to | 416 | | | | all 0 | 417 +------------+-------------+----------------+--------------------+ 418 | | 1 | 0000001 | Valid | 419 +------------+-------------+----------------+--------------------+ 420 | 0 | 1 | 00000000000001 | Invalid: A shorter | 421 | | | | VINT_DATA encoding | 422 | | | | is available. | 423 +------------+-------------+----------------+--------------------+ 424 | | 1 | 0111111 | Valid | 425 +------------+-------------+----------------+--------------------+ 426 | 0 | 1 | 00000000111111 | Invalid: A shorter | 427 | | | | VINT_DATA encoding | 428 | | | | is available. | 429 +------------+-------------+----------------+--------------------+ 430 | | 1 | 1111111 | Invalid: VINT_DATA | 431 | | | | MUST NOT be set to | 432 | | | | all 1 | 433 +------------+-------------+----------------+--------------------+ 434 | 0 | 1 | 00000001111111 | Valid | 435 +------------+-------------+----------------+--------------------+ 437 Table 3: Examples of valid and invalid Element IDs 439 The range and count of possible Element IDs are determined by their 440 octet length. Examples of this are provided in Table 4. 442 +-------------------------+----------------+-----------------+ 443 | Element ID Octet Length | Range of Valid | Number of Valid | 444 | | Element IDs | Element IDs | 445 +=========================+================+=================+ 446 | 1 | 0x81 - 0xFE | 126 | 447 +-------------------------+----------------+-----------------+ 448 | 2 | 0x407F - | 16,256 | 449 | | 0x7FFE | | 450 +-------------------------+----------------+-----------------+ 451 | 3 | 0x203FFF - | 2,080,768 | 452 | | 0x3FFFFE | | 453 +-------------------------+----------------+-----------------+ 454 | 4 | 0x101FFFFF - | 268,338,304 | 455 | | 0x1FFFFFFE | | 456 +-------------------------+----------------+-----------------+ 458 Table 4: Examples of count and range for Element IDs at 459 various octet lengths 461 6. Element Data Size 463 6.1. Data Size Format 465 The Element Data Size expresses the length in octets of Element Data. 466 The Element Data Size itself is encoded as a Variable Size Integer. 467 By default, Element Data Sizes can be encoded in lengths from one 468 octet to eight octets, although Element Data Sizes of greater lengths 469 MAY be used if the octet length of the longest Element Data Size of 470 the EBML Document is declared in the EBMLMaxSizeLength Element of the 471 EBML Header (see Section 11.2.5). Unlike the VINT_DATA of the 472 Element ID, the VINT_DATA component of the Element Data Size is not 473 mandated to be encoded at the shortest valid length. For example, an 474 Element Data Size with binary encoding of 1011 1111 or a binary 475 encoding of 0100 0000 0011 1111 are both valid Element Data Sizes and 476 both store a semantically equal value (both 0b00000000111111 and 477 0b0111111, the VINT_DATA sections of the examples, represent the 478 integer 63). 480 Although an Element ID with all VINT_DATA bits set to zero is 481 invalid, an Element Data Size with all VINT_DATA bits set to zero is 482 allowed for EBML Element Types which do not mandate a non-zero length 483 (see Section 7). An Element Data Size with all VINT_DATA bits set to 484 zero indicates that the Element Data is zero octets in length. Such 485 an EBML Element is referred to as an Empty Element. If an Empty 486 Element has a default value declared then the EBML Reader MUST 487 interpret the value of the Empty Element as the default value. If an 488 Empty Element has no default value declared then the EBML Reader MUST 489 use the value of the Empty Element for the corresponding EBML Element 490 Type of the Element ID, 0 for numbers and an empty string for 491 strings. 493 6.2. Unknown Data Size 495 An Element Data Size with all VINT_DATA bits set to one is reserved 496 as an indicator that the size of the EBML Element is unknown. The 497 only reserved value for the VINT_DATA of Element Data Size is all 498 bits set to one. An EBML Element with an unknown Element Data Size 499 is referred to as an Unknown-Sized Element. Only a Master Element is 500 allowed to be of unknown size, and it can only be so if the 501 unknownsizeallowed attribute of its EBML Schema is set to true (see 502 Section 11.1.5.10). 504 The use of Unknown-Sized Elements allows for an EBML Element to be 505 written and read before the size of the EBML Element is known. 506 Unknown-Sized Elements MUST only be used if the Element Data Size is 507 not known before the Element Data is written, such as in some cases 508 of data streaming. The end of an Unknown-Sized Element is determined 509 by whichever comes first: 511 * Any EBML Element that is a valid Parent Element of the Unknown- 512 Sized Element according to the EBML Schema, Global Elements 513 excluded. 515 * Any valid EBML Element according to the EBML Schema, Global 516 Elements excluded, that is not a Descendant Element of the 517 Unknown-Sized Element but share a common direct parent, such as a 518 Top-Level Element. 520 * Any EBML Element that is a valid Root Element according to the 521 EBML Schema, Global Elements excluded. 523 * The end of the Parent Element with a known size has been reached. 525 * The end of the EBML Document, either when reaching the end of the 526 file or because a new EBML Header started. 528 Consider an Unknown-Sized Element which EBML path is 529 "\root\level1\level2\elt". When reading a new Element ID, assuming 530 the EBML Path of that new Element is valid, here are some possible 531 and impossible ways that this new Element is ending "elt": 533 +------------------------------------+---------------------------+ 534 | EBML Path of new element | Status | 535 +====================================+===========================+ 536 | "\root\level1\level2" | Ends the Unknown-Sized | 537 | | Element; as it is a new | 538 | | Parent Element | 539 +------------------------------------+---------------------------+ 540 | "\root\level1" | Ends the Unknown-Sized | 541 | | Element; as it is a new | 542 | | Parent Element | 543 +------------------------------------+---------------------------+ 544 | "\root" | Ends the Unknown-Sized | 545 | | Element; as it is a new | 546 | | Root Element | 547 +------------------------------------+---------------------------+ 548 | "\root2" | Ends the Unknown-Sized | 549 | | Element; as it is a new | 550 | | Root Element | 551 +------------------------------------+---------------------------+ 552 | "\root\level1\level2\other" | Ends the Unknown-Sized | 553 | | Element; as they share | 554 | | the same parent | 555 +------------------------------------+---------------------------+ 556 | "\root\level1\level2\elt" | Ends the Unknown-Sized | 557 | | Element; as they share | 558 | | the same parent | 559 +------------------------------------+---------------------------+ 560 | "\root\level1\level2\elt\inside" | Doesn't end the Unknown- | 561 | | Sized Element; it's a | 562 | | child of "elt" | 563 +------------------------------------+---------------------------+ 564 | "\root\level1\level2\elt\" | Global Element is valid; | 565 | | it's a child of "elt" | 566 +------------------------------------+---------------------------+ 567 | "\root\level1\level2\" | Global Element cannot be | 568 | | interpreted with this | 569 | | path; while parsing "elt" | 570 | | a Global Element can only | 571 | | be a child of "elt" | 572 +------------------------------------+---------------------------+ 574 Table 5: Examples of determining the end of an Unknown-Sized 575 Element 577 6.3. Data Size Values 579 For Element Data Sizes encoded at octet lengths from one to eight, 580 Table 6 depicts the range of possible values that can be encoded as 581 an Element Data Size. An Element Data Size with an octet length of 8 582 is able to express a size of 2^56-2 or 72,057,594,037,927,934 octets 583 (or about 72 petabytes). The maximum possible value that can be 584 stored as Element Data Size is referred to as VINTMAX. 586 +--------------+----------------------+ 587 | Octet Length | Possible Value Range | 588 +==============+======================+ 589 | 1 | 0 to 2^7 - 2 | 590 +--------------+----------------------+ 591 | 2 | 0 to 2^14 - 2 | 592 +--------------+----------------------+ 593 | 3 | 0 to 2^21 - 2 | 594 +--------------+----------------------+ 595 | 4 | 0 to 2^28 - 2 | 596 +--------------+----------------------+ 597 | 5 | 0 to 2^35 - 2 | 598 +--------------+----------------------+ 599 | 6 | 0 to 2^42 - 2 | 600 +--------------+----------------------+ 601 | 7 | 0 to 2^49 - 2 | 602 +--------------+----------------------+ 603 | 8 | 0 to 2^56 - 2 | 604 +--------------+----------------------+ 606 Table 6: Possible range of values 607 that can be stored in VINTs by 608 octet length. 610 If the length of Element Data equals 2^(n*7)-1 then the octet length 611 of the Element Data Size MUST be at least n+1. This rule prevents an 612 Element Data Size from being expressed as the unknown size value. 613 Table 7 clarifies this rule by showing a valid and invalid expression 614 of an Element Data Size with a VINT_DATA of 127 (which is equal to 615 2^(1*7)-1) and 16,383 (which is equal to 2^((2*7)-1).) 616 +------------+-------------+-----------------------+--------------+ 617 | VINT_WIDTH | VINT_MARKER | VINT_DATA | Element Data | 618 | | | | Size Status | 619 +============+=============+=======================+==============+ 620 | | 1 | 1111111 | Reserved | 621 | | | | (meaning | 622 | | | | Unknown) | 623 +------------+-------------+-----------------------+--------------+ 624 | 0 | 1 | 00000001111111 | Valid | 625 | | | | (meaning 127 | 626 | | | | octets) | 627 +------------+-------------+-----------------------+--------------+ 628 | 00 | 1 | 000000000000001111111 | Valid | 629 | | | | (meaning 127 | 630 | | | | octets) | 631 +------------+-------------+-----------------------+--------------+ 632 | 0 | 1 | 11111111111111 | Reserved | 633 | | | | (meaning | 634 | | | | Unknown) | 635 +------------+-------------+-----------------------+--------------+ 636 | 00 | 1 | 000000011111111111111 | Valid | 637 | | | | (16,383 | 638 | | | | octets) | 639 +------------+-------------+-----------------------+--------------+ 641 Table 7: Demonstration of VINT_DATA reservation for VINTs of 642 unknown size. 644 7. EBML Element Types 646 EBML Elements are defined by an EBML Schema (see Section 11.1) which 647 MUST declare one of the following EBML Element Types for each EBML 648 Element. An EBML Element Type defines a concept of storing data 649 within an EBML Element that describes such characteristics as length, 650 endianness, and definition. 652 EBML Elements which are defined as a Signed Integer Element, Unsigned 653 Integer Element, Float Element, or Date Element use big endian 654 storage. 656 7.1. Signed Integer Element 658 A Signed Integer Element MUST declare a length from zero to eight 659 octets. If the EBML Element is not defined to have a default value, 660 then a Signed Integer Element with a zero-octet length represents an 661 integer value of zero. 663 A Signed Integer Element stores an integer (meaning that it can be 664 written without a fractional component) which could be negative, 665 positive, or zero. Signed Integers are stored with two's complement 666 notation with the leftmost bit being the sign bit. Because EBML 667 limits Signed Integers to 8 octets in length a Signed Integer Element 668 stores a number from -9,223,372,036,854,775,808 to 669 +9,223,372,036,854,775,807. 671 7.2. Unsigned Integer Element 673 An Unsigned Integer Element MUST declare a length from zero to eight 674 octets. If the EBML Element is not defined to have a default value, 675 then an Unsigned Integer Element with a zero-octet length represents 676 an integer value of zero. 678 An Unsigned Integer Element stores an integer (meaning that it can be 679 written without a fractional component) which could be positive or 680 zero. Because EBML limits Unsigned Integers to 8 octets in length an 681 Unsigned Integer Element stores a number from 0 to 682 18,446,744,073,709,551,615. 684 7.3. Float Element 686 A Float Element MUST declare a length of either zero octet (0 bit), 687 four octets (32 bit) or eight octets (64 bit). If the EBML Element 688 is not defined to have a default value, then a Float Element with a 689 zero-octet length represents a numerical value of zero. 691 A Float Element stores a floating-point number in the 32-bit and 692 64-bit binary interchange format as defined in [IEEE.754.1985]. 694 7.4. String Element 696 A String Element MUST declare a length in octets from zero to 697 VINTMAX. If the EBML Element is not defined to have a default value, 698 then a String Element with a zero-octet length represents an empty 699 string. 701 A String Element MUST either be empty (zero-length) or contain 702 printable ASCII characters [RFC0020] in the range of 0x20 to 0x7E, 703 with an exception made for termination (see Section 13). 705 7.5. UTF-8 Element 707 A UTF-8 Element MUST declare a length in octets from zero to VINTMAX. 708 If the EBML Element is not defined to have a default value, then a 709 UTF-8 Element with a zero-octet length represents an empty string. 711 A UTF-8 Element contains only a valid Unicode string as defined in 712 [RFC3629], with an exception made for termination (see Section 13). 714 7.6. Date Element 716 A Date Element MUST declare a length of either zero octets or eight 717 octets. If the EBML Element is not defined to have a default value, 718 then a Date Element with a zero-octet length represents a timestamp 719 of 2001-01-01T00:00:00.000000000 UTC [RFC3339]. 721 The Date Element stores an integer in the same format as the Signed 722 Integer Element that expresses a point in time referenced in 723 nanoseconds from the precise beginning of the third millennium of the 724 Gregorian Calendar in Coordinated Universal Time (also known as 725 2001-01-01T00:00:00.000000000 UTC). This provides a possible 726 expression of time from 1708-09-11T00:12:44.854775808 UTC to 727 2293-04-11T11:47:16.854775807 UTC. 729 7.7. Master Element 731 A Master Element MUST declare a length in octets from zero to VINTMAX 732 or be of unknown length. See Section 6 for rules that apply to 733 elements of unknown length. 735 The Master Element contains zero or more other elements. EBML 736 Elements contained within a Master Element MUST have the 737 EBMLParentPath of their Element Path equal to the EBMLFullPath of the 738 Master Element Element Path (see Section 11.1.5.2). Element Data 739 stored within Master Elements SHOULD only consist of EBML Elements 740 and SHOULD NOT contain any data that is not part of an EBML Element. 741 The EBML Schema identifies what Element IDs are valid within the 742 Master Elements for that version of the EBML Document Type. Any data 743 contained within a Master Element that is not part of a Child Element 744 MUST be ignored. 746 7.8. Binary Element 748 A Binary Element MUST declare a length in octets from zero to 749 VINTMAX. 751 The contents of a Binary Element should not be interpreted by the 752 EBML Reader. 754 8. EBML Document 756 An EBML Document is composed of only two components, an EBML Header 757 and an EBML Body. An EBML Document MUST start with an EBML Header 758 that declares significant characteristics of the entire EBML Body. 759 An EBML Document consists of EBML Elements and MUST NOT contain any 760 data that is not part of an EBML Element. 762 8.1. EBML Header 764 The EBML Header is a declaration that provides processing 765 instructions and identification of the EBML Body. The EBML Header of 766 an EBML Document is analogous to the XML Declaration of an XML 767 Document. 769 The EBML Header documents the EBML Schema (also known as the EBML 770 DocType) that is used to semantically interpret the structure and 771 meaning of the EBML Document. Additionally the EBML Header documents 772 the versions of both EBML and the EBML Schema that were used to write 773 the EBML Document and the versions required to read the EBML 774 Document. 776 The EBML Header MUST contain a single Master Element with an Element 777 Name of EBML and Element ID of 0x1A45DFA3 (see Section 11.2.1) and 778 any number of additional EBML Elements within it. The EBML Header of 779 an EBML Document that uses an EBMLVersion of 1 MUST only contain EBML 780 Elements that are defined as part of this document. 782 Elements within an EBML Header can be at most 4 octets long, except 783 for the EBML Element with Element Name EBML and Element ID 784 "0x1A45DFA3" (see Section 11.2.1), which can be up to 8 octets long. 786 8.2. EBML Body 788 All data of an EBML Document following the EBML Header is the EBML 789 Body. The end of the EBML Body, as well as the end of the EBML 790 Document that contains the EBML Body, is reached at whichever comes 791 first: the beginning of a new EBML Header at the Root Level or the 792 end of the file. This document defines precisely which EBML Elements 793 are to be used within the EBML Header, but does not name or define 794 which EBML Elements are to be used within the EBML Body. The 795 definition of which EBML Elements are to be used within the EBML Body 796 is defined by an EBML Schema. 798 Within the EBML Body, the maximum octet length allowed for any 799 Element ID is set by the EBMLMaxIDLength Element of the EBML Header 800 and the maximum octet length allowed for any Element Data Size is set 801 by the EBMLMaxSizeLength Element of the EBML Header. 803 9. EBML Stream 805 An EBML Stream is a file that consists of one or more EBML Documents 806 that are concatenated together. An occurrence of a EBML Header at 807 the Root Level marks the beginning of an EBML Document. 809 10. EBML Versioning 811 An EBML Document handles 2 different versions: the version of the 812 EBML Header and the version of the EBML Body. Both versions are 813 meant to be backward compatible. 815 10.1. EBML Header Version 817 The version of the EBML Header is found in EBMLVersion. An EBML 818 parser can read an EBML Header if it can read either the EBMLVersion 819 version or a version equal or higher than the one found in 820 EBMLReadVersion. 822 10.2. EBML Document Version 824 The version of the EBML Body is found in EBMLDocTypeVersion. A 825 parser for the particular DocType format can read the EBML Document 826 if it can read either the EBMLDocTypeVersion version of that format 827 or a version equal or higher than the one found in 828 EBMLDocTypeReadVersion. 830 11. Elements semantic 832 11.1. EBML Schema 834 An EBML Schema is a well-formed XML Document [W3C.REC-xml-20081126] 835 that defines the properties, arrangement, and usage of EBML Elements 836 that compose a specific EBML Document Type. The relationship of an 837 EBML Schema to an EBML Document is analogous to the relationship of 838 an XML Schema [W3C.REC-xmlschema-0-20041028] to an XML Document 839 [W3C.REC-xml-20081126]. An EBML Schema MUST be clearly associated 840 with one or more EBML Document Types. An EBML Document Type is 841 identified by a string stored within the EBML Header in the DocType 842 Element; for example matroska or webm (see Section 11.2.6). The 843 DocType value for an EBML Document Type MUST be unique, persistent 844 and described in the IANA Registry (see Section 17.2). 846 An EBML Schema MUST declare exactly one EBML Element at Root Level 847 (referred to as the Root Element) that occurs exactly once within an 848 EBML Document. The Void Element MAY also occur at Root Level but is 849 not a Root Element (see Section 11.3.2). 851 The EBML Schema MUST document all Elements of the EBML Body. The 852 EBML Schema does not document Global Elements that are defined by 853 this document (namely the Void Element and the CRC-32 Element). 855 The EBML Schema MUST NOT use the Element ID "0x1A45DFA3" which is 856 reserved for the EBML Header for resynchronization purpose. 858 An EBML Schema MAY constrain the use of EBML Header Elements (see 859 Section 11.2) by adding or constraining that Element's "range" 860 attribute. For example, an EBML Schema MAY constrain the 861 EBMLMaxSizeLength to a maximum value of "8" or MAY constrain the 862 EBMLVersion to only support a value of "1". If an EBML Schema adopts 863 the EBML Header Element as-is, then it is not required to document 864 that Element within the EBML Schema. If an EBML Schema constrains 865 the range of an EBML Header Element, then that Element MUST be 866 documented within an "" node of the EBML Schema. This 867 document provides an example of an EBML Schema, see Section 11.1.1. 869 11.1.1. EBML Schema Example 871 872 874 875 878 881 882 884 Container of data and 885 attributes representing one or many files. 886 887 889 890 An attached file. 891 892 893 896 897 Filename of the attached file. 898 900 901 904 905 MIME type of the file. 906 907 908 911 912 Modification timestamp of the file. 913 914 915 917 918 The data of the file. 919 920 921 923 11.1.2. Element 925 Within an EBML Schema, the XPath [W3C.REC-xpath-19991116] of 926 "" element is "/EBMLSchema". 928 As an XML Document, the EBML Schema MUST use "" as the 929 top level element. The "" element can contain 930 "" sub-elements. 932 11.1.3. Attributes 934 Within an EBML Schema the "" element uses the following 935 attributes: 937 11.1.3.1. docType 939 Within an EBML Schema, the XPath of "@docType" attribute is 940 "/EBMLSchema/@docType". 942 The docType lists the official name of the EBML Document Type that is 943 defined by the EBML Schema; for example, "". 946 The docType attribute is REQUIRED within the "" Element. 948 11.1.3.2. version 950 Within an EBML Schema, the XPath of "@version" attribute is 951 "/EBMLSchema/@version". 953 The version lists a non-negative integer that specifies the version 954 of the docType documented by the EBML Schema. Unlike XML Schemas, an 955 EBML Schema documents all versions of a docType's definition rather 956 than using separate EBML Schemas for each version of a docType. EBML 957 Elements may be introduced and deprecated by using the minver and 958 maxver attributes of "". 960 The version attribute is REQUIRED within the "" Element. 962 11.1.3.3. ebml 964 Within an EBML Schema, the XPath of "@ebml" attribute is 965 "/EBMLSchema/@ebml". 967 The ebml attribute is a positive integer that specifies the version 968 of the EBML Header (see Section 11.2.2) used by the EBML Schema. If 969 the attribute is omitted, the EBML Header version is 1. 971 11.1.4. Element 973 Within an EBML Schema, the XPath of "" element is 974 "/EBMLSchema/element". 976 Each "" defines one EBML Element through the use of several 977 attributes that are defined in Section 11.1.5. EBML Schemas MAY 978 contain additional attributes to extend the semantics but MUST NOT 979 conflict with the definitions of the "" attributes defined 980 within this document. 982 The "" nodes contain a description of the meaning and use of 983 the EBML Element stored within one or more "" sub- 984 elements, followed by optional "" sub-elements, 985 followed by zero or one "" sub-element, followed by 986 optional "" sub-elements. All "" nodes MUST be 987 sub-elements of the "". 989 11.1.5. Attributes 991 Within an EBML Schema the "" uses the following attributes 992 to define an EBML Element: 994 11.1.5.1. name 996 Within an EBML Schema, the XPath of "@name" attribute is 997 "/EBMLSchema/element/@name". 999 The name provides the human-readable name of the EBML Element. The 1000 value of the name MUST be in the form of characters "A" to "Z", "a" 1001 to "z", "0" to "9", "-" and ".". The first character of the name 1002 MUST be in the form of an "A" to "Z", "a" to "z", "0" to "9" 1003 character. 1005 The name attribute is REQUIRED. 1007 11.1.5.2. path 1009 Within an EBML Schema, the XPath of "@path" attribute is 1010 "/EBMLSchema/element/@path". 1012 The path defines the allowed storage locations of the EBML Element 1013 within an EBML Document. This path MUST be defined with the full 1014 hierarchy of EBML Elements separated with a "\". The top EBML 1015 Element in the path hierarchy being the first in the value. The 1016 syntax of the path attribute is defined using this Augmented Backus- 1017 Naur Form (ABNF) [RFC5234] with the case sensitive update [RFC7405] 1018 notation: 1020 The path attribute is REQUIRED. 1022 EBMLFullPath = EBMLParentPath EBMLElement 1024 EBMLParentPath = PathDelimiter [EBMLParents] 1026 EBMLParents = 0*IntermediatePathAtom EBMLLastParent 1027 IntermediatePathAtom = EBMLPathAtom / GlobalPlaceholder 1028 EBMLLastParent = EBMLPathAtom / GlobalPlaceholder 1030 EBMLPathAtom = [IsRecursive] EBMLAtomName PathDelimiter 1031 EBMLElement = [IsRecursive] EBMLAtomName 1033 PathDelimiter = "\" 1034 IsRecursive = "+" 1035 EBMLAtomName = ALPHA / DIGIT 0*EBMLNameChar 1036 EBMLNameChar = ALPHA / DIGIT / "-" / "." 1038 GlobalPlaceholder = "(" GlobalParentOccurence "\)" 1039 GlobalParentOccurence = [PathMinOccurrence] "-" [PathMaxOccurrence] 1040 PathMinOccurrence = 1*DIGIT ; no upper limit 1041 PathMaxOccurrence = 1*DIGIT ; no upper limit 1042 The "*", "(" and ")" symbols are interpreted as defined in [RFC5234]. 1044 The EBMLAtomName of the EBMLElement part MUST be equal to the "@name" 1045 attribute of the EBML Schema. If the EBMLElement part contains an 1046 IsRecursive part, the EBML Element can occur within itself 1047 recursively (see Section 11.1.5.11). 1049 The starting PathDelimiter of EBMLParentPath corresponds to the root 1050 of the EBML Document. 1052 The "@path" value MUST be unique within the EBML Schema. The "@id" 1053 value corresponding to this "@path" MUST NOT be defined for use 1054 within another EBML Element with the same EBMLParentPath as this 1055 "@path". 1057 A path with a GlobalPlaceholder as the EBMLLastParent defines a 1058 Global Element; see Section 11.3. If the element has no 1059 EBMLLastParent part or the EBMLLastParent part is not a 1060 GlobalPlaceholder then the Element is not a Global Element. 1062 The GlobalParentOccurence part is interpreted as the amount of valid 1063 EBMLPathAtom parts that can replace the GlobalPlaceholder in the 1064 path. PathMinOccurrence represents the minimum amount of 1065 EBMLPathAtom required to replace the GlobalPlaceholder. 1066 PathMaxOccurrence represents the maximum amount of EBMLPathAtom 1067 possible to replace the GlobalPlaceholder. 1069 If PathMinOccurrence is not present then that GlobalParentOccurence 1070 has a PathMinOccurrence value of 0. If PathMaxOccurrence is not 1071 present then there is no upper bound for the permitted amount of 1072 EBMLPathAtom possible to replace the GlobalPlaceholder. 1073 PathMaxOccurrence MUST NOT have the value 0 as it would mean no 1074 EBMLPathAtom can replace the GlobalPlaceholder and the EBMLFullPath 1075 would be the same without that GlobalPlaceholder part. 1076 PathMaxOccurrence MUST be bigger or equal to PathMinOccurrence. 1078 For example in "\a\(0-1\)global", the Element path "\a\x\global" 1079 corresponds to an EBMLPathAtom occurence of 1. The Element 1080 "\a\x\y\global" corresponds to an EBMLPathAtom occurence of 2, etc. 1081 In those case "\a\x" or "\a\x\y" MUST be valid pathes to be able to 1082 contain the element "global". 1084 Consider another EBML Path "\a\(1-\)global". There has to be at 1085 least one EBMLPathAtom between the "\a\" part and "global". So the 1086 "global" EBML Element cannot be found inside the "\a" EBML Element as 1087 it means the resulting path "\a\global" has no EBMLPathAtom between 1088 the "\a\" and "global". But the "global" EBML Element can be found 1089 inside the "\a\b" EBML Element as the resulting path "\a\b\global" 1090 has one EBMLPathAtom between the "\a\" and "global". Or it can be 1091 found inside the "\a\b\c" EBML Element (two EBMLPathAtom), or inside 1092 the "\a\b\c\d" EBML Element (three EBMLPathAtom), etc. 1094 Consider another EBML Path "\a\(0-1\)global". There has to be at 1095 most one EBMLPathAtom between the "\a\" part and "global". So the 1096 "global" EBML Element can be found inside the "\a" EBML Element (0 1097 EBMLPathAtom replacing GlobalPlaceholder) or inside the "\a\b" EBML 1098 Element (one replacement EBMLPathAtom). But it cannot be found 1099 inside the "\a\b\c" EBML Element as the resulting path 1100 "\a\b\c\global" has two EBMLPathAtom between "\a\" and "global". 1102 11.1.5.3. id 1104 Within an EBML Schema, the XPath of "@id" attribute is "/EBMLSchema/ 1105 element/@id". 1107 The Element ID encoded as a Variable Size Integer expressed in 1108 hexadecimal notation prefixed by a 0x that is read and stored in big- 1109 endian order. To reduce the risk of false positives while parsing 1110 EBML Streams, the Element IDs of the Root Element and Top-Level 1111 Elements SHOULD be at least 4 octets in length. Element IDs defined 1112 for use at Root Level or directly under the Root Level MAY use 1113 shorter octet lengths to facilitate padding and optimize edits to 1114 EBML Documents; for instance, the Void Element uses an Element ID 1115 with a one octet length to allow its usage in more writing and 1116 editing scenarios. 1118 The Element ID of any Element found within an EBML Document MUST only 1119 match a single "@path" value of its corresponding EBML Schema, but a 1120 separate instance of that Element ID value defined by the EBML Schema 1121 MAY occur within a different "@path". If more than one Element is 1122 defined to use the same "@id" value, then the "@path" values of those 1123 Elements MUST NOT share the same EBMLParentPath. Elements MUST NOT 1124 be defined to use the same "@id" value if one of their common Parent 1125 Elements could be an Unknown-Size Element. 1127 The id attribute is REQUIRED. 1129 11.1.5.4. minOccurs 1131 Within an EBML Schema, the XPath of "@minOccurs" attribute is 1132 "/EBMLSchema/element/@minOccurs". 1134 The minOccurs is a non-negative integer expressing the minimum 1135 permitted number of occurrences of this EBML Element within its 1136 Parent Element. 1138 Each instance of the Parent Element MUST contain at least this many 1139 instances of this EBML Element. If the EBML Element has an empty 1140 EBMLParentPath then minOccurs refers to constraints on the occurrence 1141 of the EBML Element within the EBML Document. EBML Elements with 1142 minOccurs set to "1" that also have a default value (see 1143 Section 11.1.5.8) declared are not REQUIRED to be stored but are 1144 REQUIRED to be interpreted, see Section 11.1.18. 1146 An EBML Element defined with a minOccurs value greater than zero is 1147 called a Mandatory EBML Element. 1149 The minOccurs attribute is OPTIONAL. If the minOccurs attribute is 1150 not present then that EBML Element has a minOccurs value of 0. 1152 The semantic meaning of minOccurs within an EBML Schema is analogous 1153 to the meaning of minOccurs within an XML Schema. 1155 11.1.5.5. maxOccurs 1157 Within an EBML Schema, the XPath of "@maxOccurs" attribute is 1158 "/EBMLSchema/element/@maxOccurs". 1160 The maxOccurs is a non-negative integer expressing the maximum 1161 permitted number of occurrences of this EBML Element within its 1162 Parent Element. 1164 Each instance of the Parent Element MUST contain at most this many 1165 instances of this EBML Element, including the unwritten mandatory 1166 element with a default value, see Section 11.1.18. If the EBML 1167 Element has an empty EBMLParentPath then maxOccurs refers to 1168 constraints on the occurrence of the EBML Element within the EBML 1169 Document. 1171 The maxOccurs attribute is OPTIONAL. If the maxOccurs attribute is 1172 not present then there is no upper bound for the permitted number of 1173 occurrences of this EBML Element within its Parent Element or within 1174 the EBML Document depending on whether the EBMLParentPath of the EBML 1175 Element is empty or not. 1177 The semantic meaning of maxOccurs within an EBML Schema is analogous 1178 to the meaning of maxOccurs within an XML Schema, when it is not 1179 present it's similar to xml:maxOccurs="unbounded" in an XML Schema. 1181 11.1.5.6. range 1183 Within an EBML Schema, the XPath of "@range" attribute is 1184 "/EBMLSchema/element/@range". 1186 A numerical range for EBML Elements which are of numerical types 1187 (Unsigned Integer, Signed Integer, Float, and Date). If specified 1188 the value of the EBML Element MUST be within the defined range. See 1189 Section 11.1.5.6.1 for rules applied to expression of range values. 1191 The range attribute is OPTIONAL. If the range attribute is not 1192 present then any value legal for the type attribute is valid. 1194 11.1.5.6.1. Expression of range 1196 The range attribute MUST only be used with EBML Elements that are 1197 either signed integer, unsigned integer, float, or date. The 1198 expression defines the upper, lower, exact or excluded value of the 1199 EBML Element and optionally an upper boundary value combined with a 1200 lower boundary. The range expression may contain whitespace (using 1201 the ASCII 0x20 character) for readability but whitespace within a 1202 range expression MUST NOT convey meaning. 1204 To set a fixed value for the range, the value is used as the 1205 attribute value. For example "1234" means the EBML element always 1206 has the value 1234. The value can be prefixed with "not" to indicate 1207 that the fixed value MUST NOT be used for that Element. For example 1208 "not 1234" means the Element can use all values of its type except 1209 1234. 1211 For an exclusive lower boundary the ">" sign is used and the ">=" 1212 sign is used for an inclusive lower boundary. For example ">3" 1213 meaning the Element value MUST be greater than 3 or ">=0x1p+0" 1214 meaning the Element value MUST be greater than or equal to the 1215 floating value 1.0, see Section 11.1.17. 1217 For an exclusive upper boundary the "<" sign is used and the "<=" 1218 sign is used for an inclusive upper boundary. For example "<-2" 1219 meaning the Element value MUST be less than -2 or "<=10" meaning the 1220 Element value MUST be less than or equal to the 10. 1222 The lower and upper bounds can be combined into an expression to form 1223 a closed boundary. The lower boundary coming first followed by the 1224 upper boundary, separated by a comma. For example ">3,<= 20" means 1225 the Element value MUST be greater than 3 and less than or equal to 1226 20. 1228 A special form of lower and upper bounds using the "-" separator is 1229 possible, meaning the Element value MUST be greater than or to the 1230 first value and MUST be less than or equal to the second value. For 1231 example "1-10" is equivalent to ">=1,<=10". If the upper boundary is 1232 negative, only the latter form MUST be used. 1234 11.1.5.7. length 1236 Within an EBML Schema, the XPath of "@length" attribute is 1237 "/EBMLSchema/element/@length". 1239 A value to express the valid length of the Element Data as written 1240 measured in octets. The length provides a constraint in addition to 1241 the Length value of the definition of the corresponding EBML Element 1242 Type. This length MUST be expressed as either a non-negative integer 1243 or a range (see Section 11.1.5.6.1) that consists of only non- 1244 negative integers and valid operators. 1246 The length attribute is OPTIONAL. If the length attribute is not 1247 present for that EBML Element then that EBML Element is only limited 1248 in length by the definition of the associated EBML Element Type. 1250 11.1.5.8. default 1252 Within an EBML Schema, the XPath of "@default" attribute is 1253 "/EBMLSchema/element/@default". 1255 If an Element is mandatory (has a minOccurs value greater than zero) 1256 but not written within its Parent Element or stored as an Empty 1257 Element, then the EBML Reader of the EBML Document MUST semantically 1258 interpret the EBML Element as present with this specified default 1259 value for the EBML Element. An unwritten mandatory Element with a 1260 declared default value is semantically equivalent to that Element if 1261 written with the default value stored as the Element Data. EBML 1262 Elements that are Master Elements MUST NOT declare a default value. 1263 EBML Elements with a minOccurs value greater than 1 MUST NOT declare 1264 a default value. 1266 The default attribute is OPTIONAL. 1268 11.1.5.9. type 1270 Within an EBML Schema, the XPath of "@type" attribute is 1271 "/EBMLSchema/element/@type". 1273 The type MUST be set to one of the following values: "integer" 1274 (signed integer), "uinteger" (unsigned integer), "float", "string", 1275 "date", "utf-8", "master", or "binary". The content of each type is 1276 defined within Section 7. 1278 The type attribute is REQUIRED. 1280 11.1.5.10. unknownsizeallowed 1282 Within an EBML Schema, the XPath of "@unknownsizeallowed" attribute 1283 is "/EBMLSchema/element/@unknownsizeallowed". 1285 A boolean to express if an EBML Element is permitted to be Unknown- 1286 Sized Element (having all VINT_DATA bits of Element Data Size set to 1287 1). EBML Elements that are not Master Elements MUST NOT set 1288 unknownsizeallowed to true. An EBML Element that is defined with an 1289 unknownsizeallowed attribute set to 1 MUST also have the 1290 unknownsizeallowed attribute of its Parent Element set to 1. 1292 An EBML Element with the unknownsizeallowed attribute set to 1 MUST 1293 NOT have its recursive attribute set to 1. 1295 The unknownsizeallowed attribute is OPTIONAL. If the 1296 unknownsizeallowed attribute is not used then that EBML Element is 1297 not allowed to use an unknown Element Data Size. 1299 11.1.5.11. recursive 1301 Within an EBML Schema, the XPath of "@recursive" attribute is 1302 "/EBMLSchema/element/@recursive". 1304 A boolean to express if an EBML Element is permitted to be stored 1305 recursively. In this case the EBML Element MAY be stored within 1306 another EBML Element that has the same Element ID. Which itself can 1307 be stored in an EBML Element that has the same Element ID, and so on. 1308 EBML Elements that are not Master Elements MUST NOT set recursive to 1309 true. 1311 If the EBMLElement part of the "@path" contains an IsRecursive part 1312 then the recursive value MUST be true and false otherwise. 1314 An EBML Element with the recursive attribute set to 1 MUST NOT have 1315 its unknownsizeallowed attribute set to 1. 1317 The recursive attribute is OPTIONAL. If the recursive attribute is 1318 not present then the EBML Element MUST NOT be used recursively. 1320 11.1.5.12. recurring 1322 Within an EBML Schema, the XPath of "@recurring" attribute is 1323 "/EBMLSchema/element/@recurring". 1325 A boolean to express if an EBML Element is defined as an Identically 1326 Recurring Element or not; see Section 11.1.16. 1328 The recurring attribute is OPTIONAL. If the recurring attribute is 1329 not present then the EBML Element is not an Identically Recurring 1330 Element. 1332 11.1.5.13. minver 1334 Within an EBML Schema, the XPath of "@minver" attribute is 1335 "/EBMLSchema/element/@minver". 1337 The minver (minimum version) attribute stores a non-negative integer 1338 that represents the first version of the docType to support the EBML 1339 Element. 1341 The minver attribute is OPTIONAL. If the minver attribute is not 1342 present, then the EBML Element has a minimum version of "1". 1344 11.1.5.14. maxver 1346 Within an EBML Schema, the XPath of "@maxver" attribute is 1347 "/EBMLSchema/element/@maxver". 1349 The maxver (maximum version) attribute stores a non-negative integer 1350 that represents the last or most recent version of the docType to 1351 support the element. maxver MUST be greater than or equal to minver. 1353 The maxver attribute is OPTIONAL. If the maxver attribute is not 1354 present then the EBML Element has a maximum version equal to the 1355 value stored in the version attribute of "". 1357 11.1.6. Element 1359 Within an EBML Schema, the XPath of "" attribute is 1360 "/EBMLSchema/element/documentation". 1362 The "" element provides additional information about 1363 the EBML Element. Within the "" element the following 1364 XHTML [W3C.SPSD-xhtml-basic-20180327] elements MAY be used: "", 1365 "
", "". 1367 11.1.7. Attributes 1369 11.1.7.1. lang 1371 Within an EBML Schema, the XPath of "@lang" attribute is 1372 "/EBMLSchema/element/documentation/@lang". 1374 A lang attribute which is set to the [RFC5646] value of the language 1375 of the element's documentation. 1377 The lang attribute is OPTIONAL. 1379 11.1.7.2. purpose 1381 Within an EBML Schema, the XPath of "@purpose" attribute is 1382 "/EBMLSchema/element/documentation/@purpose". 1384 A purpose attribute distinguishes the meaning of the documentation. 1385 Values for the "" sub-element's purpose attribute MUST 1386 include one of the values listed in Table 8. 1388 +------------+-------------------------------------------------+ 1389 | value of | definition | 1390 | purpose | | 1391 | attribute | | 1392 +============+=================================================+ 1393 | definition | A 'definition' is recommended for every defined | 1394 | | EBML Element. This documentation explains the | 1395 | | semantic meaning of the EBML Element. | 1396 +------------+-------------------------------------------------+ 1397 | rationale | An explanation about the reason or catalyst for | 1398 | | the definition of the Element. | 1399 +------------+-------------------------------------------------+ 1400 | usage | Recommended practices or guideline for both | 1401 | notes | reading, writing, or interpreting the Element. | 1402 +------------+-------------------------------------------------+ 1403 | references | Informational references to support the | 1404 | | contextualization and understanding of the | 1405 | | value of the Element. | 1406 +------------+-------------------------------------------------+ 1408 Table 8: Definitions of the permitted values for the purpose 1409 attribute of the documentation Element. 1411 The purpose attribute is REQUIRED. 1413 11.1.8. Element 1415 Within an EBML Schema, the XPath of "" attribute 1416 is "/EBMLSchema/element/implementation_note". 1418 In some cases within an EBML Document Type, the attributes of the 1419 "" element are not sufficient to clearly communicate how the 1420 defined EBML Element is intended to be implemented. For instance, 1421 one EBML Element might only be mandatory if another EBML Element is 1422 present, or as another example, the default value of an EBML Element 1423 might derive from a related Element's content. In these cases where 1424 the Element's definition is conditional or advanced implementation 1425 notes are needed, one or many "" elements can be 1426 used to store that information. The "" refer to 1427 a specific attribute of the parent "" as expressed by the 1428 "note_attribute" attribute Section 11.1.9.1. 1430 11.1.9. Attributes 1432 11.1.9.1. note_attribute 1434 Within an EBML Schema, the XPath of "@note_attribute" attribute is 1435 "/EBMLSchema/element/implementation_note/@note_attribute". 1437 The note_attribute attribute references which of the ""'s 1438 attributes that the implementation_note is in regards to. The 1439 note_attribute attribute MUST be set to one of the following values 1440 (corresponding to that attribute of the parent ""): 1441 "minOccurs", "maxOccurs", "range", "length", "default", "minver", or 1442 "maxver". The "" SHALL supersede the parent 1443 ""'s attribute that is named in the "note_attribute" 1444 attribute. An "" SHALL NOT have more than one 1445 "" of the same "note_attribute". 1447 The note_attribute attribute is REQUIRED. 1449 11.1.9.2. Example 1451 The following fragment of an EBML Schema demonstrates how an 1452 "" is used. In this case an EBML Schema 1453 documents a list of items that are described with an optional cost. 1454 The Currency Element uses an "" to say that the 1455 Currency Element is REQUIRED if the Cost Element is set, otherwise 1456 not. 1458 1460 1461 A set of items. 1462 1463 1464 1466 1467 An item. 1468 1469 1470 1472 1473 The cost of the item, if any. 1474 1475 1476 1478 1479 The currency of the item's cost. 1480 1481 1482 Currency MUST be set (minOccurs=1) if the associated Item stores 1483 a Cost, else Currency MAY be unset (minOccurs=0). 1484 1485 1487 11.1.10. Element 1489 Within an EBML Schema, the XPath of "" attribute is 1490 "/EBMLSchema/element/restriction". 1492 The "" element provides information about restrictions 1493 to the allowable values for the EBML Element which are listed in 1494 "" elements. 1496 11.1.11. Element 1498 Within an EBML Schema, the XPath of "" attribute is 1499 "/EBMLSchema/element/restriction/enum". 1501 The "" element stores a list of values allowed for storage in 1502 the EBML Element. The values MUST match the type of the EBML Element 1503 (for example "" cannot be a valid value for a EBML 1504 Element that is defined as an unsigned integer). An "" element 1505 MAY also store "" elements to further describe the 1506 "". 1508 11.1.12. Attributes 1510 11.1.12.1. label 1512 Within an EBML Schema, the XPath of "@label" attribute is 1513 "/EBMLSchema/element/restriction/enum/@label". 1515 The label provides a concise expression for human consumption that 1516 describes what the value of the "" represents. 1518 The label attribute is OPTIONAL. 1520 11.1.12.2. value 1522 Within an EBML Schema, the XPath of "@value" attribute is 1523 "/EBMLSchema/element/restriction/enum/@value". 1525 The value represents data that MAY be stored within the EBML Element. 1527 The value attribute is REQUIRED. 1529 11.1.13. Element 1531 Within an EBML Schema, the XPath of "" attribute is 1532 "/EBMLSchema/element/extension". 1534 The "" element provides an unconstrained element to 1535 contain information about the associated EBML "" which is 1536 undefined by this document but MAY be defined by the associated EBML 1537 Document Type. The "" element MUST contain a "type" 1538 attribute and also MAY contain any other attribute or sub-element as 1539 long as the EBML Schema remains as a well-formed XML Document. All 1540 "" elements MUST be sub-elements of the "". 1542 11.1.14. Attributes 1544 11.1.14.1. type 1546 Within an EBML Schema, the XPath of "@type" attribute is 1547 "/EBMLSchema/element/extension/@type". 1549 The type attribute should reference a name or identifier of the 1550 project or authority associated with the contents of the 1551 "" element. 1553 The type attribute is REQUIRED. 1555 11.1.15. XML Schema for EBML Schema 1557 This following provides an XML Schema [W3C.REC-xmlschema-0-20041028] 1558 for facilitating verification of an EBML Schema to the definition 1559 described in Section 8.1. 1561 1562 1568 1569 1572 1574 1575 1576 1578 1579 1580 1581 1583 1585 1586 1587 1589 1591 1593 1595 1596 1597 1598 1599 1600 1602 1603 1604 1605 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1651 1653 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1671 1672 1673 1675 1676 1678 1679 1680 1682 1683 1684 1685 1687 1688 1689 1691 1692 1693 1694 1696 1697 1698 1700 1702 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1739 11.1.16. Identically Recurring Elements 1741 An Identically Recurring Element is an EBML Element that MAY occur 1742 within its Parent Element more than once but that each recurrence 1743 within that Parent Element MUST be identical both in storage and 1744 semantics. Identically Recurring Elements are permitted to be stored 1745 multiple times within the same Parent Element in order to increase 1746 data resilience and optimize the use of EBML in transmission. For 1747 instance a pertinent Top-Level Element could be periodically resent 1748 within a data stream so that an EBML Reader which starts reading the 1749 stream from the middle could better interpret the contents. 1750 Identically Recurring Elements SHOULD include a CRC-32 Element as a 1751 Child Element; this is especially recommended when EBML is used for 1752 long-term storage or transmission. If a Parent Element contains more 1753 than one copy of an Identically Recurring Element which includes a 1754 CRC-32 Element as a Child Element then the first instance of the 1755 Identically Recurring Element with a valid CRC-32 value should be 1756 used for interpretation. If a Parent Element contains more than one 1757 copy of an Identically Recurring Element which does not contain a 1758 CRC-32 Element or if CRC-32 Elements are present but none are valid 1759 then the first instance of the Identically Recurring Element should 1760 be used for interpretation. 1762 11.1.17. Textual expression of floats 1764 When a float value is represented textually in an EBML Schema, such 1765 as within a default or range value, the float values MUST be 1766 expressed as Hexadecimal Floating-Point Constants as defined in the 1767 C11 standard [ISO.9899.2011] (see section 6.4.4.2 on Floating 1768 Constants). Table 9 provides examples of expressions of float 1769 ranges. 1771 +-------------------+-----------------------------------------+ 1772 | as decimal | as Hexadecimal Floating-Point Constants | 1773 +===================+=========================================+ 1774 | 0.0 | "0x0p+1" | 1775 +-------------------+-----------------------------------------+ 1776 | 0.0-1.0 | "0x0p+1-0x1p+0" | 1777 +-------------------+-----------------------------------------+ 1778 | 1.0-256.0 | "0x1p+0-0x1p+8" | 1779 +-------------------+-----------------------------------------+ 1780 | 0.857421875 | "0x1.b7p-1" | 1781 +-------------------+-----------------------------------------+ 1782 | -1.0--0.857421875 | "-0x1p+0--0x1.b7p-1" | 1783 +-------------------+-----------------------------------------+ 1785 Table 9: Example of floating point values and ranges as 1786 decimal and as Hexadecimal Floating-Point Constants. 1788 Within an expression of a float range, as in an integer range, the - 1789 (hyphen) character is the separator between the minimal and maximum 1790 value permitted by the range. Hexadecimal Floating-Point Constants 1791 also use a - (hyphen) when indicating a negative binary power. 1792 Within a float range, when a - (hyphen) is immediately preceded by a 1793 letter p, then the - (hyphen) is a part of the Hexadecimal Floating- 1794 Point Constant which notes negative binary power. Within a float 1795 range, when a - (hyphen) is not immediately preceded by a letter p, 1796 then the - (hyphen) represents the separator between the minimal and 1797 maximum value permitted by the range. 1799 11.1.18. Note on the use of default attributes to define Mandatory EBML 1800 Elements 1802 If a Mandatory EBML Element has a default value declared by an EBML 1803 Schema and the value of the EBML Element is equal to the declared 1804 default value then that EBML Element is not required to be present 1805 within the EBML Document if its Parent Element is present. In this 1806 case, the default value of the Mandatory EBML Element MUST be read by 1807 the EBML Reader although the EBML Element is not present within its 1808 Parent Element. 1810 If a Mandatory EBML Element has no default value declared by an EBML 1811 Schema and its Parent Element is present then the EBML Element MUST 1812 be present as well. If a Mandatory EBML Element has a default value 1813 declared by an EBML Schema and its Parent Element is present and the 1814 value of the EBML Element is NOT equal to the declared default value 1815 then the EBML Element MUST be present. 1817 Table 10 clarifies if a Mandatory EBML Element MUST be written, 1818 according to if the default value is declared, if the value of the 1819 EBML Element is equal to the declared default value, and if the 1820 Parent Element is used. 1822 +-----------------+-------------+---------------+------------------+ 1823 | Is the default | Is the | Is the Parent | Then is storing | 1824 | value declared? | value equal | Element | the EBML Element | 1825 | | to default? | present? | REQUIRED? | 1826 +=================+=============+===============+==================+ 1827 | Yes | Yes | Yes | No | 1828 +-----------------+-------------+---------------+------------------+ 1829 | Yes | Yes | No | No | 1830 +-----------------+-------------+---------------+------------------+ 1831 | Yes | No | Yes | Yes | 1832 +-----------------+-------------+---------------+------------------+ 1833 | Yes | No | No | No | 1834 +-----------------+-------------+---------------+------------------+ 1835 | No | n/a | Yes | Yes | 1836 +-----------------+-------------+---------------+------------------+ 1837 | No | n/a | No | No | 1838 +-----------------+-------------+---------------+------------------+ 1840 Table 10: Demonstration of the conditional requirements of VINT 1841 Storage. 1843 11.2. EBML Header Elements 1845 This document contains definitions of all EBML Elements of the EBML 1846 Header. 1848 11.2.1. EBML Element 1850 name: EBML 1852 path: "\EBML" 1854 id: 0x1A45DFA3 1856 minOccurs: 1 1858 maxOccurs: 1 1860 type: Master Element 1862 description: Set the EBML characteristics of the data to follow. 1863 Each EBML Document has to start with this. 1865 11.2.2. EBMLVersion Element 1867 name: EBMLVersion 1869 path: "\EBML\EBMLVersion" 1871 id 0x4286 1873 minOccurs: 1 1875 maxOccurs: 1 1877 range: not 0 1879 default: 1 1881 type: Unsigned Integer 1883 description: The version of EBML specifications used to create the 1884 EBML Document. The version of EBML defined in this document is 1, so 1885 EBMLVersion SHOULD be 1. 1887 11.2.3. EBMLReadVersion Element 1889 name: EBMLReadVersion 1890 path: "\EBML\EBMLReadVersion" 1892 id: 0x42F7 1894 minOccurs: 1 1896 maxOccurs: 1 1898 range: 1 1900 default: 1 1902 type: Unsigned Integer 1904 description: The minimum EBML version an EBML Reader has to support 1905 to read this EBML Document. The EBMLReadVersion Element MUST be less 1906 than or equal to EBMLVersion. 1908 11.2.4. EBMLMaxIDLength Element 1910 name: EBMLMaxIDLength 1912 path: "\EBML\EBMLMaxIDLength" 1914 id 0x42F2 1916 minOccurs: 1 1918 maxOccurs: 1 1920 range: >=4 1922 default: 4 1924 type: Unsigned Integer 1926 description: The EBMLMaxIDLength Element stores the maximum permitted 1927 length in octets of the Element IDs to be found within the EBML Body. 1928 An EBMLMaxIDLength Element value of four is RECOMMENDED, though 1929 larger values are allowed. 1931 11.2.5. EBMLMaxSizeLength Element 1933 name: EBMLMaxSizeLength 1935 path: "\EBML\EBMLMaxSizeLength" 1937 id 0x42F3 1938 minOccurs: 1 1940 maxOccurs: 1 1942 range: not 0 1944 default: 8 1946 type: Unsigned Integer 1948 description: The EBMLMaxSizeLength Element stores the maximum 1949 permitted length in octets of the expressions of all Element Data 1950 Sizes to be found within the EBML Body. The EBMLMaxSizeLength 1951 Element documents an upper bound for the "length" of all Element Data 1952 Size expressions within the EBML Body and not an upper bound for the 1953 "value" of all Element Data Size expressions within the EBML Body. 1954 EBML Elements that have an Element Data Size expression which is 1955 larger in octets than what is expressed by EBMLMaxSizeLength Element 1956 are invalid. 1958 11.2.6. DocType Element 1960 name: DocType 1962 path: "\EBML\DocType" 1964 id 0x4282 1966 minOccurs: 1 1968 maxOccurs: 1 1970 length: >0 1972 type: String 1974 description: A string that describes and identifies the content of 1975 the EBML Body that follows this EBML Header. 1977 11.2.7. DocTypeVersion Element 1979 name: DocTypeVersion 1981 path: "\EBML\DocTypeVersion" 1983 id 0x4287 1985 minOccurs: 1 1986 maxOccurs: 1 1988 range: not 0 1990 default: 1 1992 type: Unsigned Integer 1994 description: The version of DocType interpreter used to create the 1995 EBML Document. 1997 11.2.8. DocTypeReadVersion Element 1999 name: DocTypeReadVersion 2001 path: "\EBML\DocTypeReadVersion" 2003 id 0x4285 2005 minOccurs: 1 2007 maxOccurs: 1 2009 range: not 0 2011 default: 1 2013 type: Unsigned Integer 2015 description: The minimum DocType version an EBML Reader has to 2016 support to read this EBML Document. The value of the 2017 DocTypeReadVersion Element MUST be less than or equal to the value of 2018 the DocTypeVersion Element. 2020 11.2.9. DocTypeExtension Element 2022 name: DocTypeExtension 2024 path: "\EBML\DocTypeExtension" 2026 id 0x4281 2028 minOccurs: 0 2030 type: Master Element 2032 description: A DocTypeExtension adds extra Elements to the main 2033 DocType+DocTypeVersion tuple it's attached to. An EBML Reader MAY 2034 know these extra Elements and how to use them. A DocTypeExtension 2035 MAY be used to iterate between experimental Elements before they are 2036 integrated in a regular DocTypeVersion. Reading one DocTypeExtension 2037 version of a DocType+DocTypeVersion tuple doesn't imply one should be 2038 able to read upper versions of this DocTypeExtension. 2040 11.2.10. DocTypeExtensionName Element 2042 name: DocTypeExtensionName 2044 path: "\EBML\DocTypeExtension\Name" 2046 id 0x4283 2048 minOccurs: 1 2050 maxOccurs: 1 2052 length: >0 2054 type: String 2056 description: The name of the DocTypeExtension to differentiate it 2057 from other DocTypeExtension of the same DocType+DocTypeVersion tuple. 2058 A DocTypeExtensionName value MUST be unique within the EBML Header. 2060 11.2.11. DocTypeExtensionVersion Element 2062 name: DocTypeExtensionVersion 2064 path: "\EBML\DocTypeExtension\Version" 2066 id 0x4284 2068 minOccurs: 1 2070 maxOccurs: 1 2072 range: not 0 2074 type: Unsigned Integer 2076 description: The version of the DocTypeExtension. Different 2077 DocTypeExtensionVersion values of the same 2078 DocType+DocTypeVersion+DocTypeExtensionName tuple MAY contain 2079 completely different sets of extra Elements. An EBML Reader MAY 2080 support multiple versions of the same DocTypeExtension, only one or 2081 none. 2083 11.3. Global Elements 2085 EBML allows some special Elements to be found within more than one 2086 parent in an EBML Document or optionally at the Root Level of an EBML 2087 Body. These Elements are called Global Elements. There are 2 Global 2088 Elements that can be found in any EBML Document: the CRC-32 Element 2089 and the Void Element. An EBML Schema MAY add other Global Elements 2090 to the format it defines. These extra elements apply only to the 2091 EBML Body, not the EBML Header. 2093 Global Elements are EBML Elements whose EBMLLastParent part of the 2094 path has a GlobalPlaceholder. Because it is the last Parent part of 2095 the path, a Global Element might also have an EBMLParentPath parts in 2096 its path. In this case the Global Element can only be found within 2097 this EBMLParentPath path, i.e. it's not fully "global". 2099 A Global Element can be found in many Parent Elements, allowing the 2100 same number of occurrences in each Parent where this Element is 2101 found. 2103 11.3.1. CRC-32 Element 2105 name: CRC-32 2107 path: "\(1-\)CRC-32" 2109 id: 0xBF 2111 minOccurs: 0 2113 maxOccurs: 1 2115 length: 4 2117 type: Binary 2119 description: The CRC-32 Element contains a 32-bit Cyclic Redundancy 2120 Check value of all the Element Data of the Parent Element as stored 2121 except for the CRC-32 Element itself. When the CRC-32 Element is 2122 present, the CRC-32 Element MUST be the first ordered EBML Element 2123 within its Parent Element for easier reading. All Top-Level Elements 2124 of an EBML Document that are Master Elements SHOULD include a CRC-32 2125 Element as a Child Element. The CRC in use is the IEEE-CRC-32 2126 algorithm as used in the [ISO.3309.1979] standard and in section 2127 8.1.1.6.2 of [ITU.V42.1994], with initial value of 0xFFFFFFFF. The 2128 CRC value MUST be computed on a little endian bytestream and MUST use 2129 little endian storage. 2131 11.3.2. Void Element 2133 name: Void 2135 path: "\(-\)Void" 2137 id: 0xEC 2139 minOccurs: 0 2141 type: Binary 2143 description: Used to void data or to avoid unexpected behaviors when 2144 using damaged data. The content is discarded. Also used to reserve 2145 space in a sub-element for later use. 2147 12. Considerations for Reading EBML Data 2149 The following scenarios describe events to consider when reading EBML 2150 Documents and the recommended design of an EBML Reader. 2152 If a Master Element contains a CRC-32 Element that doesn't validate, 2153 then the EBML Reader MAY ignore all contained data except for 2154 Descendant Elements that contain their own valid CRC-32 Element. 2156 In the following XML representation of a simple, hypothetical EBML 2157 fragment, a Master Element called CONTACT contains two Child 2158 Elements, NAME and ADDRESS. In this example, some data within the 2159 NAME Element had been altered, so that the CRC-32 of the NAME Element 2160 does not validate and thus any Ancestor Element with a CRC-32 would 2161 therefore also no longer validate. However, even though the CONTACT 2162 Element has a CRC-32 that does not validate (because of the changed 2163 data within the NAME Element), the CRC-32 of the ADDRESS Element does 2164 validate and thus the contents and semantics of the ADDRESS Element 2165 MAY be used. 2167 2168 c119a69b 2169 2170 1f59ee2b 2171 invalid data 2172 invalid data 2173 2174
2175 df941cc9 2176 valid data 2177 valid data 2178
2179
2181 If a Master Element contains more occurrences of a Child Master 2182 Element than permitted according to the maxOccurs and recurring 2183 attributes of the definition of that Element then the occurrences in 2184 addition to maxOccurs MAY be ignored. 2186 If a Master Element contains more occurrences of a Child Element than 2187 permitted according to the maxOccurs attribute of the definition of 2188 that Element then all instances of that Element after the first 2189 maxOccur occurrences from the beginning of its Parent Element SHOULD 2190 be ignored. 2192 13. Terminating Elements 2194 Null Octets, which are octets with all bits set to zero, MAY follow 2195 the value of a String Element or UTF-8 Element to serve as a 2196 terminator. An EBML Writer MAY terminate a String Element or UTF-8 2197 Element with Null Octets in order to overwrite a stored value with a 2198 new value of lesser length while maintaining the same Element Data 2199 Size (this can prevent the need to rewrite large portions of an EBML 2200 Document); otherwise the use of Null Octets within a String Element 2201 or UTF-8 Element is NOT RECOMMENDED. The Element Data of a UTF-8 2202 Element MUST be a valid UTF-8 string up to whichever comes first: the 2203 end of the Element or the first occurring Null octet. Within the 2204 Element Data of a String or UTF-8 Element, any Null octet itself and 2205 any following data within that Element SHOULD be ignored. A string 2206 value and a copy of that string value terminated by one or more Null 2207 Octets are semantically equal. 2209 Table 11 shows examples of semantics and validation for the use of 2210 Null Octets. Values to represent Stored Values and the Semantic 2211 Meaning as represented as hexadecimal values. 2213 +---------------------+---------------------+ 2214 | Stored Value | Semantic Meaning | 2215 +=====================+=====================+ 2216 | 0x65 0x62 0x6D 0x6C | 0x65 0x62 0x6D 0x6C | 2217 +---------------------+---------------------+ 2218 | 0x65 0x62 0x00 0x6C | 0x65 0x62 | 2219 +---------------------+---------------------+ 2220 | 0x65 0x62 0x00 0x00 | 0x65 0x62 | 2221 +---------------------+---------------------+ 2222 | 0x65 0x62 | 0x65 0x62 | 2223 +---------------------+---------------------+ 2225 Table 11: Exmaples of semantics for Null 2226 Octets in VINT_DATA. 2228 14. Guidelines for Updating Elements 2230 An EBML Document can be updated without requiring that the entire 2231 EBML Document be rewritten. These recommendations describe 2232 strategies to change the Element Data of a written EBML Element with 2233 minimal disruption to the rest of the EBML Document. 2235 14.1. Reducing a Element Data in Size 2237 There are three methods to reduce the size of Element Data of a 2238 written EBML Element. 2240 14.1.1. Adding a Void Element 2242 When an EBML Element is changed to reduce its total length by more 2243 than one octet, an EBML Writer SHOULD fill the freed space with a 2244 Void Element. 2246 14.1.2. Extending the Element Data Size 2248 The same value for Element Data Size MAY be written in various 2249 lengths, so for minor reductions of the Element Data, the Element 2250 Size MAY be written to a longer octet length to fill the freed space. 2252 For example, the first row of Table 12 depicts a String Element that 2253 stores an Element ID (3 octets), Element Data Size (1 octet), and 2254 Element Data (4 octets). If the Element Data is changed to reduce 2255 the length by one octet and if the current length of the Element Data 2256 Size is less than its maximum permitted length, then the Element Data 2257 Size of that Element MAY be rewritten to increase its length by one 2258 octet. Thus before and after the change the EBML Element maintains 2259 the same length of 8 octets and data around the Element does not need 2260 to be moved. 2262 +-------------+------------+-------------------+--------------+ 2263 | Status | Element ID | Element Data Size | Element Data | 2264 +=============+============+===================+==============+ 2265 | Before edit | 0x3B4040 | 0x84 | 0x65626D6C | 2266 +-------------+------------+-------------------+--------------+ 2267 | After edit | 0x3B4040 | 0x4003 | 0x6D6B76 | 2268 +-------------+------------+-------------------+--------------+ 2270 Table 12: Example of editing a VINT to reduce VINT_DATA 2271 length by one octet. 2273 This method is RECOMMENDED when the Element Data is reduced by a 2274 single octet; for reductions by two or more octets it is RECOMMENDED 2275 to fill the freed space with a Void Element. 2277 Note that if the Element Data length needs to be rewritten as 2278 shortened by one octet and the Element Data Size could be rewritten 2279 as a shorter VINT then it is RECOMMENDED to rewrite the Element Data 2280 Size as one octet shorter, shorten the Element Data by one octet, and 2281 follow that Element with a Void Element. For example, Table 13 2282 depicts a String Element that stores an Element ID (3 octets), 2283 Element Data Size (2 octets, but could be rewritten in one octet), 2284 and Element Data (3 octets). If the Element Data is to be rewritten 2285 to a two octet length, then another octet can be taken from Element 2286 Data Size so that there is enough space to add a two octet Void 2287 Element. 2289 +--------+------------+-------------------+--------------+---------+ 2290 | Status | Element ID | Element Data Size | Element Data | Void | 2291 | | | | | Element | 2292 +========+============+===================+==============+=========+ 2293 | Before | 0x3B4040 | 0x4003 | 0x6D6B76 | | 2294 +--------+------------+-------------------+--------------+---------+ 2295 | After | 0x3B4040 | 0x82 | 0x6869 | 0xEC80 | 2296 +--------+------------+-------------------+--------------+---------+ 2298 Table 13: Example of editing a VINT to reduce VINT_DATA length 2299 by more than one octet. 2301 14.1.3. Terminating Element Data 2303 For String Elements and UTF-8 Elements the length of Element Data 2304 could be reduced by adding Null Octets to terminate the Element Data 2305 (see Section 13). 2307 In Table 14, a four octets long Element Data is changed to a three 2308 octet long value followed by a Null Octet; the Element Data Size 2309 includes any Null Octets used to terminate Element Data so remains 2310 unchanged. 2312 +-------------+------------+-------------------+--------------+ 2313 | Status | Element ID | Element Data Size | Element Data | 2314 +=============+============+===================+==============+ 2315 | Before edit | 0x3B4040 | 0x84 | 0x65626D6C | 2316 +-------------+------------+-------------------+--------------+ 2317 | After edit | 0x3B4040 | 0x84 | 0x6D6B7600 | 2318 +-------------+------------+-------------------+--------------+ 2320 Table 14: Example of terminating VINT_DATA with a Null 2321 Octet when reducing VINT length during an edit. 2323 Note that this method is NOT RECOMMENDED. For reductions of one 2324 octet, the method for Extending the Element Data Size SHOULD be used. 2325 For reduction by more than one octet, the method for Adding a Void 2326 Element SHOULD be used. 2328 14.2. Considerations when Updating Elements with Cyclic Redundancy 2329 Check (CRC) 2331 If the Element to be changed is a Descendant Element of any Master 2332 Element that contains a CRC-32 Element (see Section 11.3.1) then the 2333 CRC-32 Element MUST be verified before permitting the change. 2334 Additionally the CRC-32 Element value MUST be subsequently updated to 2335 reflect the changed data. 2337 15. Backward and Forward Compatibility 2339 Elements of an EBML format SHOULD be designed with backward and 2340 forward compatibility in mind. 2342 15.1. Backward Compatibility 2344 Backward compatibility of new EBML Elements can be achieved by using 2345 default values for mandatory elements. The default value MUST 2346 represent the state that was assumed for previous versions of the 2347 EBML Schema, without this new EBML Element. If such a state doesn't 2348 make sense for previous versions, then the new EBML Element SHOULD 2349 NOT be mandatory. 2351 Non mandatory EBML Elements can be added in a new EBMLDocTypeVersion. 2352 Since they are not mandatory they won't be found in older versions of 2353 the EBMLDocTypeVersion, just as they might not be found in newer 2354 versions. This causes no compatibility issue. 2356 15.2. Forward Compatibility 2358 EBML Elements MAY be marked as deprecated in a new EBMLDocTypeVersion 2359 using the maxver attribute of the EBML Schema. If such an Element is 2360 found in an EBML Document with newer version of the 2361 EBMLDocTypeVersion it SHOULD be discarded. 2363 16. Security Considerations 2365 EBML itself does not offer any kind of security and does not provide 2366 confidentiality. EBML does not provide any kind of authorization. 2367 EBML only offers marginally useful and effective data integrity 2368 options, such as CRC elements. 2370 Even if the semantic layer offers any kind of encryption, EBML itself 2371 could leak information at both the semantic layer (as declared via 2372 the DocType Element) and within the EBML structure (the presence of 2373 EBML Elements can be derived even with an unknown semantic layer 2374 using a heuristic approach; not without errors, of course, but with a 2375 certain degree of confidence). 2377 An EBML Document that has the following issues may still be handled 2378 by the EBML Reader and the data accepted as such, depending on how 2379 strict the EBML Reader wants to be: 2381 * Invalid Element IDs that are longer than the limit stated in the 2382 EBMLMaxIDLength Element of the EBML Header. 2384 * Invalid Element IDs that are not encoded in the shortest-possible 2385 way. 2387 * Invalid Element Data Size values that are longer than the limit 2388 stated in the EBMLMaxSizeLength Element of the EBML Header. 2390 Element IDs that are unknown to the EBML Reader MAY be accepted as 2391 valid EBML IDs in order to skip such elements. 2393 EBML Elements with a string type may contain extra data after the 2394 first 0x00. These data MUST be discarded according to the Section 13 2395 rules. 2397 An EBML Reader may discard some or all data if the following errors 2398 are found in the EBML Document: 2400 * Invalid Element Data Size values (e.g. extending the length of the 2401 EBML Element beyond the scope of the Parent Element; possibly 2402 triggering access-out-of-bounds issues). 2404 * Very high lengths in order to force out-of-memory situations 2405 resulting in a denial of service, access-out-of-bounds issues etc. 2407 * Missing EBML Elements that are mandatory in a Master Element and 2408 have no declared default value, making the semantic invalid at 2409 that Master Element level. 2411 * Usage of invalid UTF-8 encoding in EBML Elements of UTF-8 type 2412 (e.g. in order to trigger access-out-of-bounds or buffer overflow 2413 issues). 2415 * Usage of invalid data in EBML Elements with a date type, 2416 triggering bogus date accesses. 2418 * The CRC-32 Element (see Section 11.3.1) of a Master Element 2419 doesn't match the rest of the content of that Master Element. 2421 Side channel attacks could exploit: 2423 * The semantic equivalence of the same string stored in a String 2424 Element or UTF-8 Element with and without zero-bit padding, making 2425 comparison at the semantic level invalid. 2427 * The semantic equivalence of VINT_DATA within Element Data Size 2428 with two different lengths due to left-padding zero bits, making 2429 comparison at the semantic level invalid. 2431 * Data contained within a Master Element which is not itself part of 2432 a Child Element can trigger incorrect parsing behavior in EBML 2433 Readers. 2435 * Extraneous copies of Identically Recurring Element, making parsing 2436 unnecessarily slow to the point of not being usable. 2438 * Copies of Identically Recurring Element within a Parent Element 2439 that contain invalid CRC-32 Elements. EBML Readers not checking 2440 the CRC-32 might use the version of the element with mismatching 2441 CRC-32. 2443 * Use of Void Elements which could be used to hide content or create 2444 bogus resynchronization points seen by some EBML Reader and not 2445 others. 2447 17. IANA Considerations 2448 17.1. EBML Element ID Registry 2450 This document creates a new IANA Registry called "EBML Element ID 2451 Registry". 2453 Element IDs are described in section Element ID. Element IDs are 2454 encoded using the VINT mechanism described in section Section 4 can 2455 be between one and five octets long. Five octet long Element IDs are 2456 possible only if declared in the header. 2458 This IANA Registry only applies to Elements that can be contained in 2459 the EBML Header, thus including Global Elements. Elements only found 2460 in the EBML Body have their own set of independent Element IDs and 2461 are not part of this IANA Registry. 2463 One-octet Element IDs MUST be between 0x81 and 0xFE. These items are 2464 valuable because they are short, and need to be used for commonly 2465 repeated elements. Element IDs are to be allocated within this range 2466 according to the "RFC Required" policy [RFC8126]. 2468 The following one-octet Element IDs are RESERVED: 0xFF and 0x80. 2470 The one-octet range of 0x00 to 0x7F are not valid for use as an 2471 Element ID. 2473 Two-octet Element IDs MUST be between 0x407F and 0x7FFE. Element IDs 2474 are to be allocated within this range according to the "Specification 2475 Required" policy [RFC8126]. 2477 The following two-octet Element IDs are RESERVED: 0x7FFF and 0x4000. 2479 The two-octet ranges of 0x0000 to 0x3FFF and 0x8000 to 0xFFFF are not 2480 valid for use as an Element ID. 2482 Three-octet Element IDs MUST be between 0x203FFF and 0x3FFFFE. 2483 Element IDs are to be allocated within this range according to the 2484 "First Come First Served" policy [RFC8126]. 2486 The following three-octet Element IDs are RESERVED: 0x3FFFFF and 2487 0x200000. 2489 The three-octet ranges of 0x000000 to 0x1FFFFF and 0x400000 to 2490 0xFFFFFF are not valid for use as an Element ID. 2492 Four-octet Element IDs MUST be between 0x101FFFFF and 0x1FFFFFFE. 2493 Four-octet Element IDs are somewhat special in that they are useful 2494 for resynchronizing to major structures in the event of data 2495 corruption or loss. As such four-octet Element IDs are split into 2496 two categories. Four-octet Element IDs whose lower three octets (as 2497 encoded) would make printable 7-bit ASCII values (0x20 to 0x7E, 2498 inclusive) MUST be allocated by the "Specification Required" policy. 2499 Sequential allocation of values is not required: specifications 2500 SHOULD include a specific request, and are encouraged to do early 2501 allocations. 2503 To be clear about the above category: four-octet Element IDs always 2504 start with hex 0x10 to 0x1F, and that octet may be chosen so that the 2505 entire VINT has some desirable property, such as a specific CRC. The 2506 other three octets, when ALL having values between 0x20 (32, ASCII 2507 Space) and 0x7E (126, ASCII "~"), fall into this category. 2509 Other four-octet Element IDs may be allocated by the "First Come 2510 First Served" policy. 2512 The following four-octet Element IDs are RESERVED: 0x1FFFFFFF and 2513 0x10000000. 2515 The four-octet ranges of 0x00000000 to 0x0FFFFFFF and 0x20000000 to 2516 0xFFFFFFFF are not valid for use as an Element ID. 2518 Five-octet Element IDs (values from 0x080FFFFFFF to 0x0FFFFFFFFE) are 2519 RESERVED according to the "Experimental Use" policy [RFC8126]: they 2520 may be used by anyone at any time, but there is no coordination. 2522 ID Values found in this document are assigned as initial values as 2523 follows: 2525 +------------+-------------------------+-----------------+ 2526 | Element ID | Element Name | Reference | 2527 +============+=========================+=================+ 2528 | 0x1A45DFA3 | EBML | Described in | 2529 | | | Section 11.2.1 | 2530 +------------+-------------------------+-----------------+ 2531 | 0x4286 | EBMLVersion | Described in | 2532 | | | Section 11.2.2 | 2533 +------------+-------------------------+-----------------+ 2534 | 0x42F7 | EBMLReadVersion | Described in | 2535 | | | Section 11.2.3 | 2536 +------------+-------------------------+-----------------+ 2537 | 0x42F2 | EBMLMaxIDLength | Described in | 2538 | | | Section 11.2.4 | 2539 +------------+-------------------------+-----------------+ 2540 | 0x42F3 | EBMLMaxSizeLength | Described in | 2541 | | | Section 11.2.5 | 2542 +------------+-------------------------+-----------------+ 2543 | 0x4282 | DocType | Described in | 2544 | | | Section 11.2.6 | 2545 +------------+-------------------------+-----------------+ 2546 | 0x4287 | DocTypeVersion | Described in | 2547 | | | Section 11.2.7 | 2548 +------------+-------------------------+-----------------+ 2549 | 0x4285 | DocTypeReadVersion | Described in | 2550 | | | Section 11.2.8 | 2551 +------------+-------------------------+-----------------+ 2552 | 0x4281 | DocTypeExtension | Described in | 2553 | | | Section 11.2.9 | 2554 +------------+-------------------------+-----------------+ 2555 | 0x4283 | DocTypeExtensionName | Described in | 2556 | | | Section 11.2.10 | 2557 +------------+-------------------------+-----------------+ 2558 | 0x4284 | DocTypeExtensionVersion | Described in | 2559 | | | Section 11.2.11 | 2560 +------------+-------------------------+-----------------+ 2561 | 0xBF | CRC-32 | Described in | 2562 | | | Section 11.3.1 | 2563 +------------+-------------------------+-----------------+ 2564 | 0xEC | Void | Described in | 2565 | | | Section 11.3.2 | 2566 +------------+-------------------------+-----------------+ 2568 Table 15: IDs and Names for EBML Elements assigned by 2569 this document. 2571 17.2. EBML DocType Registry 2573 This document creates a new IANA Registry called "EBML DocType 2574 Registry". 2576 To register a new DocType in this registry one needs a DocType name, 2577 a Description of the DocType, a Change Controller (IESG or email of 2578 registrant) and an optional Reference to a document describing the 2579 DocType. 2581 DocType values are described in Section 11.1.3.1. DocTypes are ASCII 2582 strings, defined in Section 7.4, which label the official name of the 2583 EBML Document Type. The strings may be allocated according to the 2584 "First Come First Served" policy. 2586 The use of ASCII corresponds to the types and code already in use, 2587 the value is not meant to be visible to the user. 2589 DocType string values of "matroska" and "webm" are RESERVED to the 2590 IETF for future use. These can be assigned via the "IESG Approval" 2591 or "RFC Required" policies [RFC8126]. 2593 18. Normative References 2595 [W3C.REC-xmlschema-0-20041028] 2596 Fallside, D. and P. Walmsley, "XML Schema Part 0: Primer 2597 Second Edition", World Wide Web Consortium Recommendation 2598 REC-xmlschema-0-20041028, 28 October 2004, 2599 . 2601 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 2602 Specifications: ABNF", STD 68, RFC 5234, 2603 DOI 10.17487/RFC5234, January 2008, 2604 . 2606 [ITU.V42.1994] 2607 International Telecommunications Union, "Error-correcting 2608 Procedures for DCEs Using Asynchronous-to-Synchronous 2609 Conversion", 1994. 2611 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2612 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2613 May 2017, . 2615 [RFC0020] Cerf, V., "ASCII format for network interchange", STD 80, 2616 RFC 20, DOI 10.17487/RFC0020, October 1969, 2617 . 2619 [ISO.9899.2011] 2620 International Organization for Standardization, 2621 "Programming languages - C", 2011. 2623 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2624 Requirement Levels", BCP 14, RFC 2119, 2625 DOI 10.17487/RFC2119, March 1997, 2626 . 2628 [RFC5646] Phillips, A., Ed. and M. Davis, Ed., "Tags for Identifying 2629 Languages", BCP 47, RFC 5646, DOI 10.17487/RFC5646, 2630 September 2009, . 2632 [RFC7405] Kyzivat, P., "Case-Sensitive String Support in ABNF", 2633 RFC 7405, DOI 10.17487/RFC7405, December 2014, 2634 . 2636 [W3C.SPSD-xhtml-basic-20180327] 2637 McCarron, S., "XHTML(tm) Basic 1.1 - Second Edition", 27 2638 March 2018. 2640 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 2641 Writing an IANA Considerations Section in RFCs", BCP 26, 2642 RFC 8126, DOI 10.17487/RFC8126, June 2017, 2643 . 2645 [IEEE.754.1985] 2646 Institute of Electrical and Electronics Engineers, 2647 "Standard for Binary Floating-Point Arithmetic", August 2648 1985. 2650 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 2651 10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November 2652 2003, . 2654 [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: 2655 Timestamps", RFC 3339, DOI 10.17487/RFC3339, July 2002, 2656 . 2658 [W3C.REC-xml-20081126] 2659 Bray, T., Paoli, J., Sperberg-McQueen, M., Maler, E., and 2660 F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fifth 2661 Edition)", World Wide Web Consortium Recommendation REC- 2662 xml-20081126, 26 November 2008, 2663 . 2665 [ISO.3309.1979] 2666 International Organization for Standardization, "Data 2667 communication - High-level data link control procedures - 2668 Frame structure", 1979. 2670 19. Informative References 2672 [Matroska] IETF, "Matroska Specifications", 2019, 2673 . 2676 [WebM] The WebM Project, "WebM Container Guidelines", November 2677 2017, . 2679 [W3C.REC-xpath-19991116] 2680 Clark, J. and S. DeRose, "XML Path Language (XPath) 2681 Version 1.0", World Wide Web Consortium Recommendation 2682 REC-xpath-19991116, 16 November 1999, 2683 . 2685 Authors' Addresses 2687 Steve Lhomme 2689 Email: slhomme@matroska.org 2691 Dave Rice 2693 Email: dave@dericed.com 2695 Moritz Bunkus 2697 Email: moritz@bunkus.org