Bug 1536766 - Remove unused MediaStream::HasCurrentData. r=padenot
☠☠ backed out by 41f1dcbe9caa ☠ ☠
authorAndreas Pehrson <apehrson@mozilla.com>
Thu, 18 Apr 2019 15:24:12 +0000
changeset 528918 25f3a33ec51b06b14d8f5eef12ebc3afe4c21e88
parent 528917 199efe6aec594ef6d9f3c4c8af16b2e997a8bd51
child 528919 f2923dfcf33cd9567b83e2e2793a026b52893408
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1536766
milestone68.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 1536766 - Remove unused MediaStream::HasCurrentData. r=padenot Differential Revision: https://phabricator.services.mozilla.com/D27266
dom/media/MediaStreamGraph.cpp
dom/media/MediaStreamGraph.h
dom/media/TrackUnionStream.cpp
dom/media/webaudio/AudioNodeStream.cpp
--- a/dom/media/MediaStreamGraph.cpp
+++ b/dom/media/MediaStreamGraph.cpp
@@ -1855,17 +1855,16 @@ void MediaStreamGraphImpl::Dispatch(alre
 }
 
 MediaStream::MediaStream()
     : mTracksStartTime(0),
       mStartBlocking(GRAPH_TIME_MAX),
       mSuspendedCount(0),
       mFinished(false),
       mNotifiedFinished(false),
-      mHasCurrentData(false),
       mMainThreadCurrentTime(0),
       mMainThreadFinished(false),
       mFinishedNotificationSent(false),
       mMainThreadDestroyed(false),
       mNrOfMainThreadUsers(0),
       mGraph(nullptr) {
   MOZ_COUNT_CTOR(MediaStream);
 }
@@ -2658,20 +2657,16 @@ void SourceMediaStream::ExtractPendingIn
                     streamDesiredUpToTime);
     }
     if (data->mCommands & SourceMediaStream::TRACK_END) {
       mTracks.FindTrack(data->mID)->SetEnded();
       mUpdateTracks.RemoveElementAt(i);
     }
   }
 
-  if (mTracks.GetEarliestTrackEnd() > 0) {
-    mHasCurrentData = true;
-  }
-
   if (finished) {
     FinishOnGraphThread();
   }
 }
 
 void SourceMediaStream::AddTrackInternal(TrackID aID, TrackRate aRate,
                                          MediaSegment* aSegment,
                                          uint32_t aFlags) {
--- a/dom/media/MediaStreamGraph.h
+++ b/dom/media/MediaStreamGraph.h
@@ -485,18 +485,16 @@ class MediaStream : public mozilla::Link
    * having its blocking time calculated in UpdateGraph and its blocking time
    * taken account of in UpdateCurrentTimeForStreams.
    */
   GraphTime StreamTimeToGraphTime(StreamTime aTime) const;
 
   bool IsFinishedOnGraphThread() const { return mFinished; }
   virtual void FinishOnGraphThread();
 
-  bool HasCurrentData() const { return mHasCurrentData; }
-
   /**
    * Find track by track id.
    */
   StreamTracks::Track* FindTrack(TrackID aID) const;
 
   StreamTracks::Track* EnsureTrack(TrackID aTrack);
 
   virtual void ApplyTrackDisabling(TrackID aTrackID, MediaSegment* aSegment,
@@ -605,23 +603,16 @@ class MediaStream : public mozilla::Link
    * Only accessed on the graph thread
    */
   bool mFinished;
   /**
    * When true, mFinished is true and we've played all the data in this stream
    * and fired NotifyFinished notifications.
    */
   bool mNotifiedFinished;
-  /**
-   * True if some data can be present by this stream if/when it's unblocked.
-   * Set by the stream itself on the MediaStreamGraph thread. Only changes
-   * from false to true once a stream has data, since we won't
-   * unblock it until there's more data.
-   */
-  bool mHasCurrentData;
 
   // Main-thread views of state
   StreamTime mMainThreadCurrentTime;
   bool mMainThreadFinished;
   bool mFinishedNotificationSent;
   bool mMainThreadDestroyed;
   int mNrOfMainThreadUsers;
 
--- a/dom/media/TrackUnionStream.cpp
+++ b/dom/media/TrackUnionStream.cpp
@@ -76,28 +76,24 @@ void TrackUnionStream::ProcessInput(Grap
     mappedTracksFinished.AppendElement(true);
     mappedTracksWithMatchingInputTracks.AppendElement(false);
   }
 
   AutoTArray<MediaInputPort*, 32> inputs(mInputs);
   inputs.AppendElements(mSuspendedInputs);
 
   bool allFinished = !inputs.IsEmpty();
-  bool allHaveCurrentData = !inputs.IsEmpty();
   for (uint32_t i = 0; i < inputs.Length(); ++i) {
     MediaStream* stream = inputs[i]->GetSource();
     if (!stream->IsFinishedOnGraphThread()) {
       // XXX we really should check whether 'stream' has finished within time
       // aTo, not just that it's finishing when all its queued data eventually
       // runs out.
       allFinished = false;
     }
-    if (!stream->HasCurrentData()) {
-      allHaveCurrentData = false;
-    }
     for (StreamTracks::TrackIter tracks(stream->GetStreamTracks());
          !tracks.IsEnded(); tracks.Next()) {
       bool found = false;
       for (uint32_t j = 0; j < mTrackMap.Length(); ++j) {
         TrackMapEntry* map = &mTrackMap[j];
         if (map->mInputPort == inputs[i] &&
             map->mInputTrackID == tracks->GetID()) {
           bool trackFinished = false;
@@ -139,20 +135,16 @@ void TrackUnionStream::ProcessInput(Grap
     }
   }
   if (allFinished && mAutofinish && (aFlags & ALLOW_FINISH)) {
     // All streams have finished and won't add any more tracks, and
     // all our tracks have actually finished and been removed from our map,
     // so we're finished now.
     FinishOnGraphThread();
   }
-  if (allHaveCurrentData) {
-    // We can make progress if we're not blocked
-    mHasCurrentData = true;
-  }
 }
 
 uint32_t TrackUnionStream::AddTrack(MediaInputPort* aPort,
                                     StreamTracks::Track* aTrack,
                                     GraphTime aFrom) {
   STREAM_LOG(LogLevel::Verbose,
              ("TrackUnionStream %p adding track %d for "
               "input stream %p track %d, desired id %d",
--- a/dom/media/webaudio/AudioNodeStream.cpp
+++ b/dom/media/webaudio/AudioNodeStream.cpp
@@ -38,18 +38,16 @@ AudioNodeStream::AudioNodeStream(AudioNo
       mIsActive(aEngine->IsActive()),
       mMarkAsFinishedAfterThisBlock(false),
       mAudioParamStream(false),
       mPassThrough(false) {
   MOZ_ASSERT(NS_IsMainThread());
   mSuspendedCount = !(mIsActive || mFlags & EXTERNAL_OUTPUT);
   mChannelCountMode = ChannelCountMode::Max;
   mChannelInterpretation = ChannelInterpretation::Speakers;
-  // AudioNodes are always producing data
-  mHasCurrentData = true;
   mLastChunks.SetLength(std::max(uint16_t(1), mEngine->OutputCount()));
   MOZ_COUNT_CTOR(AudioNodeStream);
 }
 
 AudioNodeStream::~AudioNodeStream() {
   MOZ_ASSERT(mActiveInputCount == 0);
   MOZ_COUNT_DTOR(AudioNodeStream);
 }