Bug 1240630: [ffvpx] P2. Hook up FFVPX PDM to PDMFactory. r=kentuckyfriedtakahe
☠☠ backed out by 72660585b6a3 ☠ ☠
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 19 Jan 2016 17:31:25 +1100
changeset 317789 9d90d4b0b9289c2104420b323cd5ca4ea26fbede
parent 317788 6162c46b32ff73e75dd9043693f8280f2a2fd740
child 317790 06abea99a29206ba64d2231ace8ac9d25b1da3a7
push id1079
push userjlund@mozilla.com
push dateFri, 15 Apr 2016 21:02:33 +0000
treeherdermozilla-release@575fbf6786d5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskentuckyfriedtakahe
bugs1240630
milestone46.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 1240630: [ffvpx] P2. Hook up FFVPX PDM to PDMFactory. r=kentuckyfriedtakahe Add new preference media.ffvpx.enabled to control FFVPX PDM being enabled.
dom/media/platforms/PDMFactory.cpp
dom/media/platforms/PDMFactory.h
modules/libpref/init/all.js
--- a/dom/media/platforms/PDMFactory.cpp
+++ b/dom/media/platforms/PDMFactory.cpp
@@ -4,16 +4,19 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "PDMFactory.h"
 
 #ifdef XP_WIN
 #include "WMFDecoderModule.h"
 #endif
+#ifdef MOZ_FFVPX
+#include "FFVPXRuntimeLinker.h"
+#endif
 #ifdef MOZ_FFMPEG
 #include "FFmpegRuntimeLinker.h"
 #endif
 #ifdef MOZ_APPLEMEDIA
 #include "AppleDecoderModule.h"
 #endif
 #ifdef MOZ_GONK_MEDIACODEC
 #include "GonkDecoderModule.h"
@@ -48,16 +51,20 @@ bool PDMFactory::sUseBlankDecoder = fals
 #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_FFVPX
+bool PDMFactory::sFFVPXDecoderEnabled = false;
+using namespace ffvpx;
+#endif
 #ifdef MOZ_FFMPEG
 bool PDMFactory::sFFmpegDecoderEnabled = false;
 #endif
 #ifdef XP_WIN
 bool PDMFactory::sWMFDecoderEnabled = false;
 #endif
 
 bool PDMFactory::sEnableFuzzingWrapper = false;
@@ -89,16 +96,20 @@ PDMFactory::Init()
 #endif
 
   Preferences::AddBoolVarCache(&sGMPDecoderEnabled,
                                "media.gmp.decoder.enabled", false);
 #ifdef MOZ_FFMPEG
   Preferences::AddBoolVarCache(&sFFmpegDecoderEnabled,
                                "media.ffmpeg.enabled", false);
 #endif
+#ifdef MOZ_FFVPX
+  Preferences::AddBoolVarCache(&sFFVPXDecoderEnabled,
+                               "media.ffvpx.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,
@@ -107,16 +118,19 @@ PDMFactory::Init()
                                "media.decoder.fuzzing.dont-delay-inputexhausted", false);
 
 #ifdef XP_WIN
   WMFDecoderModule::Init();
 #endif
 #ifdef MOZ_APPLEMEDIA
   AppleDecoderModule::Init();
 #endif
+#ifdef MOZ_FFVPX
+  FFVPXRuntimeLinker::Link();
+#endif
 #ifdef MOZ_FFMPEG
   FFmpegRuntimeLinker::Link();
 #endif
   GMPDecoderModule::Init();
 }
 
 PDMFactory::PDMFactory()
 {
@@ -257,16 +271,22 @@ PDMFactory::CreatePDMs()
   }
 #endif
 #ifdef XP_WIN
   if (sWMFDecoderEnabled) {
     m = new WMFDecoderModule();
     StartupPDM(m);
   }
 #endif
+#ifdef MOZ_FFVPX
+  if (sFFVPXDecoderEnabled) {
+    m = FFVPXRuntimeLinker::CreateDecoderModule();
+    StartupPDM(m);
+  }
+#endif
 #ifdef MOZ_FFMPEG
   if (sFFmpegDecoderEnabled) {
     m = FFmpegRuntimeLinker::CreateDecoderModule();
     StartupPDM(m);
   }
 #endif
 #ifdef MOZ_APPLEMEDIA
   m = new AppleDecoderModule();
--- a/dom/media/platforms/PDMFactory.h
+++ b/dom/media/platforms/PDMFactory.h
@@ -68,16 +68,19 @@ private:
 #ifdef MOZ_GONK_MEDIACODEC
   static bool sGonkDecoderEnabled;
 #endif
 #ifdef MOZ_WIDGET_ANDROID
   static bool sAndroidMCDecoderPreferred;
   static bool sAndroidMCDecoderEnabled;
 #endif
   static bool sGMPDecoderEnabled;
+#ifdef MOZ_FFVPX
+  static bool sFFVPXDecoderEnabled;
+#endif
 #ifdef MOZ_FFMPEG
   static bool sFFmpegDecoderEnabled;
 #endif
 #ifdef XP_WIN
   static bool sWMFDecoderEnabled;
 #endif
   static bool sEnableFuzzingWrapper;
   static uint32_t sVideoOutputMinimumInterval_ms;
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -324,16 +324,19 @@ pref("media.use-blank-decoder", false);
 pref("media.wmf.enabled", true);
 pref("media.wmf.decoder.thread-count", -1);
 pref("media.wmf.low-latency.enabled", false);
 pref("media.wmf.skip-blacklist", false);
 #endif
 #if defined(MOZ_FFMPEG)
 pref("media.ffmpeg.enabled", true);
 #endif
+#if defined(MOZ_FFVPX)
+pref("media.ffvpx.enabled", true);
+#endif
 pref("media.gmp.decoder.enabled", false);
 pref("media.gmp.decoder.aac", 0);
 pref("media.gmp.decoder.h264", 0);
 #ifdef MOZ_RAW
 pref("media.raw.enabled", true);
 #endif
 pref("media.ogg.enabled", true);
 pref("media.opus.enabled", true);