Enable AVCF hardware video decoding
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 15 Jul 2012 02:19:00 +0000 (02:19 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 15 Jul 2012 02:19:00 +0000 (02:19 +0000)
commit3668481c0faafdecd3e93aad5c0b41818f2131bc
treee513bd24e143c68e2ec5d60de7578f9349f217a2
parentff0b52ed2cbefeceb9a0eafc0125f3cdb45c56a6
Enable AVCF hardware video decoding
https://bugs.webkit.org/show_bug.cgi?id=90015
<rdar://problem/10770317>

Reviewed by Anders Carlsson.

Source/WebCore:

* html/HTMLMediaElement.cpp:
(WebCore):
(WebCore::HTMLMediaElement::mediaPlayerGraphicsDeviceAdapter): New, return the client's graphics
    device adapter.
* html/HTMLMediaElement.h:

* page/ChromeClient.h:
(WebCore::ChromeClient::graphicsDeviceAdapter): New.

* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::graphicsDeviceAdapter): New, ask the media element for the graphics
    device adapter.
* platform/graphics/MediaPlayer.h:

* platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h: Soft-link AVCFPlayerSetDirect3DDevice
    and AVCFPlayerEnableHardwareAcceleratedVideoDecoderKey.

* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::createAVAssetForURL): Pass the current d3d9
    device interface to the AVFWrapper.
(WebCore::AVFWrapper::createAssetForURL): If the d3d9 device implements IDirect3DDevice9Ex,
    tell the AVAsset to enable hardware video decoding.
(WebCore::AVFWrapper::createPlayer): Pass the d3d9 device to the player if it implements IDirect3DDevice9Ex.

* platform/graphics/ca/win/CACFLayerTreeHost.h:
(WebCore::CACFLayerTreeHost::graphicsDeviceAdapter): New, default implementation.

* platform/graphics/ca/win/LegacyCACFLayerTreeHost.h:
(WebCore::LegacyCACFLayerTreeHost::graphicsDeviceAdapter): New, default implementation.
* platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
(WebCore::WKCACFViewLayerTreeHost::graphicsDeviceAdapter): New.
* platform/graphics/ca/win/WKCACFViewLayerTreeHost.h:

* platform/win/SoftLinking.h: Define SOFT_LINK_DLL_IMPORT_OPTIONAL, SOFT_LINK_LOADED_LIBRARY,
    and SOFT_LINK_VARIABLE_DLL_IMPORT_OPTIONAL.

Source/WebKit/win:

* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::graphicsDeviceAdapter): New, return the view's graphics adapter.
* WebCoreSupport/WebChromeClient.h:
(WebChromeClient):

* WebView.cpp:
(WebView::graphicsDeviceAdapter): New, return the layer tree host's graphics adapter.
* WebView.h:
(WebCore):
(WebView):

Source/WebKit2:

* DerivedSources.make: Define HAVE_AVCF if necessary.

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit):
(WebKit::WebChromeClient::graphicsDeviceAdapter): New, return the layer tree host's
    graphics adapter.
* WebProcess/WebCoreSupport/WebChromeClient.h:
(WebChromeClient):
* WebProcess/WebPage/LayerTreeHost.h:
(WebCore):
(LayerTreeHost):
(WebKit::LayerTreeHost::graphicsDeviceAdapter): New, default implementation.

* WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h:
(LayerTreeHostCAWin):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122676 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/page/ChromeClient.h
Source/WebCore/platform/graphics/MediaPlayer.cpp
Source/WebCore/platform/graphics/MediaPlayer.h
Source/WebCore/platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h
Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp
Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h
Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.h
Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp
Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.h
Source/WebCore/platform/win/SoftLinking.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp
Source/WebKit/win/WebCoreSupport/WebChromeClient.h
Source/WebKit/win/WebView.cpp
Source/WebKit/win/WebView.h
Source/WebKit2/ChangeLog
Source/WebKit2/DerivedSources.make
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp
Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h