Bug 1338064 - Enable VP9 in MP4 for EME in Nightly. r?gerald draft
authorChris Pearce <cpearce@mozilla.com>
Thu, 09 Feb 2017 20:09:39 +1300
changeset 481081 2776004d3f6a9cfa05c9e48da2043fd90f313695
parent 481057 8ae93951d56306b24078f038ff779d5d37d2cd8b
child 545101 25859f736a958bf0853e5639719b54410c7ff636
push id44709
push userbmo:cpearce@mozilla.com
push dateThu, 09 Feb 2017 07:11:35 +0000
reviewersgerald
bugs1338064
milestone54.0a1
Bug 1338064 - Enable VP9 in MP4 for EME in Nightly. r?gerald MozReview-Commit-ID: Deggrc038Va
browser/app/profile/firefox.js
dom/media/MediaPrefs.h
dom/media/eme/MediaKeySystemAccess.cpp
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1370,16 +1370,22 @@ pref("ui.key.menuAccessKeyFocuses", true
 // enable DRM, whereupon the EME plugin binaries will be downloaded if
 // permission is granted.
 pref("media.eme.enabled", false);
 #else
 pref("media.eme.enabled", true);
 #endif
 pref("media.eme.apiVisible", true);
 
+#ifdef NIGHTLY_BUILD
+pref("media.eme.vp9-in-mp4.enabled", true);
+#else
+pref("media.eme.vp9-in-mp4.enabled", false);
+#endif
+
 // Whether we should run a test-pattern through EME GMPs before assuming they'll
 // decode H.264.
 pref("media.gmp.trial-create.enabled", true);
 
 // Note: when media.gmp-*.visible is true, provided we're running on a
 // supported platform/OS version, the corresponding CDM appears in the
 // plugins list, Firefox will download the GMP/CDM if enabled, and our
 // UI to re-enable EME prompts the user to re-enable EME if it's disabled
--- a/dom/media/MediaPrefs.h
+++ b/dom/media/MediaPrefs.h
@@ -130,16 +130,18 @@ private:
   DECL_MEDIA_PREF("media.decoder.fuzzing.enabled",            PDMFuzzingEnabled, bool, false);
   DECL_MEDIA_PREF("media.decoder.fuzzing.video-output-minimum-interval-ms", PDMFuzzingInterval, uint32_t, 0);
   DECL_MEDIA_PREF("media.decoder.fuzzing.dont-delay-inputexhausted", PDMFuzzingDelayInputExhausted, bool, true);
   DECL_MEDIA_PREF("media.decoder.recycle.enabled",            MediaDecoderCheckRecycling, bool, false);
   DECL_MEDIA_PREF("media.gmp.decoder.enabled",                PDMGMPEnabled, bool, true);
   DECL_MEDIA_PREF("media.gmp.decoder.aac",                    GMPAACPreferred, uint32_t, 0);
   DECL_MEDIA_PREF("media.gmp.decoder.h264",                   GMPH264Preferred, uint32_t, 0);
 
+  DECL_MEDIA_PREF("media.eme.vp9-in-mp4.enabled",             EMEVP9inMP4, bool, false);
+
   // MediaDecoderStateMachine
   DECL_MEDIA_PREF("media.suspend-bkgnd-video.enabled",        MDSMSuspendBackgroundVideoEnabled, bool, false);
   DECL_MEDIA_PREF("media.suspend-bkgnd-video.delay-ms",       MDSMSuspendBackgroundVideoDelay, AtomicUint32, SUSPEND_BACKGROUND_VIDEO_DELAY_MS);
   DECL_MEDIA_PREF("media.dormant-on-pause-timeout-ms",        DormantOnPauseTimeout, int32_t, 5000);
 
   // WebSpeech
   DECL_MEDIA_PREF("media.webspeech.synth.force_global_queue", WebSpeechForceGlobal, bool, false);
   DECL_MEDIA_PREF("media.webspeech.test.enable",              WebSpeechTestEnabled, bool, false);
--- a/dom/media/eme/MediaKeySystemAccess.cpp
+++ b/dom/media/eme/MediaKeySystemAccess.cpp
@@ -282,16 +282,19 @@ GetSupportedKeySystems()
         clearkey.mMP4.SetCanDecryptAndDecode(EME_CODEC_H264);
       } else {
         clearkey.mMP4.SetCanDecrypt(EME_CODEC_H264);
       }
 #else
       clearkey.mMP4.SetCanDecrypt(EME_CODEC_AAC);
       clearkey.mMP4.SetCanDecrypt(EME_CODEC_H264);
 #endif
+      if (MediaPrefs::EMEVP9inMP4()) {
+        clearkey.mMP4.SetCanDecrypt(EME_CODEC_VP9);
+      }
       clearkey.mWebM.SetCanDecrypt(EME_CODEC_VORBIS);
       clearkey.mWebM.SetCanDecrypt(EME_CODEC_OPUS);
       clearkey.mWebM.SetCanDecrypt(EME_CODEC_VP8);
       clearkey.mWebM.SetCanDecrypt(EME_CODEC_VP9);
       keySystemConfigs.AppendElement(Move(clearkey));
     }
   }
   {
@@ -350,16 +353,19 @@ GetSupportedKeySystems()
             data.mSupportType->SetCanDecryptAndDecode(data.mEMECodecType);
           } else {
             data.mSupportType->SetCanDecrypt(data.mEMECodecType);
           }
         }
       }
 #else
       widevine.mMP4.SetCanDecryptAndDecode(EME_CODEC_H264);
+      if (MediaPrefs::EMEVP9inMP4()) {
+        widevine.mMP4.SetCanDecryptAndDecode(EME_CODEC_VP9);
+      }
       widevine.mWebM.SetCanDecrypt(EME_CODEC_VORBIS);
       widevine.mWebM.SetCanDecrypt(EME_CODEC_OPUS);
       widevine.mWebM.SetCanDecryptAndDecode(EME_CODEC_VP8);
       widevine.mWebM.SetCanDecryptAndDecode(EME_CODEC_VP9);
 #endif
       keySystemConfigs.AppendElement(Move(widevine));
     }
   }