From d885daf77442861c8d7161bd5ccdf8f564946938 Mon Sep 17 00:00:00 2001 From: Chris Pearce Date: Tue, 28 Mar 2017 11:05:48 +1300 Subject: [PATCH] Bug 1351132 - Fix keystatus and decode logging in ChromiumCDMChild. r=gerald MozReview-Commit-ID: xwfJ4WwbmN --HG-- extra : rebase_source : ee459eb16df41055ce6ade360ff1149f3b894caa --- dom/media/gmp/ChromiumCDMChild.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/dom/media/gmp/ChromiumCDMChild.cpp b/dom/media/gmp/ChromiumCDMChild.cpp index 33bccca1d47d..7cf9fdda78b2 100644 --- a/dom/media/gmp/ChromiumCDMChild.cpp +++ b/dom/media/gmp/ChromiumCDMChild.cpp @@ -13,6 +13,7 @@ #include "mozilla/Unused.h" #include "nsPrintfCString.h" #include "base/time.h" +#include "GMPUtils.h" namespace mozilla { namespace gmp { @@ -154,15 +155,11 @@ ToString(const cdm::KeyInformation* aKeysInfo, uint32_t aKeysInfoCount) { nsCString str; for (uint32_t i = 0; i < aKeysInfoCount; i++) { - nsCString keyId; - const cdm::KeyInformation& key = aKeysInfo[i]; - for (size_t k = 0; k < key.key_id_size; k++) { - keyId.Append(nsPrintfCString("%hhX", key.key_id[k])); - } if (!str.IsEmpty()) { str.AppendLiteral(","); } - str.Append(keyId); + const cdm::KeyInformation& key = aKeysInfo[i]; + str.Append(ToHexString(key.key_id, key.key_id_size)); str.AppendLiteral("="); str.AppendInt(key.status); } @@ -509,7 +506,8 @@ mozilla::ipc::IPCResult ChromiumCDMChild::RecvDecryptAndDecodeFrame(const CDMInputBuffer& aBuffer) { MOZ_ASSERT(IsOnMessageLoopThread()); - GMP_LOG("ChromiumCDMChild::RecvDecryptAndDecodeFrame()"); + GMP_LOG("ChromiumCDMChild::RecvDecryptAndDecodeFrame() t=%" PRId64 ")", + aBuffer.mTimestamp()); MOZ_ASSERT(mDecoderInitialized); // The output frame may not have the same timestamp as the frame we put in. @@ -525,8 +523,9 @@ ChromiumCDMChild::RecvDecryptAndDecodeFrame(const CDMInputBuffer& aBuffer) WidevineVideoFrame frame; cdm::Status rv = mCDM->DecryptAndDecodeFrame(input, &frame); - GMP_LOG("WidevineVideoDecoder::Decode(timestamp=%" PRId64 ") rv=%d", - input.timestamp, + GMP_LOG("ChromiumCDMChild::RecvDecryptAndDecodeFrame() t=%" PRId64 + " CDM decoder rv=%d", + aBuffer.mTimestamp(), rv); switch (rv) {