Bug 1456743 - P2. Have MediaFormatReader debug show live audio codec type. r=bryce
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 30 Apr 2018 19:06:06 +0200
changeset 416442 c526527f499ec1c912a58937031730747bc7cf29
parent 416441 0f4214755cd79038d89861cc29be0e5fd090e7eb
child 416443 d89660b4978f082c7676af47e3c4da2789e20153
push id33928
push usercsabou@mozilla.com
push dateWed, 02 May 2018 09:26:14 +0000
treeherdermozilla-central@d28c45ebedcc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbryce
bugs1456743
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1456743 - P2. Have MediaFormatReader debug show live audio codec type. r=bryce Additionally, show the number of channels and the sampling rate. MozReview-Commit-ID: L067Hbv0bXz
dom/media/MediaFormatReader.cpp
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -3517,28 +3517,35 @@ MediaFormatReader::GetMozDebugReaderData
   nsAutoCString audioType("none");
   nsAutoCString videoType("none");
 
   if (HasAudio()) {
     MutexAutoLock lock(mAudio.mMutex);
     audioDecoderName = mAudio.mDecoder
                        ? mAudio.mDecoder->GetDescriptionName()
                        : mAudio.mDescription;
-    audioType = mInfo.mAudio.mMimeType;
+    audioType = mAudio.mInfo ? mAudio.mInfo->mMimeType : mInfo.mAudio.mMimeType;
   }
   if (HasVideo()) {
     MutexAutoLock mon(mVideo.mMutex);
     videoDecoderName = mVideo.mDecoder
                        ? mVideo.mDecoder->GetDescriptionName()
                        : mVideo.mDescription;
-    videoType = mInfo.mVideo.mMimeType;
+    videoType = mVideo.mInfo ? mVideo.mInfo->mMimeType : mInfo.mVideo.mMimeType;
   }
 
-  result += nsPrintfCString(
-    "Audio Decoder(%s): %s\n", audioType.get(), audioDecoderName.get());
+  result +=
+    nsPrintfCString("Audio Decoder(%s, %u channels @ %0.1fkHz): %s\n",
+                    audioType.get(),
+                    mAudio.mInfo ? mAudio.mInfo->GetAsAudioInfo()->mChannels
+                                 : mInfo.mAudio.mChannels,
+                    (mAudio.mInfo ? mAudio.mInfo->GetAsAudioInfo()->mRate
+                                  : mInfo.mAudio.mRate) /
+                      1000.0f,
+                    audioDecoderName.get());
   result += nsPrintfCString("Audio Frames Decoded: %" PRIu64 "\n",
                             mAudio.mNumSamplesOutputTotal);
   if (HasAudio()) {
     result += nsPrintfCString(
       "Audio State: ni=%d no=%d wp=%d demuxr=%d demuxq=%u decoder=%d tt=%.1f "
       "tths=%d in=%" PRIu64 " out=%" PRIu64
       " qs=%u pending=%u wfd=%d eos=%d ds=%d wfk=%d sid=%u\n",
       NeedInput(mAudio),