Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move control track related content in a separate document #461

Merged
merged 8 commits into from Apr 11, 2021
1 change: 1 addition & 0 deletions .github/workflows/generate-rfcs.yaml
Expand Up @@ -45,6 +45,7 @@ jobs:
mv draft-ietf-cellar-codec-??.xml artifacts
mv draft-ietf-cellar-tags-??.xml artifacts
mv draft-ietf-cellar-chapter-codecs-??.xml artifacts
mv draft-ietf-cellar-control-??.xml artifacts

- name: XML Artifact
uses: actions/upload-artifact@master
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -8,10 +8,13 @@ _site
*ietf-cellar-codec*
*ietf-cellar-tags-*
*ietf-cellar-chapter-codecs-*
*ietf-cellar-control-*
bootstrap.mak
ebml_matroska_elements.md
ebml_matroska_elements4rfc.md
control_elements4rfc.md
matroska_tagging_registry.md
control_xsd.xml
matroska_xsd.xml
metadata.min.js
mmark
Expand Down
22 changes: 19 additions & 3 deletions Makefile
Expand Up @@ -2,14 +2,17 @@ VERSION_MATROSKA := 06
VERSION_CODEC := 05
VERSION_TAGS := 05
VERSION_CHAPTER_CODECS := 01
VERSION_CONTROL := 01
STATUS_MATROSKA := draft-
STATUS_CODEC := draft-
STATUS_TAGS := draft-
STATUS_CHAPTER_CODECS := draft-
STATUS_CONTROL := draft-
OUTPUT_MATROSKA := $(STATUS_MATROSKA)ietf-cellar-matroska-$(VERSION_MATROSKA)
OUTPUT_CODEC := $(STATUS_CODEC)ietf-cellar-codec-$(VERSION_CODEC)
OUTPUT_TAGS := $(STATUS_TAGS)ietf-cellar-tags-$(VERSION_TAGS)
OUTPUT_CHAPTER_CODECS := $(STATUS_CHAPTER_CODECS)ietf-cellar-chapter-codecs-$(VERSION_CHAPTER_CODECS)
OUTPUT_CONTROL := $(STATUS_CONTROL)ietf-cellar-control-$(VERSION_CONTROL)

XML2RFC_CALL := xml2rfc
MMARK_CALL := mmark
Expand All @@ -20,24 +23,32 @@ EBML_SCHEMA_XSD := ../ebml-specification/EBMLSchema.xsd
XML2RFC := $(XML2RFC_CALL) --v3
MMARK := $(MMARK_CALL)

all: matroska codecs tags chapter_codecs
all: matroska codecs tags chapter_codecs control
$(info RFC rendering has been tested with mmark version 2.2.8 and xml2rfc 2.46.0, please ensure these are installed and recent enough.)

matroska: $(OUTPUT_MATROSKA).html $(OUTPUT_MATROSKA).txt $(OUTPUT_MATROSKA).xml
codecs: $(OUTPUT_CODEC).html $(OUTPUT_CODEC).txt $(OUTPUT_CODEC).xml
tags: $(OUTPUT_TAGS).html $(OUTPUT_TAGS).txt $(OUTPUT_TAGS).xml
chapter_codecs: $(OUTPUT_CHAPTER_CODECS).html $(OUTPUT_CHAPTER_CODECS).txt $(OUTPUT_CHAPTER_CODECS).xml
control: $(OUTPUT_CONTROL).html $(OUTPUT_CONTROL).txt $(OUTPUT_CONTROL).xml

matroska_xsd.xml: transforms/schema_clean.xsl ebml_matroska.xml
xsltproc transforms/schema_clean.xsl ebml_matroska.xml > $@

check: matroska_xsd.xml $(EBML_SCHEMA_XSD)
control_xsd.xml: transforms/schema_clean.xsl control_elements.xml
xsltproc transforms/schema_clean.xsl control_elements.xml > $@

check: matroska_xsd.xml control_xsd.xml $(EBML_SCHEMA_XSD)
xmllint --noout --schema $(EBML_SCHEMA_XSD) matroska_xsd.xml
xmllint --noout --schema $(EBML_SCHEMA_XSD) control_xsd.xml

ebml_matroska_elements4rfc.md: transforms/ebml_schema2markdown4rfc.xsl matroska_xsd.xml
xsltproc transforms/ebml_schema2markdown4rfc.xsl matroska_xsd.xml > $@

$(OUTPUT_MATROSKA).md: index_matroska.md diagram.md matroska_schema_section_header.md ebml_matroska_elements4rfc.md ordering.md chapters.md attachments.md cues.md streaming.md menu.md notes.md rfc_backmatter_matroska.md
control_elements4rfc.md: transforms/ebml_schema2markdown4rfc.xsl control_xsd.xml
xsltproc transforms/ebml_schema2markdown4rfc.xsl control_xsd.xml > $@

$(OUTPUT_MATROSKA).md: index_matroska.md diagram.md matroska_schema_section_header.md ebml_matroska_elements4rfc.md ordering.md chapters.md attachments.md cues.md streaming.md notes.md rfc_backmatter_matroska.md
cat $^ | sed -e '/^---/,/^---/d' \
-e "s/@BUILD_DATE@/$(shell date +'%F')/" \
-e "s/@BUILD_VERSION@/$(OUTPUT_MATROSKA)/" > $@
Expand All @@ -54,6 +65,10 @@ $(OUTPUT_CHAPTER_CODECS).md: index_chapter_codecs.md chapter_codecs.md rfc_backm
-e "s/@BUILD_VERSION@/$(OUTPUT_CHAPTER_CODECS)/" > $@


$(OUTPUT_CONTROL).md: index_control.md control.md control_elements4rfc.md menu.md rfc_backmatter_control.md
cat $^ | sed -e "s/@BUILD_DATE@/$(shell date +'%F')/" \
-e "s/@BUILD_VERSION@/$(OUTPUT_CONTROL)/" > $@

%.xml: %.md
$(MMARK) $< | awk '/<?rfc toc=/ && !modif { printf("<?rfc tocdepth=\"6\"?>\n"); modif=1 } {print}' | \
sed -e "s/submissionType=/sortRefs=\"true\" submissionType=/" \
Expand All @@ -76,6 +91,7 @@ clean:
$(RM) -f $(OUTPUT_CODEC).txt $(OUTPUT_CODEC).html $(OUTPUT_CODEC).md $(OUTPUT_CODEC).xml
$(RM) -f $(OUTPUT_TAGS).txt $(OUTPUT_TAGS).html $(OUTPUT_TAGS).md $(OUTPUT_TAGS).xml
$(RM) -f $(OUTPUT_CHAPTER_CODECS).txt $(OUTPUT_CHAPTER_CODECS).html $(OUTPUT_CHAPTER_CODECS).md $(OUTPUT_CHAPTER_CODECS).xml
$(RM) -f $(OUTPUT_CONTROL).txt $(OUTPUT_CONTROL).html $(OUTPUT_CONTROL).md $(OUTPUT_CONTROL).xml
$(RM) -rf _site

.PHONY: clean check website matroska codecs tags all
136 changes: 26 additions & 110 deletions chapters.md
Expand Up @@ -17,30 +17,6 @@ An `Edition` contains a set of `Edition` flags and **MUST** contain at least one
Chapters are always inside an `Edition` (or a Chapter itself part of an `Edition`).
Multiple Editions are allowed. Some of these Editions **MAY** be ordered and others not.

### EditionFlagHidden

When the `EditionFlagHidden` flag is set to `false` it means the `Edition` is visible and selectable
in a `Matroska Player`.
All `ChapterAtoms Elements` **MUST** be interpreted with their own `ChapterFlagHidden` flags.

ChapterFlagHidden | False | True | visible
:-----------------|:------|:-----|:-------
Chapter 1 | X | | yes
Chapter 2 | | X | no
Table: ChapterAtom visibility to the user{#chapterVisibility}

When the `EditionFlagHidden` flag is set to `true` the `Edition` is hidden and **SHOULD NOT** be
selectable in a `Matroska Player`.
If all `Editions` `EditionFlagHidden` flags are set to `true`, there is no visible `Edition`.
In this case all `ChapterAtoms Elements` **MUST** also be interpreted as if their `ChapterFlagHidden`
flag is also set to `true`, regardless with their own `ChapterFlagHidden` flags.

ChapterFlagHidden | False | True | visible
:-----------------|:------|:-----|:-------
Chapter 1 | X | | no
Chapter 2 | | X | no
Table: ChapterAtom visibility in hidden editions{#chapterVisibilityHidden}

### EditionFlagDefault

Only one `Edition` **SHOULD** have an `EditionFlagDefault` flag set to `true`.
Expand All @@ -49,55 +25,31 @@ Only one `Edition` **SHOULD** have an `EditionFlagDefault` flag set to `true`.

The `Default Edition` is the `Edition` that a `Matroska Player` **SHOULD** use for playback by default.

The first `Edition` with both the `EditionFlagDefault` flag set to `true` and the `EditionFlagHidden`
flag set to `false` is the `Default Edition`.
When all `EditionFlagDefault` flags are set to `false` and all `EditionFlagHidden` flag set to `true`,
then the first `Edition` is the `Default Edition`.
When all `EditionFlagHidden` flags are set to `true`, then the first `Edition` with the
`EditionFlagDefault` flag set to `true` is the `Default Edition`.
When all `EditionFlagDefault` flags are set to `false`, then the first `Edition` with the
`EditionFlagHidden` flag set to `false` is the `Default Edition`.
When there is no `Edition` with a `EditionFlagDefault` flag are set to `true` and a
`EditionFlagHidden` flags are set to `false`, then the first `Edition` with the `EditionFlagHidden`
flag set to `false` is the `Default Edition`.

In other words, in case the `Default Edition` is not obvious, the first `Edition` with a
`EditionFlagHidden` flag set to `false` **SHOULD** be preferred.

Edition | FlagHidden | FlagDefault | Default Edition
:---------|:-----------|:------------|:---------------
Edition 1 | true | true |
Edition 2 | true | true |
Edition 3 | false | true | X
Table: Default edition, some visible, all default{#defaultEditionSomeVisibleAllDefault}

Edition | FlagHidden | FlagDefault | Default Edition
:---------|:-----------|:------------|:---------------
Edition 1 | true | false | X
Edition 2 | true | false |
Edition 3 | true | false |
Table: Default edition, all hidden, no default{#defaultEditionAllHiddenNoDefault}

Edition | FlagHidden | FlagDefault | Default Edition
:---------|:-----------|:------------|:---------------
Edition 1 | true | false |
Edition 2 | true | true | X
Edition 3 | true | false |
Table: Default edition, all hidden, with default{#defaultEditionAllHiddenWithDefault}

Edition | FlagHidden | FlagDefault | Default Edition
:---------|:-----------|:------------|:---------------
Edition 1 | true | false |
Edition 2 | false | false | X
Edition 3 | false | false |
Table: Default edition, some visible, no default{#defaultEditionSomeVisibleNoDefault}

Edition | FlagHidden | FlagDefault | Default Edition
:---------|:-----------|:------------|:---------------
Edition 1 | true | false |
Edition 2 | true | true |
Edition 3 | false | false | X
Table: Default edition, some visible, some default{#defaultEditionSomeVisibleSomeDefault}
The first `Edition` with the `EditionFlagDefault` flag set to `true` is the `Default Edition`.

When all `EditionFlagDefault` flags are set to `false`, then the first `Edition`
is the `Default Edition`.

Edition | FlagDefault | Default Edition
:---------|:------------|:---------------
Edition 1 | true | X
Edition 2 | true |
Edition 3 | true |
Table: Default edition, all default{#defaultEditionAllDefault}

Edition | FlagDefault | Default Edition
:---------|:------------|:---------------
Edition 1 | false | X
Edition 2 | false |
Edition 3 | false |
Table: Default edition, no default{#defaultEditionNoDefault}

Edition | FlagDefault | Default Edition
:---------|:------------|:---------------
Edition 1 | false |
Edition 2 | true | X
Edition 3 | false |
Table: Default edition, with default{#defaultEditionWithDefault}

### EditionFlagOrdered

Expand Down Expand Up @@ -198,7 +150,7 @@ Chapter 4 | 9000000000 | 8000000000 | -1000000000 (illegal)

### ChapterFlagHidden

The `ChapterFlagHidden` flag works differently from the `EditionFlagHidden` flag. Each Chapter
Each Chapter
`ChapterFlagHidden` flag works independently from parent chapters.
A `Nested Chapter` with `ChapterFlagHidden` flag set to `false` remains visible even if the
`Parent Chapter` `ChapterFlagHidden` flag is set to `true`.
Expand All @@ -212,25 +164,6 @@ Chapter 2 | true | no
Nested Chapter 2.1 | false | yes
Nested Chapter 2.2 | true | no

### ChapterFlagEnabled

If the `ChapterFlagEnabled` flag is set to `false` a `Matroska Player` **MUST NOT** use this
`Chapter` and all his `Nested Chapters`.
For `Simple Chapters`, a `Matroska Player` **MAY** display this enabled `Chapter` with a marker in
the timeline.
For `Ordered Chapters` a `Matroska Player` **MUST** use the duration of this enabled `Chapter`.

Chapter + Nested Chapter | ChapterFlagEnabled | used
:------------------------|:-------------------|:----
Chapter 1 | true | yes
+Nested Chapter 1.1 | true | yes
+Nested Chapter 1.2 | false | no
++Nested Chapter 1.2.1 | true | no
++Nested Chapter 1.2.2 | false | no
Chapter 2 | false | no
+Nested Chapter 2.1 | true | no
+Nested Chapter 2.2 | true | no

## Menu features

The menu features are handled like a `chapter codec`. That means each codec has a type,
Expand Down Expand Up @@ -274,7 +207,6 @@ This would translate in the following matroska form :
<ChapLanguage>eng</ChapLanguage>
</ChapterDisplay>
<ChapterFlagHidden>0</ChapterFlagHidden>
<ChapterFlagEnabled>1</ChapterFlagEnabled>
</ChapterAtom>
<ChapterAtom>
<ChapterUID>2311527</ChapterUID>
Expand All @@ -289,7 +221,6 @@ This would translate in the following matroska form :
<ChapLanguage>fra</ChapLanguage>
</ChapterDisplay>
<ChapterFlagHidden>0</ChapterFlagHidden>
<ChapterFlagEnabled>1</ChapterFlagEnabled>
</ChapterAtom>
<ChapterAtom>
<ChapterUID>3430008</ChapterUID>
Expand All @@ -304,7 +235,6 @@ This would translate in the following matroska form :
<ChapLanguage>fra</ChapLanguage>
</ChapterDisplay>
<ChapterFlagHidden>0</ChapterFlagHidden>
<ChapterFlagEnabled>1</ChapterFlagEnabled>
</ChapterAtom>
<ChapterAtom>
<ChapterUID>4548489</ChapterUID>
Expand All @@ -319,7 +249,6 @@ This would translate in the following matroska form :
<ChapLanguage>fra</ChapLanguage>
</ChapterDisplay>
<ChapterFlagHidden>0</ChapterFlagHidden>
<ChapterFlagEnabled>1</ChapterFlagEnabled>
</ChapterAtom>
<ChapterAtom>
<ChapterUID>5666960</ChapterUID>
Expand All @@ -334,10 +263,8 @@ This would translate in the following matroska form :
<ChapLanguage>fra</ChapLanguage>
</ChapterDisplay>
<ChapterFlagHidden>0</ChapterFlagHidden>
<ChapterFlagEnabled>1</ChapterFlagEnabled>
</ChapterAtom>
<EditionFlagDefault>0</EditionFlagDefault>
<EditionFlagHidden>0</EditionFlagHidden>
</EditionEntry>
</Chapters>
```
Expand Down Expand Up @@ -381,7 +308,6 @@ of them contain another splitting.
<ChapLanguage>eng</ChapLanguage>
</ChapterDisplay>
<ChapterFlagHidden>0</ChapterFlagHidden>
<ChapterFlagEnabled>1</ChapterFlagEnabled>
</ChapterAtom>
<ChapterAtom>
<ChapterUID>3</ChapterUID>
Expand All @@ -392,7 +318,6 @@ of them contain another splitting.
<ChapLanguage>eng</ChapLanguage>
</ChapterDisplay>
<ChapterFlagHidden>0</ChapterFlagHidden>
<ChapterFlagEnabled>1</ChapterFlagEnabled>
</ChapterAtom>
<ChapterAtom>
<ChapterUID>4</ChapterUID>
Expand All @@ -403,7 +328,6 @@ of them contain another splitting.
<ChapLanguage>eng</ChapLanguage>
</ChapterDisplay>
<ChapterFlagHidden>0</ChapterFlagHidden>
<ChapterFlagEnabled>1</ChapterFlagEnabled>
</ChapterAtom>
<ChapterAtom>
<ChapterUID>5</ChapterUID>
Expand All @@ -414,10 +338,8 @@ of them contain another splitting.
<ChapLanguage>eng</ChapLanguage>
</ChapterDisplay>
<ChapterFlagHidden>0</ChapterFlagHidden>
<ChapterFlagEnabled>1</ChapterFlagEnabled>
</ChapterAtom>
<ChapterFlagHidden>0</ChapterFlagHidden>
<ChapterFlagEnabled>1</ChapterFlagEnabled>
</ChapterAtom>
<ChapterAtom>
<ChapterUID>6</ChapterUID>
Expand All @@ -428,7 +350,6 @@ of them contain another splitting.
<ChapLanguage>eng</ChapLanguage>
</ChapterDisplay>
<ChapterFlagHidden>0</ChapterFlagHidden>
<ChapterFlagEnabled>1</ChapterFlagEnabled>
</ChapterAtom>
<ChapterAtom>
<ChapterUID>7</ChapterUID>
Expand All @@ -439,7 +360,6 @@ of them contain another splitting.
<ChapLanguage>eng</ChapLanguage>
</ChapterDisplay>
<ChapterFlagHidden>0</ChapterFlagHidden>
<ChapterFlagEnabled>1</ChapterFlagEnabled>
</ChapterAtom>
<ChapterAtom>
<ChapterUID>8</ChapterUID>
Expand All @@ -450,7 +370,6 @@ of them contain another splitting.
<ChapLanguage>eng</ChapLanguage>
</ChapterDisplay>
<ChapterFlagHidden>0</ChapterFlagHidden>
<ChapterFlagEnabled>1</ChapterFlagEnabled>
</ChapterAtom>
<ChapterAtom>
<ChapterUID>9</ChapterUID>
Expand All @@ -461,7 +380,6 @@ of them contain another splitting.
<ChapLanguage>eng</ChapLanguage>
</ChapterDisplay>
<ChapterFlagHidden>0</ChapterFlagHidden>
<ChapterFlagEnabled>1</ChapterFlagEnabled>
</ChapterAtom>
<ChapterAtom>
<ChapterUID>10</ChapterUID>
Expand All @@ -472,10 +390,8 @@ of them contain another splitting.
<ChapLanguage>eng</ChapLanguage>
</ChapterDisplay>
<ChapterFlagHidden>0</ChapterFlagHidden>
<ChapterFlagEnabled>1</ChapterFlagEnabled>
</ChapterAtom>
<EditionFlagDefault>0</EditionFlagDefault>
<EditionFlagHidden>0</EditionFlagHidden>
</EditionEntry>
</Chapters>
```