本文整理汇总了C++中nsString::EqualsASCII方法的典型用法代码示例。如果您正苦于以下问题:C++ nsString::EqualsASCII方法的具体用法?C++ nsString::EqualsASCII怎么用?C++ nsString::EqualsASCII使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsString
的用法示例。
在下文中一共展示了nsString::EqualsASCII方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HaveGMPFor
static bool
CanDecryptAndDecode(mozIGeckoMediaPluginService* aGMPService,
const nsString& aKeySystem,
const nsString& aContentType,
CodecType aCodecType,
const KeySystemContainerSupport& aContainerSupport,
const nsTArray<GMPCodecString>& aCodecs,
DecoderDoctorDiagnostics* aDiagnostics)
{
MOZ_ASSERT(aCodecType != Invalid);
MOZ_ASSERT(HaveGMPFor(aGMPService,
NS_ConvertUTF16toUTF8(aKeySystem),
NS_LITERAL_CSTRING(GMP_API_DECRYPTOR)));
for (const GMPCodecString& codec : aCodecs) {
MOZ_ASSERT(!codec.IsEmpty());
nsCString api = (aCodecType == Audio) ? NS_LITERAL_CSTRING(GMP_API_AUDIO_DECODER)
: NS_LITERAL_CSTRING(GMP_API_VIDEO_DECODER);
if (aContainerSupport.DecryptsAndDecodes(codec) &&
HaveGMPFor(aGMPService,
NS_ConvertUTF16toUTF8(aKeySystem),
api,
codec)) {
// GMP can decrypt-and-decode this codec.
continue;
}
if (aContainerSupport.Decrypts(codec) &&
NS_SUCCEEDED(MediaSource::IsTypeSupported(aContentType, aDiagnostics))) {
// GMP can decrypt and is allowed to return compressed samples to
// Gecko to decode, and Gecko has a decoder.
continue;
}
// Neither the GMP nor Gecko can both decrypt and decode. We don't
// support this codec.
#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 (codec == GMP_CODEC_AAC &&
aKeySystem.EqualsASCII(kEMEKeySystemWidevine) &&
!WMFDecoderModule::HasAAC()) {
if (aDiagnostics) {
aDiagnostics->SetKeySystemIssue(
DecoderDoctorDiagnostics::eWidevineWithNoWMF);
}
}
#endif
return false;
}
return true;
}