Bug 1143278 - Make gmp-clearkey not require a Win8 only DLL to decode audio on Win7. r=edwin

This commit is contained in:
Chris Pearce 2015-04-13 13:39:46 +12:00
Родитель b4934d9e89
Коммит e61fe5c00d
3 изменённых файлов: 34 добавлений и 4 удалений

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

@ -51,10 +51,38 @@ CDMCaps::AutoLock::~AutoLock()
mData.Unlock();
}
#ifdef PR_LOGGING
static void
TestCap(uint64_t aFlag,
uint64_t aCaps,
const nsACString& aCapName,
nsACString& aCapStr)
{
if (!(aFlag & aCaps)) {
return;
}
if (!aCapStr.IsEmpty()) {
aCapStr.AppendLiteral(",");
}
aCapStr.Append(aCapName);
}
nsCString
CapsToString(uint64_t aCaps)
{
nsCString capsStr;
TestCap(GMP_EME_CAP_DECRYPT_AUDIO, aCaps, NS_LITERAL_CSTRING("DecryptAudio"), capsStr);
TestCap(GMP_EME_CAP_DECRYPT_VIDEO, aCaps, NS_LITERAL_CSTRING("DecryptVideo"), capsStr);
TestCap(GMP_EME_CAP_DECRYPT_AND_DECODE_AUDIO, aCaps, NS_LITERAL_CSTRING("DecryptAndDecodeAudio"), capsStr);
TestCap(GMP_EME_CAP_DECRYPT_AND_DECODE_VIDEO, aCaps, NS_LITERAL_CSTRING("DecryptAndDecodeVideo"), capsStr);
return capsStr;
}
#endif // PR_LOGGING
void
CDMCaps::AutoLock::SetCaps(uint64_t aCaps)
{
EME_LOG("SetCaps()");
EME_LOG("SetCaps() %s", CapsToString(aCaps).get());
mData.mMonitor.AssertCurrentThreadOwns();
mData.mCaps = aCaps;
for (size_t i = 0; i < mData.mWaitForCaps.Length(); i++) {

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

@ -113,7 +113,7 @@ typedef int64_t GMPTimestamp;
//
// Note: Gecko does not currently support the caps changing at runtime.
// Set them once per plugin initialization, during the startup of
// the GMPdecryptor.
// the GMPDecryptor.
// Capability; CDM can decrypt encrypted buffers and return still
// compressed buffers back to Gecko for decompression there.

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

@ -73,9 +73,11 @@ EnsureLibs()
static bool sInitDone = false;
static bool sInitOk = false;
if (!sInitDone) {
// Note: For AAC decoding, we need to use msauddecmft.dll on Win8,
// and msmpeg2adec.dll on earlier Windows. So if we have at least
// one of these, assume we can decode.
sInitOk = LinkMfplat() &&
!!GetModuleHandleA("msauddecmft.dll") &&
!!GetModuleHandleA("msmpeg2adec.dll") &&
(!!GetModuleHandleA("msauddecmft.dll") || !!GetModuleHandleA("msmpeg2adec.dll")) &&
!!GetModuleHandleA("msmpeg2vdec.dll");
sInitDone = true;
}