<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[187377] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/187377">187377</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-07-24 19:37:39 -0700 (Fri, 24 Jul 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[MSE] Incorrect sample timestamps when using &quot;sequence&quot; mode
https://bugs.webkit.org/show_bug.cgi?id=147252

Patch by Sajid Anwar &lt;sajidanwar94@gmail.com&gt; on 2015-07-24
Reviewed by Jer Noble.

Source/WebCore:

Test: media/media-source/media-source-sequence-timestamps.html

According to the specification, the &quot;sequence&quot; mode indicates that the samples in the buffer will use generated timestamps
instead of the presentation/decode timestamps already present in the sample. The current implementation always adds
the current timestamp offset to the samples' timestamps, as expected for &quot;segments&quot; mode.

Add a method to media samples to allow their presentation and decode timestamps to be set to specific values.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Fix an algorithm condition to align with the specification, and
    correctly set the presentation and decode timestamps of samples when in &quot;sequence&quot; mode.
* platform/MediaSample.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::MediaSampleAVFObjC::setTimestamps): Add a new method to set the values of a sample's presentation and decode timestamps.
* platform/mock/mediasource/MockBox.h:
(WebCore::MockBox::setTimestamps): Set m_presentationTimestamp and m_decodeTimestamp.
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockMediaSample::offsetTimestampsBy): Pass to MockBox.
* testing/Internals.cpp:
(WebCore::Internals::setShouldGenerateTimestamps): Expose the internal `setShouldGenerateTimestamps` method of SourceBuffer.
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* media/media-source/media-source-sequence-timestamps-expected.txt: Added.
* media/media-source/media-source-sequence-timestamps.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasourceSourceBuffercpp">trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformMediaSampleh">trunk/Source/WebCore/platform/MediaSample.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmockmediasourceMockBoxh">trunk/Source/WebCore/platform/mock/mediasource/MockBox.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmockmediasourceMockSourceBufferPrivatecpp">trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsh">trunk/Source/WebCore/testing/Internals.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsidl">trunk/Source/WebCore/testing/Internals.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsmediamediasourcemediasourcesequencetimestampsexpectedtxt">trunk/LayoutTests/media/media-source/media-source-sequence-timestamps-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediamediasourcemediasourcesequencetimestampshtml">trunk/LayoutTests/media/media-source/media-source-sequence-timestamps.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (187376 => 187377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-07-25 01:08:19 UTC (rev 187376)
+++ trunk/LayoutTests/ChangeLog        2015-07-25 02:37:39 UTC (rev 187377)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2015-07-24  Sajid Anwar  &lt;sajidanwar94@gmail.com&gt;
+
+        [MSE] Incorrect sample timestamps when using &quot;sequence&quot; mode
+        https://bugs.webkit.org/show_bug.cgi?id=147252
+
+        Reviewed by Jer Noble.
+
+        * media/media-source/media-source-sequence-timestamps-expected.txt: Added.
+        * media/media-source/media-source-sequence-timestamps.html: Added.
+
</ins><span class="cx"> 2015-07-24  Chris Fleizach  &lt;cfleizach@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         AX: scrollable elements do not allow 3-finger swipe
</span></span></pre></div>
<a id="trunkLayoutTestsmediamediasourcemediasourcesequencetimestampsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/media/media-source/media-source-sequence-timestamps-expected.txt (0 => 187377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/media-source/media-source-sequence-timestamps-expected.txt                                (rev 0)
+++ trunk/LayoutTests/media/media-source/media-source-sequence-timestamps-expected.txt        2015-07-25 02:37:39 UTC (rev 187377)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+RUN(audio.src = URL.createObjectURL(source))
+EVENT(sourceopen)
+RUN(sourceBuffer = source.addSourceBuffer(&quot;audio/mock; codecs=mock&quot;))
+RUN(sourceBuffer.mode = &quot;sequence&quot;)
+RUN(sourceBuffer.appendBuffer(initSegment))
+EVENT(updateend)
+RUN(sourceBuffer.appendBuffer(samples))
+EVENT(updateend)
+EXPECTED (bufferedSamples.length == '6') OK
+{PTS({0/1, 0.000000}), DTS({0/1, 0.000000}), duration({1000/1000, 1.000000}), flags(1), generation(0)}
+{PTS({1000/1000, 1.000000}), DTS({1000/1000, 1.000000}), duration({1000/1000, 1.000000}), flags(0), generation(0)}
+{PTS({2000/1000, 2.000000}), DTS({2000/1000, 2.000000}), duration({1000/1000, 1.000000}), flags(0), generation(0)}
+{PTS({3000/1000, 3.000000}), DTS({3000/1000, 3.000000}), duration({1000/1000, 1.000000}), flags(1), generation(0)}
+{PTS({4000/1000, 4.000000}), DTS({4000/1000, 4.000000}), duration({1000/1000, 1.000000}), flags(0), generation(0)}
+{PTS({5000/1000, 5.000000}), DTS({5000/1000, 5.000000}), duration({1000/1000, 1.000000}), flags(0), generation(0)}
+END OF TEST
+
</ins></span></pre></div>
<a id="trunkLayoutTestsmediamediasourcemediasourcesequencetimestampshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/media/media-source/media-source-sequence-timestamps.html (0 => 187377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/media-source/media-source-sequence-timestamps.html                                (rev 0)
+++ trunk/LayoutTests/media/media-source/media-source-sequence-timestamps.html        2015-07-25 02:37:39 UTC (rev 187377)
</span><span class="lines">@@ -0,0 +1,65 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;title&gt;media-source-sequence-timestamps&lt;/title&gt;
+    &lt;script src=&quot;mock-media-source.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;../video-test.js&quot;&gt;&lt;/script&gt;
+    &lt;script&gt;
+    var source;
+    var sourceBuffer;
+    var initSegment;
+    var samples;
+    var bufferedSamples;
+    
+    var audio;
+
+    if (window.internals)
+        internals.initializeMockMediaSource();
+
+    function runTest()
+    {
+        audio = document.getElementsByTagName('audio')[0];
+
+        source = new MediaSource();
+        waitForEventOn(source, 'sourceopen', sourceOpen);
+        run('audio.src = URL.createObjectURL(source)');
+    }
+
+    function sourceOpen()
+    {
+        run('sourceBuffer = source.addSourceBuffer(&quot;audio/mock; codecs=mock&quot;)');
+        run('sourceBuffer.mode = &quot;sequence&quot;');
+        internals.setShouldGenerateTimestamps(sourceBuffer, true);
+        waitForEventOn(sourceBuffer, 'updateend', loadSamples, false, true);
+        initSegment = makeAInit(8, [makeATrack(1, 'mock', TRACK_KIND.AUDIO)]);
+        run('sourceBuffer.appendBuffer(initSegment)');
+    }
+
+    function loadSamples()
+    {
+        // In &quot;sequence&quot; mode, the samples' timestamps are not used
+        samples = concatenateSamples([
+            makeASample(0, 0, 1, 1, SAMPLE_FLAG.SYNC, 0),
+            makeASample(2, 2, 1, 1, SAMPLE_FLAG.NONE, 0),
+            makeASample(4, 4, 1, 1, SAMPLE_FLAG.NONE, 0),
+            makeASample(6, 6, 1, 1, SAMPLE_FLAG.SYNC, 0),
+            makeASample(8, 8, 1, 1, SAMPLE_FLAG.NONE, 0),
+            makeASample(10, 10, 1, 1, SAMPLE_FLAG.NONE, 0),
+        ]);
+        waitForEventOn(sourceBuffer, 'updateend', samplesAdded, false, true);
+        run('sourceBuffer.appendBuffer(samples)');
+    }
+
+    function samplesAdded()
+    {
+        bufferedSamples = internals.bufferedSamplesForTrackID(sourceBuffer, 1);
+        testExpected(&quot;bufferedSamples.length&quot;, 6);
+        bufferedSamples.forEach(consoleWrite);
+
+        endTest();
+    }
+    &lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;audio&gt;&lt;/audio&gt;
+&lt;/body&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (187376 => 187377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-07-25 01:08:19 UTC (rev 187376)
+++ trunk/Source/WebCore/ChangeLog        2015-07-25 02:37:39 UTC (rev 187377)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2015-07-24  Sajid Anwar  &lt;sajidanwar94@gmail.com&gt;
+
+        [MSE] Incorrect sample timestamps when using &quot;sequence&quot; mode
+        https://bugs.webkit.org/show_bug.cgi?id=147252
+
+        Reviewed by Jer Noble.
+
+        Test: media/media-source/media-source-sequence-timestamps.html
+
+        According to the specification, the &quot;sequence&quot; mode indicates that the samples in the buffer will use generated timestamps
+        instead of the presentation/decode timestamps already present in the sample. The current implementation always adds
+        the current timestamp offset to the samples' timestamps, as expected for &quot;segments&quot; mode.
+
+        Add a method to media samples to allow their presentation and decode timestamps to be set to specific values.
+
+        * Modules/mediasource/SourceBuffer.cpp:
+        (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Fix an algorithm condition to align with the specification, and
+            correctly set the presentation and decode timestamps of samples when in &quot;sequence&quot; mode.
+        * platform/MediaSample.h:
+        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
+        (WebCore::MediaSampleAVFObjC::setTimestamps): Add a new method to set the values of a sample's presentation and decode timestamps.
+        * platform/mock/mediasource/MockBox.h:
+        (WebCore::MockBox::setTimestamps): Set m_presentationTimestamp and m_decodeTimestamp.
+        * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
+        (WebCore::MockMediaSample::offsetTimestampsBy): Pass to MockBox.
+        * testing/Internals.cpp:
+        (WebCore::Internals::setShouldGenerateTimestamps): Expose the internal `setShouldGenerateTimestamps` method of SourceBuffer.
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
</ins><span class="cx"> 2015-07-24  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WKWebsiteDataStore remove methods don't properly delete cookies
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceSourceBuffercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp (187376 => 187377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp        2015-07-25 01:08:19 UTC (rev 187376)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp        2015-07-25 02:37:39 UTC (rev 187377)
</span><span class="lines">@@ -1382,7 +1382,7 @@
</span><span class="cx">         MediaTime frameDuration = sample-&gt;duration();
</span><span class="cx"> 
</span><span class="cx">         // 1.3 If mode equals &quot;sequence&quot; and group start timestamp is set, then run the following steps:
</span><del>-        if (m_mode == sequenceKeyword()) {
</del><ins>+        if (m_mode == sequenceKeyword() &amp;&amp; m_groupStartTimestamp.isValid()) {
</ins><span class="cx">             // 1.3.1 Set timestampOffset equal to group start timestamp - presentation timestamp.
</span><span class="cx">             m_timestampOffset = m_groupStartTimestamp;
</span><span class="cx"> 
</span><span class="lines">@@ -1447,8 +1447,11 @@
</span><span class="cx">             continue;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (m_timestampOffset) {
-            // Reflect the new timestamps back into the sample.
</del><ins>+        if (m_mode == sequenceKeyword()) {
+            // Use the generated timestamps instead of the sample's timestamps.
+            sample-&gt;setTimestamps(presentationTimestamp, decodeTimestamp);
+        } else if (m_timestampOffset) {
+            // Reflect the timestamp offset into the sample.
</ins><span class="cx">             sample-&gt;offsetTimestampsBy(m_timestampOffset);
</span><span class="cx">         }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformMediaSampleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/MediaSample.h (187376 => 187377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/MediaSample.h        2015-07-25 01:08:19 UTC (rev 187376)
+++ trunk/Source/WebCore/platform/MediaSample.h        2015-07-25 02:37:39 UTC (rev 187377)
</span><span class="lines">@@ -59,6 +59,7 @@
</span><span class="cx">     virtual size_t sizeInBytes() const = 0;
</span><span class="cx">     virtual FloatSize presentationSize() const = 0;
</span><span class="cx">     virtual void offsetTimestampsBy(const MediaTime&amp;) = 0;
</span><ins>+    virtual void setTimestamps(const MediaTime&amp;, const MediaTime&amp;) = 0;
</ins><span class="cx"> 
</span><span class="cx">     enum SampleFlags {
</span><span class="cx">         None = 0,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm (187376 => 187377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm        2015-07-25 01:08:19 UTC (rev 187376)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm        2015-07-25 02:37:39 UTC (rev 187377)
</span><span class="lines">@@ -459,6 +459,7 @@
</span><span class="cx">     virtual PlatformSample platformSample() override;
</span><span class="cx">     virtual void dump(PrintStream&amp;) const override;
</span><span class="cx">     virtual void offsetTimestampsBy(const MediaTime&amp;) override;
</span><ins>+    virtual void setTimestamps(const MediaTime&amp;, const MediaTime&amp;) override;
</ins><span class="cx"> 
</span><span class="cx">     RetainPtr&lt;CMSampleBufferRef&gt; m_sample;
</span><span class="cx">     AtomicString m_id;
</span><span class="lines">@@ -531,6 +532,29 @@
</span><span class="cx">     m_sample = adoptCF(newSample);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void MediaSampleAVFObjC::setTimestamps(const WTF::MediaTime &amp;presentationTimestamp, const WTF::MediaTime &amp;decodeTimestamp)
+{
+    CMItemCount itemCount = 0;
+    if (noErr != CMSampleBufferGetSampleTimingInfoArray(m_sample.get(), 0, nullptr, &amp;itemCount))
+        return;
+
+    Vector&lt;CMSampleTimingInfo&gt; timingInfoArray;
+    timingInfoArray.grow(itemCount);
+    if (noErr != CMSampleBufferGetSampleTimingInfoArray(m_sample.get(), itemCount, timingInfoArray.data(), nullptr))
+        return;
+
+    for (auto&amp; timing : timingInfoArray) {
+        timing.presentationTimeStamp = toCMTime(presentationTimestamp);
+        timing.decodeTimeStamp = toCMTime(decodeTimestamp);
+    }
+
+    CMSampleBufferRef newSample;
+    if (noErr != CMSampleBufferCreateCopyWithNewTiming(kCFAllocatorDefault, m_sample.get(), itemCount, timingInfoArray.data(), &amp;newSample))
+        return;
+
+    m_sample = adoptCF(newSample);
+}
+
</ins><span class="cx"> #pragma mark -
</span><span class="cx"> #pragma mark MediaDescriptionAVFObjC
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockmediasourceMockBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/mediasource/MockBox.h (187376 => 187377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/mediasource/MockBox.h        2015-07-25 01:08:19 UTC (rev 187376)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockBox.h        2015-07-25 02:37:39 UTC (rev 187377)
</span><span class="lines">@@ -135,6 +135,11 @@
</span><span class="cx">         m_presentationTimestamp += offset;
</span><span class="cx">         m_decodeTimestamp += offset;
</span><span class="cx">     }
</span><ins>+    void setTimestamps(const MediaTime&amp; presentationTimestamp, const MediaTime&amp; decodeTimestamp)
+    {
+        m_presentationTimestamp = presentationTimestamp;
+        m_decodeTimestamp = decodeTimestamp;
+    }
</ins><span class="cx"> 
</span><span class="cx">     enum {
</span><span class="cx">         IsSync = 1 &lt;&lt; 0,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockmediasourceMockSourceBufferPrivatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp (187376 => 187377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp        2015-07-25 01:08:19 UTC (rev 187376)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp        2015-07-25 02:37:39 UTC (rev 187377)
</span><span class="lines">@@ -64,6 +64,7 @@
</span><span class="cx">     virtual FloatSize presentationSize() const override { return FloatSize(); }
</span><span class="cx">     virtual void dump(PrintStream&amp;) const override;
</span><span class="cx">     virtual void offsetTimestampsBy(const MediaTime&amp; offset) override { m_box.offsetTimestampsBy(offset); }
</span><ins>+    virtual void setTimestamps(const MediaTime&amp; presentationTimestamp, const MediaTime&amp; decodeTimestamp) override { m_box.setTimestamps(presentationTimestamp, decodeTimestamp); }
</ins><span class="cx"> 
</span><span class="cx">     unsigned generation() const { return m_box.generation(); }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (187376 => 187377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2015-07-25 01:08:19 UTC (rev 187376)
+++ trunk/Source/WebCore/testing/Internals.cpp        2015-07-25 02:37:39 UTC (rev 187377)
</span><span class="lines">@@ -2633,6 +2633,12 @@
</span><span class="cx"> 
</span><span class="cx">     return buffer-&gt;bufferedSamplesForTrackID(trackID);
</span><span class="cx"> }
</span><ins>+    
+void Internals::setShouldGenerateTimestamps(SourceBuffer* buffer, bool flag)
+{
+    if (buffer)
+        buffer-&gt;setShouldGenerateTimestamps(flag);
+}
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO)
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.h (187376 => 187377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.h        2015-07-25 01:08:19 UTC (rev 187376)
+++ trunk/Source/WebCore/testing/Internals.h        2015-07-25 02:37:39 UTC (rev 187377)
</span><span class="lines">@@ -381,6 +381,7 @@
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE)
</span><span class="cx">     WEBCORE_TESTSUPPORT_EXPORT void initializeMockMediaSource();
</span><span class="cx">     Vector&lt;String&gt; bufferedSamplesForTrackID(SourceBuffer*, const AtomicString&amp;);
</span><ins>+    void setShouldGenerateTimestamps(SourceBuffer*, bool);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO)
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.idl (187376 => 187377)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.idl        2015-07-25 01:08:19 UTC (rev 187376)
+++ trunk/Source/WebCore/testing/Internals.idl        2015-07-25 02:37:39 UTC (rev 187377)
</span><span class="lines">@@ -355,6 +355,7 @@
</span><span class="cx"> 
</span><span class="cx">     [Conditional=MEDIA_SOURCE] void initializeMockMediaSource();
</span><span class="cx">     [Conditional=MEDIA_SOURCE] DOMString[] bufferedSamplesForTrackID(SourceBuffer buffer, DOMString trackID);
</span><ins>+    [Conditional=MEDIA_SOURCE] void setShouldGenerateTimestamps(SourceBuffer buffer, boolean flag);
</ins><span class="cx"> 
</span><span class="cx">     [Conditional=VIDEO] void beginMediaSessionInterruption();
</span><span class="cx">     [Conditional=VIDEO] void endMediaSessionInterruption(DOMString flags);
</span></span></pre>
</div>
</div>

</body>
</html>