Bug 1159495 - Only report Adobe EME supported if required WMF codecs are installed. r=edwin, a=sledru
authorChris Pearce <cpearce@mozilla.com>
Tue, 28 Apr 2015 21:54:00 -0400
changeset 260346 60555feb4888
parent 260345 db6a2986c24d
child 260347 6e95db92c8d4
push id757
push userryanvm@gmail.com
push date2015-05-01 19:40 +0000
treeherdermozilla-release@a1efc72ea226 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedwin, sledru
bugs1159495
milestone38.0
Bug 1159495 - Only report Adobe EME supported if required WMF codecs are installed. r=edwin, a=sledru
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"
@@ -150,16 +151,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;
+    }
     if (!HaveGMPFor(mps,
                     NS_ConvertUTF16toUTF8(aKeySystem),
                     NS_LITERAL_CSTRING(GMP_API_DECRYPTOR)) &&
         // XXX to be removed later in bug 1147692
         !HaveGMPFor(mps,
                     NS_ConvertUTF16toUTF8(aKeySystem),
                     NS_LITERAL_CSTRING(GMP_API_DECRYPTOR_COMPAT))) {
       return MediaKeySystemStatus::Cdm_not_installed;