Bug 1471588 - Add details to SourceMediaStream and TrackUnionStream tracing. r=padenot
authorAndreas Pehrson <pehrsons@mozilla.com>
Wed, 27 Jun 2018 18:30:13 +0200
changeset 819837 3bbc83b7469fae194f6b8266d1d25e7a76ed47a0
parent 819836 0fffc7902a91f01c4ee0acb85aeb49cef3b6f83d
child 819838 2c429714e908c2888676e1e0bef9959b0a4595b5
push id116678
push userbmo:nchevobbe@mozilla.com
push dateWed, 18 Jul 2018 18:05:12 +0000
reviewerspadenot
bugs1471588
milestone63.0a1
Bug 1471588 - Add details to SourceMediaStream and TrackUnionStream tracing. r=padenot MozReview-Commit-ID: 38UoVtXILBk
dom/media/MediaStreamGraph.cpp
dom/media/TrackUnionStream.cpp
--- a/dom/media/MediaStreamGraph.cpp
+++ b/dom/media/MediaStreamGraph.cpp
@@ -2759,17 +2759,17 @@ SourceMediaStream::SetPullEnabled(bool a
     bool mEnabled;
   };
   GraphImpl()->AppendMessage(MakeUnique<Message>(this, aEnabled));
 }
 
 bool
 SourceMediaStream::PullNewData(StreamTime aDesiredUpToTime)
 {
-  TRACE_AUDIO_CALLBACK();
+  TRACE_AUDIO_CALLBACK_COMMENT("SourceMediaStream %p", this);
   MutexAutoLock lock(mMutex);
   if (!mPullEnabled || mFinished) {
     return false;
   }
   // Compute how much stream time we'll need assuming we don't block
   // the stream at all.
   StreamTime t = GraphTimeToStreamTime(aDesiredUpToTime);
   StreamTime current = mTracks.GetEnd();
--- a/dom/media/TrackUnionStream.cpp
+++ b/dom/media/TrackUnionStream.cpp
@@ -63,17 +63,17 @@ TrackUnionStream::TrackUnionStream()
         EndTrack(i);
         mTrackMap.RemoveElementAt(i);
       }
     }
     ProcessedMediaStream::RemoveInput(aPort);
   }
   void TrackUnionStream::ProcessInput(GraphTime aFrom, GraphTime aTo, uint32_t aFlags)
   {
-    TRACE();
+    TRACE_AUDIO_CALLBACK_COMMENT("TrackUnionStream %p", this);
     if (IsFinishedOnGraphThread()) {
       return;
     }
     AutoTArray<bool,8> mappedTracksFinished;
     AutoTArray<bool,8> mappedTracksWithMatchingInputTracks;
     for (uint32_t i = 0; i < mTrackMap.Length(); ++i) {
       mappedTracksFinished.AppendElement(true);
       mappedTracksWithMatchingInputTracks.AppendElement(false);
@@ -285,16 +285,21 @@ TrackUnionStream::TrackUnionStream()
     outputTrack->SetEnded();
   }
 
   void TrackUnionStream::CopyTrackData(StreamTracks::Track* aInputTrack,
                      uint32_t aMapIndex, GraphTime aFrom, GraphTime aTo,
                      bool* aOutputTrackFinished)
   {
     TrackMapEntry* map = &mTrackMap[aMapIndex];
+    TRACE_AUDIO_CALLBACK_COMMENT("Input stream %p track %i -> TrackUnionStream %p track %i",
+                                 map->mInputPort->GetSource(),
+                                 map->mInputTrackID,
+                                 this,
+                                 map->mOutputTrackID);
     StreamTracks::Track* outputTrack = mTracks.FindTrack(map->mOutputTrackID);
     MOZ_ASSERT(outputTrack && !outputTrack->IsEnded(), "Can't copy to ended track");
 
     MediaSegment* segment = map->mSegment;
     MediaStream* source = map->mInputPort->GetSource();
 
     GraphTime next;
     *aOutputTrackFinished = false;