Bug 1322234 - P1. Add option to disable hardware decoding. r=bryce
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 04 Oct 2018 09:42:56 +0000
changeset 439549 49dc3475d6f34392b1177870a8cf5f135934ff80
parent 439548 3fad68f9222d3902c97529961530db6cc9250630
child 439550 ad7f2511596c2992ad1185ac96c985f17fb36f93
push id34778
push usernbeleuzu@mozilla.com
push dateThu, 04 Oct 2018 15:22:02 +0000
treeherdermozilla-central@01634947caab [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbryce
bugs1322234
milestone64.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 1322234 - P1. Add option to disable hardware decoding. r=bryce For know will only be used with Windows WMF decoders. Differential Revision: https://phabricator.services.mozilla.com/D7615
dom/media/platforms/PlatformDecoderModule.h
dom/media/platforms/wmf/WMFDecoderModule.cpp
--- a/dom/media/platforms/PlatformDecoderModule.h
+++ b/dom/media/platforms/PlatformDecoderModule.h
@@ -45,16 +45,17 @@ static LazyLogModule sPDMLog("PlatformDe
 struct MOZ_STACK_CLASS CreateDecoderParams final
 {
   explicit CreateDecoderParams(const TrackInfo& aConfig) : mConfig(aConfig) { }
 
   enum class Option
   {
     Default,
     LowLatency,
+    HardwareDecoderNotAllowed,
   };
   using OptionSet = EnumSet<Option>;
 
   struct UseNullDecoder
   {
     UseNullDecoder() = default;
     explicit UseNullDecoder(bool aUseNullDecoder) : mUse(aUseNullDecoder) { }
     bool mUse = false;
--- a/dom/media/platforms/wmf/WMFDecoderModule.cpp
+++ b/dom/media/platforms/wmf/WMFDecoderModule.cpp
@@ -95,22 +95,23 @@ already_AddRefed<MediaDataDecoder>
 WMFDecoderModule::CreateVideoDecoder(const CreateDecoderParams& aParams)
 {
   if (aParams.mOptions.contains(CreateDecoderParams::Option::LowLatency)) {
     // Latency on Windows is bad. Let's not attempt to decode with WMF decoders
     // when low latency is required.
     return nullptr;
   }
 
-  nsAutoPtr<WMFVideoMFTManager> manager(
-    new WMFVideoMFTManager(aParams.VideoConfig(),
-                           aParams.mKnowsCompositor,
-                           aParams.mImageContainer,
-                           aParams.mRate.mValue,
-                           sDXVAEnabled));
+  nsAutoPtr<WMFVideoMFTManager> manager(new WMFVideoMFTManager(
+    aParams.VideoConfig(),
+    aParams.mKnowsCompositor,
+    aParams.mImageContainer,
+    aParams.mRate.mValue,
+    sDXVAEnabled && !aParams.mOptions.contains(
+                      CreateDecoderParams::Option::HardwareDecoderNotAllowed)));
 
   MediaResult result = manager->Init();
   if (NS_FAILED(result)) {
     if (aParams.mError) {
       *aParams.mError = result;
     }
     return nullptr;
   }