Bug 1210231 - Enable unencrypted <video> playback using Adobe's GMP for decoding. r=jya
authorChris Pearce <cpearce@mozilla.com>
Thu, 29 Oct 2015 21:54:38 +1300
changeset 304377 3cfb964dd761aa12893df1fa8de743ceb81a82a4
parent 304376 c03bf59e4061f0c88163fa7da42fe6547be395b8
child 304378 81edda656162c13bcbb6ce06659ada57e039f0a3
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1210231
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 1210231 - Enable unencrypted <video> playback using Adobe's GMP for decoding. r=jya
browser/app/profile/firefox.js
dom/media/platforms/PDMFactory.cpp
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1518,18 +1518,23 @@ pref("identity.fxaccounts.migrateToDevEd
 #ifdef MOZ_WIDGET_GTK
 pref("ui.key.menuAccessKeyFocuses", true);
 #endif
 
 // Encrypted media extensions.
 pref("media.eme.enabled", true);
 pref("media.eme.apiVisible", true);
 
-// If decoding-via-gmp is turned on for <video>, default to using
-// Adobe's GMP for decoding.
+// Decode using Gecko Media Plugins in <video>, if a system decoder is not
+// availble and the preferred GMP is available.
+pref("media.gmp.decoder.enabled", true);
+
+// If decoding-via-GMP is turned on for <video>, use Adobe's GMP for decoding,
+// if it's available. Note: We won't fallback to another GMP if Adobe's is not
+// installed.
 pref("media.gmp.decoder.aac", 2);
 pref("media.gmp.decoder.h264", 2);
 
 // Whether we should run a test-pattern through EME GMPs before assuming they'll
 // decode H.264.
 pref("media.gmp.trial-create.enabled", true);
 
 #ifdef MOZ_ADOBE_EME
--- a/dom/media/platforms/PDMFactory.cpp
+++ b/dom/media/platforms/PDMFactory.cpp
@@ -245,20 +245,16 @@ PDMFactory::CreatePDMs()
     m = CreateBlankDecoderModule();
     StartupPDM(m);
     // The Blank PDM SupportsMimeType reports true for all codecs; the creation
     // of its decoder is infallible. As such it will be used for all media, we
     // can stop creating more PDM from this point.
     return;
   }
 
-  if (sGMPDecoderEnabled) {
-    m = new GMPDecoderModule();
-    StartupPDM(m);
-  }
 #ifdef MOZ_WIDGET_ANDROID
   if(sAndroidMCDecoderPreferred && sAndroidMCDecoderEnabled) {
     m = new AndroidDecoderModule();
     StartupPDM(m);
   }
 #endif
 #ifdef XP_WIN
   if (sWMFDecoderEnabled) {
@@ -286,16 +282,21 @@ PDMFactory::CreatePDMs()
   if(sAndroidMCDecoderEnabled){
     m = new AndroidDecoderModule();
     StartupPDM(m);
   }
 #endif
 
   m = new AgnosticDecoderModule();
   StartupPDM(m);
+
+  if (sGMPDecoderEnabled) {
+    m = new GMPDecoderModule();
+    StartupPDM(m);
+  }  
 }
 
 bool
 PDMFactory::StartupPDM(PlatformDecoderModule* aPDM)
 {
   if (aPDM && NS_SUCCEEDED(aPDM->Startup())) {
     mCurrentPDMs.AppendElement(aPDM);
     return true;