[MSE] Bug 25505 - Introduce 'generate timestamps flag' to handle MPEG audio timestamp generation.
--- a/media-source/byte-stream-format-registry-respec.html Tue Apr 29 10:48:50 2014 -0700
+++ b/media-source/byte-stream-format-registry-respec.html Tue Apr 29 14:12:11 2014 -0700
@@ -4,6 +4,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Media Source Extensions Byte Stream Format Registry</title>
<script src="respec-w3c-common.js" class="remove"></script>
+ <script src="media-source.js" class="remove"></script>
<script class="remove">
var respecConfig = {
// specification status (e.g. WD, LCWD, NOTE, etc.). If in doubt use ED.
@@ -24,6 +25,11 @@
{ name: "Aaron Colwell", url: "", company: "Google Inc.", companyURL: "http://www.google.com/" },
],
+ mseDefGroupName: "byte-stream-format-registry",
+ mseUnusedGroupNameExcludeList: ["media-source"],
+ mseContributors: [
+ ],
+
// name of the WG
wg: "HTML Working Group",
@@ -44,9 +50,14 @@
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: {},
+ definitionMap: {
+ },
+
+ postProcess: [ mediaSourcePostProcessor ]
};
</script>
<!-- script to register bugs -->
@@ -70,8 +81,8 @@
<section id="purpose">
<h2>Purpose</h2>
<p>This registry is intended to enhance interoperability among implementations and users of
- <a href="http://www.w3.org/TR/media-source/#idl-def-SourceBuffer"><code>SourceBuffer</code></a> objects described in the
- <a href="http://www.w3.org/TR/media-source/">Media Source Extensions(MSE)</a> specification. In particular, this registry provides the means (1) to identify
+ <a class="externalDFN">SourceBuffer</a> objects described in the
+ <a def-id="mse-spec"></a>(MSE) specification. In particular, this registry provides the means (1) to identify
and avoid MIME-type collisions among byte stream formats, and (2) to disclose information about byte stream formats accepted by MSE
implementations to promote interoperability.
</section>
@@ -79,7 +90,7 @@
<section id="organization">
<h2>Organization</h2>
<p>The registry maintains a mapping between MIME-type/subtype pairs and byte stream format specifications. The byte stream format specifications describe the
- structure and semantics of byte streams accepted by <a href="http://www.w3.org/TR/media-source/#idl-def-SourceBuffer"><code>SourceBuffer</code></a> objects
+ structure and semantics of byte streams accepted by <a class="externalDFN">SourceBuffer</a> objects
created with the associated MIME-type/subtype pair.</p>
<p>This registry is not intended to include any information on whether a byte stream format is encumbered by intellectual property claims. Implementors and users
are advised to seek appropriate legal counsel in this matter if they intend to implement or use a specific byte stream format.</p>
@@ -90,10 +101,12 @@
<ol>
<li>Each entry must include a unique MIME-type/subtype pair. If the byte stream format is derived-from an existing file format, then it should use the
MIME-type/subtype pairs typically used for the file format.</li>
+ <li>Each entry must include a <a def-id="generate-timestamps-flag"></a> value that must be used by
+ <a class="externalDFN">SourceBuffer</a> when handling the byte stream format.</li>
<li>Each entry must include a link that references a publically available specification. It is recommended that such a specification be made available
without cost (other than reasonable shipping and handling if not available by online means).</li>
- <li>Each entry must comply with all requirements outlined in the <a href="http://www.w3.org/TR/media-source/#byte-stream-formats">byte stream formats section</a>
- of the <a href="http://www.w3.org/TR/media-source/">Media Source Extensions</a> specification.</li>
+ <li>Each entry must comply with all requirements outlined in the <a def-id="byte-stream-formats-section"></a>
+ of the <a def-id="mse-spec"></a> specification.</li>
<li>Candidate entries must be announced on <a href="public-html-media@w3.org">public-html-media@w3.org</a>(<a href="public-html-media-request@w3.org">subscribe</a>,
<a href="http://lists.w3.org/Archives/Public/public-html-media/">archives</a>) so they can be discussed and evaluated for compliance before being added to the
registry.</li>
@@ -108,6 +121,7 @@
<tr>
<th>MIME type/subtype</th>
<th>Public Specification(s)</th>
+ <th>Generate Timestamps Flag</th>
</tr>
</thead>
<tbody>
@@ -117,6 +131,7 @@
video/webm
</td>
<td><a href="webm-byte-stream-format.html">WebM Byte Stream Format</a></td>
+ <td>false</td>
</tr>
<tr>
<td>
@@ -124,6 +139,7 @@
video/mp4
</td>
<td><a href="isobmff-byte-stream-format.html">ISO BMFF Byte Stream Format</a></td>
+ <td>false</td>
</tr>
<tr>
<td>
@@ -131,6 +147,15 @@
video/mp2t
</td>
<td><a href="mp2t-byte-stream-format.html">MPEG-2 Transport Streams Byte Stream Format</a></td>
+ <td>false</td>
+ </tr>
+ <tr>
+ <td>
+ audio/mpeg<br>
+ audio/aac
+ </td>
+ <td><a href="mpeg-audio-byte-stream-format.html">MPEG Audio Byte Stream Format</a></td>
+ <td>true</td>
</tr>
</tbody>
</table>
--- a/media-source/byte-stream-format-registry.html Tue Apr 29 10:48:50 2014 -0700
+++ b/media-source/byte-stream-format-registry.html Tue Apr 29 14:12:11 2014 -0700
@@ -5,6 +5,7 @@
<title>Media Source Extensions Byte Stream Format Registry</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] ">
@@ -130,7 +131,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>
@@ -138,7 +139,7 @@
</p>
<h1 class="title p-name" id="title" property="dcterms:title">Media Source Extensions Byte Stream Format Registry</h1>
- <h2 property="dcterms:issued" datatype="xsd:dateTime" content="2013-12-03T02:22:47.000Z" id="w3c-editor-s-draft-02-december-2013"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft <time class="dt-published" datetime="2013-12-02">02 December 2013</time></h2>
+ <h2 property="dcterms:issued" datatype="xsd:dateTime" content="2014-04-30T03:32:56.000Z" id="w3c-editor-s-draft-29-april-2014"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft <time class="dt-published" datetime="2014-04-29">29 April 2014</time></h2>
<dl>
<dt>This version:</dt>
@@ -171,7 +172,7 @@
<p class="copyright">
<a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> ©
- 2013
+ 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>,
@@ -195,8 +196,8 @@
<section id="purpose" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
<!--OddPage--><h2 aria-level="1" role="heading" id="h2_purpose"><span class="secno">1. </span>Purpose</h2>
<p>This registry is intended to enhance interoperability among implementations and users of
- <a href="http://www.w3.org/TR/media-source/#idl-def-SourceBuffer"><code>SourceBuffer</code></a> objects described in the
- <a href="http://www.w3.org/TR/media-source/">Media Source Extensions(MSE)</a> specification. In particular, this registry provides the means (1) to identify
+ <code><a href="media-source.html#idl-def-SourceBuffer" class="idlType">SourceBuffer</a></code> objects described in the
+ <a href="media-source.html#">Media Source Extensions</a>(MSE) specification. In particular, this registry provides the means (1) to identify
and avoid MIME-type collisions among byte stream formats, and (2) to disclose information about byte stream formats accepted by MSE
implementations to promote interoperability.
</p></section>
@@ -204,7 +205,7 @@
<section id="organization" typeof="bibo:Chapter" resource="#ref" rel="bibo:Chapter">
<!--OddPage--><h2 aria-level="1" role="heading" id="h2_organization"><span class="secno">2. </span>Organization</h2>
<p>The registry maintains a mapping between MIME-type/subtype pairs and byte stream format specifications. The byte stream format specifications describe the
- structure and semantics of byte streams accepted by <a href="http://www.w3.org/TR/media-source/#idl-def-SourceBuffer"><code>SourceBuffer</code></a> objects
+ structure and semantics of byte streams accepted by <code><a href="media-source.html#idl-def-SourceBuffer" class="idlType">SourceBuffer</a></code> objects
created with the associated MIME-type/subtype pair.</p>
<p>This registry is not intended to include any information on whether a byte stream format is encumbered by intellectual property claims. Implementors and users
are advised to seek appropriate legal counsel in this matter if they intend to implement or use a specific byte stream format.</p>
@@ -215,10 +216,12 @@
<ol>
<li>Each entry must include a unique MIME-type/subtype pair. If the byte stream format is derived-from an existing file format, then it should use the
MIME-type/subtype pairs typically used for the file format.</li>
+ <li>Each entry must include a <var><a href="media-source.html#sourcebuffer-generate-timestamps-flag">generate timestamps flag</a></var> value that must be used by
+ <code><a href="media-source.html#idl-def-SourceBuffer" class="idlType">SourceBuffer</a></code> when handling the byte stream format.</li>
<li>Each entry must include a link that references a publically available specification. It is recommended that such a specification be made available
without cost (other than reasonable shipping and handling if not available by online means).</li>
- <li>Each entry must comply with all requirements outlined in the <a href="http://www.w3.org/TR/media-source/#byte-stream-formats">byte stream formats section</a>
- of the <a href="http://www.w3.org/TR/media-source/">Media Source Extensions</a> specification.</li>
+ <li>Each entry must comply with all requirements outlined in the <a href="media-source.html#byte-stream-formats">byte stream formats section</a>
+ of the <a href="media-source.html#">Media Source Extensions</a> specification.</li>
<li>Candidate entries must be announced on <a href="public-html-media@w3.org">public-html-media@w3.org</a>(<a href="public-html-media-request@w3.org">subscribe</a>,
<a href="http://lists.w3.org/Archives/Public/public-html-media/">archives</a>) so they can be discussed and evaluated for compliance before being added to the
registry.</li>
@@ -233,6 +236,7 @@
<tr>
<th>MIME type/subtype</th>
<th>Public Specification(s)</th>
+ <th>Generate Timestamps Flag</th>
</tr>
</thead>
<tbody>
@@ -242,6 +246,7 @@
video/webm
</td>
<td><a href="webm-byte-stream-format.html">WebM Byte Stream Format</a></td>
+ <td>false</td>
</tr>
<tr>
<td>
@@ -249,6 +254,7 @@
video/mp4
</td>
<td><a href="isobmff-byte-stream-format.html">ISO BMFF Byte Stream Format</a></td>
+ <td>false</td>
</tr>
<tr>
<td>
@@ -256,6 +262,15 @@
video/mp2t
</td>
<td><a href="mp2t-byte-stream-format.html">MPEG-2 Transport Streams Byte Stream Format</a></td>
+ <td>false</td>
+ </tr>
+ <tr>
+ <td>
+ audio/mpeg<br>
+ audio/aac
+ </td>
+ <td><a href="mpeg-audio-byte-stream-format.html">MPEG Audio Byte Stream Format</a></td>
+ <td>true</td>
</tr>
</tbody>
</table>
--- a/media-source/media-source-respec.html Tue Apr 29 10:48:50 2014 -0700
+++ b/media-source/media-source-respec.html Tue Apr 29 14:12:11 2014 -0700
@@ -356,6 +356,22 @@
</li>
<li>If the <a def-id="readyState"></a> attribute is not in the <a def-id="open"></a> state then throw an <a def-id="invalid-state-err"></a> exception and abort these steps.</li>
<li>Create a new <a>SourceBuffer</a> object and associated resources.</li>
+ <li>Set the <a def-id="generate-timestamps-flag"></a> on the new object to the value in the
+ "Generate Timestamps Flag" column of the <a def-id="byte-stream-format-registry"></a> entry
+ that is associated with <var>type</var>.
+ <li>
+ <dl class="switch">
+ <dt>If the <a def-id="generate-timestamps-flag"></a> equals true:</dt>
+ <dd>
+ Set the <a def-id="mode"></a> attribute on the new object to
+ <a def-id="AppendMode-sequence"></a>.
+ </dd>
+ <dt>Otherwise:</dt>
+ <dd>
+ Set the <a def-id="mode"></a> attribute on the new object to
+ <a def-id="AppendMode-segments"></a>.
+ </dd>
+ </li>
<li>Add the new object to <a def-id="sourceBuffers"></a> and <a def-id="queue-a-task-to-fire-an-event-named"></a> <a def-id="addsourcebuffer"></a> at <a def-id="sourceBuffers"></a>.</li>
<li>Return the new object.</li>
</ol>
@@ -799,11 +815,14 @@
<dl title="interface SourceBuffer : EventTarget" class="idl">
<dt>attribute AppendMode mode</dt>
<dd>
- <p>Controls how a sequence of <a def-id="media-segments"></a> are handled. This attribute is initially set to <a def-id="AppendMode-segments"></a> when the object is created.</p>
+ <p>Controls how a sequence of <a def-id="media-segments"></a> are handled. This attribute is initially set by <a def-id="addSourceBuffer"></a> after the object is created.</p>
<p>On getting, Return the initial value or the last value that was successfully set.</p>
<p>On setting, run the following steps:</p>
<ol>
<li>Let <var>new mode</var> equal the new value being assigned to this attribute.</li>
+ <li>If <a def-id="generate-timestamps-flag"></a> equals true and <var>new mode</var> equals
+ <a def-id="AppendMode-segments"></a>, then throw an <a def-id="invalid-access-err"></a>
+ exception and abort these steps.</li>
<li>If this object has been removed from the <a def-id="sourceBuffers"></a> attribute of the <a def-id="parent-media-source"></a>, then throw an <a def-id="invalid-state-err"></a> exception and
abort these steps.</li>
<li>If the <a def-id="updating"></a> attribute equals true, then throw an <a def-id="invalid-state-err"></a> exception and abort these steps.</li>
@@ -1098,6 +1117,11 @@
<p class="note">The <a def-id="group-end-timestamp"></a> stores the highest <a def-id="coded-frame-end-timestamp"></a> across all <a def-id="track-buffers"></a> in a <a>SourceBuffer</a>. Therefore, care should be taken in setting the <a def-id="mode"></a> attribute when appending multiplexed segments in which the timestamps are not aligned across tracks.
</p>
+ <p>The <dfn id="sourcebuffer-generate-timestamps-flag">generate timestamps flag</dfn> is a
+ boolean variable that keeps track of whether timestamps need to be generated for the
+ <a def-id="coded-frames"></a> passed to the <a def-id="coded-frame-processing-algorithm"></a>.
+ This flag is set by <a def-id="addSourceBuffer"></a> when the SourceBuffer object is created.
+ </p>
<p>When the segment parser loop algorithm is invoked, run the following steps:</p>
<ol>
@@ -1392,19 +1416,34 @@
<li>
<p>For each <a def-id="coded-frame"></a> in the <a def-id="media-segment"></a> run the following steps:</p>
<ol>
- <li><i>Loop Top: </i>Let <var>presentation timestamp</var> be a double precision floating point representation of the coded frame's <a def-id="presentation-timestamp"></a> in seconds.
- <p class="note">Special processing may be needed to determine the presentation and decode timestamps for timed text frames since this information may not be explicilty
- present in the underlying format or may be dependent on the order of the frames. Some metadata text tracks, like MPEG2-TS PSI data, may only have implied timestamps.
- Format specific rules for these situations should be in the <a def-id="byte-stream-format-specs"></a> or in separate extension specifications.</p>
- </li>
- <li>Let <var>decode timestamp</var> be a double precision floating point representation of the coded frame's decode timestamp in seconds.
- <p class="note">Implementations don't have to internally store timestamps in a double precision floating point representation. This
- representation is used here because it is the represention for timestamps in the HTML spec. The intention here is to make the
- behavior clear without adding unnecessary complexity to the algorithm to deal with the fact that adding a timestampOffset may
- cause a timestamp rollover in the underlying timestamp representation used by the byte stream format. Implementations can use any
- internal timestamp representation they wish, but the addition of timestampOffset should behave in a similar manner to what would happen
- if a double precision floating point representation was used.
- </p>
+ <li><i>Loop Top: </i><dl class="switch">
+ <dt>If <a def-id="generate-timestamps-flag"></a> equals true:</dt>
+ <dd>
+ <ol>
+ <li>Let <var>presentation timestamp</var> equal 0.</li>
+ <li>Let <var>decode timestamp</var> equal 0.</li>
+ </ol>
+ </dd>
+ <dt>Otherwise:</dt>
+ <dd>
+ <ol>
+ <li>Let <var>presentation timestamp</var> be a double precision floating point representation of the coded frame's <a def-id="presentation-timestamp"></a> in seconds.
+ <p class="note">Special processing may be needed to determine the presentation and decode timestamps for timed text frames since this information may not be explicilty
+ present in the underlying format or may be dependent on the order of the frames. Some metadata text tracks, like MPEG2-TS PSI data, may only have implied timestamps.
+ Format specific rules for these situations should be in the <a def-id="byte-stream-format-specs"></a> or in separate extension specifications.</p>
+ </li>
+ <li>Let <var>decode timestamp</var> be a double precision floating point representation of the coded frame's decode timestamp in seconds.
+ <p class="note">Implementations don't have to internally store timestamps in a double precision floating point representation. This
+ representation is used here because it is the represention for timestamps in the HTML spec. The intention here is to make the
+ behavior clear without adding unnecessary complexity to the algorithm to deal with the fact that adding a timestampOffset may
+ cause a timestamp rollover in the underlying timestamp representation used by the byte stream format. Implementations can use any
+ internal timestamp representation they wish, but the addition of timestampOffset should behave in a similar manner to what would happen
+ if a double precision floating point representation was used.
+ </p>
+ </li>
+ </ol>
+ </dd>
+ </dl>
</li>
<li>Let <var>frame duration</var> be a double precision floating point representation of the <a def-id="coded-frames-duration"></a> in seconds.</li>
<li>If <a def-id="mode"></a> equals <a def-id="AppendMode-sequence"></a> and <a def-id="group-start-timestamp"></a> is set, then run the following steps:
@@ -1549,6 +1588,8 @@
</li>
<li>If <var>frame end timestamp</var> is greater than <a def-id="group-end-timestamp"></a>,
then set <a def-id="group-end-timestamp"></a> equal to <var>frame end timestamp</var>.</li>
+ <li>If <a def-id="generate-timestamps-flag"></a> equals true, then set
+ <a def-id="timestampOffset"></a> equal to <var>frame end timestamp</var>.</li>
</ol>
</li>
<li>
@@ -2274,6 +2315,8 @@
<td>
<ul>
<li>Bug 25347 - Remove unnecessary null & invalid enum value checks.</li>
+ <li>Bug 25505 - Introduce "generate timestamps flag" to handle MPEG audio timestamp
+ generation.</li>
</ul>
</td>
</tr>
--- a/media-source/media-source.html Tue Apr 29 10:48:50 2014 -0700
+++ b/media-source/media-source.html Tue Apr 29 14:12:11 2014 -0700
@@ -400,7 +400,7 @@
</p>
<h1 class="title p-name" id="title" property="dcterms:title">Media Source Extensions</h1>
- <h2 property="dcterms:issued" datatype="xsd:dateTime" content="2014-04-30T00:55:01.000Z" id="w3c-editor-s-draft-29-april-2014"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft <time class="dt-published" datetime="2014-04-29">29 April 2014</time></h2>
+ <h2 property="dcterms:issued" datatype="xsd:dateTime" content="2014-04-30T04:10:29.000Z" id="w3c-editor-s-draft-29-april-2014"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft <time class="dt-published" datetime="2014-04-29">29 April 2014</time></h2>
<dl>
<dt>This version:</dt>
@@ -763,6 +763,22 @@
</li>
<li>If the <code><a href="#widl-MediaSource-readyState">readyState</a></code> attribute is not in the <code><a href="#idl-def-ReadyState.open">"open"</a></code> state then throw an <code><a href="http://dom.spec.whatwg.org/#dom-domexception-invalid_state_err">INVALID_STATE_ERR</a></code> exception and abort these steps.</li>
<li>Create a new <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> object and associated resources.</li>
+ <li>Set the <var><a href="#sourcebuffer-generate-timestamps-flag">generate timestamps flag</a></var> on the new object to the value in the
+ "Generate Timestamps Flag" column of the <a href="byte-stream-format-registry.html">byte stream format registry</a> entry
+ that is associated with <var>type</var>.
+ </li><li>
+ <dl class="switch">
+ <dt>If the <var><a href="#sourcebuffer-generate-timestamps-flag">generate timestamps flag</a></var> equals true:</dt>
+ <dd>
+ Set the <code><a href="#widl-SourceBuffer-mode">mode</a></code> attribute on the new object to
+ <code><a href="#idl-def-AppendMode.sequence">"sequence"</a></code>.
+ </dd>
+ <dt>Otherwise:</dt>
+ <dd>
+ Set the <code><a href="#widl-SourceBuffer-mode">mode</a></code> attribute on the new object to
+ <code><a href="#idl-def-AppendMode.segments">"segments"</a></code>.
+ </dd>
+ </dl></li>
<li>Add the new object to <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code> and <a href="http://www.w3.org/TR/html5/webappapis.html#queue-a-task">queue a task</a> to <a href="http://www.w3.org/TR/html5/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="#dom-evt-addsourcebuffer">addsourcebuffer</a></code> at <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code>.</li>
<li>Return the new object.</li>
</ol></dd><dt id="widl-MediaSource-endOfStream-void-EndOfStreamError-error"><code>endOfStream</code></dt><dd>
@@ -1240,11 +1256,14 @@
<li>Return a new static <a href="http://www.w3.org/TR/html5/embedded-content-0.html#normalized-timeranges-object">normalized TimeRanges object</a> for the <a href="#media-segment">media segments</a> buffered.</li>
</ol>
</dd><dt id="widl-SourceBuffer-mode"><code>mode</code> of type <span class="idlAttrType"><a href="#idl-def-AppendMode" class="idlType"><code>AppendMode</code></a></span>, </dt><dd>
- <p>Controls how a sequence of <a href="#media-segment">media segments</a> are handled. This attribute is initially set to <code><a href="#idl-def-AppendMode.segments">"segments"</a></code> when the object is created.</p>
+ <p>Controls how a sequence of <a href="#media-segment">media segments</a> are handled. This attribute is initially set by <code><a href="#widl-MediaSource-addSourceBuffer-SourceBuffer-DOMString-type">addSourceBuffer()</a></code> after the object is created.</p>
<p>On getting, Return the initial value or the last value that was successfully set.</p>
<p>On setting, run the following steps:</p>
<ol>
<li>Let <var>new mode</var> equal the new value being assigned to this attribute.</li>
+ <li>If <var><a href="#sourcebuffer-generate-timestamps-flag">generate timestamps flag</a></var> equals true and <var>new mode</var> equals
+ <code><a href="#idl-def-AppendMode.segments">"segments"</a></code>, then throw an <code><a href="http://dom.spec.whatwg.org/#dom-domexception-invalid_access_err">INVALID_ACCESS_ERR</a></code>
+ exception and abort these steps.</li>
<li>If this object has been removed from the <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code> attribute of the <a href="#parent-media-source">parent media source</a>, then throw an <code><a href="http://dom.spec.whatwg.org/#dom-domexception-invalid_state_err">INVALID_STATE_ERR</a></code> exception and
abort these steps.</li>
<li>If the <code><a href="#widl-SourceBuffer-updating">updating</a></code> attribute equals true, then throw an <code><a href="http://dom.spec.whatwg.org/#dom-domexception-invalid_state_err">INVALID_STATE_ERR</a></code> exception and abort these steps.</li>
@@ -1465,6 +1484,11 @@
<div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_16"><span>Note</span></div><p class="">The <var><a href="#sourcebuffer-group-end-timestamp">group end timestamp</a></var> stores the highest <a href="#coded-frame-end-timestamp">coded frame end timestamp</a> across all <a href="#track-buffer">track buffers</a> in a <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a>. Therefore, care should be taken in setting the <code><a href="#widl-SourceBuffer-mode">mode</a></code> attribute when appending multiplexed segments in which the timestamps are not aligned across tracks.
</p></div>
+ <p>The <dfn id="sourcebuffer-generate-timestamps-flag">generate timestamps flag</dfn> is a
+ boolean variable that keeps track of whether timestamps need to be generated for the
+ <a href="#coded-frame">coded frames</a> passed to the <a href="#sourcebuffer-coded-frame-processing">coded frame processing algorithm</a>.
+ This flag is set by <code><a href="#widl-MediaSource-addSourceBuffer-SourceBuffer-DOMString-type">addSourceBuffer()</a></code> when the SourceBuffer object is created.
+ </p>
<p>When the segment parser loop algorithm is invoked, run the following steps:</p>
<ol>
@@ -1759,19 +1783,34 @@
<li>
<p>For each <a href="#coded-frame">coded frame</a> in the <a href="#media-segment">media segment</a> run the following steps:</p>
<ol>
- <li><i>Loop Top: </i>Let <var>presentation timestamp</var> be a double precision floating point representation of the coded frame's <a href="#presentation-timestamp">presentation timestamp</a> in seconds.
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_21"><span>Note</span></div><p class="">Special processing may be needed to determine the presentation and decode timestamps for timed text frames since this information may not be explicilty
- present in the underlying format or may be dependent on the order of the frames. Some metadata text tracks, like MPEG2-TS PSI data, may only have implied timestamps.
- Format specific rules for these situations should be in the <a href="#byte-stream-format-specs">byte stream format specifications</a> or in separate extension specifications.</p></div>
- </li>
- <li>Let <var>decode timestamp</var> be a double precision floating point representation of the coded frame's decode timestamp in seconds.
- <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_22"><span>Note</span></div><p class="">Implementations don't have to internally store timestamps in a double precision floating point representation. This
- representation is used here because it is the represention for timestamps in the HTML spec. The intention here is to make the
- behavior clear without adding unnecessary complexity to the algorithm to deal with the fact that adding a timestampOffset may
- cause a timestamp rollover in the underlying timestamp representation used by the byte stream format. Implementations can use any
- internal timestamp representation they wish, but the addition of timestampOffset should behave in a similar manner to what would happen
- if a double precision floating point representation was used.
- </p></div>
+ <li><i>Loop Top: </i><dl class="switch">
+ <dt>If <var><a href="#sourcebuffer-generate-timestamps-flag">generate timestamps flag</a></var> equals true:</dt>
+ <dd>
+ <ol>
+ <li>Let <var>presentation timestamp</var> equal 0.</li>
+ <li>Let <var>decode timestamp</var> equal 0.</li>
+ </ol>
+ </dd>
+ <dt>Otherwise:</dt>
+ <dd>
+ <ol>
+ <li>Let <var>presentation timestamp</var> be a double precision floating point representation of the coded frame's <a href="#presentation-timestamp">presentation timestamp</a> in seconds.
+ <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_21"><span>Note</span></div><p class="">Special processing may be needed to determine the presentation and decode timestamps for timed text frames since this information may not be explicilty
+ present in the underlying format or may be dependent on the order of the frames. Some metadata text tracks, like MPEG2-TS PSI data, may only have implied timestamps.
+ Format specific rules for these situations should be in the <a href="#byte-stream-format-specs">byte stream format specifications</a> or in separate extension specifications.</p></div>
+ </li>
+ <li>Let <var>decode timestamp</var> be a double precision floating point representation of the coded frame's decode timestamp in seconds.
+ <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_22"><span>Note</span></div><p class="">Implementations don't have to internally store timestamps in a double precision floating point representation. This
+ representation is used here because it is the represention for timestamps in the HTML spec. The intention here is to make the
+ behavior clear without adding unnecessary complexity to the algorithm to deal with the fact that adding a timestampOffset may
+ cause a timestamp rollover in the underlying timestamp representation used by the byte stream format. Implementations can use any
+ internal timestamp representation they wish, but the addition of timestampOffset should behave in a similar manner to what would happen
+ if a double precision floating point representation was used.
+ </p></div>
+ </li>
+ </ol>
+ </dd>
+ </dl>
</li>
<li>Let <var>frame duration</var> be a double precision floating point representation of the <a href="#coded-frame-duration">coded frame's duration</a> in seconds.</li>
<li>If <code><a href="#widl-SourceBuffer-mode">mode</a></code> equals <code><a href="#idl-def-AppendMode.sequence">"sequence"</a></code> and <var><a href="#sourcebuffer-group-start-timestamp">group start timestamp</a></var> is set, then run the following steps:
@@ -1916,6 +1955,8 @@
</li>
<li>If <var>frame end timestamp</var> is greater than <var><a href="#sourcebuffer-group-end-timestamp">group end timestamp</a></var>,
then set <var><a href="#sourcebuffer-group-end-timestamp">group end timestamp</a></var> equal to <var>frame end timestamp</var>.</li>
+ <li>If <var><a href="#sourcebuffer-generate-timestamps-flag">generate timestamps flag</a></var> equals true, then set
+ <code><a href="#widl-SourceBuffer-timestampOffset">timestampOffset</a></code> equal to <var>frame end timestamp</var>.</li>
</ol>
</li>
<li>
@@ -2612,6 +2653,8 @@
<td>
<ul>
<li>Bug 25347 - Remove unnecessary null & invalid enum value checks.</li>
+ <li>Bug 25505 - Introduce "generate timestamps flag" to handle MPEG audio timestamp
+ generation.</li>
</ul>
</td>
</tr>
--- a/media-source/media-source.js Tue Apr 29 10:48:50 2014 -0700
+++ b/media-source/media-source.js Tue Apr 29 14:12:11 2014 -0700
@@ -121,6 +121,7 @@
}
var mseDefinitions = {
+ 'mse-spec': { func: link_helper, fragment: '#', link_text: 'Media Source Extensions', },
'sourceBuffers': { func: idlref_helper, fragment: 'widl-MediaSource-sourceBuffers', link_text: 'sourceBuffers', },
'activeSourceBuffers': { func: idlref_helper, fragment: 'widl-MediaSource-activeSourceBuffers', link_text: 'activeSourceBuffers', },
'addSourceBuffer': { func: idlref_helper, fragment: 'widl-MediaSource-addSourceBuffer-SourceBuffer-DOMString-type', link_text: 'addSourceBuffer()', },
@@ -228,6 +229,7 @@
'buffer-full-flag': { func: var_helper, fragment: '#sourcebuffer-buffer-full-flag', link_text: 'buffer full flag', },
'group-start-timestamp': { func: var_helper, fragment: '#sourcebuffer-group-start-timestamp', link_text: 'group start timestamp', },
'group-end-timestamp': { func: var_helper, fragment: '#sourcebuffer-group-end-timestamp', link_text: 'group end timestamp', },
+ 'generate-timestamps-flag': { func: var_helper, fragment: '#sourcebuffer-generate-timestamps-flag', link_text: 'generate timestamps flag', },
'MediaSource-object-URL': { func: link_helper, fragment: '#mediasource-object-url', link_text: 'MediaSource object URL', },
'first-init-segment-flag': { func: var_helper, fragment: '#first-init-segment-flag', link_text: 'first initialization segment flag', },
@@ -359,7 +361,15 @@
}
function mediaSourcePreProcessor() {
- $("a[def-id]").each(function () {
+ for (var x in groupBaseURLs) {
+ if (groupBaseURLs[x] == MSE_spec_url && window.respecConfig.specStatus == "ED") {
+ MSE_spec_url = "media-source.html";
+ groupBaseURLs[x] = MSE_spec_url;
+ break;
+ }
+ }
+
+ $("a[def-id]").each(function () {
$(this).addClass('externalDFN');
});
--- a/media-source/mpeg-audio-byte-stream-format-respec.html Tue Apr 29 10:48:50 2014 -0700
+++ b/media-source/mpeg-audio-byte-stream-format-respec.html Tue Apr 29 14:12:11 2014 -0700
@@ -147,45 +147,6 @@
</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.
--- a/media-source/mpeg-audio-byte-stream-format.html Tue Apr 29 10:48:50 2014 -0700
+++ b/media-source/mpeg-audio-byte-stream-format.html Tue Apr 29 14:12:11 2014 -0700
@@ -165,7 +165,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>
@@ -173,7 +173,7 @@
</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>
+ <h2 property="dcterms:issued" datatype="xsd:dateTime" content="2014-04-30T03:33:49.000Z" id="w3c-editor-s-draft-29-april-2014"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft <time class="dt-published" datetime="2014-04-29">29 April 2014</time></h2>
<dl>
<dt>This version:</dt>
@@ -292,17 +292,17 @@
-</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><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></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>
+ <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="media-source.html#init-segment">initialization segments</a>, <a href="media-source.html#media-segment">media segments</a>, and <a href="media-source.html#random-access-point">random access points</a> required by the <a href="media-source.html#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>
+ <p>This section specifies the MIME-types that may be passed to <code><a href="media-source.html#widl-MediaSource-isTypeSupported-boolean-DOMString-type">isTypeSupported()</a></code> or <code><a href="media-source.html#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>
@@ -338,51 +338,12 @@
<!--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>
+ <li>Every <a href="#mpeg-audio-frame">MPEG Audio Frame</a> is a <a href="media-source.html#random-access-point">random access point</a>.</li>
+ <li>Every <a href="#mpeg-audio-frame">MPEG Audio Frame</a> header is an <a href="media-source.html#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="media-source.html#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.