Bug 1258220 - Disable Adobe GMP if SSE2 isn't supported. r=gerald
authorChris Pearce <cpearce@mozilla.com>
Fri, 25 Mar 2016 07:56:47 +1300
changeset 290275 1c8b633d485f1ef077e8942591865ac9ffb95717
parent 290274 8ef8befd63b90b867ae27ab1b58758180dad0fc3
child 290276 98b1a2771e728dad0cd9887f660c7ad7ae5f75ff
push id74185
push usercpearce@mozilla.com
push dateThu, 24 Mar 2016 18:56:58 +0000
treeherdermozilla-inbound@1c8b633d485f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1258220
milestone48.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 1258220 - Disable Adobe GMP if SSE2 isn't supported. r=gerald
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;
   }