<!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>[187092] branches/safari-601.1-branch/Source</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/187092">187092</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2015-07-20 22:27:51 -0700 (Mon, 20 Jul 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/187044">r187044</a>. rdar://problem/21661808</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari6011branchSourceWebCoreChangeLog">branches/safari-601.1-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari6011branchSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm">branches/safari-601.1-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm</a></li>
<li><a href="#branchessafari6011branchSourceWebCoreplatformiosWebVideoFullscreenControllerAVKitmm">branches/safari-601.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm</a></li>
<li><a href="#branchessafari6011branchSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKith">branches/safari-601.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h</a></li>
<li><a href="#branchessafari6011branchSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKitmm">branches/safari-601.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm</a></li>
<li><a href="#branchessafari6011branchSourceWebCoreplatformiosWebVideoFullscreenModelh">branches/safari-601.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenModel.h</a></li>
<li><a href="#branchessafari6011branchSourceWebCoreplatformiosWebVideoFullscreenModelVideoElementh">branches/safari-601.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.h</a></li>
<li><a href="#branchessafari6011branchSourceWebCoreplatformiosWebVideoFullscreenModelVideoElementmm">branches/safari-601.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.mm</a></li>
<li><a href="#branchessafari6011branchSourceWebCoreplatformspicocoaAVKitSPIh">branches/safari-601.1-branch/Source/WebCore/platform/spi/cocoa/AVKitSPI.h</a></li>
<li><a href="#branchessafari6011branchSourceWebCoreplatformspicocoaQuartzCoreSPIh">branches/safari-601.1-branch/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h</a></li>
<li><a href="#branchessafari6011branchSourceWebKit2ChangeLog">branches/safari-601.1-branch/Source/WebKit2/ChangeLog</a></li>
<li><a href="#branchessafari6011branchSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxyh">branches/safari-601.1-branch/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.h</a></li>
<li><a href="#branchessafari6011branchSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxymm">branches/safari-601.1-branch/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm</a></li>
<li><a href="#branchessafari6011branchSourceWebKit2WebProcessiosWebVideoFullscreenManagermm">branches/safari-601.1-branch/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari6011branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebCore/ChangeLog (187091 => 187092)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebCore/ChangeLog        2015-07-21 05:27:45 UTC (rev 187091)
+++ branches/safari-601.1-branch/Source/WebCore/ChangeLog        2015-07-21 05:27:51 UTC (rev 187092)
</span><span class="lines">@@ -1,5 +1,123 @@
</span><span class="cx"> 2015-07-20 Matthew Hanson <matthew_hanson@apple.com>
</span><span class="cx">
</span><ins>+ Merge r187044. rdar://problem/21661808
+
+ 2015-07-20 Jeremy Jones <jeremyj@apple.com>
+
+ Adopt AVPlayerLayerView
+ https://bugs.webkit.org/show_bug.cgi?id=146862
+
+ Reviewed by Jer Noble.
+
+ The CALayerHost is replaced with WebLayerHostView to be compatible with UIView animations.
+ Some animation is improved in the conversion.
+
+ WebAVPlayerLayerView and WebAVPictureInPicturePlayerLayerView derive from AVKit and UIKit respectively.
+ Because these frameworks are loaded at runtime, these classes must be generate using objc/runtime.h to
+ register them from c functions at runtime. The most important part of these UIViews is that their
+ backing layer is a WebAVPlayerLayer.
+
+ WebCALayerHostWrapper and WebAVVideoLayer are combined into WebAVPlayerLayer to simplify the hierarchy.
+ WebAVPlayerLayer is a stand-in for an AVPlayerLayer.
+
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer): -removeFromSuperlayer is redundant.
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenGravity): syncTextTrackBounds on change.
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenFrame):
+ We never want animation here, since all animation will happen in UIViews.
+ This is just for going into the final size after a transform based animation.
+
+ * platform/ios/WebVideoFullscreenControllerAVKit.mm:
+ (WebVideoFullscreenControllerContext::didSetupFullscreen): layer -> view
+ (WebVideoFullscreenControllerContext::didCleanupFullscreen): layer -> view
+ (WebVideoFullscreenControllerContext::setUpFullscreen): layer -> view
+
+ (WebVideoFullscreenControllerContext::setVideoLayerFrame): layer -> view
+ Use fence port to synchronize between the UIThread and the WebThread,
+ the same way WebKit2 uses a fence port to synchronize between processes.
+
+ (WebVideoFullscreenControllerContext::setVideoLayerGravity):
+ No longer necessary to cache videoGravity at this level.
+
+ * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
+ * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
+
+ (-[WebAVPlayerLayer init]):
+ (-[WebAVPlayerLayer dealloc]):
+ (-[WebAVPlayerLayer playerController]):
+ (-[WebAVPlayerLayer setBounds:]):
+ (-[WebAVPlayerLayer resolveBounds]):
+ (-[WebAVPlayerLayer setVideoGravity:]):
+ (-[WebAVPlayerLayer videoGravity]):
+ (-[WebAVPlayerLayer videoRect]):
+ (+[WebAVPlayerLayer keyPathsForValuesAffectingVideoRect]):
+ Added class WebAVPlayerLayer, replacing WebAVVideoLayer and WebCALayerHostWrapper.
+
+ (WebAVPictureInPicturePlayerLayerView_layerClass):
+ (getWebAVPictureInPicturePlayerLayerViewClass):
+ Added runtime class WebAVPictureInPicturePlayerLayerView
+
+ (WebAVPlayerLayerView_layerClass):
+ (WebAVPlayerLayerView_playerController):
+ (WebAVPlayerLayerView_setPlayerController):
+ (WebAVPlayerLayerView_videoView):
+ (WebAVPlayerLayerView_setVideoView):
+ (WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView):
+ (WebAVPlayerLayerView_stopRoutingVideoToPictureInPicturePlayerLayerView):
+ (WebAVPlayerLayerView_pictureInPicturePlayerLayerView):
+ (getWebAVPlayerLayerViewClass):
+ Added runtime class WebAVPlayerLayerView
+
+ (WebVideoFullscreenInterfaceAVKit::setVideoDimensions):
+ Dimensions are also stored in WebAVPlayerLayer so it can make decisions about
+ animating the video layer.
+
+ (WebVideoFullscreenInterfaceAVKit::setExternalPlayback):
+ (WebVideoFullscreenInterfaceAVKit::enterFullscreen):
+ (WebVideoFullscreenInterfaceAVKit::didStopPictureInPicture):
+ (WebVideoFullscreenInterfaceAVKit::cleanupFullscreen):
+ Straightforward layer to view conversion.
+
+ (WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline):
+ Set view frame using the view hierarchy instead of assuming it is directly in a window.
+
+ (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
+ Set view frame using the view hierarchy instead of assuming it is directly in a window.
+ dispatch_async before calling didExitFullscreen() to allows CATransactions to complete.
+
+ (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
+ Set view frame using the view hierarchy instead of assuming it is directly in a window.
+ dispatch_async before calling didSetupFullscreen() to allows CATransactions to complete.
+
+ (-[WebCALayerHostWrapper dealloc]): Deleted.
+ (-[WebCALayerHostWrapper setVideoSublayer:]): Deleted.
+ (-[WebCALayerHostWrapper videoSublayer]): Deleted.
+ (-[WebCALayerHostWrapper setBounds:]): Deleted.
+ (-[WebCALayerHostWrapper resolveBounds]): Deleted.
+ Class WebCALayerHostWrapper deleted. Functionality rolled into WebAVPlayerLayer.
+
+ (+[WebAVVideoLayer videoLayer]): Deleted.
+ (-[WebAVVideoLayer init]): Deleted.
+ (-[WebAVVideoLayer setPlayerViewController:]): Deleted.
+ (-[WebAVVideoLayer setVideoSublayer:]): Deleted.
+ (-[WebAVVideoLayer setBounds:]): Deleted.
+ (-[WebAVVideoLayer setVideoLayerGravity:]): Deleted.
+ (-[WebAVVideoLayer videoLayerGravity]): Deleted.
+ (-[WebAVVideoLayer enterPIPModeRedirectingVideoToLayer:]): Deleted.
+ (-[WebAVVideoLayer leavePIPMode]): Deleted.
+ Class WebAVVideoLayer deleted. Functionality rolled into WebAVPlayerLayer.
+
+ * platform/ios/WebVideoFullscreenModel.h:
+ * platform/ios/WebVideoFullscreenModelVideoElement.h:
+ * platform/ios/WebVideoFullscreenModelVideoElement.mm:
+ No need to store frame and gravity in the model. It is stored in the UI where it is used.
+
+ (WebVideoFullscreenModelVideoElement::videoLayerFrame): Deleted.
+ (WebVideoFullscreenModelVideoElement::videoLayerGravity): Deleted.
+ * platform/spi/cocoa/AVKitSPI.h: Add AVPlayerLayerView.
+
+2015-07-20 Matthew Hanson <matthew_hanson@apple.com>
+
</ins><span class="cx"> Merge r187039. rdar://problem/21474317
</span><span class="cx">
</span><span class="cx"> 2015-07-20 Tim Horton <timothy_horton@apple.com>
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (187091 => 187092)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2015-07-21 05:27:45 UTC (rev 187091)
+++ branches/safari-601.1-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2015-07-21 05:27:51 UTC (rev 187092)
</span><span class="lines">@@ -1124,9 +1124,8 @@
</span><span class="cx"> CAContext *newContext = nil;
</span><span class="cx">
</span><span class="cx"> if (m_videoFullscreenLayer && m_videoLayer) {
</span><del>- [m_videoLayer setFrame:CGRectMake(0, 0, m_videoFullscreenFrame.width(), m_videoFullscreenFrame.height())];
- [m_videoLayer removeFromSuperlayer];
</del><span class="cx"> [m_videoFullscreenLayer insertSublayer:m_videoLayer.get() atIndex:0];
</span><ins>+ [m_videoLayer setFrame:CGRectMake(0, 0, m_videoFullscreenFrame.width(), m_videoFullscreenFrame.height())];
</ins><span class="cx"> newContext = [m_videoFullscreenLayer context];
</span><span class="cx"> } else if (m_videoInlineLayer && m_videoLayer) {
</span><span class="cx"> [m_videoLayer setFrame:[m_videoInlineLayer bounds]];
</span><span class="lines">@@ -1158,11 +1157,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> if (m_videoLayer) {
</span><del>- [m_videoLayer setStyle:nil]; // This enables actions, i.e. implicit animations.
- [CATransaction begin];
</del><span class="cx"> [m_videoLayer setFrame:CGRectMake(0, 0, frame.width(), frame.height())];
</span><del>- [CATransaction commit];
- [m_videoLayer web_disableAllActions];
</del><span class="cx"> }
</span><span class="cx"> syncTextTrackBounds();
</span><span class="cx"> }
</span><span class="lines">@@ -1182,8 +1177,12 @@
</span><span class="cx"> videoGravity = AVLayerVideoGravityResizeAspectFill;
</span><span class="cx"> else
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><ins>+
+ if ([m_videoLayer videoGravity] == videoGravity)
+ return;
</ins><span class="cx">
</span><span class="cx"> [m_videoLayer setVideoGravity:videoGravity];
</span><ins>+ syncTextTrackBounds();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode(MediaPlayer::VideoFullscreenMode mode)
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebCoreplatformiosWebVideoFullscreenControllerAVKitmm"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm (187091 => 187092)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm        2015-07-21 05:27:45 UTC (rev 187091)
+++ branches/safari-601.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm        2015-07-21 05:27:51 UTC (rev 187092)
</span><span class="lines">@@ -30,6 +30,8 @@
</span><span class="cx"> #import "WebVideoFullscreenControllerAVKit.h"
</span><span class="cx">
</span><span class="cx"> #import "Logging.h"
</span><ins>+#import "QuartzCoreSPI.h"
+#import "SoftLinking.h"
</ins><span class="cx"> #import "TimeRanges.h"
</span><span class="cx"> #import "WebVideoFullscreenInterfaceAVKit.h"
</span><span class="cx"> #import "WebVideoFullscreenModelVideoElement.h"
</span><span class="lines">@@ -37,6 +39,9 @@
</span><span class="cx"> #import <WebCore/HTMLVideoElement.h>
</span><span class="cx"> #import <WebCore/WebCoreThreadRun.h>
</span><span class="cx">
</span><ins>+SOFT_LINK_FRAMEWORK(UIKit)
+SOFT_LINK_CLASS(UIKit, UIView)
+
</ins><span class="cx"> using namespace WebCore;
</span><span class="cx">
</span><span class="cx"> #if __IPHONE_OS_VERSION_MIN_REQUIRED <= 80200 || !HAVE(AVKIT)
</span><span class="lines">@@ -129,9 +134,7 @@
</span><span class="cx"> virtual void endScanning() override;
</span><span class="cx"> virtual void requestExitFullscreen() override;
</span><span class="cx"> virtual void setVideoLayerFrame(FloatRect) override;
</span><del>- virtual FloatRect videoLayerFrame() const override { return m_frame; }
</del><span class="cx"> virtual void setVideoLayerGravity(WebVideoFullscreenModel::VideoGravity) override;
</span><del>- virtual VideoGravity videoLayerGravity() const override { return m_gravity; }
</del><span class="cx"> virtual void selectAudioMediaOption(uint64_t index) override;
</span><span class="cx"> virtual void selectLegibleMediaOption(uint64_t index) override;
</span><span class="cx"> virtual void fullscreenModeChanged(HTMLMediaElementEnums::VideoFullscreenMode) override;
</span><span class="lines">@@ -139,10 +142,8 @@
</span><span class="cx"> RefPtr<WebVideoFullscreenInterfaceAVKit> m_interface;
</span><span class="cx"> RefPtr<WebVideoFullscreenModelVideoElement> m_model;
</span><span class="cx"> RefPtr<HTMLVideoElement> m_videoElement;
</span><del>- RetainPtr<PlatformLayer> m_videoFullscreenLayer;
</del><ins>+ RetainPtr<UIView> m_videoFullscreenView;
</ins><span class="cx"> RetainPtr<WebVideoFullscreenController> m_controller;
</span><del>- FloatRect m_frame;
- VideoGravity m_gravity;
</del><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> #pragma mark WebVideoFullscreenChangeObserver
</span><span class="lines">@@ -151,8 +152,9 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(isUIThread());
</span><span class="cx"> RefPtr<WebVideoFullscreenControllerContext> strongThis(this);
</span><del>- WebThreadRun([strongThis, this] {
- m_model->setVideoFullscreenLayer(m_videoFullscreenLayer.get());
</del><ins>+ RetainPtr<CALayer> videoFullscreenLayer = [m_videoFullscreenView layer];
+ WebThreadRun([strongThis, this, videoFullscreenLayer] {
+ m_model->setVideoFullscreenLayer(videoFullscreenLayer.get());
</ins><span class="cx"> dispatch_async(dispatch_get_main_queue(), [strongThis, this] {
</span><span class="cx"> m_interface->enterFullscreen();
</span><span class="cx"> });
</span><span class="lines">@@ -177,6 +179,7 @@
</span><span class="cx"> m_interface->setWebVideoFullscreenModel(nullptr);
</span><span class="cx"> m_interface->setWebVideoFullscreenChangeObserver(nullptr);
</span><span class="cx"> m_interface = nullptr;
</span><ins>+ m_videoFullscreenView = nil;
</ins><span class="cx">
</span><span class="cx"> RefPtr<WebVideoFullscreenControllerContext> strongThis(this);
</span><span class="cx"> WebThreadRun([strongThis, this] {
</span><span class="lines">@@ -185,7 +188,6 @@
</span><span class="cx"> m_model->setVideoElement(nullptr);
</span><span class="cx"> m_model = nullptr;
</span><span class="cx"> m_videoElement = nullptr;
</span><del>- m_videoFullscreenLayer = nil;
</del><span class="cx">
</span><span class="cx"> [m_controller didFinishFullscreen:this];
</span><span class="cx"> });
</span><span class="lines">@@ -450,18 +452,25 @@
</span><span class="cx"> void WebVideoFullscreenControllerContext::setVideoLayerFrame(FloatRect frame)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(isUIThread());
</span><del>- m_frame = frame;
</del><span class="cx"> RefPtr<WebVideoFullscreenControllerContext> strongThis(this);
</span><del>- WebThreadRun([strongThis, this, frame] {
</del><ins>+ RetainPtr<CALayer> videoFullscreenLayer = [m_videoFullscreenView layer];
+
+ mach_port_name_t fencePort = [[videoFullscreenLayer context] createFencePort];
+
+ WebThreadRun([strongThis, this, frame, fencePort, videoFullscreenLayer] {
+ [CATransaction begin];
+ [CATransaction setAnimationDuration:0];
</ins><span class="cx"> if (m_model)
</span><span class="cx"> m_model->setVideoLayerFrame(frame);
</span><ins>+ [[videoFullscreenLayer context] setFencePort:fencePort];
+ mach_port_deallocate(mach_task_self(), fencePort);
+ [CATransaction commit];
</ins><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebVideoFullscreenControllerContext::setVideoLayerGravity(WebVideoFullscreenModel::VideoGravity videoGravity)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(isUIThread());
</span><del>- m_gravity = videoGravity;
</del><span class="cx"> RefPtr<WebVideoFullscreenControllerContext> strongThis(this);
</span><span class="cx"> WebThreadRun([strongThis, this, videoGravity] {
</span><span class="cx"> if (m_model)
</span><span class="lines">@@ -510,19 +519,19 @@
</span><span class="cx"> m_interface = WebVideoFullscreenInterfaceAVKit::create();
</span><span class="cx"> m_interface->setWebVideoFullscreenChangeObserver(this);
</span><span class="cx"> m_interface->setWebVideoFullscreenModel(this);
</span><ins>+ m_videoFullscreenView = adoptNS([[getUIViewClass() alloc] init]);
</ins><span class="cx">
</span><span class="cx"> RefPtr<WebVideoFullscreenControllerContext> strongThis(this);
</span><span class="cx"> WebThreadRun([strongThis, this, viewRef, mode] {
</span><span class="cx"> m_model = WebVideoFullscreenModelVideoElement::create();
</span><span class="cx"> m_model->setWebVideoFullscreenInterface(this);
</span><span class="cx"> m_model->setVideoElement(m_videoElement.get());
</span><del>- m_videoFullscreenLayer = [CALayer layer];
</del><span class="cx">
</span><span class="cx"> bool allowsPictureInPicture = m_videoElement->mediaSession().allowsPictureInPicture(*m_videoElement.get());
</span><span class="cx"> IntRect videoElementClientRect = m_videoElement->clientRect();
</span><span class="cx">
</span><span class="cx"> dispatch_async(dispatch_get_main_queue(), [strongThis, this, videoElementClientRect, viewRef, mode, allowsPictureInPicture] {
</span><del>- m_interface->setupFullscreen(*m_videoFullscreenLayer.get(), videoElementClientRect, viewRef.get(), mode, allowsPictureInPicture);
</del><ins>+ m_interface->setupFullscreen(*m_videoFullscreenView.get(), videoElementClientRect, viewRef.get(), mode, allowsPictureInPicture);
</ins><span class="cx"> });
</span><span class="cx"> });
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKith"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h (187091 => 187092)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h        2015-07-21 05:27:45 UTC (rev 187091)
+++ branches/safari-601.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h        2015-07-21 05:27:51 UTC (rev 187092)
</span><span class="lines">@@ -45,8 +45,8 @@
</span><span class="cx"> OBJC_CLASS UIWindow;
</span><span class="cx"> OBJC_CLASS UIView;
</span><span class="cx"> OBJC_CLASS CALayer;
</span><del>-OBJC_CLASS WebAVVideoLayer;
-OBJC_CLASS WebCALayerHostWrapper;
</del><ins>+OBJC_CLASS WebAVPlayerLayerView;
+OBJC_CLASS WebAVPlayerLayer;
</ins><span class="cx">
</span><span class="cx"> namespace WTF {
</span><span class="cx"> class String;
</span><span class="lines">@@ -91,7 +91,7 @@
</span><span class="cx"> WEBCORE_EXPORT virtual void setLegibleMediaSelectionOptions(const Vector<WTF::String>& options, uint64_t selectedIndex) override;
</span><span class="cx"> WEBCORE_EXPORT virtual void setExternalPlayback(bool enabled, ExternalPlaybackTargetType, WTF::String localizedDeviceName) override;
</span><span class="cx">
</span><del>- WEBCORE_EXPORT virtual void setupFullscreen(PlatformLayer&, const IntRect& initialRect, UIView *, HTMLMediaElementEnums::VideoFullscreenMode, bool allowsPictureInPicturePlayback);
</del><ins>+ WEBCORE_EXPORT virtual void setupFullscreen(UIView&, const IntRect& initialRect, UIView *, HTMLMediaElementEnums::VideoFullscreenMode, bool allowsPictureInPicturePlayback);
</ins><span class="cx"> WEBCORE_EXPORT virtual void enterFullscreen();
</span><span class="cx"> WEBCORE_EXPORT virtual void exitFullscreen(const IntRect& finalRect);
</span><span class="cx"> WEBCORE_EXPORT virtual void cleanupFullscreen();
</span><span class="lines">@@ -133,9 +133,6 @@
</span><span class="cx">
</span><span class="cx"> RetainPtr<WebAVPlayerController> m_playerController;
</span><span class="cx"> RetainPtr<AVPlayerViewController> m_playerViewController;
</span><del>- RetainPtr<CALayer> m_videoLayer;
- RetainPtr<WebAVVideoLayer> m_videoLayerContainer;
- RetainPtr<WebCALayerHostWrapper> m_layerHostWrapper;
</del><span class="cx"> WebVideoFullscreenModel* m_videoFullscreenModel { nullptr };
</span><span class="cx"> WebVideoFullscreenChangeObserver* m_fullscreenChangeObserver { nullptr };
</span><span class="cx">
</span><span class="lines">@@ -144,6 +141,7 @@
</span><span class="cx"> RetainPtr<UIViewController> m_viewController;
</span><span class="cx"> RetainPtr<UIView> m_parentView;
</span><span class="cx"> RetainPtr<UIWindow> m_parentWindow;
</span><ins>+ RetainPtr<WebAVPlayerLayerView> m_playerLayerView;
</ins><span class="cx"> HTMLMediaElementEnums::VideoFullscreenMode m_mode { HTMLMediaElementEnums::VideoFullscreenModeNone };
</span><span class="cx"> std::function<void(bool)> m_prepareToInlineCallback;
</span><span class="cx"> bool m_allowsPictureInPicturePlayback { false };
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKitmm"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm (187091 => 187092)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm        2015-07-21 05:27:45 UTC (rev 187091)
+++ branches/safari-601.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm        2015-07-21 05:27:51 UTC (rev 187092)
</span><span class="lines">@@ -39,6 +39,8 @@
</span><span class="cx"> #import "WebVideoFullscreenModel.h"
</span><span class="cx"> #import <AVFoundation/AVTime.h>
</span><span class="cx"> #import <UIKit/UIKit.h>
</span><ins>+#import <objc/message.h>
+#import <objc/runtime.h>
</ins><span class="cx"> #import <wtf/RetainPtr.h>
</span><span class="cx"> #import <wtf/text/CString.h>
</span><span class="cx"> #import <wtf/text/WTFString.h>
</span><span class="lines">@@ -50,11 +52,16 @@
</span><span class="cx">
</span><span class="cx"> SOFT_LINK_FRAMEWORK(AVFoundation)
</span><span class="cx"> SOFT_LINK_CLASS(AVFoundation, AVPlayerLayer)
</span><ins>+SOFT_LINK_CONSTANT(AVFoundation, AVLayerVideoGravityResize, NSString *)
+SOFT_LINK_CONSTANT(AVFoundation, AVLayerVideoGravityResizeAspect, NSString *)
+SOFT_LINK_CONSTANT(AVFoundation, AVLayerVideoGravityResizeAspectFill, NSString *)
</ins><span class="cx">
</span><span class="cx"> SOFT_LINK_FRAMEWORK(AVKit)
</span><span class="cx"> SOFT_LINK_CLASS(AVKit, AVPlayerController)
</span><span class="cx"> SOFT_LINK_CLASS(AVKit, AVPlayerViewController)
</span><span class="cx"> SOFT_LINK_CLASS(AVKit, AVValueTiming)
</span><ins>+SOFT_LINK_CLASS(AVKit, AVPlayerLayerView)
+SOFT_LINK_CLASS(AVKit, AVPictureInPicturePlayerLayerView)
</ins><span class="cx">
</span><span class="cx"> SOFT_LINK_FRAMEWORK(UIKit)
</span><span class="cx"> SOFT_LINK_CLASS(UIKit, UIApplication)
</span><span class="lines">@@ -74,13 +81,12 @@
</span><span class="cx">
</span><span class="cx"> @class WebAVMediaSelectionOption;
</span><span class="cx">
</span><del>-@interface WebAVPlayerController : NSObject <AVPlayerViewControllerDelegate>
-{
</del><ins>+@interface WebAVPlayerController : NSObject <AVPlayerViewControllerDelegate> {
</ins><span class="cx"> WebAVMediaSelectionOption *_currentAudioMediaSelectionOption;
</span><span class="cx"> WebAVMediaSelectionOption *_currentLegibleMediaSelectionOption;
</span><span class="cx"> }
</span><span class="cx">
</span><del>--(void)resetState;
</del><ins>+- (void)resetState;
</ins><span class="cx">
</span><span class="cx"> @property (retain) AVPlayerController* playerControllerProxy;
</span><span class="cx"> @property (assign) WebVideoFullscreenModel* delegate;
</span><span class="lines">@@ -150,7 +156,8 @@
</span><span class="cx"> [super dealloc];
</span><span class="cx"> }
</span><span class="cx">
</span><del>--(void)resetState {
</del><ins>+- (void)resetState
+{
</ins><span class="cx"> self.contentDuration = 0;
</span><span class="cx"> self.maxTime = 0;
</span><span class="cx"> self.contentDurationWithinEndTimes = 0;
</span><span class="lines">@@ -181,7 +188,8 @@
</span><span class="cx"> self.currentLegibleMediaSelectionOption = nil;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-- (AVPlayer*) player {
</del><ins>+- (AVPlayer *) player
+{
</ins><span class="cx"> return nil;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -568,25 +576,52 @@
</span><span class="cx"> @implementation WebAVMediaSelectionOption
</span><span class="cx"> @end
</span><span class="cx">
</span><del>-
-@interface WebCALayerHostWrapper : CALayer
-@property (assign) WebVideoFullscreenModel* model;
</del><ins>+@interface WebAVPlayerLayer : CALayer
+@property (nonatomic, retain) NSString *videoGravity;
+@property (nonatomic, getter=isReadyForDisplay) BOOL readyForDisplay;
+@property (nonatomic, retain) AVPlayerController *playerController;
+@property (nonatomic, retain) CALayer *videoSublayer;
+@property (nonatomic, copy, nullable) NSDictionary *pixelBufferAttributes;
+@property CGSize videoDimensions;
+@property CGRect modelVideoLayerFrame;
</ins><span class="cx"> @end
</span><span class="cx">
</span><del>-@implementation WebCALayerHostWrapper {
</del><ins>+@implementation WebAVPlayerLayer {
+ RetainPtr<WebAVPlayerController> _avPlayerController;
</ins><span class="cx"> RetainPtr<CALayer> _videoSublayer;
</span><ins>+ RetainPtr<NSString> _videoGravity;
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+- (instancetype)init
+{
+ self = [super init];
+ if (self) {
+ [self setMasksToBounds:YES];
+ _videoGravity = getAVLayerVideoGravityResizeAspect();
+ }
+ return self;
+}
+
</ins><span class="cx"> - (void)dealloc
</span><span class="cx"> {
</span><span class="cx"> [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(resolveBounds) object:nil];
</span><span class="cx"> [super dealloc];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-- (void)setVideoSublayer:(CALayer*)videoSublayer
</del><ins>+- (AVPlayerController *)playerController
</ins><span class="cx"> {
</span><ins>+ return (AVPlayerController *)_avPlayerController.get();
+}
+
+- (void)setPlayerController:(AVPlayerController *)playerController
+{
+ ASSERT(!playerController || [playerController isKindOfClass:[WebAVPlayerController class]]);
+ _avPlayerController = (WebAVPlayerController *)playerController;
+}
+
+- (void)setVideoSublayer:(CALayer *)videoSublayer
+{
</ins><span class="cx"> _videoSublayer = videoSublayer;
</span><del>- [self addSublayer:videoSublayer];
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (CALayer*)videoSublayer
</span><span class="lines">@@ -598,152 +633,239 @@
</span><span class="cx"> {
</span><span class="cx"> if (CGRectEqualToRect(bounds, self.bounds))
</span><span class="cx"> return;
</span><del>-
</del><ins>+
</ins><span class="cx"> [super setBounds:bounds];
</span><ins>+
+ if ([_videoSublayer superlayer] != self)
+ return;
</ins><span class="cx">
</span><span class="cx"> [_videoSublayer setPosition:CGPointMake(CGRectGetMidX(bounds), CGRectGetMidY(bounds))];
</span><del>-
- if (!self.model)
</del><ins>+
+ if (![_avPlayerController delegate])
</ins><span class="cx"> return;
</span><span class="cx">
</span><del>- FloatRect videoFrame = self.model->videoLayerFrame();
- FloatRect targetFrame;
- switch (self.model->videoLayerGravity()) {
- case WebCore::WebVideoFullscreenModel::VideoGravityResize:
- targetFrame = bounds;
- break;
- case WebCore::WebVideoFullscreenModel::VideoGravityResizeAspect:
- targetFrame = largestRectWithAspectRatioInsideRect(videoFrame.size().aspectRatio(), bounds);
- break;
- case WebCore::WebVideoFullscreenModel::VideoGravityResizeAspectFill:
- targetFrame = smallestRectWithAspectRatioAroundRect(videoFrame.size().aspectRatio(), bounds);
- break;
- }
- CATransform3D transform = CATransform3DMakeScale(targetFrame.width() / videoFrame.width(), targetFrame.height() / videoFrame.height(), 1);
- [_videoSublayer setSublayerTransform:transform];
</del><ins>+ FloatRect sourceVideoFrame;
+ FloatRect targetVideoFrame;
+ float videoAspectRatio = self.videoDimensions.width / self.videoDimensions.height;
+
+ if ([getAVLayerVideoGravityResize() isEqualToString:self.videoGravity]) {
+ sourceVideoFrame = self.modelVideoLayerFrame;
+ targetVideoFrame = self.bounds;
+ } else if ([getAVLayerVideoGravityResizeAspect() isEqualToString:self.videoGravity]) {
+ sourceVideoFrame = largestRectWithAspectRatioInsideRect(videoAspectRatio, self.modelVideoLayerFrame);
+ targetVideoFrame = largestRectWithAspectRatioInsideRect(videoAspectRatio, self.bounds);
+ } else if ([getAVLayerVideoGravityResizeAspectFill() isEqualToString:self.videoGravity]) {
+ sourceVideoFrame = smallestRectWithAspectRatioAroundRect(videoAspectRatio, self.modelVideoLayerFrame);
+ self.modelVideoLayerFrame = CGRectMake(0, 0, sourceVideoFrame.width(), sourceVideoFrame.height());
+ [_avPlayerController delegate]->setVideoLayerFrame(self.modelVideoLayerFrame);
+ targetVideoFrame = smallestRectWithAspectRatioAroundRect(videoAspectRatio, self.bounds);
+ } else
+ ASSERT_NOT_REACHED();
</ins><span class="cx">
</span><ins>+ UIView *view = [_videoSublayer delegate];
+ CGAffineTransform transform = CGAffineTransformMakeScale(targetVideoFrame.width() / sourceVideoFrame.width(), targetVideoFrame.height() / sourceVideoFrame.height());
+ [view setTransform:transform];
+
</ins><span class="cx"> [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(resolveBounds) object:nil];
</span><del>- [self performSelector:@selector(resolveBounds) withObject:nil afterDelay:[CATransaction animationDuration] + 0.1];
</del><ins>+
+ if (!CGAffineTransformEqualToTransform(CGAffineTransformIdentity, transform))
+ [self performSelector:@selector(resolveBounds) withObject:nil afterDelay:[CATransaction animationDuration] + 0.1];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)resolveBounds
</span><span class="cx"> {
</span><span class="cx"> [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(resolveBounds) object:nil];
</span><del>- if (!self.model)
</del><ins>+ if (![_avPlayerController delegate])
</ins><span class="cx"> return;
</span><del>-
</del><ins>+
+ if ([_videoSublayer superlayer] != self)
+ return;
+
</ins><span class="cx"> [CATransaction begin];
</span><span class="cx"> [CATransaction setAnimationDuration:0];
</span><del>-
- [_videoSublayer setSublayerTransform:CATransform3DIdentity];
- self.model->setVideoLayerFrame([self bounds]);
</del><span class="cx">
</span><ins>+ [(UIView *)[_videoSublayer delegate] setTransform:CGAffineTransformIdentity];
+ self.modelVideoLayerFrame = [self bounds];
+ [_avPlayerController delegate]->setVideoLayerFrame(self.modelVideoLayerFrame);
+
</ins><span class="cx"> [CATransaction commit];
</span><span class="cx"> }
</span><ins>+
+- (void)setVideoGravity:(NSString *)videoGravity
+{
+ _videoGravity = videoGravity;
+
+ if (![_avPlayerController delegate])
+ return;
+
+ WebCore::WebVideoFullscreenModel::VideoGravity gravity = WebCore::WebVideoFullscreenModel::VideoGravityResizeAspect;
+ if (videoGravity == getAVLayerVideoGravityResize())
+ gravity = WebCore::WebVideoFullscreenModel::VideoGravityResize;
+ if (videoGravity == getAVLayerVideoGravityResizeAspect())
+ gravity = WebCore::WebVideoFullscreenModel::VideoGravityResizeAspect;
+ else if (videoGravity == getAVLayerVideoGravityResizeAspectFill())
+ gravity = WebCore::WebVideoFullscreenModel::VideoGravityResizeAspectFill;
+ else
+ ASSERT_NOT_REACHED();
+
+ [_avPlayerController delegate]->setVideoLayerGravity(gravity);
+}
+
+- (NSString *)videoGravity
+{
+ return _videoGravity.get();
+}
+
+- (CGRect)videoRect
+{
+ float videoAspectRatio = self.videoDimensions.width / self.videoDimensions.height;
+
+ if ([getAVLayerVideoGravityResizeAspect() isEqualToString:self.videoGravity])
+ return largestRectWithAspectRatioInsideRect(videoAspectRatio, self.bounds);
+ if ([getAVLayerVideoGravityResizeAspectFill() isEqualToString:self.videoGravity])
+ return smallestRectWithAspectRatioAroundRect(videoAspectRatio, self.bounds);
+
+ return self.bounds;
+}
+
++ (NSSet *)keyPathsForValuesAffectingVideoRect
+{
+ return [NSSet setWithObjects:@"videoDimensions", @"videoGravity", nil];
+}
+
</ins><span class="cx"> @end
</span><span class="cx">
</span><del>-@interface WebAVVideoLayer : CALayer <AVVideoLayer>
-+(WebAVVideoLayer *)videoLayer;
-@property (nonatomic) AVVideoLayerGravity videoLayerGravity;
-@property (nonatomic, getter = isReadyForDisplay) BOOL readyForDisplay;
-@property (nonatomic) CGRect videoRect;
-- (void)setPlayerViewController:(AVPlayerViewController *)playerViewController;
-- (void)setPlayerController:(AVPlayerController *)playerController;
-@property (nonatomic, retain) CALayer* videoSublayer;
</del><ins>+@interface WebAVPictureInPicturePlayerLayerView : AVPictureInPicturePlayerLayerView
</ins><span class="cx"> @end
</span><span class="cx">
</span><del>-@implementation WebAVVideoLayer
</del><ins>+static CALayer* WebAVPictureInPicturePlayerLayerView_layerClass(id, SEL)
</ins><span class="cx"> {
</span><del>- RetainPtr<WebAVPlayerController> _avPlayerController;
- RetainPtr<AVPlayerViewController> _avPlayerViewController;
- RetainPtr<CALayer> _videoSublayer;
- AVVideoLayerGravity _videoLayerGravity;
</del><ins>+ return [WebAVPlayerLayer class];
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-+(WebAVVideoLayer *)videoLayer
</del><ins>+static Class getWebAVPictureInPicturePlayerLayerViewClass()
</ins><span class="cx"> {
</span><del>- return [[[WebAVVideoLayer alloc] init] autorelease];
</del><ins>+ static Class theClass = nil;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ theClass = objc_allocateClassPair(getAVPictureInPicturePlayerLayerViewClass(), "WebAVPictureInPicturePlayerLayerView", 0);
+ objc_registerClassPair(theClass);
+ Class metaClass = objc_getMetaClass("WebAVPictureInPicturePlayerLayerView");
+ class_addMethod(metaClass, @selector(layerClass), (IMP)WebAVPictureInPicturePlayerLayerView_layerClass, "@@:");
+ });
+
+ return theClass;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-- (instancetype)init
</del><ins>+@interface WebAVPlayerLayerView : AVPlayerLayerView
+@property (retain) UIView* videoView;
+@end
+
+static CALayer* WebAVPlayerLayerView_layerClass(id, SEL)
</ins><span class="cx"> {
</span><del>- self = [super init];
- if (self) {
- [self setMasksToBounds:YES];
- [self setVideoLayerGravity:AVVideoLayerGravityResizeAspect];
- }
- return self;
</del><ins>+ return [WebAVPlayerLayer class];
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-- (void)setPlayerController:(AVPlayerController *)playerController
</del><ins>+static AVPlayerController* WebAVPlayerLayerView_playerController(id aSelf, SEL)
</ins><span class="cx"> {
</span><del>- ASSERT(!playerController || [playerController isKindOfClass:[WebAVPlayerController class]]);
- _avPlayerController = (WebAVPlayerController *)playerController;
</del><ins>+ AVPlayerLayerView *playerLayer = aSelf;
+ WebAVPlayerLayer *webAVPlayerLayer = (WebAVPlayerLayer *)[playerLayer playerLayer];
+ return [webAVPlayerLayer playerController];
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-- (void)setPlayerViewController:(AVPlayerViewController *)playerViewController
</del><ins>+static void WebAVPlayerLayerView_setPlayerController(id aSelf, SEL, AVPlayerController *playerController)
</ins><span class="cx"> {
</span><del>- _avPlayerViewController = playerViewController;
</del><ins>+ AVPlayerLayerView *playerLayerView = aSelf;
+ WebAVPlayerLayer *webAVPlayerLayer = (WebAVPlayerLayer *)[playerLayerView playerLayer];
+ [webAVPlayerLayer setPlayerController: playerController];
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-- (void)setVideoSublayer:(CALayer *)videoSublayer
</del><ins>+static UIView* WebAVPlayerLayerView_videoView(id aSelf, SEL)
</ins><span class="cx"> {
</span><del>- _videoSublayer = videoSublayer;
- [self addSublayer:videoSublayer];
</del><ins>+ AVPlayerLayerView *playerLayer = aSelf;
+ WebAVPlayerLayer *webAVPlayerLayer = (WebAVPlayerLayer *)[playerLayer playerLayer];
+ CALayer* videoLayer = [webAVPlayerLayer videoSublayer];
+ if (!videoLayer)
+ return nil;
+ ASSERT([[videoLayer delegate] isKindOfClass:getUIViewClass()]);
+ return (UIView *)[videoLayer delegate];
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-- (CALayer*)videoSublayer
</del><ins>+static void WebAVPlayerLayerView_setVideoView(id aSelf, SEL, UIView *videoView)
</ins><span class="cx"> {
</span><del>- return _videoSublayer.get();
</del><ins>+ AVPlayerLayerView *playerLayerView = aSelf;
+ WebAVPlayerLayer *webAVPlayerLayer = (WebAVPlayerLayer *)[playerLayerView playerLayer];
+ [webAVPlayerLayer setVideoSublayer:[videoView layer]];
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-- (void)setBounds:(CGRect)bounds
</del><ins>+static void WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView(id aSelf, SEL)
</ins><span class="cx"> {
</span><del>- [super setBounds:bounds];
</del><ins>+ WebAVPlayerLayerView *playerLayerView = aSelf;
+ AVPictureInPicturePlayerLayerView *pipView = [playerLayerView pictureInPicturePlayerLayerView];
</ins><span class="cx">
</span><del>- if ([_videoSublayer superlayer] == self) {
- [_videoSublayer setPosition:CGPointMake(CGRectGetMidX(bounds), CGRectGetMidY(bounds))];
- [_videoSublayer setBounds:bounds];
- }
</del><ins>+ WebAVPlayerLayer *playerLayer = (WebAVPlayerLayer *)[playerLayerView playerLayer];
+ WebAVPlayerLayer *pipPlayerLayer = (WebAVPlayerLayer *)[pipView playerLayer];
+ [playerLayer setVideoGravity:getAVLayerVideoGravityResizeAspect()];
+ [pipPlayerLayer setVideoSublayer:playerLayer.videoSublayer];
+ [pipPlayerLayer setVideoDimensions:playerLayer.videoDimensions];
+ [pipPlayerLayer setVideoGravity:playerLayer.videoGravity];
+ [pipPlayerLayer setModelVideoLayerFrame:playerLayer.modelVideoLayerFrame];
+ [pipPlayerLayer setPlayerController:playerLayer.playerController];
+ [pipView addSubview:playerLayerView.videoView];
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-- (void)setVideoLayerGravity:(AVVideoLayerGravity)videoLayerGravity
</del><ins>+static void WebAVPlayerLayerView_stopRoutingVideoToPictureInPicturePlayerLayerView(id aSelf, SEL)
</ins><span class="cx"> {
</span><del>- _videoLayerGravity = videoLayerGravity;
-
- if (![_avPlayerController delegate])
- return;
-
- WebCore::WebVideoFullscreenModel::VideoGravity gravity = WebCore::WebVideoFullscreenModel::VideoGravityResizeAspect;
- if (videoLayerGravity == AVVideoLayerGravityResize)
- gravity = WebCore::WebVideoFullscreenModel::VideoGravityResize;
- if (videoLayerGravity == AVVideoLayerGravityResizeAspect)
- gravity = WebCore::WebVideoFullscreenModel::VideoGravityResizeAspect;
- else if (videoLayerGravity == AVVideoLayerGravityResizeAspectFill)
- gravity = WebCore::WebVideoFullscreenModel::VideoGravityResizeAspectFill;
- else
- ASSERT_NOT_REACHED();
-
- [_avPlayerController delegate]->setVideoLayerGravity(gravity);
</del><ins>+ WebAVPlayerLayerView *playerLayerView = aSelf;
+ [playerLayerView addSubview:playerLayerView.videoView];
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-- (AVVideoLayerGravity)videoLayerGravity
</del><ins>+static AVPictureInPicturePlayerLayerView *WebAVPlayerLayerView_pictureInPicturePlayerLayerView(id aSelf, SEL)
</ins><span class="cx"> {
</span><del>- return _videoLayerGravity;
</del><ins>+ WebAVPlayerLayerView *playerLayerView = aSelf;
+ WebAVPictureInPicturePlayerLayerView *pipView = [playerLayerView valueForKey:@"_pictureInPicturePlayerLayerView"];
+ if (!pipView) {
+ pipView = [[getWebAVPictureInPicturePlayerLayerViewClass() alloc] initWithFrame:CGRectZero];
+ [playerLayerView setValue:pipView forKey:@"_pictureInPicturePlayerLayerView"];
+ }
+ return pipView;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-- (void)enterPIPModeRedirectingVideoToLayer:(CALayer *)layer
</del><ins>+static void WebAVPlayerLayerView_dealloc(id aSelf, SEL)
</ins><span class="cx"> {
</span><del>- [_videoSublayer removeFromSuperlayer];
- [layer addSublayer:_videoSublayer.get()];
</del><ins>+ WebAVPlayerLayerView *playerLayerView = aSelf;
+ RetainPtr<WebAVPictureInPicturePlayerLayerView> pipView = adoptNS([playerLayerView valueForKey:@"_pictureInPicturePlayerLayerView"]);
+ [playerLayerView setValue:nil forKey:@"_pictureInPicturePlayerLayerView"];
+ objc_super superClass { playerLayerView, getAVPlayerLayerViewClass() };
+ auto super_dealloc = reinterpret_cast<void(*)(objc_super*, SEL)>(objc_msgSendSuper);
+ super_dealloc(&superClass, @selector(dealloc));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-- (void)leavePIPMode
</del><ins>+#pragma mark - Methods
+
+static Class getWebAVPlayerLayerViewClass()
</ins><span class="cx"> {
</span><del>- [_videoSublayer removeFromSuperlayer];
- [self addSublayer:_videoSublayer.get()];
</del><ins>+ static Class theClass = nil;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ theClass = objc_allocateClassPair(getAVPlayerLayerViewClass(), "WebAVPlayerLayerView", 0);
+ class_addMethod(theClass, @selector(dealloc), (IMP)WebAVPlayerLayerView_dealloc, "v@:");
+ class_addMethod(theClass, @selector(setPlayerController:), (IMP)WebAVPlayerLayerView_setPlayerController, "v@:@");
+ class_addMethod(theClass, @selector(playerController), (IMP)WebAVPlayerLayerView_playerController, "@@:");
+ class_addMethod(theClass, @selector(setVideoView:), (IMP)WebAVPlayerLayerView_setVideoView, "v@:@");
+ class_addMethod(theClass, @selector(videoView), (IMP)WebAVPlayerLayerView_videoView, "@@:");
+ class_addMethod(theClass, @selector(startRoutingVideoToPictureInPicturePlayerLayerView), (IMP)WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView, "v@:");
+ class_addMethod(theClass, @selector(stopRoutingVideoToPictureInPicturePlayerLayerView), (IMP)WebAVPlayerLayerView_stopRoutingVideoToPictureInPicturePlayerLayerView, "v@:");
+ class_addMethod(theClass, @selector(pictureInPicturePlayerLayerView), (IMP)WebAVPlayerLayerView_pictureInPicturePlayerLayerView, "@@:");
+
+ class_addIvar(theClass, "_pictureInPicturePlayerLayerView", sizeof(WebAVPictureInPicturePlayerLayerView *), log2(sizeof(WebAVPictureInPicturePlayerLayerView *)), "@");
+
+ objc_registerClassPair(theClass);
+ Class metaClass = objc_getMetaClass("WebAVPlayerLayerView");
+ class_addMethod(metaClass, @selector(layerClass), (IMP)WebAVPlayerLayerView_layerClass, "@@:");
+ });
+ return theClass;
</ins><span class="cx"> }
</span><del>-@end
</del><span class="cx">
</span><span class="cx"> WebVideoFullscreenInterfaceAVKit::WebVideoFullscreenInterfaceAVKit()
</span><span class="cx"> : m_playerController(adoptNS([[WebAVPlayerController alloc] init]))
</span><span class="lines">@@ -826,6 +948,9 @@
</span><span class="cx">
</span><span class="cx"> void WebVideoFullscreenInterfaceAVKit::setVideoDimensions(bool hasVideo, float width, float height)
</span><span class="cx"> {
</span><ins>+ WebAVPlayerLayer *playerLayer = (WebAVPlayerLayer *)[m_playerLayerView playerLayer];
+
+ [playerLayer setVideoDimensions:CGSizeMake(width, height)];
</ins><span class="cx"> [m_playerController setHasEnabledVideo:hasVideo];
</span><span class="cx"> [m_playerController setContentDimensions:CGSizeMake(width, height)];
</span><span class="cx"> }
</span><span class="lines">@@ -890,14 +1015,14 @@
</span><span class="cx"> playerController.externalPlaybackAirPlayDeviceLocalizedName = localizedDeviceName;
</span><span class="cx"> playerController.externalPlaybackType = externalPlaybackType;
</span><span class="cx"> playerController.externalPlaybackActive = enabled;
</span><del>- [m_videoLayerContainer.get() setHidden:enabled];
</del><ins>+ [m_playerLayerView setHidden:enabled];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> @interface UIWindow ()
</span><del>--(BOOL)_isHostedInAnotherProcess;
</del><ins>+- (BOOL)_isHostedInAnotherProcess;
</ins><span class="cx"> @end
</span><span class="cx">
</span><del>-void WebVideoFullscreenInterfaceAVKit::setupFullscreen(PlatformLayer& videoLayer, const WebCore::IntRect& initialRect, UIView* parentView, HTMLMediaElementEnums::VideoFullscreenMode mode, bool allowsPictureInPicturePlayback)
</del><ins>+void WebVideoFullscreenInterfaceAVKit::setupFullscreen(UIView& videoView, const WebCore::IntRect& initialRect, UIView* parentView, HTMLMediaElementEnums::VideoFullscreenMode mode, bool allowsPictureInPicturePlayback)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(mode != HTMLMediaElementEnums::VideoFullscreenModeNone);
</span><span class="cx"> LOG(Fullscreen, "WebVideoFullscreenInterfaceAVKit::setupFullscreen(%p)", this);
</span><span class="lines">@@ -906,7 +1031,6 @@
</span><span class="cx">
</span><span class="cx"> [CATransaction begin];
</span><span class="cx"> [CATransaction setDisableActions:YES];
</span><del>- m_videoLayer = &videoLayer;
</del><span class="cx"> m_mode = mode;
</span><span class="cx"> m_parentView = parentView;
</span><span class="cx"> m_parentWindow = parentView.window;
</span><span class="lines">@@ -920,51 +1044,46 @@
</span><span class="cx"> [m_window makeKeyAndVisible];
</span><span class="cx"> }
</span><span class="cx">
</span><del>- [m_videoLayer removeFromSuperlayer];
</del><ins>+ m_playerLayerView = adoptNS([[getWebAVPlayerLayerViewClass() alloc] init]);
+ [m_playerLayerView setHidden:[m_playerController isExternalPlaybackActive]];
+ [m_playerLayerView setBackgroundColor:[getUIColorClass() clearColor]];
+
+ [m_playerLayerView setVideoView:&videoView];
+ [m_playerLayerView addSubview:&videoView];
</ins><span class="cx">
</span><del>- m_layerHostWrapper = adoptNS([[WebCALayerHostWrapper alloc] init]);
- [m_layerHostWrapper setModel:m_videoFullscreenModel];
- [m_layerHostWrapper setVideoSublayer:m_videoLayer.get()];
</del><ins>+ WebAVPlayerLayer *playerLayer = (WebAVPlayerLayer *)[m_playerLayerView playerLayer];
</ins><span class="cx">
</span><del>- m_videoLayerContainer = [WebAVVideoLayer videoLayer];
- [m_videoLayerContainer setHidden:[m_playerController isExternalPlaybackActive]];
- [m_videoLayerContainer setVideoSublayer:m_layerHostWrapper.get()];
</del><ins>+ [playerLayer setModelVideoLayerFrame:CGRectMake(0, 0, initialRect.width(), initialRect.height())];
+ [playerLayer setVideoDimensions:[m_playerController contentDimensions]];
</ins><span class="cx">
</span><del>- CGSize videoSize = [m_playerController contentDimensions];
- CGRect videoRect = CGRectMake(0, 0, videoSize.width, videoSize.height);
- [m_videoLayerContainer setVideoRect:videoRect];
- if (m_videoFullscreenModel)
- m_videoFullscreenModel->setVideoLayerFrame(videoRect);
</del><ins>+ m_playerViewController = adoptNS([allocAVPlayerViewControllerInstance() initWithPlayerLayerView:m_playerLayerView.get()]);
</ins><span class="cx">
</span><del>- // This method has been deprecated so ignore the warning until we port our code to the new API.
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- m_playerViewController = adoptNS([allocAVPlayerViewControllerInstance() initWithVideoLayer:m_videoLayerContainer.get()]);
-#pragma clang diagnostic pop
-
</del><span class="cx"> [m_playerViewController setShowsPlaybackControls:NO];
</span><span class="cx"> [m_playerViewController setPlayerController:(AVPlayerController *)m_playerController.get()];
</span><span class="cx"> [m_playerViewController setDelegate:m_playerController.get()];
</span><span class="cx"> [m_playerViewController setAllowsPictureInPicturePlayback:m_allowsPictureInPicturePlayback];
</span><span class="cx">
</span><del>- [m_videoLayerContainer setPlayerViewController:m_playerViewController.get()];
-
</del><span class="cx"> if (m_viewController) {
</span><span class="cx"> [m_viewController addChildViewController:m_playerViewController.get()];
</span><span class="cx"> [[m_viewController view] addSubview:[m_playerViewController view]];
</span><span class="cx"> } else
</span><del>- [parentView.window addSubview:[m_playerViewController view]];
</del><ins>+ [parentView addSubview:[m_playerViewController view]];
</ins><span class="cx">
</span><del>- [m_playerViewController view].frame = [parentView convertRect:initialRect toView:nil];
</del><ins>+ [m_playerViewController view].frame = [parentView convertRect:initialRect toView:[m_playerViewController view].superview];
</ins><span class="cx">
</span><span class="cx"> [[m_playerViewController view] setBackgroundColor:[getUIColorClass() clearColor]];
</span><ins>+ [[m_playerViewController view] setAutoresizingMask:(UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleRightMargin)];
+
</ins><span class="cx"> [[m_playerViewController view] setNeedsLayout];
</span><span class="cx"> [[m_playerViewController view] layoutIfNeeded];
</span><span class="cx">
</span><span class="cx"> [CATransaction commit];
</span><span class="cx">
</span><del>- if (m_fullscreenChangeObserver)
- m_fullscreenChangeObserver->didSetupFullscreen();
</del><ins>+ RefPtr<WebVideoFullscreenInterfaceAVKit> strongThis(this);
+ dispatch_async(dispatch_get_main_queue(), [strongThis, this] {
+ if (m_fullscreenChangeObserver)
+ m_fullscreenChangeObserver->didSetupFullscreen();
+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebVideoFullscreenInterfaceAVKit::enterFullscreen()
</span><span class="lines">@@ -975,7 +1094,7 @@
</span><span class="cx"> m_exitRequested = false;
</span><span class="cx"> m_enterRequested = true;
</span><span class="cx">
</span><del>- [m_videoLayerContainer setBackgroundColor:[[getUIColorClass() blackColor] CGColor]];
</del><ins>+ [m_playerLayerView setBackgroundColor:[getUIColorClass() blackColor]];
</ins><span class="cx"> if (mode() == HTMLMediaElementEnums::VideoFullscreenModePictureInPicture)
</span><span class="cx"> enterPictureInPicture();
</span><span class="cx"> else if (mode() == HTMLMediaElementEnums::VideoFullscreenModeStandard)
</span><span class="lines">@@ -1019,13 +1138,12 @@
</span><span class="cx">
</span><span class="cx"> LOG(Fullscreen, "WebVideoFullscreenInterfaceAVKit::exitFullscreen(%p)", this);
</span><span class="cx"> [m_playerViewController setShowsPlaybackControls:NO];
</span><del>- if (m_viewController)
- [m_playerViewController view].frame = [m_parentView convertRect:finalRect toView:nil];
- else
- [m_playerViewController view].frame = finalRect;
</del><ins>+
+ [m_playerViewController view].frame = [m_parentView convertRect:finalRect toView:[m_playerViewController view].superview];
</ins><span class="cx">
</span><del>- if ([m_videoLayerContainer videoLayerGravity] != AVVideoLayerGravityResizeAspect)
- [m_videoLayerContainer setVideoLayerGravity:AVVideoLayerGravityResizeAspect];
</del><ins>+ WebAVPlayerLayer *playerLayer = (WebAVPlayerLayer *)[m_playerLayerView playerLayer];
+ if ([playerLayer videoGravity] != getAVLayerVideoGravityResizeAspect())
+ [playerLayer setVideoGravity:getAVLayerVideoGravityResizeAspect()];
</ins><span class="cx"> [[m_playerViewController view] layoutIfNeeded];
</span><span class="cx">
</span><span class="cx"> if (isMode(HTMLMediaElementEnums::VideoFullscreenModePictureInPicture)) {
</span><span class="lines">@@ -1044,22 +1162,24 @@
</span><span class="cx">
</span><span class="cx"> [CATransaction begin];
</span><span class="cx"> [CATransaction setDisableActions:YES];
</span><del>- [m_videoLayerContainer setBackgroundColor:[[getUIColorClass() clearColor] CGColor]];
</del><ins>+ [m_playerLayerView setBackgroundColor:[getUIColorClass() clearColor]];
</ins><span class="cx"> [[m_playerViewController view] setBackgroundColor:[getUIColorClass() clearColor]];
</span><span class="cx"> [CATransaction commit];
</span><span class="cx">
</span><del>- if (m_fullscreenChangeObserver)
- m_fullscreenChangeObserver->didExitFullscreen();
</del><ins>+ dispatch_async(dispatch_get_main_queue(), ^{
+ if (m_fullscreenChangeObserver)
+ m_fullscreenChangeObserver->didExitFullscreen();
+ });
</ins><span class="cx"> }];
</span><span class="cx"> };
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> @interface UIApplication ()
</span><del>--(void)_setStatusBarOrientation:(UIInterfaceOrientation)o;
</del><ins>+- (void)_setStatusBarOrientation:(UIInterfaceOrientation)o;
</ins><span class="cx"> @end
</span><span class="cx">
</span><span class="cx"> @interface UIWindow ()
</span><del>--(UIInterfaceOrientation)interfaceOrientation;
</del><ins>+- (UIInterfaceOrientation)interfaceOrientation;
</ins><span class="cx"> @end
</span><span class="cx">
</span><span class="cx"> void WebVideoFullscreenInterfaceAVKit::cleanupFullscreen()
</span><span class="lines">@@ -1087,16 +1207,10 @@
</span><span class="cx"> if (m_viewController)
</span><span class="cx"> [m_playerViewController removeFromParentViewController];
</span><span class="cx">
</span><del>- [m_videoLayer removeFromSuperlayer];
- [m_videoLayerContainer removeFromSuperlayer];
- [m_videoLayerContainer setPlayerViewController:nil];
</del><ins>+ [m_playerLayerView removeFromSuperview];
</ins><span class="cx"> [[m_viewController view] removeFromSuperview];
</span><span class="cx">
</span><del>- [m_layerHostWrapper setModel:nullptr];
-
- m_layerHostWrapper = nil;
- m_videoLayer = nil;
- m_videoLayerContainer = nil;
</del><ins>+ m_playerLayerView = nil;
</ins><span class="cx"> m_playerViewController = nil;
</span><span class="cx"> m_playerController = nil;
</span><span class="cx"> m_viewController = nil;
</span><span class="lines">@@ -1142,7 +1256,7 @@
</span><span class="cx"> LOG(Fullscreen, "WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline(%p) - visible(%s)", this, boolString(visible));
</span><span class="cx"> if (m_prepareToInlineCallback) {
</span><span class="cx">
</span><del>- [m_playerViewController view].frame = [m_parentView convertRect:inlineRect toView:nil];
</del><ins>+ [m_playerViewController view].frame = [m_parentView convertRect:inlineRect toView:[m_playerViewController view].superview];
</ins><span class="cx">
</span><span class="cx"> std::function<void(bool)> callback = WTF::move(m_prepareToInlineCallback);
</span><span class="cx"> callback(visible);
</span><span class="lines">@@ -1213,7 +1327,7 @@
</span><span class="cx">
</span><span class="cx"> m_exitCompleted = true;
</span><span class="cx">
</span><del>- [m_videoLayerContainer setBackgroundColor:[[getUIColorClass() clearColor] CGColor]];
</del><ins>+ [m_playerLayerView setBackgroundColor:[getUIColorClass() clearColor]];
</ins><span class="cx"> [[m_playerViewController view] setBackgroundColor:[getUIColorClass() clearColor]];
</span><span class="cx">
</span><span class="cx"> clearMode(HTMLMediaElementEnums::VideoFullscreenModePictureInPicture);
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebCoreplatformiosWebVideoFullscreenModelh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenModel.h (187091 => 187092)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenModel.h        2015-07-21 05:27:45 UTC (rev 187091)
+++ branches/safari-601.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenModel.h        2015-07-21 05:27:51 UTC (rev 187092)
</span><span class="lines">@@ -48,10 +48,8 @@
</span><span class="cx"> virtual void endScanning() = 0;
</span><span class="cx"> virtual void requestExitFullscreen() = 0;
</span><span class="cx"> virtual void setVideoLayerFrame(FloatRect) = 0;
</span><del>- virtual FloatRect videoLayerFrame() const = 0;
</del><span class="cx"> enum VideoGravity { VideoGravityResize, VideoGravityResizeAspect, VideoGravityResizeAspectFill };
</span><span class="cx"> virtual void setVideoLayerGravity(VideoGravity) = 0;
</span><del>- virtual VideoGravity videoLayerGravity() const = 0;
</del><span class="cx"> virtual void selectAudioMediaOption(uint64_t index) = 0;
</span><span class="cx"> virtual void selectLegibleMediaOption(uint64_t index) = 0;
</span><span class="cx"> virtual void fullscreenModeChanged(HTMLMediaElementEnums::VideoFullscreenMode) = 0;
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebCoreplatformiosWebVideoFullscreenModelVideoElementh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.h (187091 => 187092)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.h        2015-07-21 05:27:45 UTC (rev 187091)
+++ branches/safari-601.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.h        2015-07-21 05:27:51 UTC (rev 187092)
</span><span class="lines">@@ -72,9 +72,7 @@
</span><span class="cx"> WEBCORE_EXPORT virtual void endScanning() override;
</span><span class="cx"> WEBCORE_EXPORT virtual void requestExitFullscreen() override;
</span><span class="cx"> WEBCORE_EXPORT virtual void setVideoLayerFrame(FloatRect) override;
</span><del>- WEBCORE_EXPORT virtual FloatRect videoLayerFrame() const override;
</del><span class="cx"> WEBCORE_EXPORT virtual void setVideoLayerGravity(VideoGravity) override;
</span><del>- WEBCORE_EXPORT virtual VideoGravity videoLayerGravity() const override;
</del><span class="cx"> WEBCORE_EXPORT virtual void selectAudioMediaOption(uint64_t index) override;
</span><span class="cx"> WEBCORE_EXPORT virtual void selectLegibleMediaOption(uint64_t index) override;
</span><span class="cx"> WEBCORE_EXPORT virtual void fullscreenModeChanged(HTMLMediaElementEnums::VideoFullscreenMode) override;
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebCoreplatformiosWebVideoFullscreenModelVideoElementmm"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.mm (187091 => 187092)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.mm        2015-07-21 05:27:45 UTC (rev 187091)
+++ branches/safari-601.1-branch/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.mm        2015-07-21 05:27:51 UTC (rev 187092)
</span><span class="lines">@@ -254,11 +254,6 @@
</span><span class="cx"> m_videoElement->setVideoFullscreenFrame(rect);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-FloatRect WebVideoFullscreenModelVideoElement::videoLayerFrame() const
-{
- return m_videoFrame;
-}
-
</del><span class="cx"> void WebVideoFullscreenModelVideoElement::setVideoLayerGravity(WebVideoFullscreenModel::VideoGravity gravity)
</span><span class="cx"> {
</span><span class="cx"> MediaPlayer::VideoGravity videoGravity = MediaPlayer::VideoGravityResizeAspect;
</span><span class="lines">@@ -274,21 +269,6 @@
</span><span class="cx"> m_videoElement->setVideoFullscreenGravity(videoGravity);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-WebVideoFullscreenModel::VideoGravity WebVideoFullscreenModelVideoElement::videoLayerGravity() const
-{
- switch (m_videoElement->videoFullscreenGravity()) {
- case MediaPlayer::VideoGravityResize:
- return VideoGravityResize;
- case MediaPlayer::VideoGravityResizeAspect:
- return VideoGravityResizeAspect;
- case MediaPlayer::VideoGravityResizeAspectFill:
- return VideoGravityResizeAspectFill;
- }
-
- ASSERT_NOT_REACHED();
- return VideoGravityResize;
-}
-
</del><span class="cx"> void WebVideoFullscreenModelVideoElement::selectAudioMediaOption(uint64_t selectedAudioIndex)
</span><span class="cx"> {
</span><span class="cx"> AudioTrack* selectedAudioTrack = nullptr;
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebCoreplatformspicocoaAVKitSPIh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebCore/platform/spi/cocoa/AVKitSPI.h (187091 => 187092)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebCore/platform/spi/cocoa/AVKitSPI.h        2015-07-21 05:27:45 UTC (rev 187091)
+++ branches/safari-601.1-branch/Source/WebCore/platform/spi/cocoa/AVKitSPI.h        2015-07-21 05:27:51 UTC (rev 187092)
</span><span class="lines">@@ -34,9 +34,12 @@
</span><span class="cx"> #if USE(APPLE_INTERNAL_SDK)
</span><span class="cx">
</span><span class="cx"> #import <AVKit/AVPlayerController.h>
</span><ins>+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wobjc-property-no-attribute"
+#import <AVKit/AVPlayerLayerView.h>
+#pragma clang diagnostic pop
</ins><span class="cx"> #import <AVKit/AVPlayerViewController_Private.h>
</span><span class="cx"> #import <AVKit/AVPlayerViewController_WebKitOnly.h>
</span><del>-#import <AVKit/AVVideoLayer.h>
</del><span class="cx">
</span><span class="cx"> #else
</span><span class="cx">
</span><span class="lines">@@ -58,19 +61,19 @@
</span><span class="cx"> @property (NS_NONATOMIC_IOSONLY, readonly) AVPlayerControllerStatus status;
</span><span class="cx"> @end
</span><span class="cx">
</span><del>-@protocol AVVideoLayer
-typedef NS_ENUM(NSInteger, AVVideoLayerGravity) {
- AVVideoLayerGravityInvalid = 0,
- AVVideoLayerGravityResizeAspect = 1,
- AVVideoLayerGravityResizeAspectFill = 2,
- AVVideoLayerGravityResize = 3,
-};
-- (void)setPlayerController:(AVPlayerController *)playerController;
-@property (nonatomic) AVVideoLayerGravity videoLayerGravity;
-@property (nonatomic) CGRect videoRect;
-@property (nonatomic, readonly, getter=isReadyForDisplay) BOOL readyForDisplay;
</del><ins>+@class AVPlayerLayer;
+
+@interface AVPictureInPicturePlayerLayerView : UIView
+@property (nonatomic, readonly) AVPlayerLayer *playerLayer;
</ins><span class="cx"> @end
</span><span class="cx">
</span><ins>+@interface AVPlayerLayerView : UIView
+@property (nonatomic, readonly) AVPlayerLayer *playerLayer;
+@property (nonatomic, readonly) AVPictureInPicturePlayerLayerView *pictureInPicturePlayerLayerView;
+- (void)startRoutingVideoToPictureInPicturePlayerLayerView;
+- (void)stopRoutingVideoToPictureInPicturePlayerLayerView;
+@end
+
</ins><span class="cx"> @protocol AVPlayerViewControllerDelegate <NSObject>
</span><span class="cx"> @optional
</span><span class="cx"> typedef NS_ENUM(NSInteger, AVPlayerViewControllerExitFullScreenReason) {
</span><span class="lines">@@ -85,15 +88,15 @@
</span><span class="cx"> @end
</span><span class="cx">
</span><span class="cx"> @interface AVPlayerViewController (Details)
</span><del>-- (instancetype)initWithVideoLayer:(CALayer <AVVideoLayer> *)videoLayer;
</del><ins>+- (instancetype)initWithPlayerLayerView:(AVPlayerLayerView *)playerLayerView;
</ins><span class="cx"> - (void)enterFullScreenAnimated:(BOOL)animated completionHandler:(void (^)(BOOL success, NSError *))completionHandler;
</span><span class="cx"> - (void)exitFullScreenAnimated:(BOOL)animated completionHandler:(void (^)(BOOL success, NSError *))completionHandler;
</span><span class="cx">
</span><span class="cx"> - (BOOL)isPictureInPicturePossible;
</span><span class="cx"> - (void)startPictureInPicture;
</span><span class="cx"> - (void)stopPictureInPicture;
</span><del>-- (void)setAllowsPictureInPicturePlayback:(BOOL)allow;
</del><span class="cx">
</span><ins>+@property (nonatomic) BOOL allowsPictureInPicturePlayback;
</ins><span class="cx"> @property (nonatomic, strong) AVPlayerController *playerController;
</span><span class="cx"> @property (nonatomic, weak) id <AVPlayerViewControllerDelegate> delegate;
</span><span class="cx"> @end
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebCoreplatformspicocoaQuartzCoreSPIh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h (187091 => 187092)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h        2015-07-21 05:27:45 UTC (rev 187091)
+++ branches/safari-601.1-branch/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h        2015-07-21 05:27:51 UTC (rev 187092)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include <QuartzCore/CARenderServer.h>
</span><span class="cx">
</span><span class="cx"> #ifdef __OBJC__
</span><ins>+#import <QuartzCore/CALayerHost.h>
</ins><span class="cx"> #import <QuartzCore/CALayerPrivate.h>
</span><span class="cx">
</span><span class="cx"> // FIXME: As a workaround for <rdar://problem/18985152>, we conditionally enclose the following
</span><span class="lines">@@ -134,6 +135,12 @@
</span><span class="cx"> + (void)addCommitHandler:(void(^)(void))block forPhase:(CATransactionPhase)phase;
</span><span class="cx"> @end
</span><span class="cx"> #endif
</span><ins>+
+@interface CALayerHost : CALayer
+@property uint32_t contextId;
+@property BOOL inheritsSecurity;
+@end
+
</ins><span class="cx"> #endif // __OBJC__
</span><span class="cx">
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebKit2/ChangeLog (187091 => 187092)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebKit2/ChangeLog        2015-07-21 05:27:45 UTC (rev 187091)
+++ branches/safari-601.1-branch/Source/WebKit2/ChangeLog        2015-07-21 05:27:51 UTC (rev 187092)
</span><span class="lines">@@ -1,5 +1,46 @@
</span><span class="cx"> 2015-07-20 Matthew Hanson <matthew_hanson@apple.com>
</span><span class="cx">
</span><ins>+ Merge r187044. rdar://problem/21661808
+
+ 2015-07-20 Jeremy Jones <jeremyj@apple.com>
+
+ Adopt AVPlayerLayerView
+ https://bugs.webkit.org/show_bug.cgi?id=146862
+
+ Reviewed by Simon Fraser.
+
+ The CALayerHost is replaced with WebLayerHostView to be compatible with UIView animations.
+ videoLayerFrame and videoLayerGravity no longer need to be stored because they are stored
+ where they are used in the interface. Some animation is improved in the conversion.
+
+ * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
+ * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
+ (+[WebLayerHostView layerClass]): Add class WebLayerHostView.
+ (-[WebLayerHostView contextID]):
+ (-[WebLayerHostView setContextID:]):
+ (-[WebLayerHostView layerHost]):
+ (WebKit::WebVideoFullscreenManagerProxy::invalidate): layer -> view
+ (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
+ Apply the hostingDeviceScaleFactor transform to -sublayerTransform instead of to
+ -transform. This more directly inverts the tranform WebProcess and allows -transform
+ to be used for animation in the UIProcess. This is important because UIView's actions
+ animate -transform, but not -sublayerTrasform.
+
+ (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen): layer -> view
+ (WebKit::WebVideoFullscreenModelContext::setVideoLayerFrame): Deleted.
+ (WebKit::WebVideoFullscreenModelContext::videoLayerFrame): Deleted.
+ (WebKit::WebVideoFullscreenModelContext::setVideoLayerGravity): Deleted.
+ (WebKit::WebVideoFullscreenModelContext::videoLayerGravity): Deleted.
+ * WebProcess/ios/WebVideoFullscreenManager.mm:
+ (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
+ Set initial video layer frame to fix start point of animation.
+
+ (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
+ dispatch_async allows the CATransaction to complete before continuing with the animation.
+ This prevents a flash during animation.
+
+2015-07-20 Matthew Hanson <matthew_hanson@apple.com>
+
</ins><span class="cx"> Merge r187039. rdar://problem/21474317
</span><span class="cx">
</span><span class="cx"> 2015-07-20 Tim Horton <timothy_horton@apple.com>
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxyh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.h (187091 => 187092)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.h        2015-07-21 05:27:45 UTC (rev 187091)
+++ branches/safari-601.1-branch/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.h        2015-07-21 05:27:51 UTC (rev 187092)
</span><span class="lines">@@ -53,11 +53,9 @@
</span><span class="cx">
</span><span class="cx"> void invalidate() { m_manager = nullptr; }
</span><span class="cx">
</span><del>- PlatformLayer* layerHost() const { return m_layerHost.get(); }
- void setLayerHost(RetainPtr<PlatformLayer>&& layerHost) { m_layerHost = WTF::move(layerHost); }
</del><ins>+ UIView *layerHostView() const { return m_layerHostView.get(); }
+ void setLayerHostView(RetainPtr<UIView>&& layerHostView) { m_layerHostView = WTF::move(layerHostView); }
</ins><span class="cx">
</span><del>- void setInitialVideoLayerFrame(WebCore::FloatRect frame) { m_videoLayerFrame = frame; }
-
</del><span class="cx"> private:
</span><span class="cx"> WebVideoFullscreenModelContext(WebVideoFullscreenManagerProxy& manager, uint64_t contextId)
</span><span class="cx"> : m_manager(&manager)
</span><span class="lines">@@ -78,9 +76,7 @@
</span><span class="cx"> virtual void endScanning() override;
</span><span class="cx"> virtual void requestExitFullscreen() override;
</span><span class="cx"> virtual void setVideoLayerFrame(WebCore::FloatRect) override;
</span><del>- virtual WebCore::FloatRect videoLayerFrame() const override;
</del><span class="cx"> virtual void setVideoLayerGravity(VideoGravity) override;
</span><del>- virtual VideoGravity videoLayerGravity() const override;
</del><span class="cx"> virtual void selectAudioMediaOption(uint64_t) override;
</span><span class="cx"> virtual void selectLegibleMediaOption(uint64_t) override;
</span><span class="cx"> virtual void fullscreenModeChanged(WebCore::HTMLMediaElementEnums::VideoFullscreenMode) override;
</span><span class="lines">@@ -94,9 +90,7 @@
</span><span class="cx">
</span><span class="cx"> WebVideoFullscreenManagerProxy* m_manager;
</span><span class="cx"> uint64_t m_contextId;
</span><del>- RetainPtr<PlatformLayer> m_layerHost;
- WebCore::FloatRect m_videoLayerFrame;
- VideoGravity m_videoLayerGravity { VideoGravityResize };
</del><ins>+ RetainPtr<UIView *> m_layerHostView;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> class WebVideoFullscreenManagerProxy : public RefCounted<WebVideoFullscreenManagerProxy>, private IPC::MessageReceiver {
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxymm"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm (187091 => 187092)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm        2015-07-21 05:27:45 UTC (rev 187091)
+++ branches/safari-601.1-branch/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm        2015-07-21 05:27:51 UTC (rev 187092)
</span><span class="lines">@@ -35,9 +35,34 @@
</span><span class="cx"> #import "WebVideoFullscreenManagerMessages.h"
</span><span class="cx"> #import "WebVideoFullscreenManagerProxyMessages.h"
</span><span class="cx"> #import <QuartzCore/CoreAnimation.h>
</span><ins>+#import <WebCore/QuartzCoreSPI.h>
</ins><span class="cx"> #import <WebCore/TimeRanges.h>
</span><span class="cx"> #import <WebKitSystemInterface.h>
</span><span class="cx">
</span><ins>+@interface WebLayerHostView : UIView
+@property (nonatomic, assign) uint32_t contextID;
+@end
+
+@implementation WebLayerHostView
+
++ (Class)layerClass {
+ return [CALayerHost class];
+}
+
+- (uint32_t)contextID {
+ return [[self layerHost] contextId];
+}
+
+- (void)setContextID:(uint32_t)contextID {
+ [[self layerHost] setContextId:contextID];
+}
+
+- (CALayerHost *)layerHost {
+ return (CALayerHost *)[self layer];
+}
+
+@end
+
</ins><span class="cx"> using namespace WebCore;
</span><span class="cx">
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -139,28 +164,16 @@
</span><span class="cx">
</span><span class="cx"> void WebVideoFullscreenModelContext::setVideoLayerFrame(WebCore::FloatRect frame)
</span><span class="cx"> {
</span><del>- m_videoLayerFrame = frame;
</del><span class="cx"> if (m_manager)
</span><span class="cx"> m_manager->setVideoLayerFrame(m_contextId, frame);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-WebCore::FloatRect WebVideoFullscreenModelContext::videoLayerFrame() const
-{
- return m_videoLayerFrame;
-}
-
</del><span class="cx"> void WebVideoFullscreenModelContext::setVideoLayerGravity(WebCore::WebVideoFullscreenModel::VideoGravity gravity)
</span><span class="cx"> {
</span><del>- m_videoLayerGravity = gravity;
</del><span class="cx"> if (m_manager)
</span><span class="cx"> m_manager->setVideoLayerGravity(m_contextId, gravity);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-WebCore::WebVideoFullscreenModel::VideoGravity WebVideoFullscreenModelContext::videoLayerGravity() const
-{
- return m_videoLayerGravity;
-}
-
</del><span class="cx"> void WebVideoFullscreenModelContext::selectAudioMediaOption(uint64_t optionId)
</span><span class="cx"> {
</span><span class="cx"> if (m_manager)
</span><span class="lines">@@ -240,8 +253,8 @@
</span><span class="cx"> std::tie(model, interface) = tuple;
</span><span class="cx">
</span><span class="cx"> interface->invalidate();
</span><del>- [model->layerHost() removeFromSuperlayer];
- model->setLayerHost(nullptr);
</del><ins>+ [model->layerHostView() removeFromSuperview];
+ model->setLayerHostView(nullptr);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> m_contextMap.clear();
</span><span class="lines">@@ -310,16 +323,17 @@
</span><span class="cx">
</span><span class="cx"> std::tie(model, interface) = ensureModelAndInterface(contextId);
</span><span class="cx">
</span><del>- model->setInitialVideoLayerFrame(initialRect);
- model->setLayerHost(WKMakeRenderLayer(videoLayerID));
</del><ins>+ RetainPtr<WebLayerHostView> view = adoptNS([[WebLayerHostView alloc] init]);
+ [view setContextID:videoLayerID];
+ model->setLayerHostView(view);
</ins><span class="cx"> if (hostingDeviceScaleFactor != 1) {
</span><span class="cx"> // Invert the scale transform added in the WebProcess to fix <rdar://problem/18316542>.
</span><span class="cx"> float inverseScale = 1 / hostingDeviceScaleFactor;
</span><del>- [model->layerHost() setTransform:CATransform3DMakeScale(inverseScale, inverseScale, 1)];
</del><ins>+ [[model->layerHostView() layer] setSublayerTransform:CATransform3DMakeScale(inverseScale, inverseScale, 1)];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> UIView *parentView = downcast<RemoteLayerTreeDrawingAreaProxy>(*m_page->drawingArea()).remoteLayerTreeHost().rootLayer();
</span><del>- interface->setupFullscreen(*model->layerHost(), initialRect, parentView, videoFullscreenMode, allowsPictureInPicture);
</del><ins>+ interface->setupFullscreen(*model->layerHostView(), initialRect, parentView, videoFullscreenMode, allowsPictureInPicture);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebVideoFullscreenManagerProxy::resetMediaState(uint64_t contextId)
</span><span class="lines">@@ -502,8 +516,8 @@
</span><span class="cx"> auto& model = ensureModel(contextId);
</span><span class="cx">
</span><span class="cx"> [CATransaction flush];
</span><del>- [model.layerHost() removeFromSuperlayer];
- model.setLayerHost(nullptr);
</del><ins>+ [model.layerHostView() removeFromSuperview];
+ model.setLayerHostView(nullptr);
</ins><span class="cx"> m_page->send(Messages::WebVideoFullscreenManager::DidCleanupFullscreen(contextId), m_page->pageID());
</span><span class="cx">
</span><span class="cx"> m_contextMap.remove(contextId);
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebKit2WebProcessiosWebVideoFullscreenManagermm"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm (187091 => 187092)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm        2015-07-21 05:27:45 UTC (rev 187091)
+++ branches/safari-601.1-branch/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm        2015-07-21 05:27:51 UTC (rev 187092)
</span><span class="lines">@@ -232,9 +232,13 @@
</span><span class="cx"> RefPtr<WebVideoFullscreenInterfaceContext> interface;
</span><span class="cx"> std::tie(model, interface) = ensureModelAndInterface(contextId);
</span><span class="cx">
</span><ins>+ FloatRect clientRect = clientRectForElement(&videoElement);
+ FloatRect videoLayerFrame = FloatRect(0, 0, clientRect.width(), clientRect.height());
+
</ins><span class="cx"> interface->setTargetIsFullscreen(true);
</span><span class="cx"> interface->setFullscreenMode(mode);
</span><span class="cx"> model->setVideoElement(&videoElement);
</span><ins>+ model->setVideoLayerFrame(videoLayerFrame);
</ins><span class="cx">
</span><span class="cx"> if (interface->isAnimating())
</span><span class="cx"> return;
</span><span class="lines">@@ -428,7 +432,10 @@
</span><span class="cx">
</span><span class="cx"> [CATransaction commit];
</span><span class="cx">
</span><del>- m_page->send(Messages::WebVideoFullscreenManagerProxy::EnterFullscreen(contextId), m_page->pageID());
</del><ins>+ RefPtr<WebVideoFullscreenManager> strongThis(this);
+ dispatch_async(dispatch_get_main_queue(), [strongThis, this, contextId] {
+ m_page->send(Messages::WebVideoFullscreenManagerProxy::EnterFullscreen(contextId), m_page->pageID());
+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebVideoFullscreenManager::didEnterFullscreen(uint64_t contextId)
</span></span></pre>
</div>
</div>
</body>
</html>