Bug 1254858: P8. Change default preferences value if prefs don't exist. r=kentuckyfriedtakahe a=ritu
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 10 Mar 2016 15:04:23 +1100
changeset 323724 b00d99ebc124a8ed68de5dfe6ee130bc6072d780
parent 323723 234a58549e11fa481e9e0821f1775600e4ade38b
child 323725 b2af7b49ae0ac63613ac33de668e3d04e7c8f90c
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskentuckyfriedtakahe, ritu
bugs1254858
milestone47.0a2
Bug 1254858: P8. Change default preferences value if prefs don't exist. r=kentuckyfriedtakahe a=ritu When running gtest, none of the prefs actually exist, so we end up having most PDMs disabled. MozReview-Commit-ID: GNjhXtjKpGC
dom/media/fmp4/MP4Decoder.cpp
dom/media/platforms/PDMFactory.cpp
--- a/dom/media/fmp4/MP4Decoder.cpp
+++ b/dom/media/fmp4/MP4Decoder.cpp
@@ -175,17 +175,17 @@ MP4Decoder::CanHandleMediaType(const nsA
 
   return CanHandleMediaType(NS_ConvertUTF16toUTF8(mimeType), codecs);
 }
 
 /* static */
 bool
 MP4Decoder::IsEnabled()
 {
-  return Preferences::GetBool("media.mp4.enabled");
+  return Preferences::GetBool("media.mp4.enabled", true);
 }
 
 // sTestH264ExtraData represents the content of the avcC atom found in
 // an AVC1 h264 video. It contains the H264 SPS and PPS NAL.
 // the structure of the avcC atom is as follow:
 // write(0x1);  // version, always 1
 // write(sps[0].data[1]); // profile
 // write(sps[0].data[2]); // compatibility
--- a/dom/media/platforms/PDMFactory.cpp
+++ b/dom/media/platforms/PDMFactory.cpp
@@ -77,41 +77,41 @@ PDMFactory::Init()
   MOZ_ASSERT(NS_IsMainThread());
   static bool alreadyInitialized = false;
   if (alreadyInitialized) {
     return;
   }
   alreadyInitialized = true;
 
   Preferences::AddBoolVarCache(&sUseBlankDecoder,
-                               "media.use-blank-decoder");
+                               "media.use-blank-decoder", false);
 #ifdef MOZ_GONK_MEDIACODEC
   Preferences::AddBoolVarCache(&sGonkDecoderEnabled,
-                               "media.gonk.enabled", false);
+                               "media.gonk.enabled", true);
 #endif
 #ifdef MOZ_WIDGET_ANDROID
   Preferences::AddBoolVarCache(&sAndroidMCDecoderEnabled,
                                "media.android-media-codec.enabled", false);
   Preferences::AddBoolVarCache(&sAndroidMCDecoderPreferred,
                                "media.android-media-codec.preferred", false);
 #endif
 
   Preferences::AddBoolVarCache(&sGMPDecoderEnabled,
-                               "media.gmp.decoder.enabled", false);
+                               "media.gmp.decoder.enabled", true);
 #ifdef MOZ_FFMPEG
   Preferences::AddBoolVarCache(&sFFmpegDecoderEnabled,
-                               "media.ffmpeg.enabled", false);
+                               "media.ffmpeg.enabled", true);
 #endif
 #ifdef MOZ_FFVPX
   Preferences::AddBoolVarCache(&sFFVPXDecoderEnabled,
-                               "media.ffvpx.enabled", false);
+                               "media.ffvpx.enabled", true);
 #endif
 #ifdef XP_WIN
   Preferences::AddBoolVarCache(&sWMFDecoderEnabled,
-                               "media.wmf.enabled", false);
+                               "media.wmf.enabled", true);
 #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);