Bug 1846848 - part8 : display clear lead support. r=jolin,fluent-reviewers,flod

Differential Revision: https://phabricator.services.mozilla.com/D195058
This commit is contained in:
alwu 2023-12-06 09:04:04 +00:00
parent 9445349b18
commit 15a965b141
8 changed files with 30 additions and 1 deletions

View File

@ -1099,4 +1099,5 @@ dictionary LibcConstants {
dictionary CDMInformation {
required DOMString keySystemName;
required DOMString capabilities;
required boolean clearlead;
};

View File

@ -188,4 +188,21 @@ void MFCDMCapabilitiesIPDLToKeySystemConfig(
}
#endif
bool DoesKeySystemSupportClearLead(const nsAString& aKeySystem) {
// I believe that Widevine L3 supports clear-lead, but I couldn't find any
// official documentation to prove that. The only one I can find is that Shaka
// player mentions the clear lead feature. So we expect L3 should have that as
// well. But for HWDRM, Widevine L1 and SL3000 needs to rely on special checks
// to know whether clearlead is supported. That will be implemented by
// querying for special key system names.
// https://shaka-project.github.io/shaka-packager/html/documentation.html
#ifdef MOZ_WMF_CDM
// TODO : implement new key system for PlayReady.
if (aKeySystem.EqualsLiteral(kWidevineExperiment2KeySystemName)) {
return true;
}
#endif
return aKeySystem.EqualsLiteral(kWidevineKeySystemName);
}
} // namespace mozilla

View File

@ -91,6 +91,8 @@ void MFCDMCapabilitiesIPDLToKeySystemConfig(
const MFCDMCapabilitiesIPDL& aCDMConfig, KeySystemConfig& aKeySystemConfig);
#endif
bool DoesKeySystemSupportClearLead(const nsAString& aKeySystem);
} // namespace mozilla
#endif // EME_LOG_H_

View File

@ -231,6 +231,7 @@ void KeySystemConfig::GetGMPKeySystemConfigs(dom::Promise* aPromise) {
MOZ_ASSERT(keySystemConfigs.Length() == cdmInfo.Length());
info->mKeySystemName = name;
info->mCapabilities = keySystemConfigs.LastElement().GetDebugInfo();
info->mClearlead = DoesKeySystemSupportClearLead(name);
}
}
aPromise->MaybeResolve(cdmInfo);

View File

@ -213,6 +213,8 @@ void UtilityAudioDecoderChild::GetKeySystemCapabilities(
KeySystemConfig config;
MFCDMCapabilitiesIPDLToKeySystemConfig(capabilities, config);
info->mCapabilities = config.GetDebugInfo();
info->mClearlead =
DoesKeySystemSupportClearLead(info->mKeySystemName);
}
promise->MaybeResolve(cdmInfo);
},

View File

@ -1177,6 +1177,7 @@ var snapshotFormatters = {
$.new("td", getVideoRobustness(rvArray)),
$.new("td", getAudioRobustness(rvArray)),
$.new("td", getCapabilities(rvArray)),
$.new("td", cdmInfo.clearlead ? "Yes" : "No"),
]);
}

View File

@ -567,13 +567,14 @@
<tbody id="media-content-decryption-modules-tbody">
<tr>
<th colspan="4" class="title-column" data-l10n-id="media-content-decryption-modules-title"/>
<th colspan="5" class="title-column" data-l10n-id="media-content-decryption-modules-title"/>
</tr>
<tr>
<th data-l10n-id="media-key-system-name"/>
<th data-l10n-id="media-video-robustness"/>
<th data-l10n-id="media-audio-robustness"/>
<th data-l10n-id="media-cdm-capabilities"/>
<th data-l10n-id="media-cdm-clear-lead"/>
</tr>
</tbody>

View File

@ -201,6 +201,10 @@ media-key-system-name = Key System Name
media-video-robustness = Video Robustness
media-audio-robustness = Audio Robustness
media-cdm-capabilities = Capabilities
# Clear Lead isn't defined in the spec, which means the the first few seconds
# are not encrypted. It allows playback to start without having to wait for
# license response, improving video start time and user experience.
media-cdm-clear-lead = Clear Lead
##