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