Bug 904890 - Part 4: Enable hardware accelerated video decoding for OMTC+D3D9/11. r=cpearce
authorMatt Woodrow <mwoodrow@mozilla.com>
Mon, 07 Apr 2014 15:17:41 +1200
changeset 196828 e31ba8d051be4c01c8f1b400eb18a727e7d7e917
parent 196827 2f41d32a3249c7d8b26bd0afb781c1b021b680a2
child 196829 d3861e435171bb76eb6241012fdfb3a6de2d4639
push id486
push userasasaki@mozilla.com
push dateMon, 14 Jul 2014 18:39:42 +0000
treeherdermozilla-release@d33428174ff1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs904890
milestone31.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 904890 - Part 4: Enable hardware accelerated video decoding for OMTC+D3D9/11. r=cpearce
content/media/fmp4/MP4Reader.cpp
content/media/fmp4/wmf/WMFVideoOutputSource.cpp
content/media/wmf/WMFReader.cpp
--- a/content/media/fmp4/MP4Reader.cpp
+++ b/content/media/fmp4/MP4Reader.cpp
@@ -140,17 +140,17 @@ MP4Reader::InitLayersBackendType()
 
   dom::HTMLMediaElement* element = owner->GetMediaElement();
   NS_ENSURE_TRUE_VOID(element);
 
   nsRefPtr<LayerManager> layerManager =
     nsContentUtils::LayerManagerForDocument(element->OwnerDoc());
   NS_ENSURE_TRUE_VOID(layerManager);
 
-  mLayersBackendType = layerManager->GetBackendType();
+  mLayersBackendType = layerManager->GetCompositorBackendType();
 }
 
 nsresult
 MP4Reader::Init(MediaDecoderReader* aCloneDonor)
 {
   MOZ_ASSERT(NS_IsMainThread(), "Must be on main thread.");
   PlatformDecoderModule::Init();
   mMP4Stream = new MP4Stream(mDecoder->GetResource());
--- a/content/media/fmp4/wmf/WMFVideoOutputSource.cpp
+++ b/content/media/fmp4/wmf/WMFVideoOutputSource.cpp
@@ -64,17 +64,18 @@ public:
 bool
 WMFVideoOutputSource::InitializeDXVA()
 {
   // If we use DXVA but aren't running with a D3D layer manager then the
   // readback of decoded video frames from GPU to CPU memory grinds painting
   // to a halt, and makes playback performance *worse*.
   if (!mDXVAEnabled ||
       (mLayersBackend != LayersBackend::LAYERS_D3D9 &&
-       mLayersBackend != LayersBackend::LAYERS_D3D10)) {
+       mLayersBackend != LayersBackend::LAYERS_D3D10 &&
+       mLayersBackend != LayersBackend::LAYERS_D3D11)) {
     return false;
   }
 
   // The DXVA manager must be created on the main thread.
   nsRefPtr<CreateDXVAManagerEvent> event(new CreateDXVAManagerEvent());
   NS_DispatchToMainThread(event, NS_DISPATCH_SYNC);
   mDXVA2Manager = event->mDXVA2Manager;
 
--- a/content/media/wmf/WMFReader.cpp
+++ b/content/media/wmf/WMFReader.cpp
@@ -98,18 +98,20 @@ WMFReader::InitializeDXVA()
 
   dom::HTMLMediaElement* element = owner->GetMediaElement();
   NS_ENSURE_TRUE(element, false);
 
   nsRefPtr<LayerManager> layerManager =
     nsContentUtils::LayerManagerForDocument(element->OwnerDoc());
   NS_ENSURE_TRUE(layerManager, false);
 
-  if (layerManager->GetBackendType() != LayersBackend::LAYERS_D3D9 &&
-      layerManager->GetBackendType() != LayersBackend::LAYERS_D3D10) {
+  LayersBackend backend = layerManager->GetCompositorBackendType();
+  if (backend != LayersBackend::LAYERS_D3D9 &&
+      backend != LayersBackend::LAYERS_D3D10 &&
+      backend != LayersBackend::LAYERS_D3D11) {
     return false;
   }
 
   mDXVA2Manager = DXVA2Manager::Create();
 
   return mDXVA2Manager != nullptr;
 }