<!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>[203739] 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/203739">203739</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-07-26 14:52:27 -0700 (Tue, 26 Jul 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>HTMLVideoElement frames do not update on iOS when src is a MediaStream blob
https://bugs.webkit.org/show_bug.cgi?id=159833
<rdar://problem/27379487>
Patch by George Ruan <gruan@apple.com> on 2016-07-26
Reviewed by Eric Carlson.
Source/WebCore:
Test: fast/mediastream/MediaStream-video-element-displays-buffer.html
* WebCore.xcodeproj/project.pbxproj:
* platform/cf/CoreMediaSoftLink.cpp: Add CMSampleBufferCreateReadyWithImageBuffer and CMVideoFormatDescriptionCreateForImageBuffer
softlink.
* platform/cf/CoreMediaSoftLink.h: Ditto.
* platform/cocoa/CoreVideoSoftLink.cpp: Add CVPixelBufferCreate, kCVPixelBufferCGBitmapContextCompatibilityKey, and
kCVPixelBufferCGImageCompatibilityKey.
* platform/cocoa/CoreVideoSoftLink.h: Ditto.
* platform/graphics/avfoundation/MediaSampleAVFObjC.h: Change create to return a Ref<T> instead
of RefPtr<T>.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: Make observer of
MediaStreamTrackPrivate and make MediaPlayer use an AVSampleBufferDisplayLayer instead of CALayer.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC): Clean up
observers and AVSampleBufferDisplayLayer.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable): Ensures AVSampleBufferDisplayLayer
is available.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueAudioSampleBufferFromTrack): Placeholder.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBufferFromTrack): Responsible
for enqueuing sample buffers to the active video track.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): Ensures that an AVSampleBufferDisplayLayer
exists.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayer): Destroys the AVSampleBufferDisplayLayer.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer): Replace CALayer with AVSampleBufferDisplayLayer.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play): Call updateReadyState as a deferred task.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState): readyState is bumped to HAVE_ENOUGH_DATA
only when the MediaPlayerPrivateMediaStreamAVFObjC has received a media sample.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferUpdated): Called from MediaStreamTrackPrivate when a
new SampleBuffer is available.
(WebCore::updateTracksOfType): Manage adding and removing self as observer from tracks.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks): Replace CALayer with AVSampleBufferDisplayLayer
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::acceleratedRenderingStateChanged): Copied from
MediaPlayerPrivateMediaSourceAVFObjC.mm
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load): Deleted CALayer.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode): Deleted process of updating CALayer.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateIntrinsicSize): Deleted CALayer.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createPreviewLayers): Deleted.
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::updateActiveVideoTrack): Remove redundant check.
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::sourceHasMoreMediaData): Called from RealtimeMediaSource when a new SampleBuffer
is available.
* platform/mediastream/MediaStreamTrackPrivate.h:
(WebCore::MediaStreamTrackPrivate::Observer::sampleBufferUpdated): Relays to MediaPlayerPrivateMediaStreamAVFObjC that
a new SampleBuffer is available to enqueue to the AVSampleBufferDisplayLayer.
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::settingsDidChange): Fix grammatical mistake in function name settingsDidChanged().
(WebCore::RealtimeMediaSource::mediaDataUpdated): Relays to all observers that a new SampleBuffer is available.
(WebCore::RealtimeMediaSource::settingsDidChanged): Deleted.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::processNewFrame): Calls mediaDataUpdated when a new SampleBuffer is captured.
* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer): Convert CVPixelBuffer to CMSampleBuffer.
(WebCore::MockRealtimeVideoSourceMac::pixelBufferFromCGImage): Convert CGImage to CVPixelBuffer.
(WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer): Creates a CMSampleBuffer from current imageBuffer and
sends the CMSampleBuffer to MediaPlayerPrivateMediaStreamAVFObjC
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::setFrameRate): Fix grammar of settingsDidChanged() to settingsDidChange().
(WebCore::MockRealtimeVideoSource::setSize): Ditto.
(WebCore::MockRealtimeVideoSource::generateFrame): Call updateSampleBuffer().
* platform/mock/MockRealtimeVideoSource.h: Change elapsedTime() from private to protected.
(WebCore::MockRealtimeVideoSource::updateSampleBuffer): Overriden by MockRealtimeVideoSourceMac.
LayoutTests:
* fast/mediastream/MediaStream-video-element-displays-buffer-expected.txt: Added.
* fast/mediastream/MediaStream-video-element-displays-buffer.html: Added. Checks that
a video element with a mediastream source displays frames that are neither black or transparent.
* fast/mediastream/resources/getUserMedia-helper.js:
(setupVideoElementWithStream): Sets up video element with global variable mediastream.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastmediastreamresourcesgetUserMediahelperjs">trunk/LayoutTests/fast/mediastream/resources/getUserMedia-helper.js</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformcfCoreMediaSoftLinkcpp">trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformcfCoreMediaSoftLinkh">trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.h</a></li>
<li><a href="#trunkSourceWebCoreplatformcocoaCoreVideoSoftLinkcpp">trunk/Source/WebCore/platform/cocoa/CoreVideoSoftLink.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformcocoaCoreVideoSoftLinkh">trunk/Source/WebCore/platform/cocoa/CoreVideoSoftLink.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationMediaSampleAVFObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/MediaSampleAVFObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaStreamAVFObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaStreamAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamMediaStreamPrivatecpp">trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamMediaStreamTrackPrivatecpp">trunk/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamMediaStreamTrackPrivateh">trunk/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamRealtimeMediaSourcecpp">trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamRealtimeMediaSourceh">trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreammacAVVideoCaptureSourcemm">trunk/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreammacMockRealtimeVideoSourceMach">trunk/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreammacMockRealtimeVideoSourceMacmm">trunk/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmockMockRealtimeVideoSourcecpp">trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmockMockRealtimeVideoSourceh">trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastmediastreamMediaStreamvideoelementdisplaysbufferexpectedtxt">trunk/LayoutTests/fast/mediastream/MediaStream-video-element-displays-buffer-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediastreamMediaStreamvideoelementdisplaysbufferhtml">trunk/LayoutTests/fast/mediastream/MediaStream-video-element-displays-buffer.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (203738 => 203739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-07-26 21:49:26 UTC (rev 203738)
+++ trunk/LayoutTests/ChangeLog        2016-07-26 21:52:27 UTC (rev 203739)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2016-07-26 George Ruan <gruan@apple.com>
+
+ HTMLVideoElement frames do not update on iOS when src is a MediaStream blob
+ https://bugs.webkit.org/show_bug.cgi?id=159833
+ <rdar://problem/27379487>
+
+ Reviewed by Eric Carlson.
+
+ * fast/mediastream/MediaStream-video-element-displays-buffer-expected.txt: Added.
+ * fast/mediastream/MediaStream-video-element-displays-buffer.html: Added. Checks that
+ a video element with a mediastream source displays frames that are neither black or transparent.
+ * fast/mediastream/resources/getUserMedia-helper.js:
+ (setupVideoElementWithStream): Sets up video element with global variable mediastream.
+
</ins><span class="cx"> 2016-07-26 Ryosuke Niwa <rniwa@webkit.org>
</span><span class="cx">
</span><span class="cx"> Remove the tests for legacy custom elements API
</span></span></pre></div>
<a id="trunkLayoutTestsfastmediastreamMediaStreamvideoelementdisplaysbufferexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/mediastream/MediaStream-video-element-displays-buffer-expected.txt (0 => 203739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/mediastream/MediaStream-video-element-displays-buffer-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/mediastream/MediaStream-video-element-displays-buffer-expected.txt        2016-07-26 21:52:27 UTC (rev 203739)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+Tests that the stream displays captured buffers to the video element.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS mediaDevices.getUserMedia generated a stream successfully.
+video.src = window.URL.createObjectURL(mediaStream)
+video.play()
+
+ === checking pixels ===
+PASS isPixelTransparent(buffer) is true
+PASS isPixelTransparent(buffer) is false
+PASS isPixelBlack(buffer) is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediastreamMediaStreamvideoelementdisplaysbufferhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/mediastream/MediaStream-video-element-displays-buffer.html (0 => 203739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/mediastream/MediaStream-video-element-displays-buffer.html         (rev 0)
+++ trunk/LayoutTests/fast/mediastream/MediaStream-video-element-displays-buffer.html        2016-07-26 21:52:27 UTC (rev 203739)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+ <script src="../../resources/js-test-pre.js"></script>
+ <script src="./resources/getUserMedia-helper.js"></script>
+</head>
+<body onload="start()">
+<p id="description"></p>
+<div id="console"></div>
+<video controls width="680" height="360"></video>
+<canvas width="680" height="360"></canvas>
+<script>
+ let mediaStream;
+ let video;
+
+ let buffer;
+
+ function isPixelTransparent(pixel)
+ {
+ return pixel[0] === 0 && pixel[1] === 0 && pixel[2] === 0 && pixel[3] === 0;
+ }
+
+ function isPixelBlack(pixel)
+ {
+ return pixel[0] === 0 && pixel[1] === 0 && pixel[2] === 0 && pixel[3] === 255;
+ }
+
+ function verifyFramesBeingDisplayed()
+ {
+ let canvas = document.querySelector('canvas');
+ let context = canvas.getContext('2d');
+
+ debug('<br> === checking pixels ===');
+
+ context.clearRect(0, 0, canvas.width, canvas.height);
+
+ let x = canvas.width * .035;
+ let y = canvas.height * 0.6 + 2 + x;
+
+ buffer = context.getImageData(x, y, 1, 1).data;
+ shouldBeTrue('isPixelTransparent(buffer)');
+
+ context.drawImage(video, 0, 0, canvas.width, canvas.height);
+
+ buffer = context.getImageData(x, y, 1, 1).data;
+ shouldBeFalse('isPixelTransparent(buffer)');
+ shouldBeFalse('isPixelBlack(buffer)');
+
+ finishJSTest();
+ }
+
+ function canplay()
+ {
+ evalAndLog('video.play()');
+ }
+
+ function start()
+ {
+ description("Tests that the stream displays captured buffers to the video element.");
+
+ video = document.querySelector('video');
+ video.addEventListener('canplay', canplay, false);
+ video.addEventListener('playing', verifyFramesBeingDisplayed, false);
+
+ getUserMedia("allow", {video:true}, setupVideoElementWithStream);
+ }
+
+ window.jsTestIsAsync = true;
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsfastmediastreamresourcesgetUserMediahelperjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/mediastream/resources/getUserMedia-helper.js (203738 => 203739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/mediastream/resources/getUserMedia-helper.js        2016-07-26 21:49:26 UTC (rev 203738)
+++ trunk/LayoutTests/fast/mediastream/resources/getUserMedia-helper.js        2016-07-26 21:52:27 UTC (rev 203739)
</span><span class="lines">@@ -24,3 +24,10 @@
</span><span class="cx"> testFailed('getUserMedia failed:' + e);
</span><span class="cx"> finishJSTest();
</span><span class="cx"> }
</span><ins>+
+function setupVideoElementWithStream(stream)
+{
+ mediaStream = stream;
+ testPassed('mediaDevices.getUserMedia generated a stream successfully.');
+ evalAndLog('video.src = window.URL.createObjectURL(mediaStream)');
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (203738 => 203739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-07-26 21:49:26 UTC (rev 203738)
+++ trunk/Source/WebCore/ChangeLog        2016-07-26 21:52:27 UTC (rev 203739)
</span><span class="lines">@@ -1,3 +1,78 @@
</span><ins>+2016-07-26 George Ruan <gruan@apple.com>
+
+ HTMLVideoElement frames do not update on iOS when src is a MediaStream blob
+ https://bugs.webkit.org/show_bug.cgi?id=159833
+ <rdar://problem/27379487>
+
+ Reviewed by Eric Carlson.
+
+ Test: fast/mediastream/MediaStream-video-element-displays-buffer.html
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * platform/cf/CoreMediaSoftLink.cpp: Add CMSampleBufferCreateReadyWithImageBuffer and CMVideoFormatDescriptionCreateForImageBuffer
+ softlink.
+ * platform/cf/CoreMediaSoftLink.h: Ditto.
+ * platform/cocoa/CoreVideoSoftLink.cpp: Add CVPixelBufferCreate, kCVPixelBufferCGBitmapContextCompatibilityKey, and
+ kCVPixelBufferCGImageCompatibilityKey.
+ * platform/cocoa/CoreVideoSoftLink.h: Ditto.
+ * platform/graphics/avfoundation/MediaSampleAVFObjC.h: Change create to return a Ref<T> instead
+ of RefPtr<T>.
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: Make observer of
+ MediaStreamTrackPrivate and make MediaPlayer use an AVSampleBufferDisplayLayer instead of CALayer.
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: Ditto.
+ (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC): Clean up
+ observers and AVSampleBufferDisplayLayer.
+ (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable): Ensures AVSampleBufferDisplayLayer
+ is available.
+ (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueAudioSampleBufferFromTrack): Placeholder.
+ (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBufferFromTrack): Responsible
+ for enqueuing sample buffers to the active video track.
+ (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): Ensures that an AVSampleBufferDisplayLayer
+ exists.
+ (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayer): Destroys the AVSampleBufferDisplayLayer.
+ (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer): Replace CALayer with AVSampleBufferDisplayLayer.
+ (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode): Ditto.
+ (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play): Call updateReadyState as a deferred task.
+ (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState): readyState is bumped to HAVE_ENOUGH_DATA
+ only when the MediaPlayerPrivateMediaStreamAVFObjC has received a media sample.
+ (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferUpdated): Called from MediaStreamTrackPrivate when a
+ new SampleBuffer is available.
+ (WebCore::updateTracksOfType): Manage adding and removing self as observer from tracks.
+ (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks): Replace CALayer with AVSampleBufferDisplayLayer
+ (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::acceleratedRenderingStateChanged): Copied from
+ MediaPlayerPrivateMediaSourceAVFObjC.mm
+ (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load): Deleted CALayer.
+ (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode): Deleted process of updating CALayer.
+ (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateIntrinsicSize): Deleted CALayer.
+ (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createPreviewLayers): Deleted.
+ * platform/mediastream/MediaStreamPrivate.cpp:
+ (WebCore::MediaStreamPrivate::updateActiveVideoTrack): Remove redundant check.
+ * platform/mediastream/MediaStreamTrackPrivate.cpp:
+ (WebCore::MediaStreamTrackPrivate::sourceHasMoreMediaData): Called from RealtimeMediaSource when a new SampleBuffer
+ is available.
+ * platform/mediastream/MediaStreamTrackPrivate.h:
+ (WebCore::MediaStreamTrackPrivate::Observer::sampleBufferUpdated): Relays to MediaPlayerPrivateMediaStreamAVFObjC that
+ a new SampleBuffer is available to enqueue to the AVSampleBufferDisplayLayer.
+ * platform/mediastream/RealtimeMediaSource.cpp:
+ (WebCore::RealtimeMediaSource::settingsDidChange): Fix grammatical mistake in function name settingsDidChanged().
+ (WebCore::RealtimeMediaSource::mediaDataUpdated): Relays to all observers that a new SampleBuffer is available.
+ (WebCore::RealtimeMediaSource::settingsDidChanged): Deleted.
+ * platform/mediastream/RealtimeMediaSource.h:
+ * platform/mediastream/mac/AVVideoCaptureSource.mm:
+ (WebCore::AVVideoCaptureSource::processNewFrame): Calls mediaDataUpdated when a new SampleBuffer is captured.
+ * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
+ * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
+ (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer): Convert CVPixelBuffer to CMSampleBuffer.
+ (WebCore::MockRealtimeVideoSourceMac::pixelBufferFromCGImage): Convert CGImage to CVPixelBuffer.
+ (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer): Creates a CMSampleBuffer from current imageBuffer and
+ sends the CMSampleBuffer to MediaPlayerPrivateMediaStreamAVFObjC
+ * platform/mock/MockRealtimeVideoSource.cpp:
+ (WebCore::MockRealtimeVideoSource::setFrameRate): Fix grammar of settingsDidChanged() to settingsDidChange().
+ (WebCore::MockRealtimeVideoSource::setSize): Ditto.
+ (WebCore::MockRealtimeVideoSource::generateFrame): Call updateSampleBuffer().
+ * platform/mock/MockRealtimeVideoSource.h: Change elapsedTime() from private to protected.
+ (WebCore::MockRealtimeVideoSource::updateSampleBuffer): Overriden by MockRealtimeVideoSourceMac.
+
</ins><span class="cx"> 2016-07-26 Zalan Bujtas <zalan@apple.com>
</span><span class="cx">
</span><span class="cx"> Move ControlStates HashMap to RenderBox.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (203738 => 203739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-07-26 21:49:26 UTC (rev 203738)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-07-26 21:52:27 UTC (rev 203739)
</span><span class="lines">@@ -985,6 +985,7 @@
</span><span class="cx">                 1AFE119A0CBFFCC4003017FA /* JSSQLResultSetRowList.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AFE11980CBFFCC4003017FA /* JSSQLResultSetRowList.h */; };
</span><span class="cx">                 1B124D8D1D380B7000ECDFB0 /* MediaSampleAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = 1B124D8C1D380B7000ECDFB0 /* MediaSampleAVFObjC.h */; };
</span><span class="cx">                 1B124D8F1D380BB600ECDFB0 /* MediaSampleAVFObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1B124D8E1D380BB600ECDFB0 /* MediaSampleAVFObjC.mm */; };
</span><ins>+                1BF9DB3C1D3973AD0026AEB7 /* MediaSample.h in Headers */ = {isa = PBXBuildFile; fileRef = CD641EC7181ED60100EE4C41 /* MediaSample.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 1C010700192594DF008A4201 /* InlineTextBoxStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C0106FE192594DF008A4201 /* InlineTextBoxStyle.cpp */; };
</span><span class="cx">                 1C010701192594DF008A4201 /* InlineTextBoxStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C0106FF192594DF008A4201 /* InlineTextBoxStyle.h */; };
</span><span class="cx">                 1C0939EA1A13E12900B788E5 /* CachedSVGFont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C0939E81A13E12900B788E5 /* CachedSVGFont.cpp */; };
</span><span class="lines">@@ -27053,6 +27054,7 @@
</span><span class="cx">                                 75793EC90D0CE72D007FC0AC /* JSMessageEvent.h in Headers */,
</span><span class="cx">                                 E1ADEDDA0E76BD93004A1A5E /* JSMessagePort.h in Headers */,
</span><span class="cx">                                 41F584C7104652CB009CAA64 /* JSMessagePortCustom.h in Headers */,
</span><ins>+                                1BF9DB3C1D3973AD0026AEB7 /* MediaSample.h in Headers */,
</ins><span class="cx">                                 2D6F3E951C1F85550061DBD4 /* JSMockPageOverlay.h in Headers */,
</span><span class="cx">                                 E38838991BAD145F00D62EE3 /* JSModuleLoader.h in Headers */,
</span><span class="cx">                                 A86629D109DA2B48009633A5 /* JSMouseEvent.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcfCoreMediaSoftLinkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.cpp (203738 => 203739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.cpp        2016-07-26 21:49:26 UTC (rev 203738)
+++ trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.cpp        2016-07-26 21:52:27 UTC (rev 203739)
</span><span class="lines">@@ -80,6 +80,7 @@
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMSampleBufferCreate, OSStatus, (CFAllocatorRef allocator, CMBlockBufferRef dataBuffer, Boolean dataReady, CMSampleBufferMakeDataReadyCallback makeDataReadyCallback, void *makeDataReadyRefcon, CMFormatDescriptionRef formatDescription, CMItemCount numSamples, CMItemCount numSampleTimingEntries, const CMSampleTimingInfo *sampleTimingArray, CMItemCount numSampleSizeEntries, const size_t *sampleSizeArray, CMSampleBufferRef *sBufOut), (allocator, dataBuffer, dataReady, makeDataReadyCallback, makeDataReadyRefcon, formatDescription, numSamples, numSampleTimingEntries, sampleTimingArray, numSampleSizeEntries, sampleSizeArray, sBufOut))
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMSampleBufferCreateCopy, OSStatus, (CFAllocatorRef allocator, CMSampleBufferRef sbuf, CMSampleBufferRef *sbufCopyOut), (allocator, sbuf, sbufCopyOut))
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMSampleBufferCreateCopyWithNewTiming, OSStatus, (CFAllocatorRef allocator, CMSampleBufferRef originalSBuf, CMItemCount numSampleTimingEntries, const CMSampleTimingInfo *sampleTimingArray, CMSampleBufferRef *sBufCopyOut), (allocator, originalSBuf, numSampleTimingEntries, sampleTimingArray, sBufCopyOut))
</span><ins>+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMSampleBufferCreateReadyWithImageBuffer, OSStatus, (CFAllocatorRef allocator, CVImageBufferRef imageBuffer, CMVideoFormatDescriptionRef formatDescription, const CMSampleTimingInfo* sampleTiming, CMSampleBufferRef* sBufOut), (allocator, imageBuffer, formatDescription, sampleTiming, sBufOut))
</ins><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMSampleBufferGetDecodeTimeStamp, CMTime, (CMSampleBufferRef sbuf), (sbuf))
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMSampleBufferGetDuration, CMTime, (CMSampleBufferRef sbuf), (sbuf))
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMSampleBufferGetImageBuffer, CVImageBufferRef, (CMSampleBufferRef sbuf), (sbuf))
</span><span class="lines">@@ -93,6 +94,7 @@
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMTimebaseSetRate, OSStatus, (CMTimebaseRef timebase, Float64 rate), (timebase, rate))
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMTimebaseSetTime, OSStatus, (CMTimebaseRef timebase, CMTime time), (timebase, time))
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMTimeCopyAsDictionary, CFDictionaryRef, (CMTime time, CFAllocatorRef allocator), (time, allocator))
</span><ins>+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMVideoFormatDescriptionCreateForImageBuffer, OSStatus, (CFAllocatorRef allocator, CVImageBufferRef imageBuffer, CMVideoFormatDescriptionRef* outDesc), (allocator, imageBuffer, outDesc))
</ins><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMVideoFormatDescriptionGetDimensions, CMVideoDimensions, (CMVideoFormatDescriptionRef videoDesc), (videoDesc))
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMVideoFormatDescriptionGetPresentationDimensions, CGSize, (CMVideoFormatDescriptionRef videoDesc, Boolean usePixelAspectRatio, Boolean useCleanAperture), (videoDesc, usePixelAspectRatio, useCleanAperture))
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcfCoreMediaSoftLinkh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.h (203738 => 203739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.h        2016-07-26 21:49:26 UTC (rev 203738)
+++ trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.h        2016-07-26 21:52:27 UTC (rev 203739)
</span><span class="lines">@@ -127,6 +127,8 @@
</span><span class="cx"> #define CMSampleBufferCreateCopy softLink_CoreMedia_CMSampleBufferCreateCopy
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreMedia, CMSampleBufferCreateCopyWithNewTiming, OSStatus, (CFAllocatorRef allocator, CMSampleBufferRef originalSBuf, CMItemCount numSampleTimingEntries, const CMSampleTimingInfo *sampleTimingArray, CMSampleBufferRef *sBufCopyOut), (allocator, originalSBuf, numSampleTimingEntries, sampleTimingArray, sBufCopyOut))
</span><span class="cx"> #define CMSampleBufferCreateCopyWithNewTiming softLink_CoreMedia_CMSampleBufferCreateCopyWithNewTiming
</span><ins>+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreMedia, CMSampleBufferCreateReadyWithImageBuffer, OSStatus, (CFAllocatorRef allocator, CVImageBufferRef imageBuffer, CMVideoFormatDescriptionRef formatDescription, const CMSampleTimingInfo *sampleTiming, CMSampleBufferRef *sBufOut), (allocator, imageBuffer, formatDescription, sampleTiming, sBufOut))
+#define CMSampleBufferCreateReadyWithImageBuffer softLink_CoreMedia_CMSampleBufferCreateReadyWithImageBuffer
</ins><span class="cx"> SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreMedia, CMSampleBufferGetDecodeTimeStamp, CMTime, (CMSampleBufferRef sbuf), (sbuf))
</span><span class="cx"> #define CMSampleBufferGetDecodeTimeStamp softLink_CoreMedia_CMSampleBufferGetDecodeTimeStamp
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreMedia, CMSampleBufferGetDuration, CMTime, (CMSampleBufferRef sbuf), (sbuf))
</span><span class="lines">@@ -153,6 +155,8 @@
</span><span class="cx"> #define CMTimebaseSetTime softLink_CoreMedia_CMTimebaseSetTime
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreMedia, CMTimeCopyAsDictionary, CFDictionaryRef, (CMTime time, CFAllocatorRef allocator), (time, allocator))
</span><span class="cx"> #define CMTimeCopyAsDictionary softLink_CoreMedia_CMTimeCopyAsDictionary
</span><ins>+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreMedia, CMVideoFormatDescriptionCreateForImageBuffer, OSStatus, (CFAllocatorRef allocator, CVImageBufferRef imageBuffer, CMVideoFormatDescriptionRef *outDesc), (allocator, imageBuffer, outDesc))
+#define CMVideoFormatDescriptionCreateForImageBuffer softLink_CoreMedia_CMVideoFormatDescriptionCreateForImageBuffer
</ins><span class="cx"> SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreMedia, CMVideoFormatDescriptionGetDimensions, CMVideoDimensions, (CMVideoFormatDescriptionRef videoDesc), (videoDesc))
</span><span class="cx"> #define CMVideoFormatDescriptionGetDimensions softLink_CoreMedia_CMVideoFormatDescriptionGetDimensions
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreMedia, CMVideoFormatDescriptionGetPresentationDimensions, CGSize, (CMVideoFormatDescriptionRef videoDesc, Boolean usePixelAspectRatio, Boolean useCleanAperture), (videoDesc, usePixelAspectRatio, useCleanAperture))
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcocoaCoreVideoSoftLinkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cocoa/CoreVideoSoftLink.cpp (203738 => 203739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cocoa/CoreVideoSoftLink.cpp        2016-07-26 21:49:26 UTC (rev 203738)
+++ trunk/Source/WebCore/platform/cocoa/CoreVideoSoftLink.cpp        2016-07-26 21:52:27 UTC (rev 203739)
</span><span class="lines">@@ -46,6 +46,9 @@
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreVideo, CVOpenGLESTextureCacheFlush, void, (CVOpenGLESTextureCacheRef textureCache, CVOptionFlags options), (textureCache, options))
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreVideo, CVOpenGLESTextureGetTarget, GLenum, (CVOpenGLESTextureRef image), (image))
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreVideo, CVOpenGLESTextureGetName, GLuint, (CVOpenGLESTextureRef image), (image))
</span><ins>+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreVideo, CVPixelBufferCreate, CVReturn, (CFAllocatorRef allocator, size_t width, size_t height, OSType pixelFormatType, CFDictionaryRef pixelBufferAttributes, CVPixelBufferRef *pixelBufferOut), (allocator, width, height, pixelFormatType, pixelBufferAttributes, pixelBufferOut))
+SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, CoreVideo, kCVPixelBufferCGBitmapContextCompatibilityKey, CFStringRef)
+SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, CoreVideo, kCVPixelBufferCGImageCompatibilityKey, CFStringRef)
</ins><span class="cx"> SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, CoreVideo, kCVPixelBufferIOSurfaceOpenGLESFBOCompatibilityKey, CFStringRef)
</span><span class="cx"> #else
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreVideo, CVOpenGLTextureCacheCreate, CVReturn, (CFAllocatorRef allocator, CFDictionaryRef cacheAttributes, CGLContextObj cglContext, CGLPixelFormatObj cglPixelFormat, CFDictionaryRef textureAttributes, CVOpenGLTextureCacheRef* cacheOut), (allocator, cacheAttributes, cglContext, cglPixelFormat, textureAttributes, cacheOut))
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcocoaCoreVideoSoftLinkh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cocoa/CoreVideoSoftLink.h (203738 => 203739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cocoa/CoreVideoSoftLink.h        2016-07-26 21:49:26 UTC (rev 203738)
+++ trunk/Source/WebCore/platform/cocoa/CoreVideoSoftLink.h        2016-07-26 21:52:27 UTC (rev 203739)
</span><span class="lines">@@ -62,7 +62,13 @@
</span><span class="cx"> #define CVOpenGLESTextureGetTarget softLink_CoreVideo_CVOpenGLESTextureGetTarget
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreVideo, CVOpenGLESTextureGetName, GLuint, (CVOpenGLESTextureRef image), (image))
</span><span class="cx"> #define CVOpenGLESTextureGetName softLink_CoreVideo_CVOpenGLESTextureGetName
</span><ins>+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreVideo, CVPixelBufferCreate, CVReturn, (CFAllocatorRef allocator, size_t width, size_t height, OSType pixelFormatType, CFDictionaryRef pixelBufferAttributes, CVPixelBufferRef *pixelBufferOut), (allocator, width, height, pixelFormatType, pixelBufferAttributes, pixelBufferOut))
+#define CVPixelBufferCreate softLink_CoreVideo_CVPixelBufferCreate
</ins><span class="cx">
</span><ins>+SOFT_LINK_CONSTANT_FOR_HEADER(WebCore, CoreVideo, kCVPixelBufferCGBitmapContextCompatibilityKey, CFStringRef)
+#define kCVPixelBufferCGBitmapContextCompatibilityKey get_CoreVideo_kCVPixelBufferCGBitmapContextCompatibilityKey()
+SOFT_LINK_CONSTANT_FOR_HEADER(WebCore, CoreVideo, kCVPixelBufferCGImageCompatibilityKey, CFStringRef)
+#define kCVPixelBufferCGImageCompatibilityKey get_CoreVideo_kCVPixelBufferCGImageCompatibilityKey()
</ins><span class="cx"> SOFT_LINK_CONSTANT_FOR_HEADER(WebCore, CoreVideo, kCVPixelBufferIOSurfaceOpenGLESFBOCompatibilityKey, CFStringRef)
</span><span class="cx"> #define kCVPixelBufferIOSurfaceOpenGLESFBOCompatibilityKey get_CoreVideo_kCVPixelBufferIOSurfaceOpenGLESFBOCompatibilityKey()
</span><span class="cx"> #else
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationMediaSampleAVFObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaSampleAVFObjC.h (203738 => 203739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaSampleAVFObjC.h        2016-07-26 21:49:26 UTC (rev 203738)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaSampleAVFObjC.h        2016-07-26 21:52:27 UTC (rev 203739)
</span><span class="lines">@@ -32,8 +32,8 @@
</span><span class="cx">
</span><span class="cx"> class MediaSampleAVFObjC final : public MediaSample {
</span><span class="cx"> public:
</span><del>- static RefPtr<MediaSampleAVFObjC> create(CMSampleBufferRef sample, int trackID) { return adoptRef(new MediaSampleAVFObjC(sample, trackID)); }
- static RefPtr<MediaSampleAVFObjC> create(CMSampleBufferRef sample) { return adoptRef(new MediaSampleAVFObjC(sample)); }
</del><ins>+ static Ref<MediaSampleAVFObjC> create(CMSampleBufferRef sample, int trackID) { return adoptRef(*new MediaSampleAVFObjC(sample, trackID)); }
+ static Ref<MediaSampleAVFObjC> create(CMSampleBufferRef sample) { return adoptRef(*new MediaSampleAVFObjC(sample)); }
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> MediaSampleAVFObjC(CMSampleBufferRef sample)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaStreamAVFObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h (203738 => 203739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h        2016-07-26 21:49:26 UTC (rev 203738)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h        2016-07-26 21:52:27 UTC (rev 203739)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #if ENABLE(MEDIA_STREAM) && USE(AVFOUNDATION)
</span><span class="cx">
</span><span class="cx"> #include "MediaPlayerPrivate.h"
</span><ins>+#include "MediaSample.h"
</ins><span class="cx"> #include "MediaStreamPrivate.h"
</span><span class="cx"> #include <wtf/Function.h>
</span><span class="cx"> #include <wtf/MediaTime.h>
</span><span class="lines">@@ -36,6 +37,7 @@
</span><span class="cx"> #include <wtf/WeakPtr.h>
</span><span class="cx">
</span><span class="cx"> OBJC_CLASS AVSampleBufferAudioRenderer;
</span><ins>+OBJC_CLASS AVSampleBufferDisplayLayer;
</ins><span class="cx"> OBJC_CLASS AVStreamSession;
</span><span class="cx"> typedef struct opaqueCMSampleBuffer *CMSampleBufferRef;
</span><span class="cx">
</span><span class="lines">@@ -51,7 +53,7 @@
</span><span class="cx"> class VideoFullscreenLayerManager;
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-class MediaPlayerPrivateMediaStreamAVFObjC : public MediaPlayerPrivateInterface, public MediaStreamPrivate::Observer {
</del><ins>+class MediaPlayerPrivateMediaStreamAVFObjC final : public MediaPlayerPrivateInterface, private MediaStreamPrivate::Observer, private MediaStreamTrackPrivate::Observer {
</ins><span class="cx"> public:
</span><span class="cx"> explicit MediaPlayerPrivateMediaStreamAVFObjC(MediaPlayer*);
</span><span class="cx"> virtual ~MediaPlayerPrivateMediaStreamAVFObjC();
</span><span class="lines">@@ -70,6 +72,9 @@
</span><span class="cx">
</span><span class="cx"> WeakPtr<MediaPlayerPrivateMediaStreamAVFObjC> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
</span><span class="cx">
</span><ins>+ void ensureLayer();
+ void destroyLayer();
+
</ins><span class="cx"> private:
</span><span class="cx"> // MediaPlayerPrivateInterface
</span><span class="cx">
</span><span class="lines">@@ -117,10 +122,14 @@
</span><span class="cx">
</span><span class="cx"> void setSize(const IntSize&) override { /* No-op */ }
</span><span class="cx">
</span><ins>+ void enqueueAudioSampleBufferFromTrack(MediaStreamTrackPrivate&, PlatformSample);
+ void enqueueVideoSampleBufferFromTrack(MediaStreamTrackPrivate&, PlatformSample);
+
</ins><span class="cx"> void paint(GraphicsContext&, const FloatRect&) override;
</span><span class="cx"> void paintCurrentFrameInContext(GraphicsContext&, const FloatRect&) override;
</span><span class="cx"> bool metaDataAvailable() const { return m_mediaStreamPrivate && m_readyState >= MediaPlayer::HaveMetadata; }
</span><span class="cx">
</span><ins>+ void acceleratedRenderingStateChanged() override;
</ins><span class="cx"> bool supportsAcceleratedRendering() const override { return true; }
</span><span class="cx">
</span><span class="cx"> bool hasSingleSecurityOrigin() const override { return true; }
</span><span class="lines">@@ -139,7 +148,6 @@
</span><span class="cx"> void updateReadyState();
</span><span class="cx">
</span><span class="cx"> void updateIntrinsicSize(const FloatSize&);
</span><del>- void createPreviewLayers();
</del><span class="cx"> void updateTracks();
</span><span class="cx"> void renderingModeChanged();
</span><span class="cx">
</span><span class="lines">@@ -160,6 +168,13 @@
</span><span class="cx"> void didAddTrack(MediaStreamTrackPrivate&) override;
</span><span class="cx"> void didRemoveTrack(MediaStreamTrackPrivate&) override;
</span><span class="cx">
</span><ins>+ // MediaStreamPrivateTrack::Observer
+ void trackEnded(MediaStreamTrackPrivate&) override { };
+ void trackMutedChanged(MediaStreamTrackPrivate&) override { };
+ void trackSettingsChanged(MediaStreamTrackPrivate&) override { };
+ void trackEnabledChanged(MediaStreamTrackPrivate&) override { };
+ void sampleBufferUpdated(MediaStreamTrackPrivate&, MediaSample&) override;
+
</ins><span class="cx"> #if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)
</span><span class="cx"> void setVideoFullscreenLayer(PlatformLayer*, std::function<void()> completionHandler) override;
</span><span class="cx"> void setVideoFullscreenFrame(FloatRect) override;
</span><span class="lines">@@ -168,8 +183,7 @@
</span><span class="cx"> MediaPlayer* m_player { nullptr };
</span><span class="cx"> WeakPtrFactory<MediaPlayerPrivateMediaStreamAVFObjC> m_weakPtrFactory;
</span><span class="cx"> RefPtr<MediaStreamPrivate> m_mediaStreamPrivate;
</span><del>- mutable RetainPtr<CALayer> m_previewLayer;
- mutable RetainPtr<PlatformLayer> m_videoBackgroundLayer;
</del><ins>+ RetainPtr<AVSampleBufferDisplayLayer> m_sampleBufferDisplayLayer;
</ins><span class="cx"> RetainPtr<CGImageRef> m_pausedImage;
</span><span class="cx"> std::unique_ptr<Clock> m_clock;
</span><span class="cx">
</span><span class="lines">@@ -185,6 +199,8 @@
</span><span class="cx"> bool m_muted { false };
</span><span class="cx"> bool m_haveEverPlayed { false };
</span><span class="cx"> bool m_ended { false };
</span><ins>+ bool m_hasEverEnqueuedVideoFrame { false };
+ bool m_hasReceivedMedia { false };
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)
</span><span class="cx"> std::unique_ptr<VideoFullscreenLayerManager> m_videoFullscreenLayerManager;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaStreamAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm (203738 => 203739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm        2016-07-26 21:49:26 UTC (rev 203738)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm        2016-07-26 21:52:27 UTC (rev 203739)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #import "Logging.h"
</span><span class="cx"> #import "MediaStreamPrivate.h"
</span><span class="cx"> #import "VideoTrackPrivateMediaStream.h"
</span><ins>+#import <AVFoundation/AVSampleBufferDisplayLayer.h>
</ins><span class="cx"> #import <QuartzCore/CALayer.h>
</span><span class="cx"> #import <QuartzCore/CATransaction.h>
</span><span class="cx"> #import <objc_runtime.h>
</span><span class="lines">@@ -52,6 +53,8 @@
</span><span class="cx">
</span><span class="cx"> SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
</span><span class="cx">
</span><ins>+SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVSampleBufferDisplayLayer)
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> #pragma mark -
</span><span class="lines">@@ -71,8 +74,17 @@
</span><span class="cx"> MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC()
</span><span class="cx"> {
</span><span class="cx"> LOG(Media, "MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC(%p)", this);
</span><del>- if (m_mediaStreamPrivate)
</del><ins>+ if (m_mediaStreamPrivate) {
</ins><span class="cx"> m_mediaStreamPrivate->removeObserver(*this);
</span><ins>+
+ for (auto& track : m_mediaStreamPrivate->tracks())
+ track->removeObserver(*this);
+ }
+
+ m_audioTrackMap.clear();
+ m_videoTrackMap.clear();
+
+ destroyLayer();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #pragma mark -
</span><span class="lines">@@ -87,7 +99,7 @@
</span><span class="cx">
</span><span class="cx"> bool MediaPlayerPrivateMediaStreamAVFObjC::isAvailable()
</span><span class="cx"> {
</span><del>- return AVFoundationLibrary() && isCoreMediaFrameworkAvailable();
</del><ins>+ return AVFoundationLibrary() && isCoreMediaFrameworkAvailable() && getAVSampleBufferDisplayLayerClass();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MediaPlayerPrivateMediaStreamAVFObjC::getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& types)
</span><span class="lines">@@ -105,6 +117,60 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #pragma mark -
</span><ins>+#pragma mark AVSampleBuffer Methods
+
+void MediaPlayerPrivateMediaStreamAVFObjC::enqueueAudioSampleBufferFromTrack(MediaStreamTrackPrivate&, PlatformSample)
+{
+ // FIXME: https://bugs.webkit.org/show_bug.cgi?id=159836
+}
+
+void MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBufferFromTrack(MediaStreamTrackPrivate& track, PlatformSample platformSample)
+{
+ if (&track != m_mediaStreamPrivate->activeVideoTrack())
+ return;
+
+ if (m_displayMode == LivePreview && [m_sampleBufferDisplayLayer isReadyForMoreMediaData]) {
+ [m_sampleBufferDisplayLayer enqueueSampleBuffer:platformSample.sample.cmSampleBuffer];
+
+ if (!m_hasEverEnqueuedVideoFrame) {
+ m_hasEverEnqueuedVideoFrame = true;
+ m_player->firstVideoFrameAvailable();
+ }
+ }
+}
+
+void MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer()
+{
+ if (m_sampleBufferDisplayLayer)
+ return;
+
+ m_sampleBufferDisplayLayer = adoptNS([allocAVSampleBufferDisplayLayerInstance() init]);
+#ifndef NDEBUG
+ [m_sampleBufferDisplayLayer setName:@"MediaPlayerPrivateMediaStreamAVFObjC AVSampleBufferDisplayLayer"];
+#endif
+
+ renderingModeChanged();
+
+#if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)
+ m_videoFullscreenLayerManager->setVideoLayer(m_sampleBufferDisplayLayer.get(), snappedIntRect(m_player->client().mediaPlayerContentBoxRect()).size());
+#endif
+}
+
+void MediaPlayerPrivateMediaStreamAVFObjC::destroyLayer()
+{
+ if (!m_sampleBufferDisplayLayer)
+ return;
+
+ [m_sampleBufferDisplayLayer flush];
+ m_sampleBufferDisplayLayer = nullptr;
+ renderingModeChanged();
+
+#if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)
+ m_videoFullscreenLayerManager->didDestroyVideoLayer();
+#endif
+}
+
+#pragma mark -
</ins><span class="cx"> #pragma mark MediaPlayerPrivateInterface Overrides
</span><span class="cx">
</span><span class="cx"> void MediaPlayerPrivateMediaStreamAVFObjC::load(const String&)
</span><span class="lines">@@ -129,7 +195,6 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(Media, "MediaPlayerPrivateMediaStreamAVFObjC::load(%p)", this);
</span><span class="cx">
</span><del>- m_previewLayer = nullptr;
</del><span class="cx"> m_intrinsicSize = FloatSize();
</span><span class="cx">
</span><span class="cx"> m_mediaStreamPrivate = &stream;
</span><span class="lines">@@ -157,19 +222,19 @@
</span><span class="cx">
</span><span class="cx"> PlatformLayer* MediaPlayerPrivateMediaStreamAVFObjC::platformLayer() const
</span><span class="cx"> {
</span><del>- if (!m_videoBackgroundLayer || m_displayMode == None)
</del><ins>+ if (!m_sampleBufferDisplayLayer || m_displayMode == None)
</ins><span class="cx"> return nullptr;
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)
</span><span class="cx"> return m_videoFullscreenLayerManager->videoInlineLayer();
</span><span class="cx"> #else
</span><del>- return m_videoBackgroundLayer.get();
</del><ins>+ return m_sampleBufferDisplayLayer.get();
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> MediaPlayerPrivateMediaStreamAVFObjC::DisplayMode MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode() const
</span><span class="cx"> {
</span><del>- if (m_ended || m_intrinsicSize.isEmpty() || !metaDataAvailable() || !m_videoBackgroundLayer)
</del><ins>+ if (m_ended || m_intrinsicSize.isEmpty() || !metaDataAvailable() || !m_sampleBufferDisplayLayer)
</ins><span class="cx"> return None;
</span><span class="cx">
</span><span class="cx"> if (m_mediaStreamPrivate->activeVideoTrack() && !m_mediaStreamPrivate->activeVideoTrack()->enabled())
</span><span class="lines">@@ -194,51 +259,6 @@
</span><span class="cx">
</span><span class="cx"> if (m_displayMode == None)
</span><span class="cx"> return;
</span><del>-
- [CATransaction begin];
- [CATransaction setAnimationDuration:0];
- [CATransaction setDisableActions:YES];
-
- do {
- if (m_displayMode < LivePreview) {
-
- if (m_displayMode == PausedImage) {
- if (m_videoBackgroundLayer.get().contents)
- break;
-
- RefPtr<Image> image = m_mediaStreamPrivate->currentFrameImage();
- if (!image) {
- m_displayMode = PaintItBlack;
- continue;
- }
-
- m_pausedImage = image->getCGImageRef();
- if (!m_pausedImage) {
- m_displayMode = PaintItBlack;
- continue;
- }
-
- m_videoBackgroundLayer.get().contents = (id)m_pausedImage.get();
- m_videoBackgroundLayer.get().backgroundColor = nil;
- } else {
- m_videoBackgroundLayer.get().contents = nil;
- m_videoBackgroundLayer.get().backgroundColor = cachedCGColor(Color::black);
- m_pausedImage = nullptr;
- }
-
- m_previewLayer.get().hidden = true;
-
- } else {
-
- m_previewLayer.get().hidden = false;
- m_videoBackgroundLayer.get().contents = nil;
- m_pausedImage = nullptr;
- }
-
- break;
- } while (1);
-
- [CATransaction commit];
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MediaPlayerPrivateMediaStreamAVFObjC::play()
</span><span class="lines">@@ -251,8 +271,9 @@
</span><span class="cx"> m_clock->start();
</span><span class="cx"> m_playing = true;
</span><span class="cx"> m_haveEverPlayed = true;
</span><del>- updateDisplayMode();
- updateReadyState();
</del><ins>+ scheduleDeferredTask([this] {
+ updateReadyState();
+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MediaPlayerPrivateMediaStreamAVFObjC::pause()
</span><span class="lines">@@ -341,7 +362,9 @@
</span><span class="cx"> if (!m_mediaStreamPrivate)
</span><span class="cx"> return MediaPlayer::ReadyState::HaveNothing;
</span><span class="cx">
</span><del>- if (m_mediaStreamPrivate->active()) {
</del><ins>+ // https://w3c.github.io/mediacapture-main/ Change 8. from July 4, 2013.
+ // FIXME: Only update readyState to HAVE_ENOUGH_DATA when all active tracks have sent a sample buffer.
+ if (m_mediaStreamPrivate->active() && m_hasReceivedMedia) {
</ins><span class="cx"> if (!m_haveEverPlayed)
</span><span class="cx"> return MediaPlayer::ReadyState::HaveFutureData;
</span><span class="cx"> return MediaPlayer::ReadyState::HaveEnoughData;
</span><span class="lines">@@ -387,46 +410,8 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> m_intrinsicSize = size;
</span><del>-
- if (m_videoBackgroundLayer || !m_player || !m_player->client().mediaPlayerRenderingCanBeAccelerated(m_player))
- return;
-
- if (!m_mediaStreamPrivate || !m_mediaStreamPrivate->platformLayer())
- return;
-
- createPreviewLayers();
</del><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaPlayerPrivateMediaStreamAVFObjC::createPreviewLayers()
-{
- if (!m_videoBackgroundLayer) {
- m_videoBackgroundLayer = adoptNS([[CALayer alloc] init]);
- m_videoBackgroundLayer.get().name = @"MediaPlayerPrivateMediaStreamAVFObjC preview background layer";
-
-#if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)
- m_videoFullscreenLayerManager->setVideoLayer(m_videoBackgroundLayer.get(), snappedIntRect(m_player->client().mediaPlayerContentBoxRect()).size());
-#endif
- }
-
- if (!m_previewLayer) {
- m_previewLayer = m_mediaStreamPrivate->platformLayer();
- if (m_previewLayer) {
- m_previewLayer.get().contentsGravity = kCAGravityResizeAspect;
- m_previewLayer.get().anchorPoint = CGPointZero;
- if (!m_playing)
- m_previewLayer.get().hidden = true;
-
- [m_videoBackgroundLayer addSublayer:m_previewLayer.get()];
-#if PLATFORM(MAC)
- [m_previewLayer setFrame:[m_videoBackgroundLayer bounds]];
- [m_previewLayer setAutoresizingMask:(kCALayerWidthSizable | kCALayerHeightSizable)];
-#endif
- }
- }
-
- renderingModeChanged();
-}
-
</del><span class="cx"> void MediaPlayerPrivateMediaStreamAVFObjC::renderingModeChanged()
</span><span class="cx"> {
</span><span class="cx"> updateDisplayMode();
</span><span class="lines">@@ -473,6 +458,29 @@
</span><span class="cx"> updateTracks();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferUpdated(MediaStreamTrackPrivate& track, MediaSample& mediaSample)
+{
+ ASSERT(track.id() == mediaSample.trackID());
+ ASSERT(mediaSample.platformSample().type == PlatformSample::CMSampleBufferType);
+ ASSERT(m_mediaStreamPrivate);
+
+ switch (track.type()) {
+ case RealtimeMediaSource::None:
+ // Do nothing.
+ break;
+ case RealtimeMediaSource::Audio:
+ // FIXME: https://bugs.webkit.org/show_bug.cgi?id=159836
+ break;
+ case RealtimeMediaSource::Video:
+ enqueueVideoSampleBufferFromTrack(track, mediaSample.platformSample());
+ m_hasReceivedMedia = true;
+ scheduleDeferredTask([this] {
+ updateReadyState();
+ });
+ break;
+ }
+}
+
</ins><span class="cx"> #if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)
</span><span class="cx"> void MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer(PlatformLayer *videoFullscreenLayer, std::function<void()> completionHandler)
</span><span class="cx"> {
</span><span class="lines">@@ -486,7 +494,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> template <typename RefT, typename PassRefT>
</span><del>-void updateTracksOfType(HashMap<String, RefT>& trackMap, RealtimeMediaSource::Type trackType, MediaStreamTrackPrivateVector& currentTracks, RefT (*itemFactory)(MediaStreamTrackPrivate&), MediaPlayer* player, void (MediaPlayer::*removedFunction)(PassRefT), void (MediaPlayer::*addedFunction)(PassRefT), std::function<void(RefT, int)> configureCallback)
</del><ins>+void updateTracksOfType(HashMap<String, RefT>& trackMap, RealtimeMediaSource::Type trackType, MediaStreamTrackPrivateVector& currentTracks, RefT (*itemFactory)(MediaStreamTrackPrivate&), MediaPlayer* player, void (MediaPlayer::*removedFunction)(PassRefT), void (MediaPlayer::*addedFunction)(PassRefT), std::function<void(RefT, int)> configureCallback, MediaStreamTrackPrivate::Observer* trackObserver)
</ins><span class="cx"> {
</span><span class="cx"> Vector<RefT> removedTracks;
</span><span class="cx"> Vector<RefT> addedTracks;
</span><span class="lines">@@ -519,17 +527,20 @@
</span><span class="cx"> for (const auto& track : trackMap.values())
</span><span class="cx"> configureCallback(track, index++);
</span><span class="cx">
</span><del>- for (auto& track : removedTracks)
</del><ins>+ for (auto& track : removedTracks) {
</ins><span class="cx"> (player->*removedFunction)(track);
</span><ins>+ track->streamTrack()->removeObserver(*trackObserver);
+ }
</ins><span class="cx">
</span><del>- for (auto& track : addedTracks)
</del><ins>+ for (auto& track : addedTracks) {
</ins><span class="cx"> (player->*addedFunction)(track);
</span><ins>+ track->streamTrack()->addObserver(*trackObserver);
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MediaPlayerPrivateMediaStreamAVFObjC::updateTracks()
</span><span class="cx"> {
</span><span class="cx"> MediaStreamTrackPrivateVector currentTracks = m_mediaStreamPrivate->tracks();
</span><del>- bool selectedVideoTrackChanged = false;
</del><span class="cx">
</span><span class="cx"> std::function<void(RefPtr<AudioTrackPrivateMediaStream>, int)> enableAudioTrack = [this](auto track, int index)
</span><span class="cx"> {
</span><span class="lines">@@ -536,24 +547,17 @@
</span><span class="cx"> track->setTrackIndex(index);
</span><span class="cx"> track->setEnabled(track->streamTrack()->enabled() && !track->streamTrack()->muted());
</span><span class="cx"> };
</span><del>- updateTracksOfType(m_audioTrackMap, RealtimeMediaSource::Audio, currentTracks, &AudioTrackPrivateMediaStream::create, m_player, &MediaPlayer::removeAudioTrack, &MediaPlayer::addAudioTrack, enableAudioTrack);
</del><ins>+ updateTracksOfType(m_audioTrackMap, RealtimeMediaSource::Audio, currentTracks, &AudioTrackPrivateMediaStream::create, m_player, &MediaPlayer::removeAudioTrack, &MediaPlayer::addAudioTrack, enableAudioTrack, (MediaStreamTrackPrivate::Observer*) this);
</ins><span class="cx">
</span><del>- std::function<void(RefPtr<VideoTrackPrivateMediaStream>, int)> enableVideoTrack = [this, &selectedVideoTrackChanged](auto track, int index)
</del><ins>+ std::function<void(RefPtr<VideoTrackPrivateMediaStream>, int)> enableVideoTrack = [this](auto track, int index)
</ins><span class="cx"> {
</span><del>- bool wasSelected = track->selected();
</del><span class="cx"> track->setTrackIndex(index);
</span><span class="cx"> track->setSelected(track->streamTrack() == m_mediaStreamPrivate->activeVideoTrack());
</span><del>- if (wasSelected != track->selected())
- selectedVideoTrackChanged = true;
</del><ins>+
+ if (track->selected())
+ ensureLayer();
</ins><span class="cx"> };
</span><del>- updateTracksOfType(m_videoTrackMap, RealtimeMediaSource::Video, currentTracks, &VideoTrackPrivateMediaStream::create, m_player, &MediaPlayer::removeVideoTrack, &MediaPlayer::addVideoTrack, enableVideoTrack);
-
- if (selectedVideoTrackChanged) {
- if (m_previewLayer)
- m_previewLayer = nullptr;
-
- createPreviewLayers();
- }
</del><ins>+ updateTracksOfType(m_videoTrackMap, RealtimeMediaSource::Video, currentTracks, &VideoTrackPrivateMediaStream::create, m_player, &MediaPlayer::removeVideoTrack, &MediaPlayer::addVideoTrack, enableVideoTrack, (MediaStreamTrackPrivate::Observer*) this);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<PlatformTimeRanges> MediaPlayerPrivateMediaStreamAVFObjC::seekable() const
</span><span class="lines">@@ -593,6 +597,14 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void MediaPlayerPrivateMediaStreamAVFObjC::acceleratedRenderingStateChanged()
+{
+ if (m_player->client().mediaPlayerRenderingCanBeAccelerated(m_player))
+ ensureLayer();
+ else
+ destroyLayer();
+}
+
</ins><span class="cx"> String MediaPlayerPrivateMediaStreamAVFObjC::engineDescription() const
</span><span class="cx"> {
</span><span class="cx"> static NeverDestroyed<String> description(ASCIILiteral("AVFoundation MediaStream Engine"));
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamMediaStreamPrivatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.cpp (203738 => 203739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.cpp        2016-07-26 21:49:26 UTC (rev 203738)
+++ trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.cpp        2016-07-26 21:52:27 UTC (rev 203739)
</span><span class="lines">@@ -257,7 +257,7 @@
</span><span class="cx"> {
</span><span class="cx"> m_activeVideoTrack = nullptr;
</span><span class="cx"> for (auto& track : m_trackSet.values()) {
</span><del>- if (!track->ended() && track->type() == RealtimeMediaSource::Type::Video && !track->ended()) {
</del><ins>+ if (!track->ended() && track->type() == RealtimeMediaSource::Type::Video) {
</ins><span class="cx"> m_activeVideoTrack = track.get();
</span><span class="cx"> break;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamMediaStreamTrackPrivatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.cpp (203738 => 203739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.cpp        2016-07-26 21:49:26 UTC (rev 203738)
+++ trunk/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.cpp        2016-07-26 21:52:27 UTC (rev 203739)
</span><span class="lines">@@ -213,6 +213,13 @@
</span><span class="cx"> return !m_isEnded;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void MediaStreamTrackPrivate::sourceHasMoreMediaData(MediaSample& mediaSample)
+{
+ mediaSample.setTrackID(id());
+ for (auto& observer : m_observers)
+ observer->sampleBufferUpdated(*this, mediaSample);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(MEDIA_STREAM)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamMediaStreamTrackPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.h (203738 => 203739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.h        2016-07-26 21:49:26 UTC (rev 203738)
+++ trunk/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.h        2016-07-26 21:52:27 UTC (rev 203739)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx">
</span><span class="cx"> class AudioSourceProvider;
</span><span class="cx"> class GraphicsContext;
</span><ins>+class MediaSample;
</ins><span class="cx"> class MediaSourceSettings;
</span><span class="cx"> class RealtimeMediaSourceCapabilities;
</span><span class="cx">
</span><span class="lines">@@ -50,6 +51,7 @@
</span><span class="cx"> virtual void trackMutedChanged(MediaStreamTrackPrivate&) = 0;
</span><span class="cx"> virtual void trackSettingsChanged(MediaStreamTrackPrivate&) = 0;
</span><span class="cx"> virtual void trackEnabledChanged(MediaStreamTrackPrivate&) = 0;
</span><ins>+ virtual void sampleBufferUpdated(MediaStreamTrackPrivate&, MediaSample&) { };
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> static RefPtr<MediaStreamTrackPrivate> create(RefPtr<RealtimeMediaSource>&&);
</span><span class="lines">@@ -104,6 +106,7 @@
</span><span class="cx"> void sourceMutedChanged() final;
</span><span class="cx"> void sourceSettingsChanged() final;
</span><span class="cx"> bool preventSourceFromStopping() final;
</span><ins>+ void sourceHasMoreMediaData(MediaSample&) final;
</ins><span class="cx">
</span><span class="cx"> Vector<Observer*> m_observers;
</span><span class="cx"> RefPtr<RealtimeMediaSource> m_source;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamRealtimeMediaSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp (203738 => 203739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp        2016-07-26 21:49:26 UTC (rev 203738)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp        2016-07-26 21:52:27 UTC (rev 203739)
</span><span class="lines">@@ -90,12 +90,18 @@
</span><span class="cx"> observer->sourceMutedChanged();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void RealtimeMediaSource::settingsDidChanged()
</del><ins>+void RealtimeMediaSource::settingsDidChange()
</ins><span class="cx"> {
</span><span class="cx"> for (auto& observer : m_observers)
</span><span class="cx"> observer->sourceSettingsChanged();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void RealtimeMediaSource::mediaDataUpdated(MediaSample& mediaSample)
+{
+ for (auto& observer : m_observers)
+ observer->sourceHasMoreMediaData(mediaSample);
+}
+
</ins><span class="cx"> bool RealtimeMediaSource::readonly() const
</span><span class="cx"> {
</span><span class="cx"> return m_readonly;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamRealtimeMediaSourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.h (203738 => 203739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.h        2016-07-26 21:49:26 UTC (rev 203738)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.h        2016-07-26 21:52:27 UTC (rev 203739)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> #include "AudioSourceProvider.h"
</span><span class="cx"> #include "Image.h"
</span><span class="cx"> #include "MediaConstraints.h"
</span><ins>+#include "MediaSample.h"
</ins><span class="cx"> #include "PlatformLayer.h"
</span><span class="cx"> #include "RealtimeMediaSourceCapabilities.h"
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="lines">@@ -66,6 +67,9 @@
</span><span class="cx">
</span><span class="cx"> // Observer state queries.
</span><span class="cx"> virtual bool preventSourceFromStopping() = 0;
</span><ins>+
+ // Media data changes.
+ virtual void sourceHasMoreMediaData(MediaSample&) = 0;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> virtual ~RealtimeMediaSource() { }
</span><span class="lines">@@ -86,7 +90,8 @@
</span><span class="cx">
</span><span class="cx"> virtual RefPtr<RealtimeMediaSourceCapabilities> capabilities() = 0;
</span><span class="cx"> virtual const RealtimeMediaSourceSettings& settings() = 0;
</span><del>- void settingsDidChanged();
</del><ins>+ void settingsDidChange();
+ void mediaDataUpdated(MediaSample&);
</ins><span class="cx">
</span><span class="cx"> bool stopped() const { return m_stopped; }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreammacAVVideoCaptureSourcemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm (203738 => 203739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm        2016-07-26 21:49:26 UTC (rev 203738)
+++ trunk/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm        2016-07-26 21:52:27 UTC (rev 203739)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #import "IntRect.h"
</span><span class="cx"> #import "Logging.h"
</span><span class="cx"> #import "MediaConstraints.h"
</span><ins>+#import "MediaSampleAVFObjC.h"
</ins><span class="cx"> #import "NotImplemented.h"
</span><span class="cx"> #import "PlatformLayer.h"
</span><span class="cx"> #import "RealtimeMediaSourceCenter.h"
</span><span class="lines">@@ -298,7 +299,9 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (settingsChanged)
</span><del>- this->settingsDidChanged();
</del><ins>+ settingsDidChange();
+
+ mediaDataUpdated(MediaSampleAVFObjC::create(sampleBuffer.get()));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection(AVCaptureOutputType*, CMSampleBufferRef sampleBuffer, AVCaptureConnectionType*)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreammacMockRealtimeVideoSourceMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.h (203738 => 203739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.h        2016-07-26 21:49:26 UTC (rev 203738)
+++ trunk/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.h        2016-07-26 21:52:27 UTC (rev 203739)
</span><span class="lines">@@ -37,6 +37,10 @@
</span><span class="cx"> #include "MockRealtimeVideoSource.h"
</span><span class="cx"> #include <wtf/RunLoop.h>
</span><span class="cx">
</span><ins>+typedef struct __CVBuffer *CVBufferRef;
+typedef CVBufferRef CVImageBufferRef;
+typedef CVImageBufferRef CVPixelBufferRef;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class MockRealtimeVideoSourceMac final : public MockRealtimeVideoSource {
</span><span class="lines">@@ -48,8 +52,12 @@
</span><span class="cx"> friend class MockRealtimeVideoSource;
</span><span class="cx"> MockRealtimeVideoSourceMac();
</span><span class="cx">
</span><ins>+ RetainPtr<CMSampleBufferRef> CMSampleBufferFromPixelBuffer(CVPixelBufferRef);
+ RetainPtr<CVPixelBufferRef> pixelBufferFromCGImage(CGImageRef) const;
+
</ins><span class="cx"> PlatformLayer* platformLayer() const override;
</span><span class="cx"> void updatePlatformLayer() const override;
</span><ins>+ void updateSampleBuffer() override;
</ins><span class="cx">
</span><span class="cx"> mutable RetainPtr<CGImageRef> m_previewImage;
</span><span class="cx"> mutable RetainPtr<PlatformLayer> m_previewLayer;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreammacMockRealtimeVideoSourceMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm (203738 => 203739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm        2016-07-26 21:49:26 UTC (rev 203738)
+++ trunk/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm        2016-07-26 21:52:27 UTC (rev 203739)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #import "GraphicsContextCG.h"
</span><span class="cx"> #import "ImageBuffer.h"
</span><span class="cx"> #import "MediaConstraints.h"
</span><ins>+#import "MediaSampleAVFObjC.h"
</ins><span class="cx"> #import "NotImplemented.h"
</span><span class="cx"> #import "PlatformLayer.h"
</span><span class="cx"> #import "RealtimeMediaSourceSettings.h"
</span><span class="lines">@@ -42,6 +43,9 @@
</span><span class="cx"> #import <QuartzCore/CATransaction.h>
</span><span class="cx"> #import <objc/runtime.h>
</span><span class="cx">
</span><ins>+#import "CoreMediaSoftLink.h"
+#import "CoreVideoSoftLink.h"
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> Ref<MockRealtimeVideoSource> MockRealtimeVideoSource::create()
</span><span class="lines">@@ -54,6 +58,57 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+RetainPtr<CMSampleBufferRef> MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer(CVPixelBufferRef pixelBuffer)
+{
+ if (!pixelBuffer)
+ return nullptr;
+
+ CMSampleTimingInfo timingInfo;
+
+ timingInfo.presentationTimeStamp = CMTimeMake(elapsedTime() * 1000, 1000);
+ timingInfo.decodeTimeStamp = kCMTimeInvalid;
+ timingInfo.duration = kCMTimeInvalid;
+
+ CMVideoFormatDescriptionRef formatDescription = nullptr;
+ OSStatus status = CMVideoFormatDescriptionCreateForImageBuffer(kCFAllocatorDefault, (CVImageBufferRef)pixelBuffer, &formatDescription);
+ if (status != noErr) {
+ LOG_ERROR("Failed to initialize CMVideoFormatDescription with error code: %d", status);
+ return nullptr;
+ }
+
+ CMSampleBufferRef sampleBuffer;
+ status = CMSampleBufferCreateReadyWithImageBuffer(kCFAllocatorDefault, (CVImageBufferRef)pixelBuffer, formatDescription, &timingInfo, &sampleBuffer);
+ CFRelease(formatDescription);
+ if (status != noErr) {
+ LOG_ERROR("Failed to initialize CMSampleBuffer with error code: %d", status);
+ return nullptr;
+ }
+
+ return adoptCF(sampleBuffer);
+}
+
+RetainPtr<CVPixelBufferRef> MockRealtimeVideoSourceMac::pixelBufferFromCGImage(CGImageRef image) const
+{
+ CGSize frameSize = CGSizeMake(CGImageGetWidth(image), CGImageGetHeight(image));
+ CFDictionaryRef options = (__bridge CFDictionaryRef) @{
+ (__bridge NSString *)kCVPixelBufferCGImageCompatibilityKey: @(NO),
+ (__bridge NSString *)kCVPixelBufferCGBitmapContextCompatibilityKey: @(NO)
+ };
+ CVPixelBufferRef pixelBuffer;
+ CVReturn status = CVPixelBufferCreate(kCFAllocatorDefault, frameSize.width, frameSize.height, kCVPixelFormatType_32ARGB, options, &pixelBuffer);
+ if (status != kCVReturnSuccess)
+ return nullptr;
+
+ CVPixelBufferLockBaseAddress(pixelBuffer, 0);
+ void* data = CVPixelBufferGetBaseAddress(pixelBuffer);
+ auto rgbColorSpace = adoptCF(CGColorSpaceCreateDeviceRGB());
+ auto context = adoptCF(CGBitmapContextCreate(data, frameSize.width, frameSize.height, 8, CVPixelBufferGetBytesPerRow(pixelBuffer), rgbColorSpace.get(), (CGBitmapInfo) kCGImageAlphaNoneSkipFirst));
+ CGContextDrawImage(context.get(), CGRectMake(0, 0, CGImageGetWidth(image), CGImageGetHeight(image)), image);
+ CVPixelBufferUnlockBaseAddress(pixelBuffer, 0);
+
+ return adoptCF(pixelBuffer);
+}
+
</ins><span class="cx"> PlatformLayer* MockRealtimeVideoSourceMac::platformLayer() const
</span><span class="cx"> {
</span><span class="cx"> if (m_previewLayer)
</span><span class="lines">@@ -97,6 +152,14 @@
</span><span class="cx"> [CATransaction commit];
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void MockRealtimeVideoSourceMac::updateSampleBuffer()
+{
+ auto pixelBuffer = pixelBufferFromCGImage(imageBuffer()->copyImage()->getCGImageRef());
+ auto sampleBuffer = CMSampleBufferFromPixelBuffer(pixelBuffer.get());
+
+ mediaDataUpdated(MediaSampleAVFObjC::create(sampleBuffer.get()));
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(MEDIA_STREAM)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockMockRealtimeVideoSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp (203738 => 203739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp        2016-07-26 21:49:26 UTC (rev 203738)
+++ trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp        2016-07-26 21:52:27 UTC (rev 203739)
</span><span class="lines">@@ -134,7 +134,7 @@
</span><span class="cx"> if (m_timer.isActive())
</span><span class="cx"> m_timer.startRepeating(std::chrono::milliseconds(lround(1000 / m_frameRate)));
</span><span class="cx">
</span><del>- settingsDidChanged();
</del><ins>+ settingsDidChange();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MockRealtimeVideoSource::setSize(const IntSize& size)
</span><span class="lines">@@ -169,7 +169,7 @@
</span><span class="cx"> m_imageBuffer = nullptr;
</span><span class="cx"> updatePlatformLayer();
</span><span class="cx">
</span><del>- settingsDidChanged();
</del><ins>+ settingsDidChange();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MockRealtimeVideoSource::drawAnimation(GraphicsContext& context)
</span><span class="lines">@@ -331,6 +331,7 @@
</span><span class="cx"> drawBoxes(context);
</span><span class="cx">
</span><span class="cx"> updatePlatformLayer();
</span><ins>+ updateSampleBuffer();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ImageBuffer* MockRealtimeVideoSource::imageBuffer() const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockMockRealtimeVideoSourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.h (203738 => 203739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.h        2016-07-26 21:49:26 UTC (rev 203738)
+++ trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.h        2016-07-26 21:52:27 UTC (rev 203739)
</span><span class="lines">@@ -59,9 +59,12 @@
</span><span class="cx"> protected:
</span><span class="cx"> MockRealtimeVideoSource(const String& name = ASCIILiteral("Mock video device"));
</span><span class="cx"> virtual void updatePlatformLayer() const { }
</span><ins>+ virtual void updateSampleBuffer() { }
</ins><span class="cx">
</span><span class="cx"> ImageBuffer* imageBuffer() const;
</span><span class="cx">
</span><ins>+ double elapsedTime();
+
</ins><span class="cx"> private:
</span><span class="cx"> void updateSettings(RealtimeMediaSourceSettings&) override;
</span><span class="cx"> void initializeCapabilities(RealtimeMediaSourceCapabilities&) override;
</span><span class="lines">@@ -80,8 +83,6 @@
</span><span class="cx">
</span><span class="cx"> void generateFrame();
</span><span class="cx">
</span><del>- double elapsedTime();
-
</del><span class="cx"> float m_baseFontSize { 0 };
</span><span class="cx"> FontCascade m_timeFont;
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>