Title: [184764] branches/safari-601.1.32.2-branch/Source/WebCore

Diff

Modified: branches/safari-601.1.32.2-branch/Source/WebCore/ChangeLog (184763 => 184764)


--- branches/safari-601.1.32.2-branch/Source/WebCore/ChangeLog	2015-05-22 08:00:46 UTC (rev 184763)
+++ branches/safari-601.1.32.2-branch/Source/WebCore/ChangeLog	2015-05-22 08:01:38 UTC (rev 184764)
@@ -1,5 +1,39 @@
 2015-05-22  Babak Shafiei  <[email protected]>
 
+        Merge r184760.
+
+    2015-05-21  Jer Noble  <[email protected]>
+
+            [iOS] Tell AVPlayerLayer when we enter optimized fullscreen mode.
+            https://bugs.webkit.org/show_bug.cgi?id=145289
+
+            Reviewed by Eric Carlson.
+
+            AVFoundation would normally already know that its AVPlayerLayer is in optimized
+            fullscreen mode, but because of the WebProcess/UIProcess split, they need to be
+            told explicitly in the WebProcess when the UIProcess enters optimized fullscreen
+            mode.
+
+            * html/HTMLMediaElement.h:
+            * html/HTMLVideoElement.cpp:
+            (WebCore::HTMLVideoElement::fullscreenModeChanged): Pass to private().
+            * platform/graphics/MediaPlayer.cpp:
+            (WebCore::MediaPlayer::setVideoFullscreenMode): Pass to m_private.
+            (WebCore::MediaPlayer::fullscreenMode): Pass to m_client.
+            * platform/graphics/MediaPlayer.h:
+            (WebCore::MediaPlayerClient::mediaPlayerFullscreenMode): Default implementation returns None.
+            * platform/graphics/MediaPlayerPrivate.h:
+            (WebCore::MediaPlayerPrivateInterface::setVideoFullscreenMode): Default implementation is a no-op.
+            * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
+            * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+            (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): Get the fullscreen
+                mode from MediaPlayer and tell the AVPlayerLayer if the mode is optimized.
+            (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode):
+                Ditto.
+            * platform/spi/mac/AVFoundationSPI.h:
+
+2015-05-22  Babak Shafiei  <[email protected]>
+
         Merge r184670.
 
     2015-05-19  Jer Noble  <[email protected]>

Modified: branches/safari-601.1.32.2-branch/Source/WebCore/html/HTMLMediaElement.h (184763 => 184764)


--- branches/safari-601.1.32.2-branch/Source/WebCore/html/HTMLMediaElement.h	2015-05-22 08:00:46 UTC (rev 184763)
+++ branches/safari-601.1.32.2-branch/Source/WebCore/html/HTMLMediaElement.h	2015-05-22 08:01:38 UTC (rev 184764)
@@ -578,6 +578,7 @@
     virtual void mediaPlayerEngineFailedToLoad() const override final;
 
     virtual double mediaPlayerRequestedPlaybackRate() const override final;
+    virtual VideoFullscreenMode mediaPlayerFullscreenMode() const override final { return fullscreenMode(); }
 
     void pendingActionTimerFired();
     void progressEventTimerFired();

Modified: branches/safari-601.1.32.2-branch/Source/WebCore/html/HTMLVideoElement.cpp (184763 => 184764)


--- branches/safari-601.1.32.2-branch/Source/WebCore/html/HTMLVideoElement.cpp	2015-05-22 08:00:46 UTC (rev 184763)
+++ branches/safari-601.1.32.2-branch/Source/WebCore/html/HTMLVideoElement.cpp	2015-05-22 08:01:38 UTC (rev 184764)
@@ -419,6 +419,9 @@
         scheduleEvent(eventNames().webkitpresentationmodechangedEvent);
     }
 
+    if (player())
+        player()->setVideoFullscreenMode(mode);
+
     HTMLMediaElement::fullscreenModeChanged(mode);
 }
 

Modified: branches/safari-601.1.32.2-branch/Source/WebCore/platform/graphics/MediaPlayer.cpp (184763 => 184764)


--- branches/safari-601.1.32.2-branch/Source/WebCore/platform/graphics/MediaPlayer.cpp	2015-05-22 08:00:46 UTC (rev 184763)
+++ branches/safari-601.1.32.2-branch/Source/WebCore/platform/graphics/MediaPlayer.cpp	2015-05-22 08:01:38 UTC (rev 184764)
@@ -620,6 +620,16 @@
     m_private->setVideoFullscreenGravity(gravity);
 }
 
+void MediaPlayer::setVideoFullscreenMode(MediaPlayer::VideoFullscreenMode mode)
+{
+    m_private->setVideoFullscreenMode(mode);
+}
+
+MediaPlayer::VideoFullscreenMode MediaPlayer::fullscreenMode() const
+{
+    return m_client.mediaPlayerFullscreenMode();
+}
+
 NSArray* MediaPlayer::timedMetadata() const
 {
     return m_private->timedMetadata();

Modified: branches/safari-601.1.32.2-branch/Source/WebCore/platform/graphics/MediaPlayer.h (184763 => 184764)


--- branches/safari-601.1.32.2-branch/Source/WebCore/platform/graphics/MediaPlayer.h	2015-05-22 08:00:46 UTC (rev 184763)
+++ branches/safari-601.1.32.2-branch/Source/WebCore/platform/graphics/MediaPlayer.h	2015-05-22 08:01:38 UTC (rev 184764)
@@ -276,6 +276,7 @@
     virtual void mediaPlayerEngineFailedToLoad() const { }
 
     virtual double mediaPlayerRequestedPlaybackRate() const { return 0; }
+    virtual MediaPlayerEnums::VideoFullscreenMode mediaPlayerFullscreenMode() const { return MediaPlayerEnums::VideoFullscreenModeNone; }
 };
 
 class MediaPlayerSupportsTypeClient {
@@ -314,6 +315,8 @@
     void setVideoFullscreenFrame(FloatRect);
     using MediaPlayerEnums::VideoGravity;
     void setVideoFullscreenGravity(VideoGravity);
+    void setVideoFullscreenMode(VideoFullscreenMode);
+    VideoFullscreenMode fullscreenMode() const;
 
     NSArray *timedMetadata() const;
     String accessLog() const;

Modified: branches/safari-601.1.32.2-branch/Source/WebCore/platform/graphics/MediaPlayerPrivate.h (184763 => 184764)


--- branches/safari-601.1.32.2-branch/Source/WebCore/platform/graphics/MediaPlayerPrivate.h	2015-05-22 08:00:46 UTC (rev 184763)
+++ branches/safari-601.1.32.2-branch/Source/WebCore/platform/graphics/MediaPlayerPrivate.h	2015-05-22 08:01:38 UTC (rev 184764)
@@ -61,6 +61,7 @@
     virtual void setVideoFullscreenLayer(PlatformLayer*) { }
     virtual void setVideoFullscreenFrame(FloatRect) { }
     virtual void setVideoFullscreenGravity(MediaPlayer::VideoGravity) { }
+    virtual void setVideoFullscreenMode(MediaPlayer::VideoFullscreenMode) { }
 
     virtual NSArray *timedMetadata() const { return 0; }
     virtual String accessLog() const { return emptyString(); }

Modified: branches/safari-601.1.32.2-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h (184763 => 184764)


--- branches/safari-601.1.32.2-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h	2015-05-22 08:00:46 UTC (rev 184763)
+++ branches/safari-601.1.32.2-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h	2015-05-22 08:01:38 UTC (rev 184764)
@@ -159,6 +159,7 @@
     virtual void setVideoFullscreenLayer(PlatformLayer*);
     virtual void setVideoFullscreenFrame(FloatRect);
     virtual void setVideoFullscreenGravity(MediaPlayer::VideoGravity);
+    virtual void setVideoFullscreenMode(MediaPlayer::VideoFullscreenMode) override;
 
     virtual NSArray *timedMetadata() const override;
     virtual String accessLog() const;

Modified: branches/safari-601.1.32.2-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (184763 => 184764)


--- branches/safari-601.1.32.2-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2015-05-22 08:00:46 UTC (rev 184763)
+++ branches/safari-601.1.32.2-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2015-05-22 08:01:38 UTC (rev 184764)
@@ -693,6 +693,8 @@
         [m_videoInlineLayer insertSublayer:m_videoLayer.get() atIndex:0];
         [m_videoLayer setFrame:m_videoInlineLayer.get().bounds];
     }
+    if ([m_videoLayer respondsToSelector:@selector(setEnterOptimizedFullscreenModeEnabled:)])
+        [m_videoLayer setEnterOptimizedFullscreenModeEnabled:(player()->fullscreenMode() & MediaPlayer::VideoFullscreenModeOptimized)];
 #else
     [m_videoLayer setFrame:CGRectMake(0, 0, defaultSize.width(), defaultSize.height())];
 #endif
@@ -1182,6 +1184,12 @@
     [m_videoLayer setVideoGravity:videoGravity];
 }
 
+void MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode(MediaPlayer::VideoFullscreenMode mode)
+{
+    if (m_videoLayer && [m_videoLayer respondsToSelector:@selector(setEnterOptimizedFullscreenModeEnabled:)])
+        [m_videoLayer setEnterOptimizedFullscreenModeEnabled:(mode & MediaPlayer::VideoFullscreenModeOptimized)];
+}
+
 NSArray *MediaPlayerPrivateAVFoundationObjC::timedMetadata() const
 {
     if (m_currentMetaData)

Modified: branches/safari-601.1.32.2-branch/Source/WebCore/platform/spi/mac/AVFoundationSPI.h (184763 => 184764)


--- branches/safari-601.1.32.2-branch/Source/WebCore/platform/spi/mac/AVFoundationSPI.h	2015-05-22 08:00:46 UTC (rev 184763)
+++ branches/safari-601.1.32.2-branch/Source/WebCore/platform/spi/mac/AVFoundationSPI.h	2015-05-22 08:01:38 UTC (rev 184764)
@@ -49,4 +49,19 @@
 
 #endif
 
+#endif // ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
+
+#if PLATFORM(IOS)
+
+#if USE(APPLE_INTERNAL_SDK)
+#import <AVKit/AVPlayerViewController_WebKitOnly.h>
 #endif
+
+#import <AVFoundation/AVPlayerLayer.h>
+
+@interface AVPlayerLayer (AVPlayerLayerOptimizedFullscreenModeSupportPrivate)
+- (void)setEnterOptimizedFullscreenModeEnabled:(BOOL)flag;
+@end
+
+#endif
+
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to