diff --git a/dom/media/eme/MediaKeySystemAccess.cpp b/dom/media/eme/MediaKeySystemAccess.cpp index 7e5194ea5e94..fae0e65cdd76 100644 --- a/dom/media/eme/MediaKeySystemAccess.cpp +++ b/dom/media/eme/MediaKeySystemAccess.cpp @@ -103,6 +103,10 @@ EnsureMinCDMVersion(mozIGeckoMediaPluginService* aGMPService, tags.AppendElement(NS_ConvertUTF16toUTF8(aKeySystem)); nsAutoCString versionStr; if (NS_FAILED(aGMPService->GetPluginVersionForAPI(NS_LITERAL_CSTRING(GMP_API_DECRYPTOR), + &tags, + versionStr)) && + // XXX to be removed later in bug 1147692 + NS_FAILED(aGMPService->GetPluginVersionForAPI(NS_LITERAL_CSTRING(GMP_API_DECRYPTOR_COMPAT), &tags, versionStr))) { return MediaKeySystemStatus::Error; @@ -153,7 +157,11 @@ MediaKeySystemAccess::GetKeySystemStatus(const nsAString& aKeySystem, } if (!HaveGMPFor(mps, NS_ConvertUTF16toUTF8(aKeySystem), - NS_LITERAL_CSTRING(GMP_API_DECRYPTOR))) { + 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; } return EnsureMinCDMVersion(mps, aKeySystem, aMinCdmVersion); @@ -197,14 +205,26 @@ IsPlayableWithGMP(mozIGeckoMediaPluginService* aGMPS, hasMP3) { return false; } - return (!hasAAC || !HaveGMPFor(aGMPS, - NS_ConvertUTF16toUTF8(aKeySystem), - NS_LITERAL_CSTRING(GMP_API_DECRYPTOR), - NS_LITERAL_CSTRING("aac"))) && - (!hasH264 || !HaveGMPFor(aGMPS, - NS_ConvertUTF16toUTF8(aKeySystem), - NS_LITERAL_CSTRING(GMP_API_DECRYPTOR), - NS_LITERAL_CSTRING("h264"))); + return (!hasAAC || + !(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")) || + // 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 diff --git a/dom/media/gmp/GMPChild.cpp b/dom/media/gmp/GMPChild.cpp index c68906f7b688..3700271f5c45 100644 --- a/dom/media/gmp/GMPChild.cpp +++ b/dom/media/gmp/GMPChild.cpp @@ -629,6 +629,12 @@ GMPChild::RecvPGMPDecryptorConstructor(PGMPDecryptorChild* aActor) void* session = nullptr; GMPErr err = GetAPI(GMP_API_DECRYPTOR, host, &session); + + if (err != GMPNoErr && !session) { + // XXX to remove in bug 1147692 + err = GetAPI(GMP_API_DECRYPTOR_COMPAT, host, &session); + } + if (err != GMPNoErr || !session) { return false; } diff --git a/dom/media/gmp/GMPService.cpp b/dom/media/gmp/GMPService.cpp index d05d704d8a77..d628f77aab90 100644 --- a/dom/media/gmp/GMPService.cpp +++ b/dom/media/gmp/GMPService.cpp @@ -602,6 +602,14 @@ GeckoMediaPluginService::GetGMPDecryptor(nsTArray* aTags, nsRefPtr gmp = SelectPluginForAPI(aNodeId, NS_LITERAL_CSTRING(GMP_API_DECRYPTOR), *aTags); + + if (!gmp) { + // XXX to remove in bug 1147692 + gmp = SelectPluginForAPI(aNodeId, + NS_LITERAL_CSTRING(GMP_API_DECRYPTOR_COMPAT), + *aTags); + } + if (!gmp) { return NS_ERROR_FAILURE; } diff --git a/dom/media/gmp/gmp-api/gmp-decryption.h b/dom/media/gmp/gmp-api/gmp-decryption.h index bb111227567b..f732fc3feb68 100644 --- a/dom/media/gmp/gmp-api/gmp-decryption.h +++ b/dom/media/gmp/gmp-api/gmp-decryption.h @@ -240,6 +240,9 @@ enum GMPSessionType { #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(). //