[EME] Improve the Initialization Data and Events section of the CENC and WebM format specs.
authorDavid Dorwin <ddorwin@google.com>
Mon, 12 May 2014 17:15:25 -0700
changeset 311 67e151641669
parent 310 30b372d9798b
child 312 3e528bd640e3
[EME] Improve the Initialization Data and Events section of the CENC and WebM format specs.
encrypted-media/cenc-format-respec.html
encrypted-media/cenc-format.html
encrypted-media/webm-format-respec.html
encrypted-media/webm-format.html
--- a/encrypted-media/cenc-format-respec.html	Fri May 09 15:17:25 2014 -0700
+++ b/encrypted-media/cenc-format-respec.html	Mon May 12 17:15:25 2014 -0700
@@ -56,18 +56,17 @@
     </script>
   </head>
   <body>
-    <div class="issue">Note: This specification is in progress. See <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=17673">Bug 17673</a>.</div>
     <p>This specification defines the stream format and initialization data for ISO Base media File Format (ISOBMFF) content using the ISO Common Encryption ('cenc') protection scheme.</p>
 
     <section id="cenc-stream-format">
-      <h1>Stream format</h1>
+      <h1>Stream Format</h1>
       <p>Under the 'cenc' protection scheme, ISOBMFF content is encrypted at the sample level with AES-128 CTR encryption, according to ISO/IEC 23001-7:2012, "Information technology - MPEG system technologies - Part 7: Common encryption in ISO base media file format files". This protection method enables multiple Key Systems to decrypt the same media content.</p>
       <p>Each key is identified by a Key ID and each encrypted sample is associated with the Key ID of the key needed to decrypt it. This association is signaled either through the specification of a default Key ID in the track encryption box ('tenc') or by assigning the sample to a Sample Group, the definition of which specifies a Key ID. Common encryption files may contain a mixture of encrypted and unencrypted samples.</p>
     </section>
 
     <section id="cenc-detect-encrypt">
       <h1>Detecting Encryption</h1>
-      <p>Protection scheme signaling conforms with ISO/IEC 14496-12. When protection has been applied, the stream type will be transformed to 'encv' for video or 'enca' for audio, with a Protection Scheme Information Box ('sinf') added to the sample entry in the Sample Description Box ('stsd'). The Protection Scheme Information Box ('sinf') will contain a Scheme Type Box ('schm') with a scheme_type field set to a value of 'cenc' (Common Encryption).</p>
+      <p>Protection scheme signaling conforms with ISO/IEC 14496-12:2012. When protection has been applied, the stream type will be transformed to 'encv' for video or 'enca' for audio, with a Protection Scheme Information Box ('sinf') added to the sample entry in the Sample Description Box ('stsd'). The Protection Scheme Information Box ('sinf') will contain a Scheme Type Box ('schm') with a scheme_type field set to a value of 'cenc' (Common Encryption).</p>
       <p>The "encrypted block" is a sample. Determining whether a sample is encrypted depends on the corresponding Track Encryption Box ('tenc') and the sample group with grouping type 'seig' (CencSampleEncryption group), if any, associated with the sample.
       The default encryption state of a sample is defined by the IsEncrypted flag in the associated track encryption box ('tenc'). This default state may be modified by the IsEncrypted flag in the SampleGroupDescriptionBox ('sgpd'), pointed to by an index in the SampleToGroupBox ('sbgp').</p>
       <p>Samples can be partially encrypted, specified by subsample information referenced by SampleAuxiliaryInformationSizesBox (‘saiz’) and SampleAuxiliaryInformationOffsetsBox ('saio') boxes.</p>
@@ -76,7 +75,11 @@
 
     <section id="cenc-init-data">
       <h1>Initialization Data and Events</h1>
-      <p>The file may contain protection system specific header ('pssh') boxes for one or more Key Systems, each containing a SystemID identifying the Key System. These multiple 'pssh' boxes are concatenated into a single Initialization Data and returned with the needkey event.</p>
+      <p>Common Encryption files may contain protection system specific header ('pssh') boxes for one or more  SystemIDs.</p>
+      <p><a href="encrypted-media.html#initialization-data">Initialization Data</a> is always one or more concatenated 'pssh' boxes.
+      <p>Each time one or more 'pssh' boxes are encountered, the <a href="encrypted-media.html#algorithms-initdata-encountered">Initialization Data Encountered</a> algorithm shall be invoked with <var title="">initDataType</var> = "cenc" and <var title="">initData</var> = the 'pssh' boxes.
+      'pssh' boxes must be provided together if and only if they appear directly next to each other in the file.
+      </p>
     </section>
   </body>
 </html>
--- a/encrypted-media/cenc-format.html	Fri May 09 15:17:25 2014 -0700
+++ b/encrypted-media/cenc-format.html	Mon May 12 17:15:25 2014 -0700
@@ -114,45 +114,6 @@
 .section dl.attrs dd, .section dl.eldef dd {
     margin-bottom:  0;
 }
-</style><style>/* --- ISSUES/NOTES --- */
-div.issue-title, div.note-title {
-    padding-right:  1em;
-    min-width: 7.5em;
-    color: #b9ab2d;
-}
-div.issue-title { color: #e05252; }
-div.note-title { color: #2b2; }
-div.issue-title span, div.note-title span {
-    text-transform: uppercase;
-}
-div.note, div.issue {
-    margin-top: 1em;
-    margin-bottom: 1em;
-}
-.note > p:first-child, .issue > p:first-child { margin-top: 0 }
-.issue, .note {
-    padding: .5em;
-    border-left-width: .5em;
-    border-left-style: solid;
-}
-div.issue, div.note {
-    padding: 1em 1.2em 0.5em;
-    margin: 1em 0;
-    position: relative;
-    clear: both;
-}
-span.note, span.issue { padding: .1em .5em .15em; }
-
-.issue {
-    border-color: #e05252;
-    background: #fbe9e9;
-}
-.note {
-    border-color: #52e052;
-    background: #e9fbe9;
-}
-
-
 </style><link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/W3C-ED"><!--[if lt IE 9]><script src='https://www.w3.org/2008/site/js/html5shiv.js'></script><![endif]--></head>
   <body class="h-entry" role="document" id="respecDocument"><div class="head" role="contentinfo" id="respecHeader">
   <p>
@@ -162,7 +123,7 @@
   </p>
   <h1 class="title p-name" id="title" property="dcterms:title">ISO Common Encryption EME Stream Format and Initialization Data</h1>
   
-  <h2 property="dcterms:issued" datatype="xsd:dateTime" content="2014-05-07T04:24:00.000Z" id="w3c-editor-s-draft-06-may-2014"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft <time class="dt-published" datetime="2014-05-06">06 May 2014</time></h2>
+  <h2 property="dcterms:issued" datatype="xsd:dateTime" content="2014-05-13T07:07:43.000Z" id="w3c-editor-s-draft-13-may-2014"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft <time class="dt-published" datetime="2014-05-13">13 May 2014</time></h2>
   <dl>
     
       <dt>This version:</dt>
@@ -219,18 +180,17 @@
   
   <hr>
 </div>
-    <div class="issue"><div class="issue-title" aria-level="1" role="heading" id="h_issue_1"><span>Issue 1</span></div><div class="">Note: This specification is in progress. See <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=17673">Bug 17673</a>.</div></div>
     <p>This specification defines the stream format and initialization data for ISO Base media File Format (ISOBMFF) content using the ISO Common Encryption ('cenc') protection scheme.</p>
 
     <section id="cenc-stream-format" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
-      <!--OddPage--><h2 aria-level="1" role="heading" id="h2_cenc-stream-format"><span class="secno">1. </span>Stream format</h2>
+      <!--OddPage--><h2 aria-level="1" role="heading" id="h2_cenc-stream-format"><span class="secno">1. </span>Stream Format</h2>
       <p>Under the 'cenc' protection scheme, ISOBMFF content is encrypted at the sample level with AES-128 CTR encryption, according to ISO/IEC 23001-7:2012, "Information technology - MPEG system technologies - Part 7: Common encryption in ISO base media file format files". This protection method enables multiple Key Systems to decrypt the same media content.</p>
       <p>Each key is identified by a Key ID and each encrypted sample is associated with the Key ID of the key needed to decrypt it. This association is signaled either through the specification of a default Key ID in the track encryption box ('tenc') or by assigning the sample to a Sample Group, the definition of which specifies a Key ID. Common encryption files may contain a mixture of encrypted and unencrypted samples.</p>
     </section>
 
     <section id="cenc-detect-encrypt" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
       <!--OddPage--><h2 aria-level="1" role="heading" id="h2_cenc-detect-encrypt"><span class="secno">2. </span>Detecting Encryption</h2>
-      <p>Protection scheme signaling conforms with ISO/IEC 14496-12. When protection has been applied, the stream type will be transformed to 'encv' for video or 'enca' for audio, with a Protection Scheme Information Box ('sinf') added to the sample entry in the Sample Description Box ('stsd'). The Protection Scheme Information Box ('sinf') will contain a Scheme Type Box ('schm') with a scheme_type field set to a value of 'cenc' (Common Encryption).</p>
+      <p>Protection scheme signaling conforms with ISO/IEC 14496-12:2012. When protection has been applied, the stream type will be transformed to 'encv' for video or 'enca' for audio, with a Protection Scheme Information Box ('sinf') added to the sample entry in the Sample Description Box ('stsd'). The Protection Scheme Information Box ('sinf') will contain a Scheme Type Box ('schm') with a scheme_type field set to a value of 'cenc' (Common Encryption).</p>
       <p>The "encrypted block" is a sample. Determining whether a sample is encrypted depends on the corresponding Track Encryption Box ('tenc') and the sample group with grouping type 'seig' (CencSampleEncryption group), if any, associated with the sample.
       The default encryption state of a sample is defined by the IsEncrypted flag in the associated track encryption box ('tenc'). This default state may be modified by the IsEncrypted flag in the SampleGroupDescriptionBox ('sgpd'), pointed to by an index in the SampleToGroupBox ('sbgp').</p>
       <p>Samples can be partially encrypted, specified by subsample information referenced by SampleAuxiliaryInformationSizesBox (‘saiz’) and SampleAuxiliaryInformationOffsetsBox ('saio') boxes.</p>
@@ -239,7 +199,11 @@
 
     <section id="cenc-init-data" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
       <!--OddPage--><h2 aria-level="1" role="heading" id="h2_cenc-init-data"><span class="secno">3. </span>Initialization Data and Events</h2>
-      <p>The file may contain protection system specific header ('pssh') boxes for one or more Key Systems, each containing a SystemID identifying the Key System. These multiple 'pssh' boxes are concatenated into a single Initialization Data and returned with the needkey event.</p>
+      <p>Common Encryption files may contain protection system specific header ('pssh') boxes for one or more  SystemIDs.</p>
+      <p><a href="encrypted-media.html#initialization-data">Initialization Data</a> is always one or more concatenated 'pssh' boxes.
+      </p><p>Each time one or more 'pssh' boxes are encountered, the <a href="encrypted-media.html#algorithms-initdata-encountered">Initialization Data Encountered</a> algorithm shall be invoked with <var title="">initDataType</var> = "cenc" and <var title="">initData</var> = the 'pssh' boxes.
+      'pssh' boxes must be provided together if and only if they appear directly next to each other in the file.
+      </p>
     </section>
   
 
--- a/encrypted-media/webm-format-respec.html	Fri May 09 15:17:25 2014 -0700
+++ b/encrypted-media/webm-format-respec.html	Mon May 12 17:15:25 2014 -0700
@@ -56,39 +56,29 @@
     </script>
   </head>
   <body>
-
-  <p>This specification defines the stream format and Initialization Data for implementations that choose to support <a href="http://www.webmproject.org/code/specs/container/">WebM</a>.</p>
+  <p>This specification defines the stream format and initialization data for <a href="http://www.webmproject.org/code/specs/container/">WebM</a>.</p>
 
   <section id="webm-stream-format">
     <h1>Stream Format </h1>
     <p><a href="http://wiki.webmproject.org/encryption/webm-encryption-rfc">Encrypted WebM streams</a> are encrypted at the block level with AES-128 CTR encryption.
     The container shall include appropriate values within the <a href="http://matroska.org/technical/specs/index.html#ContentEncryption">ContentEncryption</a> element.
     </p>
-
     <p>WebM streams may be partially encrypted, both at the <a href="http://matroska.org/technical/specs/index.html#LevelTrack">Track</a> level and the block level.
     In the former case, a subset of Tracks in the stream have a <a href="http://matroska.org/technical/specs/index.html#ContentEncryption">ContentEncryption</a> element.
-    In the latter case, a subset of the blocks within a Track containing a <a href="http://matroska.org/technical/specs/index.html#ContentEncryption">ContentEncryption</a> element are marked as encrypted.</p>
+    In the latter case, a subset of the blocks within a Track containing a <a href="http://matroska.org/technical/specs/index.html#ContentEncryption">ContentEncryption</a> element are marked as encrypted.
+    </p>
   </section>
 
   <section id="webm-detect-encrypt">
     <h1>Detecting Encryption</h1>
-    <p>When a WebM <a href="http://matroska.org/technical/specs/index.html#LevelTrack">Track</a> is parsed, the presence of a <a href="http://matroska.org/technical/specs/index.html#ContentEncKeyID">ContentEncKeyID</a> element shall indicate that the stream is potentially encrypted. Each time a new value is encountered in a ContentEncKeyID element, the <a href="encrypted-media.html#algorithms-initdata-encountered">Initialization Data Encountered</a> algorithm shall be invoked with the value in that element as <var title="">initData</var>.</p>
-
+    <p>When a WebM <a href="http://matroska.org/technical/specs/index.html#LevelTrack">Track</a> is parsed, the presence of a <a href="http://matroska.org/technical/specs/index.html#ContentEncKeyID">ContentEncKeyID</a> element indicates that blocks in the track may be encrypted.
     <p><a href="encrypted-media.html#algorithms-encrypted-block">Encrypted blocks</a> are those marked encrypted by the <a href="http://wiki.webmproject.org/encryption/webm-encryption-rfc#TOC-4.6-Signal-Byte-Format">Signal Byte.</a></p>
   </section>
 
   <section id="webm-init-data">
     <h1>Initialization Data and Events</h1>
-    <p><a href="encrypted-media.html#initialization-data">Initialization Data</a> in <a href="encrypted-media.html#events">events</a> is always a key ID, which is the <a href="http://matroska.org/technical/specs/index.html#ContentEncKeyID">ContentEncKeyID</a> of the current <a href="http://matroska.org/technical/specs/index.html#LevelTrack">Track</a>.
-    The current Track is the one being parsed or that contains the block being decrypted.
-    </p>
-
-    <p>Events only contain a single key ID.
-    However, if supported by the key system, multiple key IDs may be bundled by the application before requesting a key and multiple key ID-key pairs may be returned by the license server.
-    </p>
-
-    <p>An event will be fired for each new key ID (in <a href="http://matroska.org/technical/specs/index.html#ContentEncKeyID">ContentEncKeyID</a>) encountered.</p>
+    <p><a href="encrypted-media.html#initialization-data">Initialization Data</a> is always a single key ID, as defined by the <a href="http://matroska.org/technical/specs/index.html#ContentEncKeyID">ContentEncKeyID</a> element of the <a href="http://matroska.org/technical/specs/index.html#LevelTrack">Track</a>.</p>
+    <p>Each time a <a href="http://matroska.org/technical/specs/index.html#ContentEncKeyID">ContentEncKeyID</a> element is encountered, the <a href="encrypted-media.html#algorithms-initdata-encountered">Initialization Data Encountered</a> algorithm shall be invoked with <var title="">initDataType</var> = "webm" and <var title="">initData</var> = the value in that element.</p>
   </section>
-
   </body>
 </html>
--- a/encrypted-media/webm-format.html	Fri May 09 15:17:25 2014 -0700
+++ b/encrypted-media/webm-format.html	Mon May 12 17:15:25 2014 -0700
@@ -115,7 +115,7 @@
     margin-bottom:  0;
 }
 </style><link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/W3C-ED"><!--[if lt IE 9]><script src='https://www.w3.org/2008/site/js/html5shiv.js'></script><![endif]--></head>
-  <body class="h-entry" style="" role="document" id="respecDocument"><div class="head" role="contentinfo" id="respecHeader">
+  <body class="h-entry" role="document" id="respecDocument"><div class="head" role="contentinfo" id="respecHeader">
   <p>
     
       <a href="http://www.w3.org/"><img width="72" height="48" src="https://www.w3.org/Icons/w3c_home" alt="W3C"></a>
@@ -123,7 +123,7 @@
   </p>
   <h1 class="title p-name" id="title" property="dcterms:title">WebM EME Stream Format and Initialization Data</h1>
   
-  <h2 property="dcterms:issued" datatype="xsd:dateTime" content="2014-04-03T06:57:00.000Z" id="w3c-editor-s-draft-02-april-2014"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft <time class="dt-published" datetime="2014-04-02">02 April 2014</time></h2>
+  <h2 property="dcterms:issued" datatype="xsd:dateTime" content="2014-05-13T07:13:38.000Z" id="w3c-editor-s-draft-13-may-2014"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft <time class="dt-published" datetime="2014-05-13">13 May 2014</time></h2>
   <dl>
     
       <dt>This version:</dt>
@@ -180,40 +180,30 @@
   
   <hr>
 </div>
-
-  <p>This specification defines the stream format and Initialization Data for implementations that choose to support <a href="http://www.webmproject.org/code/specs/container/">WebM</a>.</p>
+  <p>This specification defines the stream format and initialization data for <a href="http://www.webmproject.org/code/specs/container/">WebM</a>.</p>
 
   <section id="webm-stream-format" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
     <!--OddPage--><h2 aria-level="1" role="heading" id="h2_webm-stream-format"><span class="secno">1. </span>Stream Format </h2>
     <p><a href="http://wiki.webmproject.org/encryption/webm-encryption-rfc">Encrypted WebM streams</a> are encrypted at the block level with AES-128 CTR encryption.
     The container shall include appropriate values within the <a href="http://matroska.org/technical/specs/index.html#ContentEncryption">ContentEncryption</a> element.
     </p>
-
     <p>WebM streams may be partially encrypted, both at the <a href="http://matroska.org/technical/specs/index.html#LevelTrack">Track</a> level and the block level.
     In the former case, a subset of Tracks in the stream have a <a href="http://matroska.org/technical/specs/index.html#ContentEncryption">ContentEncryption</a> element.
-    In the latter case, a subset of the blocks within a Track containing a <a href="http://matroska.org/technical/specs/index.html#ContentEncryption">ContentEncryption</a> element are marked as encrypted.</p>
+    In the latter case, a subset of the blocks within a Track containing a <a href="http://matroska.org/technical/specs/index.html#ContentEncryption">ContentEncryption</a> element are marked as encrypted.
+    </p>
   </section>
 
   <section id="webm-detect-encrypt" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
     <!--OddPage--><h2 aria-level="1" role="heading" id="h2_webm-detect-encrypt"><span class="secno">2. </span>Detecting Encryption</h2>
-    <p>When a WebM <a href="http://matroska.org/technical/specs/index.html#LevelTrack">Track</a> is parsed, the presence of a <a href="http://matroska.org/technical/specs/index.html#ContentEncKeyID">ContentEncKeyID</a> element shall indicate that the stream is potentially encrypted. Each time a new value is encountered in a ContentEncKeyID element, the <a href="encrypted-media.html#algorithms-initdata-encountered">Initialization Data Encountered</a> algorithm shall be invoked with the value in that element as <var title="">initData</var>.</p>
-
-    <p><a href="encrypted-media.html#algorithms-encrypted-block">Encrypted blocks</a> are those marked encrypted by the <a href="http://wiki.webmproject.org/encryption/webm-encryption-rfc#TOC-4.6-Signal-Byte-Format">Signal Byte.</a></p>
+    <p>When a WebM <a href="http://matroska.org/technical/specs/index.html#LevelTrack">Track</a> is parsed, the presence of a <a href="http://matroska.org/technical/specs/index.html#ContentEncKeyID">ContentEncKeyID</a> element indicates that blocks in the track may be encrypted.
+    </p><p><a href="encrypted-media.html#algorithms-encrypted-block">Encrypted blocks</a> are those marked encrypted by the <a href="http://wiki.webmproject.org/encryption/webm-encryption-rfc#TOC-4.6-Signal-Byte-Format">Signal Byte.</a></p>
   </section>
 
   <section id="webm-init-data" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
     <!--OddPage--><h2 aria-level="1" role="heading" id="h2_webm-init-data"><span class="secno">3. </span>Initialization Data and Events</h2>
-    <p><a href="encrypted-media.html#initialization-data">Initialization Data</a> in <a href="encrypted-media.html#events">events</a> is always a key ID, which is the <a href="http://matroska.org/technical/specs/index.html#ContentEncKeyID">ContentEncKeyID</a> of the current <a href="http://matroska.org/technical/specs/index.html#LevelTrack">Track</a>.
-    The current Track is the one being parsed or that contains the block being decrypted.
-    </p>
-
-    <p>Events only contain a single key ID.
-    However, if supported by the key system, multiple key IDs may be bundled by the application before requesting a key and multiple key ID-key pairs may be returned by the license server.
-    </p>
-
-    <p>An event will be fired for each new key ID (in <a href="http://matroska.org/technical/specs/index.html#ContentEncKeyID">ContentEncKeyID</a>) encountered.</p>
+    <p><a href="encrypted-media.html#initialization-data">Initialization Data</a> is always a single key ID, as defined by the <a href="http://matroska.org/technical/specs/index.html#ContentEncKeyID">ContentEncKeyID</a> element of the <a href="http://matroska.org/technical/specs/index.html#LevelTrack">Track</a>.</p>
+    <p>Each time a <a href="http://matroska.org/technical/specs/index.html#ContentEncKeyID">ContentEncKeyID</a> element is encountered, the <a href="encrypted-media.html#algorithms-initdata-encountered">Initialization Data Encountered</a> algorithm shall be invoked with <var title="">initDataType</var> = "webm" and <var title="">initData</var> = the value in that element.</p>
   </section>
-
   
 
 </body></html>
\ No newline at end of file