mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-05 00:02:37 +00:00
Bug 1075199 - More logging in ClearKey CDM - r=cpearce
This commit is contained in:
parent
4e3006ddd2
commit
bc2814dfe3
@ -117,6 +117,7 @@ AudioDecoder::DecodeTask(GMPAudioSamples* aInput)
|
||||
ClearKeyDecryptionManager::Get()->Decrypt(&buffer[0], buffer.size(), crypto);
|
||||
|
||||
if (GMP_FAILED(rv)) {
|
||||
CK_LOGE("Failed to decrypt with key id %08x...", *(uint32_t*)crypto->KeyId());
|
||||
GetPlatform()->runonmainthread(WrapTask(mCallback, &GMPAudioDecoderCallback::Error, rv));
|
||||
return;
|
||||
}
|
||||
|
@ -61,14 +61,14 @@ ClearKeyDecryptionManager::~ClearKeyDecryptionManager()
|
||||
bool
|
||||
ClearKeyDecryptionManager::HasSeenKeyId(const KeyId& aKeyId) const
|
||||
{
|
||||
CK_LOGD("ClearKeyDecryptionManager::HasSeenKeyId");
|
||||
CK_LOGD("ClearKeyDecryptionManager::SeenKeyId %s", mDecryptors.find(aKeyId) != mDecryptors.end() ? "t" : "f");
|
||||
return mDecryptors.find(aKeyId) != mDecryptors.end();
|
||||
}
|
||||
|
||||
bool
|
||||
ClearKeyDecryptionManager::IsExpectingKeyForKeyId(const KeyId& aKeyId) const
|
||||
{
|
||||
CK_LOGD("ClearKeyDecryptionManager::IsExpectingKeyForKeyId");
|
||||
CK_LOGD("ClearKeyDecryptionManager::IsExpectingKeyForId %08x...", *(uint32_t*)&aKeyId[0]);
|
||||
const auto& decryptor = mDecryptors.find(aKeyId);
|
||||
return decryptor != mDecryptors.end() && !decryptor->second->HasKey();
|
||||
}
|
||||
@ -91,7 +91,7 @@ ClearKeyDecryptionManager::GetDecryptionKey(const KeyId& aKeyId)
|
||||
void
|
||||
ClearKeyDecryptionManager::InitKey(KeyId aKeyId, Key aKey)
|
||||
{
|
||||
CK_LOGD("ClearKeyDecryptionManager::InitKey");
|
||||
CK_LOGD("ClearKeyDecryptionManager::InitKey %08x...", *(uint32_t*)&aKeyId[0]);
|
||||
if (IsExpectingKeyForKeyId(aKeyId)) {
|
||||
mDecryptors[aKeyId]->InitKey(aKey);
|
||||
}
|
||||
@ -100,7 +100,7 @@ ClearKeyDecryptionManager::InitKey(KeyId aKeyId, Key aKey)
|
||||
void
|
||||
ClearKeyDecryptionManager::ExpectKeyId(KeyId aKeyId)
|
||||
{
|
||||
CK_LOGD("ClearKeyDecryptionManager::ExpectKeyId");
|
||||
CK_LOGD("ClearKeyDecryptionManager::ExpectKeyId %08x...", *(uint32_t*)&aKeyId[0]);
|
||||
if (!HasSeenKeyId(aKeyId)) {
|
||||
mDecryptors[aKeyId] = new ClearKeyDecryptor();
|
||||
}
|
||||
@ -111,6 +111,8 @@ void
|
||||
ClearKeyDecryptionManager::ReleaseKeyId(KeyId aKeyId)
|
||||
{
|
||||
CK_LOGD("ClearKeyDecryptionManager::ReleaseKeyId");
|
||||
MOZ_ASSERT(HasKeyForKeyId(aKeyId));
|
||||
|
||||
ClearKeyDecryptor* decryptor = mDecryptors[aKeyId];
|
||||
if (!decryptor->Release()) {
|
||||
mDecryptors.erase(aKeyId);
|
||||
@ -138,7 +140,7 @@ ClearKeyDecryptor::ClearKeyDecryptor()
|
||||
|
||||
ClearKeyDecryptor::~ClearKeyDecryptor()
|
||||
{
|
||||
CK_LOGD("ClearKeyDecryptor dtor; key ID = %08x...", *(uint32_t*)&mKey[0]);
|
||||
CK_LOGD("ClearKeyDecryptor dtor; key = %08x...", *(uint32_t*)&mKey[0]);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -20,7 +20,7 @@ using namespace std;
|
||||
ClearKeySessionManager::ClearKeySessionManager()
|
||||
: mDecryptionManager(ClearKeyDecryptionManager::Get())
|
||||
{
|
||||
CK_LOGD("ClearKeySessionManager ctor");
|
||||
CK_LOGD("ClearKeySessionManager ctor %p", this);
|
||||
AddRef();
|
||||
|
||||
if (GetPlatform()->createthread(&mThread) != GMPNoErr) {
|
||||
@ -31,7 +31,7 @@ ClearKeySessionManager::ClearKeySessionManager()
|
||||
|
||||
ClearKeySessionManager::~ClearKeySessionManager()
|
||||
{
|
||||
CK_LOGD("ClearKeySessionManager dtor");
|
||||
CK_LOGD("ClearKeySessionManager dtor %p", this);
|
||||
MOZ_ASSERT(!mRefCount);
|
||||
}
|
||||
|
||||
@ -372,7 +372,7 @@ ClearKeySessionManager::DoDecrypt(GMPBuffer* aBuffer,
|
||||
void
|
||||
ClearKeySessionManager::Shutdown()
|
||||
{
|
||||
CK_LOGD("ClearKeySessionManager::Shutdown");
|
||||
CK_LOGD("ClearKeySessionManager::Shutdown %p", this);
|
||||
|
||||
for (auto it = mSessions.begin(); it != mSessions.end(); it++) {
|
||||
delete it->second;
|
||||
@ -383,7 +383,7 @@ ClearKeySessionManager::Shutdown()
|
||||
void
|
||||
ClearKeySessionManager::DecryptingComplete()
|
||||
{
|
||||
CK_LOGD("ClearKeySessionManager::DecryptingComplete");
|
||||
CK_LOGD("ClearKeySessionManager::DecryptingComplete %p", this);
|
||||
|
||||
GMPThread* thread = mThread;
|
||||
thread->Join();
|
||||
|
@ -35,6 +35,7 @@ CK_Log(const char* aFmt, ...)
|
||||
va_end(ap);
|
||||
|
||||
printf("\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
x
Reference in New Issue
Block a user