Bug 1258220 - Disable Adobe GMP if SSE2 isn't supported. r=gerald,a=lizzard
--- 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;
}