Bug 1283630 - Remove remaining MOZ_WIDEVINE_EME define checks. r?jwwang
I had meant to remove all of these in
bug 1276132, but I missed a couple. We
should now check whether Widevine is enabled before hitting these code paths
by checking the preference.
MozReview-Commit-ID: FmAdlgbF0Py
--- a/dom/media/eme/MediaKeySystemAccess.cpp
+++ b/dom/media/eme/MediaKeySystemAccess.cpp
@@ -388,17 +388,17 @@ GMPDecryptsAndGeckoDecodesAAC(mozIGeckoM
if (HaveGMPFor(aGMPService,
NS_ConvertUTF16toUTF8(aKeySystem),
NS_LITERAL_CSTRING(GMP_API_AUDIO_DECODER),
NS_LITERAL_CSTRING("aac"))) {
// We do have a GMP for AAC -> Gecko itself does *not* decode AAC.
return false;
}
-#if defined(MOZ_WIDEVINE_EME) && defined(XP_WIN)
+#if defined(XP_WIN)
// Widevine CDM doesn't include an AAC decoder. So if WMF can't
// decode AAC, and a codec wasn't specified, be conservative
// and reject the MediaKeys request, since our policy is to prevent
// the Adobe GMP's unencrypted AAC decoding path being used to
// decode content decrypted by the Widevine CDM.
if (aKeySystem.EqualsLiteral("com.widevine.alpha") &&
!WMFDecoderModule::HasAAC()) {
if (aDiagnostics) {
@@ -465,20 +465,17 @@ IsSupported(mozIGeckoMediaPluginService*
static bool
IsSupportedInitDataType(const nsString& aCandidate, const nsAString& aKeySystem)
{
// All supported keySystems can handle "cenc" initDataType.
// ClearKey also supports "keyids" and "webm" initDataTypes.
return aCandidate.EqualsLiteral("cenc") ||
((aKeySystem.EqualsLiteral("org.w3.clearkey")
-#ifdef MOZ_WIDEVINE_EME
- || aKeySystem.EqualsLiteral("com.widevine.alpha")
-#endif
- ) &&
+ || aKeySystem.EqualsLiteral("com.widevine.alpha")) &&
(aCandidate.EqualsLiteral("keyids") || aCandidate.EqualsLiteral("webm)")));
}
static bool
GetSupportedConfig(mozIGeckoMediaPluginService* aGMPService,
const nsAString& aKeySystem,
const MediaKeySystemConfiguration& aCandidate,
MediaKeySystemConfiguration& aOutConfig,
@@ -521,17 +518,17 @@ GetSupportedConfig(mozIGeckoMediaPluginS
}
if (caps.IsEmpty()) {
return false;
}
config.mVideoCapabilities.Construct();
config.mVideoCapabilities.Value().Assign(caps);
}
-#if defined(MOZ_WIDEVINE_EME) && defined(XP_WIN)
+#if defined(XP_WIN)
// Widevine CDM doesn't include an AAC decoder. So if WMF can't decode AAC,
// and a codec wasn't specified, be conservative and reject the MediaKeys request.
if (aKeySystem.EqualsLiteral("com.widevine.alpha") &&
(!aCandidate.mAudioCapabilities.WasPassed() ||
!aCandidate.mVideoCapabilities.WasPassed()) &&
!WMFDecoderModule::HasAAC()) {
if (aDiagnostics) {
aDiagnostics->SetKeySystemIssue(