Bug 1546655 - Add AudioQueue info to DecodedStream's debug info. r=jya a=jcristau
authorAndreas Pehrson <apehrson@mozilla.com>
Wed, 22 May 2019 12:46:25 +0000
changeset 536573 facb1c6c89a56ef8d71602a4e8a9b8553e771223
parent 536572 2a54b1e72baea2b593c2e46722ab97629fec8e2a
child 536574 b53f13005bd356af675fe72ec80f80a9bd8a7ae5
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya, jcristau
bugs1546655
milestone68.0
Bug 1546655 - Add AudioQueue info to DecodedStream's debug info. r=jya a=jcristau Depends on D32110 Differential Revision: https://phabricator.services.mozilla.com/D32111
dom/media/mediasink/DecodedStream.cpp
--- a/dom/media/mediasink/DecodedStream.cpp
+++ b/dom/media/mediasink/DecodedStream.cpp
@@ -957,20 +957,23 @@ void DecodedStream::DisconnectListener()
   mVideoPushListener.Disconnect();
   mAudioFinishListener.Disconnect();
   mVideoFinishListener.Disconnect();
 }
 
 nsCString DecodedStream::GetDebugInfo() {
   AssertOwnerThread();
   int64_t startTime = mStartTime.isSome() ? mStartTime->ToMicroseconds() : -1;
-  auto str =
-      nsPrintfCString("DecodedStream=%p mStartTime=%" PRId64
-                      " mLastOutputTime=%" PRId64 " mPlaying=%d mData=%p",
-                      this, startTime, mLastOutputTime.ToMicroseconds(),
-                      mPlaying.Ref(), mData.get());
+  auto lastAudio = mAudioQueue.PeekBack();
+  auto str = nsPrintfCString(
+      "DecodedStream=%p mStartTime=%" PRId64 " mLastOutputTime=%" PRId64
+      " mPlaying=%d AudioQueue(finished=%d size=%zu lastEndTime=%" PRId64
+      ") mData=%p",
+      this, startTime, mLastOutputTime.ToMicroseconds(), mPlaying.Ref(),
+      mAudioQueue.IsFinished(), mAudioQueue.GetSize(),
+      lastAudio ? lastAudio->GetEndTime().ToMicroseconds() : -1, mData.get());
   if (mData) {
     AppendStringIfNotEmpty(str, mData->GetDebugInfo());
   }
   return std::move(str);
 }
 
 }  // namespace mozilla