Bug 1159495 - Only report Adobe EME supported if required WMF codecs are installed. r=edwin
authorChris Pearce <cpearce@mozilla.com>
Thu, 30 Apr 2015 21:52:01 +1200
changeset 273145 2a4864545b47eb36c526408cded4c79eff399bcd
parent 273144 a7da86419656e127226f53e302c82bf3ed23e563
child 273146 469ae46092fcaff123de2b291dddd107155f88c9
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedwin
bugs1159495
milestone40.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 1159495 - Only report Adobe EME supported if required WMF codecs are installed. r=edwin
dom/media/eme/MediaKeySystemAccess.cpp
--- a/dom/media/eme/MediaKeySystemAccess.cpp
+++ b/dom/media/eme/MediaKeySystemAccess.cpp
@@ -8,16 +8,17 @@
 #include "mozilla/dom/MediaKeySystemAccessBinding.h"
 #include "mozilla/Preferences.h"
 #include "nsContentTypeParser.h"
 #ifdef MOZ_FMP4
 #include "MP4Decoder.h"
 #endif
 #ifdef XP_WIN
 #include "mozilla/WindowsVersion.h"
+#include "WMFDecoderModule.h"
 #endif
 #include "nsContentCID.h"
 #include "nsServiceManagerUtils.h"
 #include "mozIGeckoMediaPluginService.h"
 #include "VideoUtils.h"
 #include "mozilla/Services.h"
 #include "nsIObserverService.h"
 #include "mozilla/EMEUtils.h"
@@ -154,16 +155,21 @@ MediaKeySystemAccess::GetKeySystemStatus
        aKeySystem.EqualsLiteral("com.adobe.primetime"))) {
     // Win Vista and later only.
     if (!IsVistaOrLater()) {
       return MediaKeySystemStatus::Cdm_not_supported;
     }
     if (!Preferences::GetBool("media.gmp-eme-adobe.enabled", false)) {
       return MediaKeySystemStatus::Cdm_disabled;
     }
+    if (!WMFDecoderModule::HasH264() || !WMFDecoderModule::HasAAC()) {
+      // The system doesn't have the codecs that Adobe EME relies
+      // on installed.
+      return MediaKeySystemStatus::Cdm_not_supported;
+    }
     return EnsureMinCDMVersion(mps, aKeySystem, aMinCdmVersion, true);
   }
 #endif
 
   return MediaKeySystemStatus::Cdm_not_supported;
 }
 
 static bool