[MSE] Initial checkin of MPEG audio byte stream spec.
authorAaron Colwell <acolwell@chromium.org>
Wed, 19 Mar 2014 16:06:22 -0700
changeset 268 48643033a3f5
parent 267 151f30f76656
child 269 c92afe8aac93
[MSE] Initial checkin of MPEG audio byte stream spec.
media-source/media-source.js
media-source/mpeg-audio-byte-stream-format-respec.html
media-source/mpeg-audio-byte-stream-format.html
--- a/media-source/media-source.js	Tue Mar 25 14:43:32 2014 -0700
+++ b/media-source/media-source.js	Wed Mar 19 16:06:22 2014 -0700
@@ -215,7 +215,7 @@
     'reset-parser-state-algorithm': { func: link_helper, fragment: '#sourcebuffer-reset-parser-state', link_text: 'reset parser state algorithm', },
     'stream-append-loop': { func: link_helper, fragment: '#sourcebuffer-stream-append-loop', link_text: 'stream append loop', },
     'prepare-append': { func: link_helper, fragment: '#sourcebuffer-prepare-append', link_text: 'prepare append', },
-    'buffer-append': { func: link_helper, fragment: '#sourcebuffer-buffer-append', link_text: 'buffer append ', },
+    'buffer-append': { func: link_helper, fragment: '#sourcebuffer-buffer-append', link_text: 'buffer append', },
     'init-segment-received-algorithm': { func: link_helper, fragment: '#sourcebuffer-init-segment-received', link_text: 'initialization segment received algorithm', },
     'coded-frame-processing-algorithm': { func: link_helper, fragment: '#sourcebuffer-coded-frame-processing', link_text: 'coded frame processing algorithm', },
     'coded-frame-removal-algorithm': { func: link_helper, fragment: '#sourcebuffer-coded-frame-removal', link_text: 'coded frame removal algorithm', },
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/media-source/mpeg-audio-byte-stream-format-respec.html	Wed Mar 19 16:06:22 2014 -0700
@@ -0,0 +1,194 @@
+<!DOCTYPE html SYSTEM "about:legacy-compat">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>MPEG Audio Byte Stream Format</title>
+    <script src="respec-w3c-common.js" class="remove"></script>
+    <script src="media-source.js" class="remove"></script>
+    <script class="remove">
+      (function() {
+        var mpegContainerSpecDefinitions = {
+          'iso-11172-3': { fragment: 'http://www.iso.org/iso/catalogue_detail.htm?csnumber=22412', link_text: 'ISO/IEC 11172-3:1993', },
+          'iso-13818-3': { fragment: 'http://www.iso.org/iso/catalogue_detail.htm?csnumber=26797', link_text: 'ISO/IEC 13818-3:1998', },
+          'iso-14496-3': { fragment: 'http://www.iso.org/iso/catalogue_detail.htm?csnumber=53943', link_text: 'ISO/IEC 14496-3:2009', },
+          'id3v1': { fragment: 'http://id3.org/ID3v1', link_text: 'ID3v1', },
+          'id3v2': { fragment: 'http://id3.org/id3v2.3.0', link_text: 'ID3v2', },
+          'icecast-headers': { fragment: '#icecast-header', link_text: 'Icecast headers', },
+          'mpeg-mime-type': { fragment: '#mime-types', link_text: 'MIME-type', },
+          'mpeg-mime-types': { fragment: '#mime-types', link_text: 'MIME-types', },
+          'mpeg-audio-frame': { fragment: '#mpeg-audio-frame', link_text: 'MPEG Audio Frame', },
+          'mpeg-audio-frames': { fragment: '#mpeg-audio-frame', link_text: 'MPEG Audio Frames', },
+          'mpeg-audio-metadata-frames': { fragment: '#mpeg-metadata', link_text: 'Metadata Frames', },
+        };
+
+        mediaSourceAddDefinitionInfo("mpeg-byte-stream-format", "", mpegContainerSpecDefinitions);
+      })();
+    </script>
+
+    <script class="remove">
+      var respecConfig = {
+      // specification status (e.g. WD, LCWD, NOTE, etc.). If in doubt use ED.
+      specStatus: "ED",
+
+      // the specification's short name, as in http://www.w3.org/TR/short-name/
+      shortName: "",
+
+      // if there a publicly available Editor's Draft, this is the link
+      edDraftURI: "http://dvcs.w3.org/hg/html-media/raw-file/default/media-source/mpeg-byte-stream-format.html",
+
+      // if this is a LCWD, uncomment and set the end of its review period
+      // lcEnd: "2009-08-05",
+
+      // editors, add as many as you like
+      // only "name" is required
+      editors:  [
+        { name: "Aaron Colwell",  url: "", company: "Google Inc.", companyURL: "http://www.google.com/" },
+        { name: "Dale Curtis", url: "", company: "Google Inc.", companyURL: "http://www.google.com/" },
+      ],
+
+      mseDefGroupName: "mpeg-byte-stream-format",
+      mseUnusedGroupNameExcludeList: ["media-source"],
+      mseContributors: [
+      ],
+
+      // name of the WG
+      wg:           "HTML Working Group",
+
+      // URI of the public WG page
+      wgURI:        "http://www.w3.org/html/wg/",
+
+      // name (without the @w3c.org) of the public mailing to which comments are due
+      wgPublicList: "public-html-media",
+
+      // URI of the patent status for this WG, for Rec-track documents
+      // !!!! IMPORTANT !!!!
+      // This is important for Rec-track documents, do not copy a patent URI from a random
+      // document unless you know what you're doing. If in doubt ask your friendly neighbourhood
+      // Team Contact.
+      wgPatentURI: "http://www.w3.org/2004/01/pp-impl/40318/status",
+
+      noIDLIn: true,
+
+      scheme: "https",
+
+      preProcess: [ mediaSourcePreProcessor ],
+
+      // Empty definitions for objects declared in the document are here to
+      // prevent error messages from being displayed for references to these objects.
+      definitionMap: {
+        SourceBuffer: function() {},
+      },
+
+      postProcess: [ mediaSourcePostProcessor ]
+
+      };
+    </script>
+    <!-- script to register bugs -->
+    <script src="https://dvcs.w3.org/hg/webcomponents/raw-file/tip/assets/scripts/bug-assist.js"></script>
+    <meta name="bug.short_desc" content="[MSE] ">
+    <meta name="bug.product" content="HTML WG">
+    <meta name="bug.component" content="Media Source Extensions">
+
+    <link rel="stylesheet" href="mse.css">
+
+  </head>
+  <body>
+    <section id="abstract">
+      This specification defines a <a href="http://www.w3.org/TR/media-source/">Media Source Extensions</a> byte stream format specification based on MPEG audio streams.
+    </section>
+
+    <section id="introduction">
+      <h2>Introduction</h2>
+      <p>This specification defines segment formats for implementations that choose to support MPEG audio streams specified in <a def-id="iso-11172-3"></a>, <a def-id="iso-13818-3"></a>, and <a def-id="iso-14496-3"></a>.</p>
+      <p>It defines the <a def-id="mpeg-mime-types"></a> used to signal codecs, and provides the necessary format specific definitions for <a def-id="init-segments"></a>, <a def-id="media-segments"></a>, and <a def-id="random-access-points"></a> required by the <a def-id="byte-stream-formats-section"></a> of the Media Source Extensions spec. It also defines extra behaviors and state that only apply to this byte stream format.</p>
+    </section>
+
+    <section id="mime-types">
+      <h2>MIME-types</h2>
+      <p>This section specifies the MIME-types that may be passed to <a def-id="isTypeSupported"></a> or <a def-id="addSourceBuffer"></a> for byte streams that conform to this specification.</p>
+      <ul>
+        <li>"audio/aac" for sequences of ADTS frames, as specified in <a def-id="iso-14496-3"></a>.</li>
+        <li>"audio/mpeg" for MPEG-1/2/2.5 Layer I/II/III streams, as specified in <a href="http://tools.ietf.org/html/rfc3003">RFC 3003</a>.</li>
+      </ul>
+      <p>The "codecs" MIME-type parameter must not be used with these MIME-types.</p>
+    </section>
+
+    <section id="mpeg-audio-frames">
+      <h2>MPEG Audio Frames</h2>
+      <p>The format of an <dfn id="mpeg-audio-frame">MPEG Audio Frame</dfn> depends on the <a def-id="mpeg-mime-type"></a> used.</p>
+      <ul>
+        <li>If the "audio/aac" MIME-type is used, an MPEG Audio Frame is a sequence of bytes that conform to the adts_frame() syntax specified in Table 1.A.5 of <a def-id="iso-14496-3"></a>.</li>
+        <li>If the "audio/mpeg" MIME-type is used, an MPEG Audio Frame is a sequence of bytes that conform to the frame() syntax element specified in Section 2.4.1.2 of <a def-id="iso-11172-3"></a> or the corresponding definition in <a def-id="iso-13818-3"></a>.</li>
+      </ul>
+    </section>
+
+    <section id="mpeg-metadata">
+      <h4>Metadata Frames</h4>
+      <p>Since <a def-id="id3v1"></a>, <a def-id="id3v2"></a> metadata frames, and <a def-id="icecast-headers"></a> are common in existing MPEG audio streams, implementations should gracefully handle such frames. Zero or more of these metadata frames are allowed to occur before, after, or between <a def-id="mpeg-audio-frames"></a>. Minimal implementations must accept, consume, and ignore these frames. More advanced implementations may choose to expose the metadata information via an inband <a def-id="text-track"></a> or some other mechanism.</p>
+
+      <section id="icecast">
+        <h3>Icecast headers</h3>
+        <p>There is no normative spec for <a href="http://en.wikipedia.org/wiki/Icecast">Icecast</a>/<a href="http://en.wikipedia.org/wiki/SHOUTcast">SHOUTcast</a> headers, just <a href="http://forums.radiotoolbox.com/viewtopic.php?t=74">examples</a>. For the purpose of this specification, an <dfn id="icecast-header">Icecast header</dfn> is defined as beginning with the 4 character sequence "ICY&nbsp;"(U+0049 I, U+0043 C, U+0059 Y, U+0020 SPACE) and ending with a pair of carriage-return line-feed sequences (U+000D CARRIAGE RETURN, U+000A LINE FEED, U+000D CARRIAGE RETURN, U+000A LINE FEED).</p>
+        <p class="note">Icecast headers are allowed in the byte streams because some Icecast and SHOUTcast
+          servers return a status line that looks like "ICY OK 200" instead of a standard HTTP status line.
+          User-agent network stacks typically interpret this as an HTTP 0.9 response and include the
+          header in the response body. Allowing these headers to appear provides a simple way to
+          interoperate with these servers.</p>
+      </section>
+    </section>
+
+    <section id="mpeg-segments">
+      <h4>Segment Definitions</h4>
+      <p>The MPEG audio byte stream is a combination of one or more <a def-id="mpeg-audio-frames"></a> and zero or more <a def-id="mpeg-audio-metadata-frames"></a>.</p>
+      <ul>
+        <li>Every <a def-id="mpeg-audio-frame"></a> is a <a def-id="random-access-point"></a>.</li>
+        <li>Every <a def-id="mpeg-audio-frame"></a> header is an <a def-id="init-segment"></a>.</li>
+        <li>The coded audio in each <a def-id="mpeg-audio-frame"></a> is a <a def-id="media-segment"></a>.</li>
+      </ul>
+    </section>
+
+    <section id="mpeg-timestamp-generation">
+      <h4>Timestamp Generation</h4>
+      <p>An <a def-id="mpeg-audio-frame"></a> lacks timestamp information so a mechanism needs to be
+        defined to allow these <a def-id="coded-frames"></a> to be positioned anywhere in the timeline.
+        Since a
+        single <a def-id="mpeg-audio-frame"></a> is a <a def-id="media-segment"></a>, timestamp handling is
+        inserted before and after the step, in the <a def-id="segment-parser-loop"></a>, that calls the
+        <a def-id="coded-frame-processing-algorithm"></a>.
+        (i.e. Step 6.3) The intent is to make it easy for the web application to determine where the
+        <a def-id="mpeg-audio-frames"></a> will get inserted by ensuring that the
+        <a def-id="timestampOffset"></a> attribute always reflects the insertion point.</p>
+      <p>
+        The steps below must ONLY be applied to a
+        <a class="externalDFN">SourceBuffer</a> that is handling the byte stream format outlined in this
+        specification.
+        <p class="note">
+          We may want to move these steps into the <a def-id="segment-parser-loop"></a> if more
+          <a def-id="byte-stream-format-specs"></a> are created for media formats that don't contain
+          timestamps.
+        </p>
+      </p>
+      <p>The following steps must be run immediately before running the <a def-id="segment-parser-loop"></a>
+        step that invokes the <a def-id="coded-frame-processing-algorithm"></a>:</p>
+      <ol>
+        <li>Set the <a def-id="presentation-timestamp"></a> of the <a def-id="coded-frame"></a> to 0.</li>
+        <li>Set the <a def-id="decode-timestamp"></a> of the <a def-id="coded-frame"></a> to 0.</li>
+        <li>Let <var>frame duration</var> be the <a def-id="coded-frame-duration"></a> of the
+          <a def-id="coded-frame"></a>. (i.e. the duration of the <a def-id="mpeg-audio-frame"></a>)</li>
+        <li>Let <var>new timestamp offset</var> equal the sum of the current value of the
+          <a def-id="timestampOffset"></a> and <var>frame duration</var>.</li>
+      </ol>
+
+      <p>The following step must be run immediately after the <a def-id="segment-parser-loop"></a>
+        step that invokes the <a def-id="coded-frame-processing-algorithm"></a>:</p>
+      <ol>
+        <li>Assign <var>new timestamp offset<var> to the <a def-id="timestampOffset"></a> attribute.</li>
+      </ol>
+    </section>
+
+<!--     <section id="acknowledgements">
+      <h2>Acknowledgments</h2>
+      The editors would like to thank <a def-id="contributors"></a> for their contributions to this specification.
+    </section> -->
+  </body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/media-source/mpeg-audio-byte-stream-format.html	Wed Mar 19 16:06:22 2014 -0700
@@ -0,0 +1,392 @@
+<!DOCTYPE html>
+<html lang="en" dir="ltr" typeof="bibo:Document " about="" property="dcterms:language" content="en">
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>MPEG Audio Byte Stream Format</title>
+    
+    
+    
+
+    
+    <!-- script to register bugs -->
+    <script src="https://dvcs.w3.org/hg/webcomponents/raw-file/tip/assets/scripts/bug-assist.js"></script>
+    <meta name="bug.short_desc" content="[MSE] ">
+    <meta name="bug.product" content="HTML WG">
+    <meta name="bug.component" content="Media Source Extensions">
+
+    <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="mse.css">
+
+  <style>/*****************************************************************
+ * ReSpec 3 CSS
+ * Robin Berjon - http://berjon.com/
+ *****************************************************************/
+
+/* --- INLINES --- */
+em.rfc2119 { 
+    text-transform:     lowercase;
+    font-variant:       small-caps;
+    font-style:         normal;
+    color:              #900;
+}
+
+h1 acronym, h2 acronym, h3 acronym, h4 acronym, h5 acronym, h6 acronym, a acronym,
+h1 abbr, h2 abbr, h3 abbr, h4 abbr, h5 abbr, h6 abbr, a abbr {
+    border: none;
+}
+
+dfn {
+    font-weight:    bold;
+}
+
+a.internalDFN {
+    color:  inherit;
+    border-bottom:  1px solid #99c;
+    text-decoration:    none;
+}
+
+a.externalDFN {
+    color:  inherit;
+    border-bottom:  1px dotted #ccc;
+    text-decoration:    none;
+}
+
+a.bibref {
+    text-decoration:    none;
+}
+
+cite .bibref {
+    font-style: normal;
+}
+
+code {
+    color:  #ff4500;
+}
+
+/* --- TOC --- */
+.toc a, .tof a {
+    text-decoration:    none;
+}
+
+a .secno, a .figno {
+    color:  #000;
+}
+
+ul.tof, ol.tof {
+    list-style: none outside none;
+}
+
+.caption {
+    margin-top: 0.5em;
+    font-style:   italic;
+}
+
+/* --- TABLE --- */
+table.simple {
+    border-spacing: 0;
+    border-collapse:    collapse;
+    border-bottom:  3px solid #005a9c;
+}
+
+.simple th {
+    background: #005a9c;
+    color:  #fff;
+    padding:    3px 5px;
+    text-align: left;
+}
+
+.simple th[scope="row"] {
+    background: inherit;
+    color:  inherit;
+    border-top: 1px solid #ddd;
+}
+
+.simple td {
+    padding:    3px 10px;
+    border-top: 1px solid #ddd;
+}
+
+.simple tr:nth-child(even) {
+    background: #f0f6ff;
+}
+
+/* --- DL --- */
+.section dd > p:first-child {
+    margin-top: 0;
+}
+
+.section dd > p:last-child {
+    margin-bottom: 0;
+}
+
+.section dd {
+    margin-bottom:  1em;
+}
+
+.section dl.attrs dd, .section dl.eldef dd {
+    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">
+  <p>
+    
+      <a href="http://www.w3.org/"><img width="72" height="48" src="https://www.w3.org/Icons/w3c_home" alt="W3C"></a>
+    
+  </p>
+  <h1 class="title p-name" id="title" property="dcterms:title">MPEG Audio Byte Stream Format</h1>
+  
+  <h2 property="dcterms:issued" datatype="xsd:dateTime" content="2014-04-01T04:27:26.000Z" id="w3c-editor-s-draft-31-march-2014"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft <time class="dt-published" datetime="2014-03-31">31 March 2014</time></h2>
+  <dl>
+    
+      <dt>This version:</dt>
+      <dd><a class="u-url" href="http://dvcs.w3.org/hg/html-media/raw-file/default/media-source/mpeg-byte-stream-format.html">http://dvcs.w3.org/hg/html-media/raw-file/default/media-source/mpeg-byte-stream-format.html</a></dd>
+      <dt>Latest published version:</dt>
+      <dd><a href="http://www.w3.org/TR//">http://www.w3.org/TR//</a></dd>
+    
+    
+      <dt>Latest editor's draft:</dt>
+      <dd><a href="http://dvcs.w3.org/hg/html-media/raw-file/default/media-source/mpeg-byte-stream-format.html">http://dvcs.w3.org/hg/html-media/raw-file/default/media-source/mpeg-byte-stream-format.html</a></dd>
+    
+    
+    
+    
+      
+    
+    
+    
+    <dt>Editors:</dt>
+    <dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Aaron Colwell</span>, <a rel="foaf:workplaceHomepage" class="p-org org h-org h-card" href="http://www.google.com/">Google Inc.</a></span>
+</dd>
+<dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Dale Curtis</span>, <a rel="foaf:workplaceHomepage" class="p-org org h-org h-card" href="http://www.google.com/">Google Inc.</a></span>
+</dd>
+
+    
+    
+  </dl>
+  
+  
+  
+  
+    
+      <p class="copyright">
+        <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> ©
+        2014
+        
+        <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup>
+        (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>,
+        <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
+        <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>), 
+        
+        All Rights Reserved.
+        
+        <abbr title="World Wide Web Consortium">W3C</abbr> <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
+        <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and
+        
+          <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a>
+        
+        rules apply.
+      </p>
+    
+  
+  <hr>
+</div>
+    <section id="abstract" class="introductory" property="dcterms:abstract" datatype="" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter"><h2 aria-level="1" role="heading" id="h2_abstract">Abstract</h2><p>
+      This specification defines a <a href="http://www.w3.org/TR/media-source/">Media Source Extensions</a> byte stream format specification based on MPEG audio streams.
+    </p></section><section id="sotd" class="introductory" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter"><h2 aria-level="1" role="heading" id="h2_sotd">Status of This Document</h2>
+  
+    
+      
+        <p>
+          <em>This section describes the status of this document at the time of its publication.
+          Other documents may supersede this document. A list of current <abbr title="World Wide Web Consortium">W3C</abbr> publications and the
+          latest revision of this technical report can be found in the <a href="http://www.w3.org/TR/"><abbr title="World Wide Web Consortium">W3C</abbr> technical reports index</a> at
+          http://www.w3.org/TR/.</em>
+        </p>
+        
+        <p>
+          This document was published by the <a href="http://www.w3.org/html/wg/">HTML Working Group</a> as an Editor's Draft.
+          
+          
+            If you wish to make comments regarding this document, please send them to 
+            <a href="mailto:public-html-media@w3.org">public-html-media@w3.org</a> 
+            (<a href="mailto:public-html-media-request@w3.org?subject=subscribe">subscribe</a>,
+            <a href="http://lists.w3.org/Archives/Public/public-html-media/">archives</a>).
+          
+          
+          
+          
+            All comments are welcome.
+          
+        </p>
+        
+        
+          <p>
+            Publication as an Editor's Draft does not imply endorsement by the <abbr title="World Wide Web Consortium">W3C</abbr>
+            Membership. This is a draft document and may be updated, replaced or obsoleted by other
+            documents at any time. It is inappropriate to cite this document as other than work in
+            progress.
+          </p>
+        
+        
+        <p>
+          
+            This document was produced by a group operating under the 
+            <a id="sotd_patent" about="" rel="w3p:patentRules" href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 <abbr title="World Wide Web Consortium">W3C</abbr> Patent
+            Policy</a>.
+          
+          
+          
+            
+              <abbr title="World Wide Web Consortium">W3C</abbr> maintains a <a href="http://www.w3.org/2004/01/pp-impl/40318/status" rel="disclosure">public list of any patent
+              disclosures</a> 
+            
+            made in connection with the deliverables of the group; that page also includes
+            instructions for disclosing a patent. An individual who has actual knowledge of a patent
+            which the individual believes contains
+            <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
+            Claim(s)</a> must disclose the information in accordance with
+            <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
+            6 of the <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
+          
+          
+        </p>
+        
+      
+    
+  
+</section><section id="toc"><h2 class="introductory" aria-level="1" role="heading" id="h2_toc">Table of Contents</h2><ul class="toc" role="directory" id="respecContents"><li class="tocline"><a href="#introduction" class="tocxref"><span class="secno">1. </span>Introduction</a></li><li class="tocline"><a href="#mime-types" class="tocxref"><span class="secno">2. </span>MIME-types</a></li><li class="tocline"><a href="#mpeg-audio-frames" class="tocxref"><span class="secno">3. </span>MPEG Audio Frames</a></li><li class="tocline"><a href="#mpeg-metadata" class="tocxref"><span class="secno">4. </span>Metadata Frames</a><ul class="toc"><li class="tocline"><a href="#icecast" class="tocxref"><span class="secno">4.1 </span>Icecast headers</a></li></ul></li><li class="tocline"><a href="#mpeg-segments" class="tocxref"><span class="secno">5. </span>Segment Definitions</a></li><li class="tocline"><a href="#mpeg-timestamp-generation" class="tocxref"><span class="secno">6. </span>Timestamp Generation</a></li></ul></section>
+
+    <section id="introduction" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
+      <!--OddPage--><h2 aria-level="1" role="heading" id="h2_introduction"><span class="secno">1. </span>Introduction</h2>
+      <p>This specification defines segment formats for implementations that choose to support MPEG audio streams specified in <a href="http://www.iso.org/iso/catalogue_detail.htm?csnumber=22412">ISO/IEC 11172-3:1993</a>, <a href="http://www.iso.org/iso/catalogue_detail.htm?csnumber=26797">ISO/IEC 13818-3:1998</a>, and <a href="http://www.iso.org/iso/catalogue_detail.htm?csnumber=53943">ISO/IEC 14496-3:2009</a>.</p>
+      <p>It defines the <a href="#mime-types">MIME-types</a> used to signal codecs, and provides the necessary format specific definitions for <a href="http://www.w3.org/TR/media-source/#init-segment">initialization segments</a>, <a href="http://www.w3.org/TR/media-source/#media-segment">media segments</a>, and <a href="http://www.w3.org/TR/media-source/#random-access-point">random access points</a> required by the <a href="http://www.w3.org/TR/media-source/#byte-stream-formats">byte stream formats section</a> of the Media Source Extensions spec. It also defines extra behaviors and state that only apply to this byte stream format.</p>
+    </section>
+
+    <section id="mime-types" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
+      <!--OddPage--><h2 aria-level="1" role="heading" id="h2_mime-types"><span class="secno">2. </span>MIME-types</h2>
+      <p>This section specifies the MIME-types that may be passed to <code><a href="http://www.w3.org/TR/media-source/#widl-MediaSource-isTypeSupported-boolean-DOMString-type">isTypeSupported()</a></code> or <code><a href="http://www.w3.org/TR/media-source/#widl-MediaSource-addSourceBuffer-SourceBuffer-DOMString-type">addSourceBuffer()</a></code> for byte streams that conform to this specification.</p>
+      <ul>
+        <li>"audio/aac" for sequences of ADTS frames, as specified in <a href="http://www.iso.org/iso/catalogue_detail.htm?csnumber=53943">ISO/IEC 14496-3:2009</a>.</li>
+        <li>"audio/mpeg" for MPEG-1/2/2.5 Layer I/II/III streams, as specified in <a href="http://tools.ietf.org/html/rfc3003">RFC 3003</a>.</li>
+      </ul>
+      <p>The "codecs" MIME-type parameter must not be used with these MIME-types.</p>
+    </section>
+
+    <section id="mpeg-audio-frames" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
+      <!--OddPage--><h2 aria-level="1" role="heading" id="h2_mpeg-audio-frames"><span class="secno">3. </span>MPEG Audio Frames</h2>
+      <p>The format of an <dfn id="mpeg-audio-frame">MPEG Audio Frame</dfn> depends on the <a href="#mime-types">MIME-type</a> used.</p>
+      <ul>
+        <li>If the "audio/aac" MIME-type is used, an MPEG Audio Frame is a sequence of bytes that conform to the adts_frame() syntax specified in Table 1.A.5 of <a href="http://www.iso.org/iso/catalogue_detail.htm?csnumber=53943">ISO/IEC 14496-3:2009</a>.</li>
+        <li>If the "audio/mpeg" MIME-type is used, an MPEG Audio Frame is a sequence of bytes that conform to the frame() syntax element specified in Section 2.4.1.2 of <a href="http://www.iso.org/iso/catalogue_detail.htm?csnumber=22412">ISO/IEC 11172-3:1993</a> or the corresponding definition in <a href="http://www.iso.org/iso/catalogue_detail.htm?csnumber=26797">ISO/IEC 13818-3:1998</a>.</li>
+      </ul>
+    </section>
+
+    <section id="mpeg-metadata" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
+      <!--OddPage--><h2 aria-level="1" role="heading" id="h2_mpeg-metadata"><span class="secno">4. </span>Metadata Frames</h2>
+      <p>Since <a href="http://id3.org/ID3v1">ID3v1</a>, <a href="http://id3.org/id3v2.3.0">ID3v2</a> metadata frames, and <a href="#icecast-header">Icecast headers</a> are common in existing MPEG audio streams, implementations should gracefully handle such frames. Zero or more of these metadata frames are allowed to occur before, after, or between <a href="#mpeg-audio-frame">MPEG Audio Frames</a>. Minimal implementations must accept, consume, and ignore these frames. More advanced implementations may choose to expose the metadata information via an inband <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#texttrack">TextTrack</a></code> or some other mechanism.</p>
+
+      <section id="icecast" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
+        <h3 aria-level="2" role="heading" id="h3_icecast"><span class="secno">4.1 </span>Icecast headers</h3>
+        <p>There is no normative spec for <a href="http://en.wikipedia.org/wiki/Icecast">Icecast</a>/<a href="http://en.wikipedia.org/wiki/SHOUTcast">SHOUTcast</a> headers, just <a href="http://forums.radiotoolbox.com/viewtopic.php?t=74">examples</a>. For the purpose of this specification, an <dfn id="icecast-header">Icecast header</dfn> is defined as beginning with the 4 character sequence "ICY&nbsp;"(U+0049 I, U+0043 C, U+0059 Y, U+0020 SPACE) and ending with a pair of carriage-return line-feed sequences (U+000D CARRIAGE RETURN, U+000A LINE FEED, U+000D CARRIAGE RETURN, U+000A LINE FEED).</p>
+        <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_1"><span>Note</span></div><p class="">Icecast headers are allowed in the byte streams because some Icecast and SHOUTcast
+          servers return a status line that looks like "ICY OK 200" instead of a standard HTTP status line.
+          User-agent network stacks typically interpret this as an HTTP 0.9 response and include the
+          header in the response body. Allowing these headers to appear provides a simple way to
+          interoperate with these servers.</p></div>
+      </section>
+    </section>
+
+    <section id="mpeg-segments" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
+      <!--OddPage--><h2 aria-level="1" role="heading" id="h2_mpeg-segments"><span class="secno">5. </span>Segment Definitions</h2>
+      <p>The MPEG audio byte stream is a combination of one or more <a href="#mpeg-audio-frame">MPEG Audio Frames</a> and zero or more <a href="#mpeg-metadata">Metadata Frames</a>.</p>
+      <ul>
+        <li>Every <a href="#mpeg-audio-frame">MPEG Audio Frame</a> is a <a href="http://www.w3.org/TR/media-source/#random-access-point">random access point</a>.</li>
+        <li>Every <a href="#mpeg-audio-frame">MPEG Audio Frame</a> header is an <a href="http://www.w3.org/TR/media-source/#init-segment">initialization segment</a>.</li>
+        <li>The coded audio in each <a href="#mpeg-audio-frame">MPEG Audio Frame</a> is a <a href="http://www.w3.org/TR/media-source/#media-segment">media segment</a>.</li>
+      </ul>
+    </section>
+
+    <section id="mpeg-timestamp-generation" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
+      <!--OddPage--><h2 aria-level="1" role="heading" id="h2_mpeg-timestamp-generation"><span class="secno">6. </span>Timestamp Generation</h2>
+      <p>An <a href="#mpeg-audio-frame">MPEG Audio Frame</a> lacks timestamp information so a mechanism needs to be
+        defined to allow these <a href="http://www.w3.org/TR/media-source/#coded-frame">coded frames</a> to be positioned anywhere in the timeline.
+        Since a
+        single <a href="#mpeg-audio-frame">MPEG Audio Frame</a> is a <a href="http://www.w3.org/TR/media-source/#media-segment">media segment</a>, timestamp handling is
+        inserted before and after the step, in the <a href="http://www.w3.org/TR/media-source/#sourcebuffer-segment-parser-loop">segment parser loop</a>, that calls the
+        <a href="http://www.w3.org/TR/media-source/#sourcebuffer-coded-frame-processing">coded frame processing algorithm</a>.
+        (i.e. Step 6.3) The intent is to make it easy for the web application to determine where the
+        <a href="#mpeg-audio-frame">MPEG Audio Frames</a> will get inserted by ensuring that the
+        <code><a href="http://www.w3.org/TR/media-source/#widl-SourceBuffer-timestampOffset">timestampOffset</a></code> attribute always reflects the insertion point.</p>
+      <p>
+        The steps below must ONLY be applied to a
+        <code><a href="http://www.w3.org/TR/media-source/#idl-def-SourceBuffer" class="idlType">SourceBuffer</a></code> that is handling the byte stream format outlined in this
+        specification.
+        </p><div class="note"><div class="note-title" aria-level="2" role="heading" id="h_note_2"><span>Note</span></div><p class="">
+          We may want to move these steps into the <a href="http://www.w3.org/TR/media-source/#sourcebuffer-segment-parser-loop">segment parser loop</a> if more
+          <a href="http://www.w3.org/TR/media-source/#byte-stream-format-specs">byte stream format specifications</a> are created for media formats that don't contain
+          timestamps.
+        </p></div>
+      <p></p>
+      <p>The following steps must be run immediately before running the <a href="http://www.w3.org/TR/media-source/#sourcebuffer-segment-parser-loop">segment parser loop</a>
+        step that invokes the <a href="http://www.w3.org/TR/media-source/#sourcebuffer-coded-frame-processing">coded frame processing algorithm</a>:</p>
+      <ol>
+        <li>Set the <a href="http://www.w3.org/TR/media-source/#presentation-timestamp">presentation timestamp</a> of the <a href="http://www.w3.org/TR/media-source/#coded-frame">coded frame</a> to 0.</li>
+        <li>Set the <a href="http://www.w3.org/TR/media-source/#decode-timestamp">decode timestamp</a> of the <a href="http://www.w3.org/TR/media-source/#coded-frame">coded frame</a> to 0.</li>
+        <li>Let <var>frame duration</var> be the <a href="http://www.w3.org/TR/media-source/#coded-frame-duration">coded frame duration</a> of the
+          <a href="http://www.w3.org/TR/media-source/#coded-frame">coded frame</a>. (i.e. the duration of the <a href="#mpeg-audio-frame">MPEG Audio Frame</a>)</li>
+        <li>Let <var>new timestamp offset</var> equal the sum of the current value of the
+          <code><a href="http://www.w3.org/TR/media-source/#widl-SourceBuffer-timestampOffset">timestampOffset</a></code> and <var>frame duration</var>.</li>
+      </ol>
+
+      <p>The following step must be run immediately after the <a href="http://www.w3.org/TR/media-source/#sourcebuffer-segment-parser-loop">segment parser loop</a>
+        step that invokes the <a href="http://www.w3.org/TR/media-source/#sourcebuffer-coded-frame-processing">coded frame processing algorithm</a>:</p>
+      <ol>
+        <li>Assign <var>new timestamp offset<var> to the <code><a href="http://www.w3.org/TR/media-source/#widl-SourceBuffer-timestampOffset">timestampOffset</a></code> attribute.</var></var></li>
+      </ol>
+    </section>
+
+<!--     <section id="acknowledgements">
+      <h2>Acknowledgments</h2>
+      The editors would like to thank <a def-id="contributors"></a> for their contributions to this specification.
+    </section> -->
+  
+
+<form id="bug-assist-form" action="//www.w3.org/Bugs/Public/enter_bug.cgi" target="_blank">See a problem? Select text and <input type="submit" accesskey="f" value="file a bug" style="font-family: Tahoma, sans-serif; font-size: 10px;"><input type="hidden" name="comment" value=""><input type="hidden" name="short_desc" value="[MSE] "><input type="hidden" name="product" value="HTML WG"><input type="hidden" name="component" value="Media Source Extensions">.</form></body></html>
\ No newline at end of file