Bug 1214932 - Add exclusion guards for platform specific media pref caches. r=jya
authorChris Pearce <cpearce@mozilla.com>
Thu, 15 Oct 2015 14:51:31 +1300
changeset 301201 d565e8609c4e4f2687e1fd87a27b90fff40b892f
parent 301200 a32795633bff04b81b1fb0d7303ac8b416fa3558
child 301202 7399b9290138a06bbc1e4358802ee8ccc5510d6c
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 exclusion guards for platform specific media pref caches. r=jya
dom/media/platforms/PDMFactory.cpp
dom/media/platforms/PDMFactory.h
--- a/dom/media/platforms/PDMFactory.cpp
+++ b/dom/media/platforms/PDMFactory.cpp
@@ -40,21 +40,27 @@
 #endif
 
 namespace mozilla {
 
 extern already_AddRefed<PlatformDecoderModule> CreateAgnosticDecoderModule();
 extern already_AddRefed<PlatformDecoderModule> CreateBlankDecoderModule();
 
 bool PDMFactory::sUseBlankDecoder = false;
+#ifdef MOZ_GONK_MEDIACODEC
 bool PDMFactory::sGonkDecoderEnabled = false;
+#endif
+#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
 
 bool PDMFactory::sEnableFuzzingWrapper = false;
 uint32_t PDMFactory::sVideoOutputMinimumInterval_ms = 0;
 bool PDMFactory::sDontDelayInputExhausted = false;
 
 /* static */
 void
 PDMFactory::Init()
@@ -76,18 +82,20 @@ PDMFactory::Init()
   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);
+#ifdef MOZ_FFMPEG
   Preferences::AddBoolVarCache(&sFFmpegDecoderEnabled,
                                "media.ffmpeg.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);
 
--- a/dom/media/platforms/PDMFactory.h
+++ b/dom/media/platforms/PDMFactory.h
@@ -49,23 +49,29 @@ public:
 private:
   virtual ~PDMFactory();
   void CreatePDMs();
   // Startup the provided PDM and add it to our list if successful.
   bool StartupPDM(PlatformDecoderModule* aPDM);
   // Returns the first PDM in our list supporting the mimetype.
   already_AddRefed<PlatformDecoderModule> GetDecoder(const nsACString& aMimeType);
 
-  // Caches pref media.fragmented-mp4.use-blank-decoder
+  // PDM pref caches...
   static bool sUseBlankDecoder;
+#ifdef MOZ_GONK_MEDIACODEC
   static bool sGonkDecoderEnabled;
+#endif
+#ifdef MOZ_WIDGET_ANDROID
   static bool sAndroidMCDecoderPreferred;
   static bool sAndroidMCDecoderEnabled;
+#endif
   static bool sGMPDecoderEnabled;
+#ifdef MOZ_FFMPEG
   static bool sFFmpegDecoderEnabled;
+#endif
   static bool sEnableFuzzingWrapper;
   static uint32_t sVideoOutputMinimumInterval_ms;
   static bool sDontDelayInputExhausted;
 
   nsTArray<nsRefPtr<PlatformDecoderModule>> mCurrentPDMs;
   nsRefPtr<PlatformDecoderModule> mEMEPDM;
 };