Backed out changeset cbe9a2aea954 (bug 1147692) for test_eme_canvas_blocked.html failures.
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 25 Jun 2015 16:05:41 -0400
changeset 250214 a666c23a74aed30896f7e3af69eaf3d4318bc890
parent 250213 5ddf0a252b086c7e8e468243c6251af5c0b1da57
child 250215 d253bc334796439127e98c6505451e7b70aafc8f
push id61482
push userryanvm@gmail.com
push dateThu, 25 Jun 2015 20:05:49 +0000
treeherdermozilla-inbound@a666c23a74ae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1147692
milestone41.0a1
backs outcbe9a2aea9541146ae0a11051ed32d31eaf4e428
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
Backed out changeset cbe9a2aea954 (bug 1147692) for test_eme_canvas_blocked.html failures. CLOSED TREE
dom/media/eme/MediaKeySystemAccess.cpp
dom/media/gmp/GMPContentChild.cpp
dom/media/gmp/GMPParent.cpp
dom/media/gmp/GMPServiceParent.cpp
dom/media/gmp/gmp-api/gmp-decryption.h
--- a/dom/media/eme/MediaKeySystemAccess.cpp
+++ b/dom/media/eme/MediaKeySystemAccess.cpp
@@ -133,17 +133,23 @@ EnsureMinCDMVersion(mozIGeckoMediaPlugin
 {
   nsTArray<nsCString> tags;
   tags.AppendElement(NS_ConvertUTF16toUTF8(aKeySystem));
   bool hasPlugin;
   nsAutoCString versionStr;
   if (NS_FAILED(aGMPService->GetPluginVersionForAPI(NS_LITERAL_CSTRING(GMP_API_DECRYPTOR),
                                                     &tags,
                                                     &hasPlugin,
-                                                    versionStr))) {
+                                                    versionStr)) ||
+      // XXX to be removed later in bug 1147692
+      (aCheckForV6 && !hasPlugin &&
+       NS_FAILED(aGMPService->GetPluginVersionForAPI(NS_LITERAL_CSTRING(GMP_API_DECRYPTOR_COMPAT),
+                                                     &tags,
+                                                     &hasPlugin,
+                                                     versionStr)))) {
     return MediaKeySystemStatus::Error;
   }
 
   if (!hasPlugin) {
     return MediaKeySystemStatus::Cdm_not_installed;
   }
 
   if (aMinCdmVersion == NO_CDM_VERSION) {
@@ -249,25 +255,35 @@ IsPlayableWithGMP(mozIGeckoMediaPluginSe
                                       codecs,
                                       hasAAC,
                                       hasH264,
                                       hasMP3) ||
       hasMP3) {
     return false;
   }
   return (!hasAAC ||
-          !HaveGMPFor(aGMPS,
-                      NS_ConvertUTF16toUTF8(aKeySystem),
-                      NS_LITERAL_CSTRING(GMP_API_DECRYPTOR),
-                      NS_LITERAL_CSTRING("aac"))) &&
+          !(HaveGMPFor(aGMPS,
+                       NS_ConvertUTF16toUTF8(aKeySystem),
+                       NS_LITERAL_CSTRING(GMP_API_DECRYPTOR),
+                       NS_LITERAL_CSTRING("aac")) ||
+            // XXX remove later in bug 1147692
+            HaveGMPFor(aGMPS,
+                       NS_ConvertUTF16toUTF8(aKeySystem),
+                       NS_LITERAL_CSTRING(GMP_API_DECRYPTOR_COMPAT),
+                       NS_LITERAL_CSTRING("aac")))) &&
          (!hasH264 ||
-          HaveGMPFor(aGMPS,
-                     NS_ConvertUTF16toUTF8(aKeySystem),
-                     NS_LITERAL_CSTRING(GMP_API_DECRYPTOR),
-                     NS_LITERAL_CSTRING("h264")));
+          !(HaveGMPFor(aGMPS,
+                       NS_ConvertUTF16toUTF8(aKeySystem),
+                       NS_LITERAL_CSTRING(GMP_API_DECRYPTOR),
+                       NS_LITERAL_CSTRING("h264")) ||
+            // XXX remove later in bug 1147692
+            HaveGMPFor(aGMPS,
+                       NS_ConvertUTF16toUTF8(aKeySystem),
+                       NS_LITERAL_CSTRING(GMP_API_DECRYPTOR_COMPAT),
+                       NS_LITERAL_CSTRING("h264"))));
 #else
   return false;
 #endif
 }
 
 /* static */
 bool
 MediaKeySystemAccess::IsSupported(const nsAString& aKeySystem,
--- a/dom/media/gmp/GMPContentChild.cpp
+++ b/dom/media/gmp/GMPContentChild.cpp
@@ -113,16 +113,21 @@ GMPContentChild::DeallocPGMPVideoEncoder
 bool
 GMPContentChild::RecvPGMPDecryptorConstructor(PGMPDecryptorChild* aActor)
 {
   GMPDecryptorChild* child = static_cast<GMPDecryptorChild*>(aActor);
   GMPDecryptorHost* host = static_cast<GMPDecryptorHost*>(child);
 
   void* session = nullptr;
   GMPErr err = mGMPChild->GetAPI(GMP_API_DECRYPTOR, host, &session);
+  if (err != GMPNoErr && !session) {
+    // XXX to remove in bug 1147692
+    err = mGMPChild->GetAPI(GMP_API_DECRYPTOR_COMPAT, host, &session);
+  }
+
   if (err != GMPNoErr || !session) {
     return false;
   }
 
   child->Init(static_cast<GMPDecryptor*>(session));
 
   return true;
 }
--- a/dom/media/gmp/GMPParent.cpp
+++ b/dom/media/gmp/GMPParent.cpp
@@ -813,17 +813,18 @@ GMPParent::ReadGMPMetaData()
         nsCCharSeparatedTokenizer tagTokens(ts, ':');
         while (tagTokens.hasMoreTokens()) {
           const nsDependentCSubstring tag(tagTokens.nextToken());
           cap->mAPITags.AppendElement(tag);
         }
       }
     }
 
-    if (cap->mAPIName.EqualsLiteral(GMP_API_DECRYPTOR)) {
+    if (cap->mAPIName.EqualsLiteral(GMP_API_DECRYPTOR) ||
+        cap->mAPIName.EqualsLiteral(GMP_API_DECRYPTOR_COMPAT)) {
       mCanDecrypt = true;
 
 #if defined(XP_LINUX) && defined(MOZ_GMP_SANDBOX)
       if (!mozilla::SandboxInfo::Get().CanSandboxMedia()) {
         printf_stderr("GMPParent::ReadGMPMetaData: Plugin \"%s\" is an EME CDM"
                       " but this system can't sandbox it; not loading.\n",
                       mDisplayName.get());
         delete cap;
--- a/dom/media/gmp/GMPServiceParent.cpp
+++ b/dom/media/gmp/GMPServiceParent.cpp
@@ -663,16 +663,23 @@ GeckoMediaPluginServiceParent::SelectPlu
   if (gmpToClone) {
     GMPParent* clone = ClonePlugin(gmpToClone);
     if (!aNodeId.IsEmpty()) {
       clone->SetNodeId(aNodeId);
     }
     return clone;
   }
 
+  if (aAPI.EqualsLiteral(GMP_API_DECRYPTOR)) {
+    // XXX to remove in bug 1147692
+    return SelectPluginForAPI(aNodeId,
+                              NS_LITERAL_CSTRING(GMP_API_DECRYPTOR_COMPAT),
+                              aTags);
+  }
+
   return nullptr;
 }
 
 class CreateGMPParentTask : public nsRunnable {
 public:
   NS_IMETHOD Run() {
     MOZ_ASSERT(NS_IsMainThread());
 #if defined(XP_LINUX) && defined(MOZ_GMP_SANDBOX)
--- a/dom/media/gmp/gmp-api/gmp-decryption.h
+++ b/dom/media/gmp/gmp-api/gmp-decryption.h
@@ -235,16 +235,19 @@ public:
 enum GMPSessionType {
   kGMPTemporySession = 0,
   kGMPPersistentSession = 1,
   kGMPSessionInvalid = 2 // Must always be last.
 };
 
 #define GMP_API_DECRYPTOR "eme-decrypt-v7"
 
+// XXX remove in bug 1147692
+#define GMP_API_DECRYPTOR_COMPAT "eme-decrypt-v6"
+
 // API exposed by plugin library to manage decryption sessions.
 // When the Host requests this by calling GMPGetAPIFunc().
 //
 // API name macro: GMP_API_DECRYPTOR
 // Host API: GMPDecryptorHost
 class GMPDecryptor {
 public: