Bug 1214932 - Add media.wmf.enabled pref. r=jya
authorChris Pearce <cpearce@mozilla.com>
Thu, 15 Oct 2015 14:51:34 +1300
changeset 301202 7399b9290138a06bbc1e4358802ee8ccc5510d6c
parent 301201 d565e8609c4e4f2687e1fd87a27b90fff40b892f
child 301203 036e241fd1b477852de085f42538580d05539a06
push id5392
push userraliiev@mozilla.com
push dateMon, 14 Dec 2015 20:08:23 +0000
treeherdermozilla-beta@16ce8562a975 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1214932
milestone44.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 1214932 - Add media.wmf.enabled pref. r=jya
dom/media/platforms/PDMFactory.cpp
dom/media/platforms/PDMFactory.h
--- a/dom/media/platforms/PDMFactory.cpp
+++ b/dom/media/platforms/PDMFactory.cpp
@@ -51,16 +51,19 @@ bool PDMFactory::sGonkDecoderEnabled = f
 #ifdef MOZ_WIDGET_ANDROID
 bool PDMFactory::sAndroidMCDecoderEnabled = false;
 bool PDMFactory::sAndroidMCDecoderPreferred = false;
 #endif
 bool PDMFactory::sGMPDecoderEnabled = false;
 #ifdef MOZ_FFMPEG
 bool PDMFactory::sFFmpegDecoderEnabled = false;
 #endif
+#ifdef XP_WIN
+bool PDMFactory::sWMFDecoderEnabled = false;
+#endif
 
 bool PDMFactory::sEnableFuzzingWrapper = false;
 uint32_t PDMFactory::sVideoOutputMinimumInterval_ms = 0;
 bool PDMFactory::sDontDelayInputExhausted = false;
 
 /* static */
 void
 PDMFactory::Init()
@@ -86,16 +89,20 @@ PDMFactory::Init()
 #endif
 
   Preferences::AddBoolVarCache(&sGMPDecoderEnabled,
                                "media.gmp.decoder.enabled", false);
 #ifdef MOZ_FFMPEG
   Preferences::AddBoolVarCache(&sFFmpegDecoderEnabled,
                                "media.ffmpeg.enabled", false);
 #endif
+#ifdef XP_WIN
+  Preferences::AddBoolVarCache(&sWMFDecoderEnabled,
+                               "media.wmf.enabled", false);
+#endif
 
   Preferences::AddBoolVarCache(&sEnableFuzzingWrapper,
                                "media.decoder.fuzzing.enabled", false);
   Preferences::AddUintVarCache(&sVideoOutputMinimumInterval_ms,
                                "media.decoder.fuzzing.video-output-minimum-interval-ms", 0);
   Preferences::AddBoolVarCache(&sDontDelayInputExhausted,
                                "media.decoder.fuzzing.dont-delay-inputexhausted", false);
 
@@ -207,18 +214,20 @@ PDMFactory::CreatePDMs()
   }
 #ifdef MOZ_WIDGET_ANDROID
   if(sAndroidMCDecoderPreferred && sAndroidMCDecoderEnabled) {
     m = new AndroidDecoderModule();
     StartupPDM(m);
   }
 #endif
 #ifdef XP_WIN
-  m = new WMFDecoderModule();
-  StartupPDM(m);
+  if (sWMFDecoderEnabled) {
+    m = new WMFDecoderModule();
+    StartupPDM(m);
+  }
 #endif
 #ifdef MOZ_FFMPEG
   if (sFFmpegDecoderEnabled) {
     m = FFmpegRuntimeLinker::CreateDecoderModule();
     StartupPDM(m);
   }
 #endif
 #ifdef MOZ_APPLEMEDIA
--- a/dom/media/platforms/PDMFactory.h
+++ b/dom/media/platforms/PDMFactory.h
@@ -62,16 +62,19 @@ private:
 #ifdef MOZ_WIDGET_ANDROID
   static bool sAndroidMCDecoderPreferred;
   static bool sAndroidMCDecoderEnabled;
 #endif
   static bool sGMPDecoderEnabled;
 #ifdef MOZ_FFMPEG
   static bool sFFmpegDecoderEnabled;
 #endif
+#ifdef XP_WIN
+  static bool sWMFDecoderEnabled;
+#endif
   static bool sEnableFuzzingWrapper;
   static uint32_t sVideoOutputMinimumInterval_ms;
   static bool sDontDelayInputExhausted;
 
   nsTArray<nsRefPtr<PlatformDecoderModule>> mCurrentPDMs;
   nsRefPtr<PlatformDecoderModule> mEMEPDM;
 };