idnits 2.17.1 draft-ietf-cellar-ebml-00.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 : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The document seems to lack separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. == There are 2 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (September 23, 2016) is 2765 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 section? '1' on line 1135 looks like a reference -- Missing reference section? '2' on line 1137 looks like a reference -- Missing reference section? '3' on line 1139 looks like a reference -- Missing reference section? '4' on line 1141 looks like a reference -- Missing reference section? '5' on line 1143 looks like a reference -- Missing reference section? '6' on line 1145 looks like a reference -- Missing reference section? '7' on line 1147 looks like a reference -- Missing reference section? '8' on line 1149 looks like a reference -- Missing reference section? '1A' on line 973 looks like a reference -- Missing reference section? '45' on line 973 looks like a reference -- Missing reference section? 'DF' on line 973 looks like a reference -- Missing reference section? 'A3' on line 973 looks like a reference -- Missing reference section? '42' on line 1078 looks like a reference -- Missing reference section? '86' on line 986 looks like a reference -- Missing reference section? 'F7' on line 1000 looks like a reference -- Missing reference section? 'F2' on line 1014 looks like a reference -- Missing reference section? 'F3' on line 1029 looks like a reference -- Missing reference section? '82' on line 1051 looks like a reference -- Missing reference section? '87' on line 1064 looks like a reference -- Missing reference section? '85' on line 1078 looks like a reference -- Missing reference section? 'BF' on line 1094 looks like a reference -- Missing reference section? 'EC' on line 1120 looks like a reference Summary: 2 errors (**), 0 flaws (~~), 2 warnings (==), 23 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: March 27, 2017 6 M. Bunkus 7 September 23, 2016 9 Extensible Binary Meta Language 10 draft-ietf-cellar-ebml-00 12 Abstract 14 This document defines the Extensible Binary Meta Language (EBML) 15 format as a genearlized file format for any type of data in a 16 hierarchical form. EBML is designed as a binary equivalent to XML 17 and utilizes a storage-efficient approach to building nested Elements 18 with identifiers, lengths, and values. Similar to how an XML Schema 19 defines the structure and semantics of an XML Document, this document 20 defines an EBML Schema 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 http://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 March 27, 2017. 39 Copyright Notice 41 Copyright (c) 2016 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 46 (http://trustee.ietf.org/license-info) in effect on the date of 47 publication of this document. Please review these documents 48 carefully, as they describe your rights and restrictions with respect 49 to this document. Code Components extracted from this document must 50 include Simplified BSD License text as described in Section 4.e of 51 the Trust Legal Provisions and are provided without warranty as 52 described in the Simplified BSD License. 54 Table of Contents 56 1. EBML specifications . . . . . . . . . . . . . . . . . . . . . 2 57 1.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 2 58 1.2. Notation and Conventions . . . . . . . . . . . . . . . . 3 59 1.3. Security Considerations . . . . . . . . . . . . . . . . . 3 60 1.4. Structure . . . . . . . . . . . . . . . . . . . . . . . . 4 61 1.5. Variable Size Integer . . . . . . . . . . . . . . . . . . 4 62 1.5.1. VINT_WIDTH . . . . . . . . . . . . . . . . . . . . . 4 63 1.5.2. VINT_MARKER . . . . . . . . . . . . . . . . . . . . . 4 64 1.5.3. VINT_DATA . . . . . . . . . . . . . . . . . . . . . . 4 65 1.5.4. VINT Examples . . . . . . . . . . . . . . . . . . . . 5 66 1.6. Element ID . . . . . . . . . . . . . . . . . . . . . . . 5 67 1.7. Element Data Size . . . . . . . . . . . . . . . . . . . . 6 68 1.8. EBML Element Types . . . . . . . . . . . . . . . . . . . 8 69 1.9. EBML Document . . . . . . . . . . . . . . . . . . . . . . 11 70 1.9.1. EBML Header . . . . . . . . . . . . . . . . . . . . . 12 71 1.9.2. EBML Body . . . . . . . . . . . . . . . . . . . . . . 12 72 1.10. EBML Stream . . . . . . . . . . . . . . . . . . . . . . . 13 73 1.11. Elements semantic . . . . . . . . . . . . . . . . . . . . 13 74 1.11.1. EBML Schema . . . . . . . . . . . . . . . . . . . . 13 75 1.11.2. EBML Header Elements . . . . . . . . . . . . . . . . 22 76 1.11.3. Global elements (used everywhere in the format) . . 25 77 2.1. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 27 78 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 27 80 1. EBML specifications 82 1.1. Introduction 84 EBML, short for Extensible Binary Meta Language, specifies a binary 85 and octet (byte) aligned format inspired by the principle of XML. 87 The goal of the EBML Specification is to define a generic, binary, 88 space-efficient format that may be utilized to define more complex 89 formats (such as containers for multimedia content) using an EBML 90 Schema. The definition of the EBML format recognizes the idea behind 91 HTML and XML as a good one: separate structure and semantics allowing 92 the same structural layer to be used with multiple, possibly widely 93 differing semantic layers. Except for the EBML Header and a few 94 global elements this specification does not define particular EBML 95 format semantics; however this specification is intended to define 96 how other EBML-based formats may be defined. 98 EBML uses a simple approach of building Elements upon three pieces of 99 data (tag, length, and value) as this approach is well known, easy to 100 parse, and allows selective data parsing. The EBML structure 101 additionally allows for hierarchical arrangement to support complex 102 structural formats in an efficient manner. 104 1.2. Notation and Conventions 106 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 107 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 108 document are to be interpreted as described in RFC 2119 [1]. 110 1.3. Security Considerations 112 EBML itself does not offer any kind of security. It has nothing to 113 do with authentication, it does not provide confidentiality, only 114 marginally useful and effective data integrity options (CRC 115 elements). 117 EBML does not provide any kind of authorization. 119 Even if the semantic layer offers any kind of encryption, EBML itself 120 may leak information at both the semantic layer (as declared via the 121 DocType element) and within the EBML structure (you can derive the 122 presence of EBML elements even with an unknown semantic layer with a 123 heuristic approach; not without errors, of course, but with a certain 124 degree of confidence). 126 Attacks on an EBML reader may include: - Invalid Element IDs that are 127 longer than the limit stated in the EBMLMaxIDLength Element of the 128 EBML Header. - Invalid Element IDs that are not encoded in the 129 shortest-possible way. - Invalid Element IDs comprised of reserved 130 values. - Invalid Element Data Size values that are longer than the 131 limit stated in the EBMLMaxSizeLength Element of the EBML Header. - 132 Invalid Element Data Size values (e.g. extending the length of the 133 Element beyond the scope of the Parent Element; possibly triggering 134 access-out-of-bounds issues). - Very high lengths in order to force 135 out-of-memory situations resulting in a denial of service, access- 136 out-of-bounds issues etc. - Missing Elements that are mandatory and 137 have no declared default value. - Usage of 0x00 octets in EBML 138 Elements with a string type. - Usage of invalid UTF-8 encoding in 139 EBML Elements of UTF-8 type (e.g. in order to trigger access-out-of- 140 bounds or buffer overflow issues). - Usage of invalid data in EBML 141 Elements with a date type. 143 1.4. Structure 145 EBML uses a system of Elements to compose an EBML Document. Elements 146 incorporate three parts: an Element ID, an Element Data Size, and 147 Element Data. The Element Data, which is described by the Element 148 ID, may include either binary data or one or many other Elements. 150 1.5. Variable Size Integer 152 The Element ID and Element Data Size are both encoded as a Variable 153 Size Integer, developed according to a UTF-8 like system. The 154 Variable Size Integer is composed of a VINT_WIDTH, VINT_MARKER, and 155 VINT_DATA, in that order. Variable Size Integers shall be referred 156 to as VINT for shorthand. 158 1.5.1. VINT_WIDTH 160 Each Variable Size Integer begins with a VINT_WIDTH which consists of 161 zero or many zero-value bits. The count of consecutive zero-values 162 of the VINT_WIDTH plus one equals the length in octets of the 163 Variable Size Integer. For example, a Variable Size Integer that 164 starts with a VINT_WIDTH which contains zero consecutive zero-value 165 bits is one octet in length and a Variable Size Integer that starts 166 with one consecutive zero-value bit is two octets in length. The 167 VINT_WIDTH MUST only contain zero-value bits or be empty. 169 1.5.2. VINT_MARKER 171 The VINT_MARKER serves as a separator between the VINT_WIDTH and 172 VINT_DATA. Each Variable Size Integer MUST contain exactly one 173 VINT_MARKER. The VINT_MARKER MUST be one bit in length and contain a 174 bit with a value of one. The first bit with a value of one within 175 the Variable Size Integer is the VINT_MARKER. 177 1.5.3. VINT_DATA 179 The VINT_DATA portion of the Variable Size Integer includes all data 180 that follows (but not including) the VINT_MARKER until end of the 181 Variable Size Integer whose length is derived from the VINT_WIDTH. 182 The bits required for the VINT_WIDTH and the VINT_MARKER combined use 183 one bit per octet of the total length of the Variable Size Integer. 184 Thus a Variable Size Integer of 1 octet length supplies 7 bits for 185 VINT_DATA, a 2 octet length supplies 14 bits for VINT_DATA, and a 3 186 octet length supplies 21 bits for VINT_DATA. If the number of bits 187 required for VINT_DATA are less than the bit size of VINT_DATA, then 188 VINT_DATA may be zero-padded to the left to a size that fits. The 189 VINT_DATA value MUST be expressed as a big-endian unsigned integer. 191 1.5.4. VINT Examples 193 This table shows examples of Variable Size Integers at widths of 1 to 194 5 octets. The Representation column depicts a binary expression of 195 Variable Size Integers where VINT_WIDTH is depicted by '0', the 196 VINT_MARKER as '1', and the VINT_DATA as 'x'. 198 +-------------+------+----------------------------------------------+ 199 | Octet Width | Size | Representation | 200 +-------------+------+----------------------------------------------+ 201 | 1 | 2^7 | 1xxx xxxx | 202 | 2 | 2^14 | 01xx xxxx xxxx xxxx | 203 | 3 | 2^21 | 001x xxxx xxxx xxxx xxxx xxxx | 204 | 4 | 2^28 | 0001 xxxx xxxx xxxx xxxx xxxx xxxx xxxx | 205 | 5 | 2^35 | 0000 1xxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx | 206 | | | xxxx | 207 +-------------+------+----------------------------------------------+ 209 Note that data encoded as a Variable Size Integer may be rendered at 210 octet widths larger than needed to store the data. In this table a 211 binary value of 0b10 is shown encoded as different Variable Size 212 Integers with widths from one octet to four octet. All four encoded 213 examples have identical semantic meaning though the VINT_WIDTH and 214 the padding of the VINT_DATA vary. 216 +--------------+-------------+--------------------------------------+ 217 | Binary Value | Octet Width | As Represented in Variable Size | 218 | | | Integer | 219 +--------------+-------------+--------------------------------------+ 220 | 10 | 1 | 1000 0010 | 221 | 10 | 2 | 0100 0000 0000 0010 | 222 | 10 | 3 | 0010 0000 0000 0000 0000 0010 | 223 | 10 | 4 | 0001 0000 0000 0000 0000 0000 0000 | 224 | | | 0010 | 225 +--------------+-------------+--------------------------------------+ 227 1.6. Element ID 229 The Element ID MUST be encoded as a Variable Size Integer. By 230 default, EBML Element IDs may be encoded in lengths from one octet to 231 four octets, although Element IDs of greater lengths may be used if 232 the octet length of the EBML Document's longest Element ID is 233 declared in the EBMLMaxIDLength Element of the EBML Header. The 234 VINT_DATA component of the Element ID MUST NOT be set to either all 235 zero values or all one values. The VINT_DATA component of the 236 Element ID MUST be encoded at the shortest valid length. For 237 example, an Element ID with binary encoding of 1011 1111 is valid, 238 whereas an Element ID with binary encoding of 0100 0000 0011 1111 239 stores a semantically equal VINT_DATA but is invalid because a 240 shorter VINT encoding is possible. The following table details this 241 specific example further: 243 +------------+-------------+----------------+-------------------+ 244 | VINT_WIDTH | VINT_MARKER | VINT_DATA | Element ID Status | 245 +------------+-------------+----------------+-------------------+ 246 | | 1 | 0111111 | Valid | 247 | 0 | 1 | 00000000111111 | Invalid | 248 +------------+-------------+----------------+-------------------+ 250 The octet length of an Element ID determines its EBML Class. 252 +------------+--------------+--------------------------------+ 253 | EBML Class | Octet Length | Number of Possible Element IDs | 254 +------------+--------------+--------------------------------+ 255 | Class A | 1 | 2^7 - 2 = 126 | 256 | Class B | 2 | 2^14 - 2^7 - 1 = 16,255 | 257 | Class C | 3 | 2^21 - 2^14 - 1 = 2,080,767 | 258 | Class D | 4 | 2^28 - 2^21 - 1 = 266,388,303 | 259 +------------+--------------+--------------------------------+ 261 1.7. Element Data Size 263 The Element Data Size expresses the length in octets of Element Data. 264 The Element Data Size itself MUST be encoded as a Variable Size 265 Integer. By default, EBML Element Data Sizes can be encoded in 266 lengths from one octet to eight octets, although Element Data Sizes 267 of greater lengths MAY be used if the octet length of the EBML 268 Document's longest Element Data Size is declared in the 269 EBMLMaxSizeLength Element of the EBML Header. Unlike the VINT_DATA 270 of the Element ID, the VINT_DATA component of the Element Data Size 271 is not required to be encoded at the shortest valid length. For 272 example, an Element Data Size with binary encoding of 1011 1111 or a 273 binary encoding of 0100 0000 0011 1111 are both valid Element Data 274 Sizes and both store a semantically equal value. 276 Although an Element ID with all VINT_DATA bits set to zero is 277 invalid, an Element Data Size with all VINT_DATA bits set to zero is 278 allowed for EBML Data Types which do not mandate a non-zero length. 279 An Element Data Size with all VINT_DATA bits set to zero indicates 280 that the Element Data of the Element is zero octets in length. Such 281 an Element is referred to as an Empty Element. If an Empty Element 282 has a "default" value declared then that default value MUST be 283 interpreted as the value of the Empty Element. If an Empty Element 284 has no "default" value declared then the semantic meaning of Empty 285 Element is defined as part of the definition of the EBML Element 286 Types. 288 An Element Data Size with all VINT_DATA bits set to one is reserved 289 as an indicator that the size of the Element is unknown. The only 290 reserved value for the VINT_DATA of Element Data Size is all bits set 291 to one. This rule allows for an Element to be written and read 292 before the size of the Element is known; however unknown Element Data 293 Size values SHOULD NOT be used unnecessarily. An Element with an 294 unknown Element Data Size MUST be a Master-element in that it 295 contains other EBML Elements as sub-elements. Master-elements MAY 296 only use an unknown size if the "unknownsizeallowed" attribute of the 297 EBML Schema is set to true. The end of a Master-element with unknown 298 size is determined by the beginning of the next element that is not a 299 valid sub-element of that Master-element. An Element with an unknown 300 Element Data Size is referred to as an "Unknown-Sized Element". 302 For Element Data Sizes encoded at octet lengths from one to eight, 303 this table depicts the range of possible values that can be encoded 304 as an Element Data Size. An Element Data Size with an octet length 305 of 8 is able to express a size of 2^56-2 or 72,057,594,037,927,934 306 octets (or about 72 petabytes). The maximum possible value that can 307 be stored as Element Data Size is referred to as "VINTMAX". 309 +--------------+----------------------+ 310 | Octet Length | Possible Value Range | 311 +--------------+----------------------+ 312 | 1 | 0 to 2^7-2 | 313 | 2 | 0 to 2^14-2 | 314 | 3 | 0 to 2^21-2 | 315 | 4 | 0 to 2^28-2 | 316 | 5 | 0 to 2^35-2 | 317 | 6 | 0 to 2^42-2 | 318 | 7 | 0 to 2^49-2 | 319 | 8 | 0 to 2^56-2 | 320 +--------------+----------------------+ 322 If the length of Element Data equals 2^(n*7)-1 then the octet length 323 of the Element Data Size MUST be at least n+1. This rule prevents an 324 Element Data Size from being expressed as a reserved value. For 325 example, an Element with an octet length of 127 MUST NOT be encoded 326 in an Element Data Size encoding with a one octet length. The 327 following table clarifies this rule by showing a valid and invalid 328 expression of an Element Data Size with a VINT_DATA of 127 (which is 329 equal to 2^(1*7)-1). 331 +------------+-------------+----------------+-----------------------+ 332 | VINT_WIDTH | VINT_MARKER | VINT_DATA | Element Data Size | 333 | | | | Status | 334 +------------+-------------+----------------+-----------------------+ 335 | | 1 | 1111111 | Reserved (meaning | 336 | | | | Unknown) | 337 | 0 | 1 | 00000001111111 | Valid (meaning 127 | 338 | | | | octets) | 339 +------------+-------------+----------------+-----------------------+ 341 1.8. EBML Element Types 343 Each defined EBML Element MUST have a declared Element Type. The 344 Element Type defines a concept for storing data that may be 345 constrained by length, endianness, and purpose. 347 +------------+------------------------------------------------------+ 348 | Element | Signed Integer | 349 | Data Type | | 350 +------------+------------------------------------------------------+ 351 | Endianness | Big-endian | 352 | Length | A Signed Integer Element MUST declare a length that | 353 | | is no greater than 8 octets. An Signed Integer | 354 | | Element with a zero-octet length represents an | 355 | | integer value of zero. | 356 | Definition | A Signed Integer stores an integer (meaning that it | 357 | | can be written without a fractional component) which | 358 | | may be negative, positive, or zero. Because EBML | 359 | | limits Signed Integers to 8 octets in length a | 360 | | Signed Element may store a number from | 361 | | -9,223,372,036,854,775,808 to | 362 | | +9,223,372,036,854,775,807. | 363 +------------+------------------------------------------------------+ 364 +------------+------------------------------------------------------+ 365 | Element | Unsigned Integer | 366 | Data Type | | 367 +------------+------------------------------------------------------+ 368 | Endianness | Big-endian | 369 | Length | A Unsigned Integer Element MUST declare a length | 370 | | that is no greater than 8 octets. An Unsigned | 371 | | Integer Element with a zero-octet length represents | 372 | | an integer value of zero. | 373 | Definition | An Unsigned Integer stores an integer (meaning that | 374 | | it can be written without a fractional component) | 375 | | which may be positive or zero. Because EBML limits | 376 | | Unsigned Integers to 8 octets in length an unsigned | 377 | | Element may store a number from 0 to | 378 | | 18,446,744,073,709,551,615. | 379 +------------+------------------------------------------------------+ 381 +------------+------------------------------------------------------+ 382 | Element | Float | 383 | Data Type | | 384 +------------+------------------------------------------------------+ 385 | Endianness | Big-endian | 386 | Length | A Float Element MUST declare of length of either 0 | 387 | | octets (0 bit), 4 octets (32 bit) or 8 octets (64 | 388 | | bit). A Float Element with a zero-octet length | 389 | | represents a numerical value of zero. | 390 | Definition | A Float Elements stores a floating-point number as | 391 | | defined in IEEE 754. | 392 +------------+------------------------------------------------------+ 394 +------------+------------------------------------------------------+ 395 | Element | String | 396 | Data Type | | 397 +------------+------------------------------------------------------+ 398 | Endianness | None | 399 | Length | A String Element may declare any length from zero to | 400 | | "VINTMAX". | 401 | Definition | A String Element may either be empty (zero-length) | 402 | | or contain Printable ASCII characters in the range | 403 | | of 0x20 to 0x7E. Octets with all bits set to zero | 404 | | may follow the string value when needed. | 405 +------------+------------------------------------------------------+ 406 +------------+------------------------------------------------------+ 407 | Element | UTF-8 | 408 | Data Type | | 409 +------------+------------------------------------------------------+ 410 | Endianness | None | 411 | Length | A UTF-8 Element may declare any length from zero to | 412 | | "VINTMAX". | 413 | Definition | A UTF-8 Element shall contain only a valid Unicode | 414 | | string as defined in RFC 2279 [2]. Octets with all | 415 | | bits set to zero may follow the UTF-8 value when | 416 | | needed. | 417 +------------+------------------------------------------------------+ 419 +------------+------------------------------------------------------+ 420 | Element | Date | 421 | Data Type | | 422 +------------+------------------------------------------------------+ 423 | Endianness | None | 424 | Length | A Date Element MUST declare a length of either 0 | 425 | | octets or 8 octets. A Date Element with a zero-octet | 426 | | length represents a timestamp of | 427 | | 2001-01-01T00:00:00.000000000 UTC. | 428 | Definition | The Date Element MUST contain a Signed Integer that | 429 | | expresses a point in time referenced in nanoseconds | 430 | | from the precise beginning of the third millennium | 431 | | of the Gregorian Calendar in Coordinated Universal | 432 | | Time (also known as 2001-01-01T00:00:00.000000000 | 433 | | UTC). This provides a possible expression of time | 434 | | from 1708-09-11T00:12:44.854775808 UTC to | 435 | | 2293-04-11T11:47:16.854775807 UTC. | 436 +------------+------------------------------------------------------+ 437 +------------+------------------------------------------------------+ 438 | Element | Master-element | 439 | Data Type | | 440 +------------+------------------------------------------------------+ 441 | Endianness | None | 442 | Length | A Master-element may declare any length from zero to | 443 | | "VINTMAX". The Master-element may also use an | 444 | | unknown length. See the section on Element Data Size | 445 | | for rules that apply to elements of unknown length. | 446 | Definition | The Master-element contains zero, one, or many other | 447 | | elements. Elements contained within a Master-element | 448 | | must be defined for use at levels greater than the | 449 | | level of the Master-element. For instance is a | 450 | | Master-element occurs on level 2 then all contained | 451 | | Elements must be valid at level 3. Element Data | 452 | | stored within Master-elements SHOULD only consist of | 453 | | EBML Elements and SHOULD NOT contain any data that | 454 | | is not part of an EBML Element. When EBML is used in | 455 | | transmission or streaming, data that is not part of | 456 | | an EBML Element is permitted to be present within a | 457 | | Master-element if "unknownsizeallowed" is enabled | 458 | | within that Master-element's definition. In this | 459 | | case, the reader should skip data until a valid | 460 | | Element ID of the same level or the next greater | 461 | | level of the Master-element is found. What Element | 462 | | IDs are considered valid within a Master-element is | 463 | | identified by the EBML Schema for that version of | 464 | | the EBML Document Type. Any data contained with a | 465 | | Master-element that is not part of an Element SHOULD | 466 | | be ignored. | 467 +------------+------------------------------------------------------+ 469 +--------------+----------------------------------------------------+ 470 | Element Data | Binary | 471 | Type | | 472 +--------------+----------------------------------------------------+ 473 | Endianness | None | 474 | Length | A binary element may declare any length from zero | 475 | | to "VINTMAX". | 476 | Definition | The contents of a Binary element should not be | 477 | | interpreted by the EBML parser. | 478 +--------------+----------------------------------------------------+ 480 1.9. EBML Document 482 An EBML Document is comprised of only two components, an EBML Header 483 and an EBML Body. An EBML Document MUST start with an EBML Header 484 which declares significant characteristics of the entire EBML Body. 486 An EBML Document MAY only consist of EBML Elements and MUST NOT 487 contain any data that is not part of an EBML Element. The initial 488 EBML Element of an EBML Document and the Elements that follow it are 489 considered Level 0 Elements. If an EBML Master-element is considered 490 to be at level N and it contains one or many other EBML Elements then 491 the contained Elements shall be considered at Level N+1. Thus a 492 Level 2 Element would have to be contained by a Master-element (at 493 Level 1) that is contained by another Master-element (at Level 0). 495 1.9.1. EBML Header 497 The EBML Header is a declaration that provides processing 498 instructions and identification of the EBML Body. The EBML Header 499 may be considered as analogous to an XML Declaration. All EBML 500 Documents MUST begin with a valid EBML Header. 502 The EBML Header documents the EBML Schema (also known as the EBML 503 DocType) that may be used to semantically interpret the structure and 504 meaning of the EBML Document. Additionally the EBML Header documents 505 the versions of both EBML and the EBML Schema that were used to write 506 the EBML Document and the versions required to read the EBML 507 Document. 509 The EBML Header consists of a single Master-element with an Element 510 ID of 'EBML'. The EBML Header MUST ONLY contain EBML Elements that 511 are defined as part of the EBML Specification. 513 All EBML Elements within the EBML Header MUST NOT utilize any Element 514 ID with a length greater than 4 octets. All EBML Elements within the 515 EBML Header MUST NOT utilize any Element Data Size with a length 516 greater than 4 octets. 518 1.9.2. EBML Body 520 All data of an EBML Document following the EBML Header may be 521 considered the EBML Body. The end of the EBML Body, as well as the 522 end of the EBML Document that contains the EBML Body, is considered 523 as whichever comes first: the beginning of a new level 0 EBML Header 524 or the end of the file. The EBML Body MAY only consist of EBML 525 Elements and MUST NOT contain any data that is not part of an EBML 526 Element. Although the EBML specification itself defines precisely 527 what EBML Elements are to be used within the EBML Header, the EBML 528 specification does not name or define what EBML Elements are to be 529 used within the EBML Body. The definition of what EBML Elements are 530 to be used within the EBML Body is defined by an EBML Schema. 532 1.10. EBML Stream 534 An EBML Stream is a file that consists of one or many EBML Documents 535 that are concatenated together. An occurrence of a Level 0 EBML 536 Header marks the beginning of an EBML Document. 538 1.11. Elements semantic 540 1.11.1. EBML Schema 542 An EBML Schema is an XML Document that defines the properties, 543 arrangement, and usage of EBML Elements that compose a specific EBML 544 Document Type. The relationship of an EBML Schema to an EBML 545 Document may be considered analogous to the relationship of an XML 546 Schema [3] to an XML Document [4]. An EBML Schema MUST be clearly 547 associated with one or many EBML Document Types. An EBML Schema must 548 be expressed as well-formed XML. An EBML Document Type is identified 549 by a unique string stored within the EBML Header element called 550 DocType; for example "matroska" or "webm". 552 As an XML Document, the EBML Schema MUST use "" as the 553 top level element. The "" element MAY contain 554 "" sub-elements. Each "" defines one EBML Element 555 through the use of several attributes which are defined in the 556 section on Section 1.11.1.1. EBML Schemas MAY contain additional 557 attributes to extend the semantics but MUST NOT conflict is the 558 definitions of the "" attributes defined within this 559 specification. 561 Within the EBML Schema each EBML Element is defined to occur at a 562 specific level. For any specificied EBML Element that is not at 563 level 0, the Parent EBML Element refers to the EBML Master-element 564 that that EBML Element is contained within. For any specifiied EBML 565 Master-element the Child EBML Element refers to the EBML Elements 566 that may be immediately contained within that Master-element. For 567 any EBML Element that is not defined at level 0, the Parent EBML 568 Element may be identified by the preceding "" node which has 569 a lower value as the defined "level" attribute. The only exception 570 for this rule are Global EBML Elements which may occur within any 571 Parent EBML Element within the restriction of the Global EBML 572 Element's range declaration. 574 An EBML Schema MUST declare exactly one Element at Level 0 (referred 575 to as the Root Element) that MUST occur exactly once within an EBML 576 Document. The Root Element MUST be mandatory (with minOccurs set to 577 1) and MUST be defined to occur exactly once (maxOccurs set to 1). 578 Note that the EBML and Void Elements may also occur at Level 0 but 579 are not considered to be Root Elements. 581 Elements defined to only occur at Level 1 are known as Top-Level 582 Elements. 584 The EBML Schema does not itself document the EBML Header, but 585 documents all data of the EBML Document that follows the EBML Header. 586 The EBML Header itself is documented by this specification in the 587 Section 1.11.2 section. The EBML Schema also does not document 588 Global Elements that are defined by the EBML Specification (namely 589 Void and CRC-32). 591 1.11.1.1. EBML Schema Element Attributes 593 Within an EBML Schema the "" uses the following 594 attributes to define the EBML Schema: 596 +-----------+----------+--------------------------------------------+ 597 | attribute | required | definition | 598 | name | | | 599 +-----------+----------+--------------------------------------------+ 600 | docType | Yes | The "docType" lists the official name of | 601 | | | the EBML Document Type that is defined by | 602 | | | the EBML Schema; for example, "". | 604 | version | Yes | The "version" lists an incremental non- | 605 | | | negative integer that specifies the | 606 | | | version of the docType documented by the | 607 | | | EBML Schema. Unlike XML Schemas, an EBML | 608 | | | Schema documents all versions of a | 609 | | | docType's definition rather than using | 610 | | | separate EBML Schemas for each version of | 611 | | | a docType. Elements may be introduced and | 612 | | | deprecated by using the "minver" and | 613 | | | "maxver" attributes of . | 614 +-----------+----------+--------------------------------------------+ 616 Within an EBML Schema the "" uses the following attributes 617 to define an EBML Element. 619 +--------------------+----------+-----------------------------------+ 620 | attribute name | required | definition | 621 +--------------------+----------+-----------------------------------+ 622 | name | Yes | The official human-readable name | 623 | | | of the EBML Element. The value of | 624 | | | the name MUST be in the form of | 625 | | | an NCName as defined by the XML | 626 | | | Schema specification [5]. | 627 | level | Yes | The level notes at what | 628 | | | hierarchical depth the EBML | 629 | | | Element may occur within an EBML | 630 | | | Document. The Root Element of an | 631 | | | EBML Document is at level 0 and | 632 | | | the Elements that it may contain | 633 | | | are at level 1. The level MUST be | 634 | | | expressed as an integer. Note | 635 | | | that Elements defined as "global" | 636 | | | and "recursive" MAY occur at a | 637 | | | level greater than or equal to | 638 | | | the defined "level". | 639 | global | No | A boolean to express if an EBML | 640 | | | Element MUST occur at its defined | 641 | | | level or may occur within any | 642 | | | Parent EBML Element. If the | 643 | | | "global" attribute is not | 644 | | | expressed for that Element then | 645 | | | that element is to be considered | 646 | | | not global. | 647 | id | Yes | The Element ID expressed in | 648 | | | hexadecimal notation prefixed by | 649 | | | a '0x'. To reduce the risk of | 650 | | | false positives while parsing | 651 | | | EBML Streams, the IDs of the Root | 652 | | | Element and Top-Level Elements | 653 | | | SHOULD be at least 4 octets in | 654 | | | length. Element IDs defined for | 655 | | | use at Level 0 or Level 1 MAY use | 656 | | | shorter octet lengths to | 657 | | | facilitate padding and optimize | 658 | | | edits to EBML Documents; for | 659 | | | instance, the EBML Void Element | 660 | | | uses an Element ID with a one | 661 | | | octet length to allow its usage | 662 | | | in more writing and editing | 663 | | | scenarios. | 664 | minOccurs | No | An integer to express the minimal | 665 | | | number of occurrences that the | 666 | | | EBML Element MUST occur within | 667 | | | its Parent Element if its Parent | 668 | | | Element is used. If the Element | 669 | | | has no Parent Level (as is the | 670 | | | case with Elements at Level 0), | 671 | | | then minOccurs refers to | 672 | | | constaints on the Element's | 673 | | | occurrence within the EBML | 674 | | | Document. If the minOccurs | 675 | | | attribute is not expressed for | 676 | | | that Element then that Element | 677 | | | shall be considered to have a | 678 | | | minOccurs value of 0. This value | 679 | | | of minOccurs MUST be a positive | 680 | | | integer. The semantic meaning of | 681 | | | minOccurs within an EBML Schema | 682 | | | is considered analogous to the | 683 | | | meaning of minOccurs within an | 684 | | | XML Schema [6]. Note that | 685 | | | Elements with minOccurs set to | 686 | | | "1" that also have a default | 687 | | | value declared are not required | 688 | | | to be stored but are required to | 689 | | | be interpretted, see the Section | 690 | | | 1.11.1.6. | 691 | maxOccurs | No | A value to express the maximum | 692 | | | number of occurrences that the | 693 | | | EBML Element MAY occur within its | 694 | | | Parent Element if its Parent | 695 | | | Element is used. If the Element | 696 | | | has no Parent Level (as is the | 697 | | | case with Elements at Level 0), | 698 | | | then maxOccurs refers to | 699 | | | constaints on the Element's | 700 | | | occurrence within the EBML | 701 | | | Document. This value may be | 702 | | | either a positive integer or the | 703 | | | term "unbounded" to indicate | 704 | | | there is no maximum number of | 705 | | | occurrences or the term | 706 | | | "identical" to indicate that the | 707 | | | Element is an Section 1.11.1.3. | 708 | | | If the maxOccurs attribute is not | 709 | | | expressed for that Element then | 710 | | | that Element shall be considered | 711 | | | to have a maxOccurs value of 1. | 712 | | | The semantic meaning of maxOccurs | 713 | | | within an EBML Schema is | 714 | | | considered analogous to the | 715 | | | meaning of minOccurs within an | 716 | | | XML Schema [7], with EBML Schema | 717 | | | adding the concept of Identically | 718 | | | Recurring Elements. | 719 | range | No | For Elements which are of | 720 | | | numerical types (Unsigned | 721 | | | Integer, Signed Integer, Float, | 722 | | | and Date) a numerical range may | 723 | | | be specified. If specified that | 724 | | | the value of the EBML Element | 725 | | | MUST be within the defined range | 726 | | | inclusively. See the Section | 727 | | | 1.11.1.4 for rules applied to | 728 | | | expression of range values. | 729 | default | No | A default value may be provided. | 730 | | | If an Element is mandatory but | 731 | | | not written within its Parent | 732 | | | EBML Element, then the parser of | 733 | | | the EBML Document MUST insert the | 734 | | | defined default value of the | 735 | | | Element. EBML Elements that are | 736 | | | Master-elements MUST NOT declare | 737 | | | a default value. | 738 | type | Yes | As defined within the Section | 739 | | | 1.8, the type MUST be set to one | 740 | | | of the following values: | 741 | | | 'integer' (signed integer), | 742 | | | 'uinteger' (unsigned integer), | 743 | | | 'float', 'string', 'date', | 744 | | | 'utf-8', 'master', or 'binary'. | 745 | unknownsizeallowed | No | A boolean to express if an EBML | 746 | | | Element MAY be used as an | 747 | | | "Unknown-Sized Element" (having | 748 | | | all VINT_DATA bits of Element | 749 | | | Data Size set to 1). The | 750 | | | "unknownsizeallowed" attribute | 751 | | | only applies to Master-elements. | 752 | | | If the "unknownsizeallowed" | 753 | | | attribute is not used it is | 754 | | | assumed that the element is not | 755 | | | allowed to use an unknown Element | 756 | | | Data Size. | 757 | recursive | No | A boolean to express if an EBML | 758 | | | Element MAY be stored | 759 | | | recursively. In this case the | 760 | | | Element MAY be stored at levels | 761 | | | greater that defined in the | 762 | | | "level" attribute if the Element | 763 | | | is a Child Element of a Parent | 764 | | | Element with the same Element ID. | 765 | | | The "recursive" attribute only | 766 | | | applies to Master-elements. If | 767 | | | the "recursive" attribute is not | 768 | | | used it is assumed that the | 769 | | | element is not allowed to be used | 770 | | | recursively. | 771 | minver | No | The "minver" (minimum version) | 772 | | | attribute stores a non-negative | 773 | | | integer that represents the first | 774 | | | version of the docType to support | 775 | | | the element. If the "minver" | 776 | | | attribute is not used it is | 777 | | | assumed that the element has a | 778 | | | minimum version of "1". | 779 | maxver | No | The "maxver" (maximum version) | 780 | | | attribute stores a non-negative | 781 | | | integer that represents the last | 782 | | | or most recent version of the | 783 | | | docType to support the element. | 784 | | | If the "maxver" attribute is not | 785 | | | used it is assumed that the | 786 | | | element has a maximum version | 787 | | | equal to the value stored in the | 788 | | | "version" attribute of . | 789 +--------------------+----------+-----------------------------------+ 791 The "" nodes shall contain a description of the meaning and 792 use of the EBML Element stored within one or many "" 793 sub-elements. The "" sub-element may use a "lang" 794 attribute which may be set to the RFC 5646 value of the language of 795 the element's documentation. The "" sub-element may 796 use a "type" attribute to distinguish the meaning of the 797 documentation. Recommended values for the "" sub- 798 element's "type" attribute include: "definition", "rationale", "usage 799 notes", and "references". 801 The "" nodes MUST be arranged hierarchically according to 802 the permitted structure of the EBML Document Type. An "" 803 node that defines an EBML Element which is a Child Element of another 804 Parent Element MUST be stored as an immediate sub-element of the 805 "" node that defines the Parent Element. "" nodes 806 that define Level 0 Elements and Global Elements should be sub- 807 elements of "". 809 1.11.1.2. EBML Schema Example 810 811 812 813 814 Container of data and 815 attributes representing one or many files. 816 818 An attached file. 819 820 822 Filename of the attached 823 file. 824 825 827 MIME type of the 828 file. 829 830 832 Modification timestamp of 833 the file. 834 835 837 The data of the 838 file. 839 840 841 842 844 1.11.1.3. Identically Recurring Elements 846 An Identically Recurring Element is an Element that may occur within 847 its Parent Element more than once but that each recurrence within 848 that Parent Element MUST be identical both in storage and semantics. 849 Identically Recurring Elements are permitted to be stored multiple 850 times within the same Parent Element in order to increase data 851 resilience and optimize the use of EBML in transmission. Identically 852 Recurring Elements SHOULD include a CRC-32 Element as a Child 853 Element; this is especially recommended when EBML is used for long- 854 term storage or transmission. If a Parent Element contains more than 855 one copy of an Identically Recurring Element which includes a CRC-32 856 Child Element then the first instance of the Identically Recurring 857 Element with a valid CRC-32 value should be used for interpretation. 859 If a Parent Element contains more than one copy of an Identically 860 Recurring Element which does not contain a CRC-32 Child Element or if 861 CRC-32 Child Elements are present but none are valid then the first 862 instance of the Identically Recurring Element should be used for 863 interpretation. 865 1.11.1.4. Expression of range 867 The "range" attribute MUST only be used with EBML Elements that are 868 either "signed integer", "unsigned integer", or "float". The "range" 869 attribute does not support date EBML Elements. The "range" 870 expression may contain whitespace for readability but whitespace 871 within a "range" expression MUST NOT convey meaning. The expression 872 of the "range" MUST adhere to one of the following forms: 874 o "x-y" where x and y are integers or floats and "y" must be greater 875 than "x", meaning that the value must be greater than or equal to 876 "x" and less than or equal to "y". 878 o ">x" where "x" is an integer or float, meaning that the value MUST 879 be greater than "x". 881 o "x" where "x" is an integer or float, meaning that the value MUST 882 be equal "x". 884 The "range" may use the prefix "not" to indicate that the expressed 885 range is negated. Please also see the section on Section 1.11.1.5. 887 1.11.1.5. Textual expression of Floats 889 When a float value is represented textually in an EBML Schema, such 890 as within a "default" or "range" value, the float values MUST be 891 expressed as a Hexadecimal Floating-Point Constants as defined in the 892 C11 standard ISO/IEC 9899:2011 [8] (see section 6.4.4.2 on Floating 893 Constants). The following table provides examples of expressions of 894 float ranges. 896 +-------------------+-----------------------------------------+ 897 | as decimal | as Hexadecimal Floating-Point Constants | 898 +-------------------+-----------------------------------------+ 899 | 0.0-1.0 | 0x0p+1-0x1p+0 | 900 | 1.0-256.0 | 0x1p+0-0x1p+8 | 901 | 0.857421875 | 0x1.b7p-1 | 902 | -1.0--0.857421875 | -0x1p+0--0x1.b7p-1 | 903 +-------------------+-----------------------------------------+ 905 Within an expression of a float range, as in an integer range, the 906 "-" (hyphen) character is the separator between the minimal and 907 maximum value permitted by the range. Note that Hexadecimal 908 Floating-Point Constants also use a "-" (hyphen) when indicating a 909 negative binary power. Within a float range, when a "-" (hyphen) is 910 immediately preceded by a letter "p", then the "-" (hyphen) is a part 911 of the Hexadecimal Floating-Point Constant which notes negative 912 binary power. Within a float range, when a "-" (hyphen) is not 913 immediately preceded by a letter "p", then the "-" (hyphen) 914 represents the separator between the minimal and maximum value 915 permitted by the range. 917 1.11.1.6. Note on the Use of default attributes to define Mandatory 918 EBML Elements 920 If a Mandatory EBML Element has a default value declared by an EBML 921 Schema and the EBML Element's value is equal to the declared default 922 value then that Element is not required to be present within the EBML 923 Document if its Parent EBML Element is present. In this case, the 924 default value of the Mandatory EBML Element may be assumed although 925 the EBML Element is not present within its Parent EBML Element. Also 926 in this case the parser of the EBML Document MUST insert the defined 927 default value of the Element. 929 If a Mandatory EBML Element has no default value declared by an EBML 930 Schema and its Parent EBML Element is present than the EBML Element 931 must be present as well. If a Mandatory EBML Element has a default 932 value declared by an EBML Schema and its Parent EBML Element is 933 present and the EBML Element's value is NOT equal to the declared 934 default value then the EBML Element MUST be used. 936 This table clarifies if a Mandatory EBML Element MUST be written, 937 according to if the default value is declared, if the value of the 938 EBML Element is equal to the declared default value, and if the 939 Parent EBML Element is used. 941 +---------------+----------------+--------------+-------------------+ 942 | Is the | Is the value | Is the | Then is storing | 943 | default value | equal to | Parent | the EBML Element | 944 | declared? | default? | Element | required? | 945 | | | used? | | 946 +---------------+----------------+--------------+-------------------+ 947 | Yes | Yes | Yes | No | 948 | Yes | Yes | No | No | 949 | Yes | No | Yes | Yes | 950 | Yes | No | No | No | 951 | No | n/a | Yes | Yes | 952 | No | n/a | No | No | 953 | No | n/a | Yes | Yes | 954 | No | n/a | No | No | 955 +---------------+----------------+--------------+-------------------+ 957 1.11.1.7. Note on the Use of default attributes to define non-Mandatory 958 EBML Elements 960 If an EBML Element is not Mandatory, has a defined default value, and 961 is an Empty EBML Element then the EBML Element MUST be interpreted as 962 expressing the default value. 964 1.11.2. EBML Header Elements 966 This specification here contains definitions of all EBML Elements of 967 the EBML Header. 969 +-------------+-----------------------------------------------------+ 970 | Name | EBML | 971 +-------------+-----------------------------------------------------+ 972 | Level | 0 | 973 | EBML ID | [1A][45][DF][A3] | 974 | Mandatory | Yes | 975 | Multiple | No | 976 | Range | - | 977 | Default | - | 978 | Type | Master-element | 979 | Description | Set the EBML characteristics of the data to follow. | 980 | | Each EBML Document has to start with this. | 981 +-------------+-----------------------------------------------------+ 982 +-------------+-----------------------------------------------------+ 983 | Name | EBMLVersion | 984 +-------------+-----------------------------------------------------+ 985 | Level | 1 | 986 | EBML ID | [42][86] | 987 | Mandatory | Yes | 988 | Multiple | No | 989 | Range | 1 | 990 | Default | 1 | 991 | Type | Unsigned Integer | 992 | Description | The version of EBML parser used to create the EBML | 993 | | Document. | 994 +-------------+-----------------------------------------------------+ 996 +-------------+-----------------------------------------------------+ 997 | Name | EBMLReadVersion | 998 +-------------+-----------------------------------------------------+ 999 | Level | 1 | 1000 | EBML ID | [42][F7] | 1001 | Mandatory | Yes | 1002 | Multiple | No | 1003 | Range | 1 | 1004 | Default | 1 | 1005 | Type | Unsigned Integer | 1006 | Description | The minimum EBML version a parser has to support to | 1007 | | read this EBML Document. | 1008 +-------------+-----------------------------------------------------+ 1010 +-------------+-----------------------------------------------------+ 1011 | Name | EBMLMaxIDLength | 1012 +-------------+-----------------------------------------------------+ 1013 | Level | 1 | 1014 | EBML ID | [42][F2] | 1015 | Mandatory | Yes | 1016 | Multiple | No | 1017 | Range | >3 | 1018 | Default | 4 | 1019 | Type | Unsigned Integer | 1020 | Description | The EBMLMaxIDLength is the maximum length in octets | 1021 | | of the Element IDs to be found within the EBML | 1022 | | Body. An EBMLMaxIDLength value of four is | 1023 | | recommended, though larger values are allowed. | 1024 +-------------+-----------------------------------------------------+ 1025 +-------------+-----------------------------------------------------+ 1026 | Name | EBMLMaxSizeLength | 1027 +-------------+-----------------------------------------------------+ 1028 | Level | 1 | 1029 | EBML ID | [42][F3] | 1030 | Mandatory | Yes | 1031 | Multiple | No | 1032 | Range | >0 | 1033 | Default | 8 | 1034 | Type | Unsigned Integer | 1035 | Description | The EBMLMaxSizeLength is the maximum length in | 1036 | | octets of the expression of all Element Data Sizes | 1037 | | to be found within the EBML Body. To be clear | 1038 | | EBMLMaxSizeLength documents the maximum 'length' of | 1039 | | all Element Data Size expressions within the EBML | 1040 | | Body and not the maximum 'value' of all Element | 1041 | | Data Size expressions within the EBML Body. | 1042 | | Elements that have a Element Data Size expression | 1043 | | which is larger in octets than what is expressed by | 1044 | | EBMLMaxSizeLength SHALL be considered invalid. | 1045 +-------------+-----------------------------------------------------+ 1047 +-------------+-----------------------------------------------------+ 1048 | Name | DocType | 1049 +-------------+-----------------------------------------------------+ 1050 | Level | 1 | 1051 | EBML ID | [42][82] | 1052 | Mandatory | Yes | 1053 | Multiple | No | 1054 | Range | - | 1055 | Default | matroska | 1056 | Type | String | 1057 | Description | A string that describes and identifies the content | 1058 | | of the EBML Body that follows this EBML Header. | 1059 +-------------+-----------------------------------------------------+ 1060 +-------------+-----------------------------------------------------+ 1061 | Name | DocTypeVersion | 1062 +-------------+-----------------------------------------------------+ 1063 | Level | 1 | 1064 | EBML ID | [42][87] | 1065 | Mandatory | Yes | 1066 | Multiple | No | 1067 | Range | - | 1068 | Default | 1 | 1069 | Type | Unsigned Integer | 1070 | Description | The version of DocType interpreter used to create | 1071 | | the EBML Document. | 1072 +-------------+-----------------------------------------------------+ 1074 +-------------+-----------------------------------------------------+ 1075 | Name | DocTypeReadVersion | 1076 +-------------+-----------------------------------------------------+ 1077 | Level | 1 | 1078 | EBML ID | [42][85] | 1079 | Mandatory | Yes | 1080 | Multiple | No | 1081 | Range | - | 1082 | Default | 1 | 1083 | Type | Unsigned Integer | 1084 | Description | The minimum DocType version an interpreter has to | 1085 | | support to read this EBML Document. | 1086 +-------------+-----------------------------------------------------+ 1088 1.11.3. Global elements (used everywhere in the format) 1089 +-------------+-----------------------------------------------------+ 1090 | Name | CRC-32 | 1091 +-------------+-----------------------------------------------------+ 1092 | Level | 1+ | 1093 | Global | Yes | 1094 | EBML ID | [BF] | 1095 | Mandatory | No | 1096 | Range | - | 1097 | Default | - | 1098 | Type | Binary | 1099 | Description | The CRC-32 Element contains a 32 bit Cyclic | 1100 | | Redundancy Check value of all the Element Data of | 1101 | | the Parent Element as stored except for the CRC-32 | 1102 | | Element itself. When the CRC-32 Element is present, | 1103 | | the CRC-32 Element MUST be the first ordered | 1104 | | Element within its Parent Element for easier | 1105 | | reading. All Top-Level Elements of an EBML Document | 1106 | | SHOULD include a CRC-32 Element as a Child Element. | 1107 | | The CRC in use is the IEEE-CRC-32 algorithm as used | 1108 | | in the ISO 3309 standard and in section 8.1.1.6.2 | 1109 | | of ITU-T recommendation V.42, with initial value of | 1110 | | 0xFFFFFFFF. The CRC value MUST be computed on a | 1111 | | little endian bitstream and MUST use little endian | 1112 | | storage. | 1113 +-------------+-----------------------------------------------------+ 1115 +-------------+-----------------------------------------------------+ 1116 | Name | Void | 1117 +-------------+-----------------------------------------------------+ 1118 | Level | 0+ | 1119 | Global | Yes | 1120 | EBML ID | [EC] | 1121 | Mandatory | No | 1122 | Multiple | Yes | 1123 | Range | - | 1124 | Default | - | 1125 | Type | Binary | 1126 | Description | Used to void damaged data, to avoid unexpected | 1127 | | behaviors when using damaged data. The content is | 1128 | | discarded. Also used to reserve space in a sub- | 1129 | | element for later use. | 1130 +-------------+-----------------------------------------------------+ 1132 2. References 1133 2.1. URIs 1135 [1] https://tools.ietf.org/html/rfc2119 1137 [2] http://www.faqs.org/rfcs/rfc2279.html 1139 [3] http://www.w3.org/XML/Schema#dev 1141 [4] http://www.w3.org/TR/xml/ 1143 [5] http://www.w3.org/TR/1999/REC-xml-names-19990114/#ns-decl 1145 [6] https://www.w3.org/TR/xmlschema-0/#ref6 1147 [7] https://www.w3.org/TR/xmlschema-0/#ref6 1149 [8] http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf 1151 Authors' Addresses 1153 Steve Lhomme 1155 Dave Rice 1157 Moritz Bunkus