Title: [153628] trunk
Revision
153628
Author
[email protected]
Date
2013-08-01 17:07:03 -0700 (Thu, 01 Aug 2013)

Log Message

[Windows] WebKit1 Fullscreen Video Play is Broken
https://bugs.webkit.org/show_bug.cgi?id=119415

Reviewed by Jer Noble.

Source/WebCore: 

* platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h: Add
call for ACFPlayerLayerSetFrame
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::platformSetVisible):
Tear down video player when leaving Fullscreen mode and not using
the newer Fullscreen feature.
(WebCore::AVFWrapper::disconnectAndDeleteAVFWrapper):
Disconnect from notifications for AVCFPlayerItemPresentationSizeChangedNotification,
AVCFPlayerItemDuratoinChangedNotification, and disconnect any
LegibleOutput items added to the player item.
(WebCore::AVFWrapper::createPlayerItem): Add notifications for
AVCFPlayerItemPresentationSizeChanged. 
(WebCore::LayerClient::platformCALayerLayoutSublayersOfLayer): Notify
the AVCFPLayerLayer when the display size has changed.
* platform/graphics/ca/win/CACFLayerTreeHost.h:
(WebCore::CACFLayerTreeHost::manualCreateRenderer): Added.
* platform/graphics/ca/win/WKCACFViewLayerTreeHost.h:
(WebCore::WKCACFViewLayerTreeHost::manualCreateRenderer): Added.
* platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp:
(WebCore::MediaPlayerPrivateFullscreenWindow::createWindow): Minor
cleanups.
(WebCore::MediaPlayerPrivateFullscreenWindow::setRootChildLayer):
Make sure a Direct3D renderer is created when building the full screen
window for Video playback.

Source/WebKit/win: 

* WebPreferences.cpp:
(WebPreferences::initializeDefaultSettings): Set accelerated
rendering on by default on systems that support it.
* WebView.cpp:
(WebView::exitFullscreen): Clean up Fullscreen video controller
once it is no longer used. This was preventing users from being
able to reenter Fullscreen mode after leaving it.
(WebView::fullScreenClientForceRepaint): Change assert to
match the member actually being used in the method.

Tools: 

* WinLauncher/WinLauncher.cpp:
(dllLauncherEntryPoint): Activate full screen mode via
IWebPreferencesInternal interface.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (153627 => 153628)


--- trunk/Source/WebCore/ChangeLog	2013-08-02 00:02:25 UTC (rev 153627)
+++ trunk/Source/WebCore/ChangeLog	2013-08-02 00:07:03 UTC (rev 153628)
@@ -1,3 +1,35 @@
+2013-08-01  Brent Fulgham  <[email protected]>
+
+        [Windows] WebKit1 Fullscreen Video Play is Broken
+        https://bugs.webkit.org/show_bug.cgi?id=119415
+
+        Reviewed by Jer Noble.
+
+        * platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h: Add
+        call for ACFPlayerLayerSetFrame
+        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+        (WebCore::MediaPlayerPrivateAVFoundationCF::platformSetVisible):
+        Tear down video player when leaving Fullscreen mode and not using
+        the newer Fullscreen feature.
+        (WebCore::AVFWrapper::disconnectAndDeleteAVFWrapper):
+        Disconnect from notifications for AVCFPlayerItemPresentationSizeChangedNotification,
+        AVCFPlayerItemDuratoinChangedNotification, and disconnect any
+        LegibleOutput items added to the player item.
+        (WebCore::AVFWrapper::createPlayerItem): Add notifications for
+        AVCFPlayerItemPresentationSizeChanged. 
+        (WebCore::LayerClient::platformCALayerLayoutSublayersOfLayer): Notify
+        the AVCFPLayerLayer when the display size has changed.
+        * platform/graphics/ca/win/CACFLayerTreeHost.h:
+        (WebCore::CACFLayerTreeHost::manualCreateRenderer): Added.
+        * platform/graphics/ca/win/WKCACFViewLayerTreeHost.h:
+        (WebCore::WKCACFViewLayerTreeHost::manualCreateRenderer): Added.
+        * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp:
+        (WebCore::MediaPlayerPrivateFullscreenWindow::createWindow): Minor
+        cleanups.
+        (WebCore::MediaPlayerPrivateFullscreenWindow::setRootChildLayer):
+        Make sure a Direct3D renderer is created when building the full screen
+        window for Video playback.
+
 2013-08-01  Dean Jackson  <[email protected]>
 
         srcset algorithm breaks base64 src attributes

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h (153627 => 153628)


--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h	2013-08-02 00:02:25 UTC (rev 153627)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h	2013-08-02 00:07:03 UTC (rev 153628)
@@ -186,6 +186,9 @@
 SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerLayerIsReadyForDisplay, Boolean, __cdecl, (AVCFPlayerLayerRef playerLayer), (playerLayer))
 #define AVCFPlayerLayerIsReadyForDisplay softLink_AVCFPlayerLayerIsReadyForDisplay
 
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerLayerSetFrame, void, __cdecl, (AVCFPlayerLayerRef playerLayer, CGRect rect), (playerLayer, rect))
+#define AVCFPlayerLayerSetFrame softLink_AVCFPlayerLayerSetFrame
+
 SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerLayerSetPlayer, void, __cdecl, (AVCFPlayerLayerRef playerLayer, AVCFPlayerRef player), (playerLayer, player))
 #define AVCFPlayerLayerSetPlayer softLink_AVCFPlayerLayerSetPlayer
 

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (153627 => 153628)


--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp	2013-08-02 00:02:25 UTC (rev 153627)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp	2013-08-02 00:07:03 UTC (rev 153628)
@@ -480,6 +480,8 @@
     // whether we're affected by the same issue.
     setDelayCallbacks(true);
     m_avfWrapper->setVideoLayerHidden(!isVisible);    
+    if (!isVisible)
+        tearDownVideoRendering();
     setDelayCallbacks(false);
 }
 
@@ -1225,9 +1227,11 @@
         CFNotificationCenterRemoveObserver(center, avfWrapper->callbackContext(), AVCFPlayerItemTracksChangedNotification, avfWrapper->avPlayerItem());
         CFNotificationCenterRemoveObserver(center, avfWrapper->callbackContext(), AVCFPlayerItemSeekableTimeRangesChangedNotification, avfWrapper->avPlayerItem());
         CFNotificationCenterRemoveObserver(center, avfWrapper->callbackContext(), AVCFPlayerItemLoadedTimeRangesChangedNotification, avfWrapper->avPlayerItem());
+        CFNotificationCenterRemoveObserver(center, avfWrapper->callbackContext(), AVCFPlayerItemPresentationSizeChangedNotification, avfWrapper->avPlayerItem());
         CFNotificationCenterRemoveObserver(center, avfWrapper->callbackContext(), AVCFPlayerItemIsPlaybackLikelyToKeepUpChangedNotification, avfWrapper->avPlayerItem());
         CFNotificationCenterRemoveObserver(center, avfWrapper->callbackContext(), AVCFPlayerItemIsPlaybackBufferEmptyChangedNotification, avfWrapper->avPlayerItem());
         CFNotificationCenterRemoveObserver(center, avfWrapper->callbackContext(), AVCFPlayerItemIsPlaybackBufferFullChangedNotification, avfWrapper->avPlayerItem());
+        CFNotificationCenterRemoveObserver(center, avfWrapper->callbackContext(), AVCFPlayerItemDurationChangedNotification, avfWrapper->avPlayerItem());
         CFNotificationCenterRemoveObserver(center, avfWrapper->callbackContext(), CACFContextNeedsFlushNotification(), 0);
     }
 
@@ -1238,6 +1242,10 @@
         CFNotificationCenterRemoveObserver(CFNotificationCenterGetLocalCenter(), avfWrapper->callbackContext(), AVCFPlayerRateChangedNotification, avfWrapper->avPlayer());
     }
 
+#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP) && HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT)
+    AVCFPlayerItemRemoveOutput(avfWrapper->avPlayerItem(), avfWrapper->legibleOutput());
+#endif
+
     delete avfWrapper;
 }
 
@@ -1308,11 +1316,12 @@
     CFNotificationCenterAddObserver(center, callbackContext(), notificationCallback, AVCFPlayerItemTracksChangedNotification, itemRef, CFNotificationSuspensionBehaviorDeliverImmediately);
     CFNotificationCenterAddObserver(center, callbackContext(), notificationCallback, AVCFPlayerItemSeekableTimeRangesChangedNotification, itemRef, CFNotificationSuspensionBehaviorDeliverImmediately);
     CFNotificationCenterAddObserver(center, callbackContext(), notificationCallback, AVCFPlayerItemLoadedTimeRangesChangedNotification, itemRef, CFNotificationSuspensionBehaviorDeliverImmediately);
+    CFNotificationCenterAddObserver(center, callbackContext(), notificationCallback, AVCFPlayerItemPresentationSizeChangedNotification, itemRef, CFNotificationSuspensionBehaviorDeliverImmediately);
     CFNotificationCenterAddObserver(center, callbackContext(), notificationCallback, AVCFPlayerItemIsPlaybackLikelyToKeepUpChangedNotification, itemRef, CFNotificationSuspensionBehaviorDeliverImmediately);
     CFNotificationCenterAddObserver(center, callbackContext(), notificationCallback, AVCFPlayerItemIsPlaybackBufferEmptyChangedNotification, itemRef, CFNotificationSuspensionBehaviorDeliverImmediately);
     CFNotificationCenterAddObserver(center, callbackContext(), notificationCallback, AVCFPlayerItemIsPlaybackBufferFullChangedNotification, itemRef, CFNotificationSuspensionBehaviorDeliverImmediately);
     CFNotificationCenterAddObserver(center, callbackContext(), notificationCallback, AVCFPlayerItemDurationChangedNotification, itemRef, CFNotificationSuspensionBehaviorDeliverImmediately);
-    // FIXME: Are there other legible output things we need to register for? asset, hasEnabledAudio?
+    // FIXME: Are there other legible output things we need to register for? asset and hasEnabledAudio are not exposed by AVCF
 
     CFNotificationCenterAddObserver(center, callbackContext(), notificationCallback, CACFContextNeedsFlushNotification(), 0, CFNotificationSuspensionBehaviorDeliverImmediately);
 
@@ -1651,6 +1660,8 @@
 
     CACFLayerSetPosition(m_parent->caVideoLayer(), position);
     CACFLayerSetBounds(m_parent->caVideoLayer(), bounds);
+
+    AVCFPlayerLayerSetFrame(m_parent->videoLayer(), CGRectMake(0, 0, bounds.size.width, bounds.size.height));
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h (153627 => 153628)


--- trunk/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h	2013-08-02 00:02:25 UTC (rev 153627)
+++ trunk/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h	2013-08-02 00:07:03 UTC (rev 153628)
@@ -74,6 +74,8 @@
     virtual GraphicsDeviceAdapter* graphicsDeviceAdapter() const { return 0; }
 #endif
 
+    virtual bool createRenderer() = 0;
+
     // AbstractCACFLayerTreeHost
     virtual void flushPendingLayerChangesNow();
 
@@ -87,7 +89,6 @@
     // AbstractCACFLayerTreeHost
     virtual PlatformCALayer* rootLayer() const;
 
-    virtual bool createRenderer() = 0;
     virtual void destroyRenderer();
     virtual void contextDidChange();
 

Modified: trunk/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.h (153627 => 153628)


--- trunk/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.h	2013-08-02 00:02:25 UTC (rev 153627)
+++ trunk/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.h	2013-08-02 00:07:03 UTC (rev 153628)
@@ -38,6 +38,8 @@
 public:
     static PassRefPtr<WKCACFViewLayerTreeHost> create();
 
+    virtual bool createRenderer();
+
 private:
     WKCACFViewLayerTreeHost();
 
@@ -46,7 +48,6 @@
 
     virtual void initializeContext(void* userData, PlatformCALayer*);
     virtual void resize();
-    virtual bool createRenderer();
     virtual void destroyRenderer();
     virtual void flushContext();
     virtual void contextDidChange();

Modified: trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp (153627 => 153628)


--- trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp	2013-08-02 00:02:25 UTC (rev 153627)
+++ trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp	2013-08-02 00:07:03 UTC (rev 153628)
@@ -62,7 +62,7 @@
     static LPCWSTR windowClassName = L"MediaPlayerPrivateFullscreenWindowClass";
     if (!windowAtom) {
         WNDCLASSEX wcex = {0};
-        wcex.cbSize = sizeof(WNDCLASSEX);
+        wcex.cbSize = sizeof(wcex);
         wcex.style = CS_HREDRAW | CS_VREDRAW;
         wcex.lpfnWndProc = staticWndProc;
         wcex.hInstance = instanceHandle();
@@ -81,7 +81,7 @@
     
     ::CreateWindowExW(WS_EX_TOOLWINDOW, windowClassName, L"", WS_POPUP, 
         monitorRect.x(), monitorRect.y(), monitorRect.width(), monitorRect.height(),
-        parentHwnd, 0, WebCore::instanceHandle(), this);
+        parentHwnd, 0, instanceHandle(), this);
     ASSERT(IsWindow(m_hwnd));
 
 #if USE(ACCELERATED_COMPOSITING)
@@ -110,8 +110,10 @@
 
     if (!m_layerTreeHost) {
         m_layerTreeHost = CACFLayerTreeHost::create();
-        if (m_hwnd)
+        if (m_hwnd) {
             m_layerTreeHost->setWindow(m_hwnd);
+            m_layerTreeHost->createRenderer();
+        }
     }
 
     m_layerTreeHost->setRootChildLayer(m_rootChild.get());

Modified: trunk/Source/WebKit/win/ChangeLog (153627 => 153628)


--- trunk/Source/WebKit/win/ChangeLog	2013-08-02 00:02:25 UTC (rev 153627)
+++ trunk/Source/WebKit/win/ChangeLog	2013-08-02 00:07:03 UTC (rev 153628)
@@ -1,3 +1,20 @@
+2013-08-01  Brent Fulgham  <[email protected]>
+
+        [Windows] WebKit1 Fullscreen Video Play is Broken
+        https://bugs.webkit.org/show_bug.cgi?id=119415
+
+        Reviewed by Jer Noble.
+
+        * WebPreferences.cpp:
+        (WebPreferences::initializeDefaultSettings): Set accelerated
+        rendering on by default on systems that support it.
+        * WebView.cpp:
+        (WebView::exitFullscreen): Clean up Fullscreen video controller
+        once it is no longer used. This was preventing users from being
+        able to reenter Fullscreen mode after leaving it.
+        (WebView::fullScreenClientForceRepaint): Change assert to
+        match the member actually being used in the method.
+
 2013-08-01  Patrick Gansterer  <[email protected]>
 
         Rearrange the code of FrameWin

Modified: trunk/Source/WebKit/win/WebPreferences.cpp (153627 => 153628)


--- trunk/Source/WebKit/win/WebPreferences.cpp	2013-08-02 00:02:25 UTC (rev 153627)
+++ trunk/Source/WebKit/win/WebPreferences.cpp	2013-08-02 00:07:03 UTC (rev 153628)
@@ -261,8 +261,12 @@
 
     CFDictionaryAddValue(defaults, CFSTR(WebKitUseHighResolutionTimersPreferenceKey), kCFBooleanTrue);
 
+#if USE(CG)
+    CFDictionaryAddValue(defaults, CFSTR(WebKitAcceleratedCompositingEnabledPreferenceKey), kCFBooleanTrue);
+#else
     CFDictionaryAddValue(defaults, CFSTR(WebKitAcceleratedCompositingEnabledPreferenceKey), kCFBooleanFalse);
-    
+#endif
+
     CFDictionaryAddValue(defaults, CFSTR(WebKitShowDebugBordersPreferenceKey), kCFBooleanFalse);
 
     CFDictionaryAddValue(defaults, CFSTR(WebKitDNSPrefetchingEnabledPreferenceKey), kCFBooleanFalse);
@@ -274,6 +278,8 @@
 
     CFDictionaryAddValue(defaults, CFSTR(WebKitRequestAnimationFrameEnabledPreferenceKey), kCFBooleanTrue);
 
+    CFDictionaryAddValue(defaults, CFSTR(WebKitFullScreenEnabledPreferenceKey), kCFBooleanFalse);
+
     defaultSettings = defaults;
 }
 

Modified: trunk/Source/WebKit/win/WebView.cpp (153627 => 153628)


--- trunk/Source/WebKit/win/WebView.cpp	2013-08-02 00:02:25 UTC (rev 153627)
+++ trunk/Source/WebKit/win/WebView.cpp	2013-08-02 00:07:03 UTC (rev 153628)
@@ -6287,9 +6287,11 @@
 void WebView::exitFullscreen()
 {
 #if ENABLE(VIDEO)
-    if (m_fullScreenVideoController)
-        m_fullScreenVideoController->exitFullscreen();
+    if (!m_fullScreenVideoController)
+        return;
     
+    m_fullScreenVideoController->exitFullscreen();
+    m_fullScreenVideoController = nullptr;
 #endif
 }
 
@@ -6924,7 +6926,7 @@
 
 void WebView::fullScreenClientForceRepaint()
 {
-    ASSERT(m_fullScreenElement);
+    ASSERT(m_fullscreenController);
     RECT windowRect = {0};
     frameRect(&windowRect);
     repaint(windowRect, true /*contentChanged*/, true /*immediate*/, false /*contentOnly*/);

Modified: trunk/Tools/ChangeLog (153627 => 153628)


--- trunk/Tools/ChangeLog	2013-08-02 00:02:25 UTC (rev 153627)
+++ trunk/Tools/ChangeLog	2013-08-02 00:07:03 UTC (rev 153628)
@@ -1,3 +1,14 @@
+2013-08-01  Brent Fulgham  <[email protected]>
+
+        [Windows] WebKit1 Fullscreen Video Play is Broken
+        https://bugs.webkit.org/show_bug.cgi?id=119415
+
+        Reviewed by Jer Noble.
+
+        * WinLauncher/WinLauncher.cpp:
+        (dllLauncherEntryPoint): Activate full screen mode via
+        IWebPreferencesInternal interface.
+
 2013-08-01  ChangSeok Oh  <[email protected]>
 
         Unreviewed. Add an alternative address to show my affiliation in team.html.

Modified: trunk/Tools/WinLauncher/WinLauncher.cpp (153627 => 153628)


--- trunk/Tools/WinLauncher/WinLauncher.cpp	2013-08-02 00:02:25 UTC (rev 153627)
+++ trunk/Tools/WinLauncher/WinLauncher.cpp	2013-08-02 00:07:03 UTC (rev 153628)
@@ -357,7 +357,12 @@
     standardPreferences->setAcceleratedCompositingEnabled(TRUE);
     standardPreferences->setAVFoundationEnabled(TRUE);
 
-    HRESULT hr = WebKitCreateInstance(CLSID_WebView, 0, IID_IWebView, reinterpret_cast<void**>(&gWebView));
+    IWebPreferencesPrivate* prefsPrivate = 0;
+    HRESULT hr = standardPreferences->QueryInterface(IID_IWebPreferencesPrivate, reinterpret_cast<void**>(&prefsPrivate));
+    if (SUCCEEDED(hr))
+        prefsPrivate->setFullScreenEnabled(TRUE);
+
+    hr = WebKitCreateInstance(CLSID_WebView, 0, IID_IWebView, reinterpret_cast<void**>(&gWebView));
     if (FAILED(hr))
         goto exit;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to