Bug 1258220 - Disable Adobe GMP if SSE2 isn't supported. r=gerald,a=lizzard
authorChris Pearce <cpearce@mozilla.com>
Fri, 25 Mar 2016 07:56:47 +1300
changeset 323672 a7237024906d361f662608fada22618bfe8360c8
parent 323671 8e9a6e6cbacd7f8c2be068acb0b59a8b175eb244
child 323673 4ff46b02cabe8d437b471cb281d9f03fce13ee04
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald, lizzard
bugs1258220
milestone47.0a2
Bug 1258220 - Disable Adobe GMP if SSE2 isn't supported. r=gerald,a=lizzard
dom/media/gmp/GMPParent.cpp
--- a/dom/media/gmp/GMPParent.cpp
+++ b/dom/media/gmp/GMPParent.cpp
@@ -7,16 +7,17 @@
 #include "mozilla/Logging.h"
 #include "nsComponentManagerUtils.h"
 #include "nsComponentManagerUtils.h"
 #include "nsThreadUtils.h"
 #include "nsIRunnable.h"
 #include "nsIWritablePropertyBag2.h"
 #include "mozIGeckoMediaPluginService.h"
 #include "mozilla/ipc/GeckoChildProcessHost.h"
+#include "mozilla/SSE.h"
 #include "mozilla/SyncRunnable.h"
 #include "mozilla/unused.h"
 #include "nsIObserverService.h"
 #include "GMPTimerParent.h"
 #include "runnable_utils.h"
 #if defined(XP_LINUX) && defined(MOZ_GMP_SANDBOX)
 #include "mozilla/SandboxInfo.h"
 #endif
@@ -829,16 +830,30 @@ GMPParent::ReadGMPMetaData()
       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;
         return NS_ERROR_FAILURE;
       }
 #endif
+#ifdef XP_WIN
+      // Adobe GMP doesn't work without SSE2. Check the tags to see if
+      // the decryptor is for the Adobe GMP, and refuse to load it if
+      // SSE2 isn't supported.
+      for (const nsCString& tag : cap->mAPITags) {
+        if (!tag.EqualsLiteral("com.adobe.primetime")) {
+          continue;
+        }
+        if (!mozilla::supports_sse2()) {
+          return NS_ERROR_FAILURE;
+        }
+        break;
+      }
+#endif // XP_WIN
     }
 
     mCapabilities.AppendElement(cap);
   }
 
   if (mCapabilities.IsEmpty()) {
     return NS_ERROR_FAILURE;
   }