Bug 1271483 - p1. Optionally treat media.wmf.disabled as WMF failure for Decoder Doctor - r=cpearce draft
authorGerald Squelart <gsquelart@mozilla.com>
Tue, 24 May 2016 01:33:37 +1000
changeset 380464 a6d94f2f24b6ea351a0ed68dfcc0b5542e4c7bfa
parent 380354 51377a64158941f89ed73f388ae437cfa494c030
child 380465 16db19c21ae8e594196959afb5a7178b1dd3ca16
push id21229
push usergsquelart@mozilla.com
push dateWed, 22 Jun 2016 01:27:56 +0000
reviewerscpearce
bugs1271483
milestone50.0a1
Bug 1271483 - p1. Optionally treat media.wmf.disabled as WMF failure for Decoder Doctor - r=cpearce This can be used to test Decoder Doctor on Windows, but disabling WMF through prefs, to trigger an Decoder Doctor infobar. MozReview-Commit-ID: 1aRk111VFO7
dom/media/MediaPrefs.h
dom/media/platforms/PDMFactory.cpp
modules/libpref/init/all.js
--- a/dom/media/MediaPrefs.h
+++ b/dom/media/MediaPrefs.h
@@ -88,16 +88,17 @@ private:
 #ifdef MOZ_FFMPEG
   DECL_MEDIA_PREF("media.ffmpeg.enabled",                     PDMFFmpegEnabled, bool, true);
 #endif
 #ifdef MOZ_FFVPX
   DECL_MEDIA_PREF("media.ffvpx.enabled",                      PDMFFVPXEnabled, bool, true);
 #endif
 #ifdef XP_WIN
   DECL_MEDIA_PREF("media.wmf.enabled",                        PDMWMFEnabled, bool, true);
+  DECL_MEDIA_PREF("media.decoder-doctor.wmf-disabled-is-failure", DecoderDoctorWMFDisabledIsFailure, bool, false);
   DECL_MEDIA_PREF("media.webm.intel_decoder.enabled",         PDMWMFIntelDecoderEnabled, bool, false);
   DECL_MEDIA_PREF("media.wmf.low-latency.enabled",            PDMWMFLowLatencyEnabled, bool, false);
   DECL_MEDIA_PREF("media.wmf.decoder.thread-count",           PDMWMFThreadCount, int32_t, -1);
   DECL_MEDIA_PREF("media.wmf.skip-blacklist",                 PDMWMFSkipBlacklist, bool, false);
   DECL_MEDIA_PREF("media.windows-media-foundation.max-dxva-videos", PDMWMFMaxDXVAVideos, uint32_t, 8);
   DECL_MEDIA_PREF("media.windows-media-foundation.allow-d3d11-dxva", PDMWMFAllowD3D11, bool, true);
 #endif
   DECL_MEDIA_PREF("media.decoder.fuzzing.enabled",            PDMFuzzingEnabled, bool, false);
--- a/dom/media/platforms/PDMFactory.cpp
+++ b/dom/media/platforms/PDMFactory.cpp
@@ -252,17 +252,17 @@ PDMFactory::CreatePDMs()
     StartupPDM(m);
   }
 #endif
 #ifdef XP_WIN
   if (MediaPrefs::PDMWMFEnabled()) {
     m = new WMFDecoderModule();
     mWMFFailedToLoad = !StartupPDM(m);
   } else {
-    mWMFFailedToLoad = false;
+    mWMFFailedToLoad = MediaPrefs::DecoderDoctorWMFDisabledIsFailure();
   }
 #endif
 #ifdef MOZ_FFVPX
   if (MediaPrefs::PDMFFVPXEnabled()) {
     m = FFVPXRuntimeLinker::CreateDecoderModule();
     StartupPDM(m);
   }
 #endif
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -369,16 +369,18 @@ pref("media.apple.mp4.enabled", true);
 // changes are made.
 pref("media.gmp.storage.version.expected", 1);
 
 // Filter what triggers user notifications.
 // See DecoderDoctorDocumentWatcher::ReportAnalysis for details.
 pref("media.decoder-doctor.notifications-allowed", "MediaWMFNeeded,MediaWidevineNoWMFNoSilverlight");
 // Whether we report partial failures.
 pref("media.decoder-doctor.verbose", false);
+// Whether DD should consider WMF-disabled a WMF failure, useful for testing.
+pref("media.decoder-doctor.wmf-disabled-is-failure", false);
 
 // Whether to suspend decoding of videos in background tabs.
 #ifdef NIGHTLY_BUILD
 pref("media.suspend-bkgnd-video.enabled", true);
 #else
 pref("media.suspend-bkgnd-video.enabled", false);
 #endif
 // Delay, in ms, from time window goes to background to suspending