Bug 1397307 - P7. Display video resolution and frame rate in debug data. r?gerald draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 12 Sep 2017 17:40:42 +0200
changeset 665097 61e18a25dbcbcf607b9412408784765bc3b85bc5
parent 665096 9759e2aa9ca20240eeb0a8448a067a1f1b4c1215
child 665098 54e86e966ba89fa160df990557016538fe4bc182
push id79919
push userbmo:jyavenard@mozilla.com
push dateThu, 14 Sep 2017 22:16:27 +0000
reviewersgerald
bugs1397307
milestone57.0a1
Bug 1397307 - P7. Display video resolution and frame rate in debug data. r?gerald MozReview-Commit-ID: 9vsheKkAm4p
dom/media/MediaFormatReader.cpp
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -3163,18 +3163,28 @@ MediaFormatReader::GetMozDebugReaderData
       unsigned(size_t(mAudio.mSizeOfQueue)),
       unsigned(mAudio.mOutput.Length()),
       mAudio.mWaitingForData,
       mAudio.mDemuxEOS,
       int32_t(mAudio.mDrainState),
       mAudio.mWaitingForKey,
       mAudio.mLastStreamSourceID);
   }
+
+  VideoInfo videoInfo = mVideo.mInfo ? *mVideo.mInfo->GetAsVideoInfo()
+                                     : *mVideo.mOriginalInfo->GetAsVideoInfo();
+
   result += nsPrintfCString(
-    "Video Decoder(%s): %s\n", videoType.get(), videoDecoderName.get());
+    "Video Decoder(%s, %dx%d @ %0.2ffps): %s\n",
+    videoType.get(),
+    videoInfo.mDisplay.width < 0 ? 0 : videoInfo.mDisplay.width,
+    videoInfo.mDisplay.height < 0 ? 0 : videoInfo.mDisplay.height,
+    mVideo.mMeanRate.Mean(),
+    videoDecoderName.get());
+
   result +=
     nsPrintfCString("Hardware Video Decoding: %s\n",
                     VideoIsHardwareAccelerated() ? "enabled" : "disabled");
   result +=
     nsPrintfCString("Video Frames Decoded: %" PRIu64 " (skipped=%" PRIu64 ")\n",
                     mVideo.mNumSamplesOutputTotal,
                     mVideo.mNumSamplesSkippedTotal);
   if (HasVideo()) {