Bug 1147689 - Preserve compatibility with eme-decrypt-v6 - r=cpearce

This commit is contained in:
Edwin Flores 2015-03-26 22:58:43 +13:00
Родитель d888a5c88f
Коммит b790668a1f
4 изменённых файлов: 46 добавлений и 9 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -602,6 +602,14 @@ GeckoMediaPluginService::GetGMPDecryptor(nsTArray<nsCString>* aTags,
nsRefPtr<GMPParent> 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;
}

Просмотреть файл

@ -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().
//