Bug 1573102 - Remove mGraph from MediaStreamTrack::MSGListener. r=karlt
authorAndreas Pehrson <apehrson@mozilla.com>
Thu, 29 Aug 2019 13:32:59 +0000
changeset 551178 c9807cc4506756639c2d48803fa5fc302871bab6
parent 551177 85ef72ebde439c5de258af43faa9bd83a6e23b26
child 551179 08faaf9d4ef714eea2daea43c137cd02609830e5
push id11865
push userbtara@mozilla.com
push dateMon, 02 Sep 2019 08:54:37 +0000
treeherdermozilla-beta@37f59c4671b3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs1573102
milestone70.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 1573102 - Remove mGraph from MediaStreamTrack::MSGListener. r=karlt To accomodate this, MediaStreamTrackListener::NotifyEnded/Removed get an additional aGraph argument. NotifyEnabledStateChanged is getting it too, for completion. Differential Revision: https://phabricator.services.mozilla.com/D43667
dom/media/MediaStreamGraph.cpp
dom/media/MediaStreamListener.h
dom/media/MediaStreamTrack.cpp
dom/media/VideoOutput.h
dom/media/encoder/MediaEncoder.cpp
dom/media/imagecapture/CaptureTask.cpp
dom/media/mediasink/DecodedStream.cpp
dom/media/webspeech/recognition/SpeechTrackListener.cpp
dom/media/webspeech/recognition/SpeechTrackListener.h
media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
--- a/dom/media/MediaStreamGraph.cpp
+++ b/dom/media/MediaStreamGraph.cpp
@@ -165,17 +165,17 @@ void MediaStreamGraphImpl::UpdateCurrent
         if (!track->NotifiedEnded()) {
           // Playout of this track ended and listeners have not been notified.
           track->NotifyEnded();
           for (const TrackBound<MediaStreamTrackListener>& listener :
                stream->mTrackListeners) {
             if (listener.mTrackID == track->GetID()) {
               listener.mListener->NotifyOutput(
                   this, track->GetEnd() - track->GetStart());
-              listener.mListener->NotifyEnded();
+              listener.mListener->NotifyEnded(this);
             }
           }
         }
       } else {
         for (const TrackBound<MediaStreamTrackListener>& listener :
              stream->mTrackListeners) {
           if (listener.mTrackID == track->GetID()) {
             listener.mListener->NotifyOutput(
@@ -1966,17 +1966,17 @@ StreamTracks::Track* MediaStream::Ensure
   return track;
 }
 
 void MediaStream::RemoveAllListenersImpl() {
   GraphImpl()->AssertOnGraphThreadOrNotRunning();
 
   auto trackListeners(mTrackListeners);
   for (auto& l : trackListeners) {
-    l.mListener->NotifyRemoved();
+    l.mListener->NotifyRemoved(Graph());
   }
   mTrackListeners.Clear();
 
   RemoveAllDirectListenersImpl();
 }
 
 void MediaStream::DestroyImpl() {
   for (int32_t i = mConsumers.Length() - 1; i >= 0; --i) {
@@ -2116,20 +2116,20 @@ void MediaStream::AddTrackListenerImpl(
     return;
   }
   PrincipalHandle lastPrincipalHandle =
       track->GetSegment()->GetLastPrincipalHandle();
   l->mListener->NotifyPrincipalHandleChanged(Graph(), lastPrincipalHandle);
   if (track->IsEnded() &&
       track->GetEnd() <=
           GraphTimeToStreamTime(GraphImpl()->mStateComputedTime)) {
-    l->mListener->NotifyEnded();
+    l->mListener->NotifyEnded(Graph());
   }
   if (GetDisabledTrackMode(aTrackID) == DisabledTrackMode::SILENCE_BLACK) {
-    l->mListener->NotifyEnabledStateChanged(false);
+    l->mListener->NotifyEnabledStateChanged(Graph(), false);
   }
 }
 
 void MediaStream::AddTrackListener(MediaStreamTrackListener* aListener,
                                    TrackID aTrackID) {
   class Message : public ControlMessage {
    public:
     Message(MediaStream* aStream, MediaStreamTrackListener* aListener,
@@ -2144,17 +2144,17 @@ void MediaStream::AddTrackListener(Media
   GraphImpl()->AppendMessage(MakeUnique<Message>(this, aListener, aTrackID));
 }
 
 void MediaStream::RemoveTrackListenerImpl(MediaStreamTrackListener* aListener,
                                           TrackID aTrackID) {
   for (size_t i = 0; i < mTrackListeners.Length(); ++i) {
     if (mTrackListeners[i].mListener == aListener &&
         mTrackListeners[i].mTrackID == aTrackID) {
-      mTrackListeners[i].mListener->NotifyRemoved();
+      mTrackListeners[i].mListener->NotifyRemoved(Graph());
       mTrackListeners.RemoveElementAt(i);
       return;
     }
   }
 }
 
 void MediaStream::RemoveTrackListener(MediaStreamTrackListener* aListener,
                                       TrackID aTrackID) {
@@ -2260,34 +2260,34 @@ void MediaStream::RunAfterPendingUpdates
 void MediaStream::SetTrackEnabledImpl(TrackID aTrackID,
                                       DisabledTrackMode aMode) {
   if (aMode == DisabledTrackMode::ENABLED) {
     for (int32_t i = mDisabledTracks.Length() - 1; i >= 0; --i) {
       if (aTrackID == mDisabledTracks[i].mTrackID) {
         mDisabledTracks.RemoveElementAt(i);
         for (TrackBound<MediaStreamTrackListener>& l : mTrackListeners) {
           if (l.mTrackID == aTrackID) {
-            l.mListener->NotifyEnabledStateChanged(true);
+            l.mListener->NotifyEnabledStateChanged(Graph(), true);
           }
         }
         return;
       }
     }
   } else {
     for (const DisabledTrack& t : mDisabledTracks) {
       if (aTrackID == t.mTrackID) {
         NS_ERROR("Changing disabled track mode for a track is not allowed");
         return;
       }
     }
     mDisabledTracks.AppendElement(DisabledTrack(aTrackID, aMode));
     if (aMode == DisabledTrackMode::SILENCE_BLACK) {
       for (TrackBound<MediaStreamTrackListener>& l : mTrackListeners) {
         if (l.mTrackID == aTrackID) {
-          l.mListener->NotifyEnabledStateChanged(false);
+          l.mListener->NotifyEnabledStateChanged(Graph(), false);
         }
       }
     }
   }
 }
 
 DisabledTrackMode MediaStream::GetDisabledTrackMode(TrackID aTrackID) {
   for (const DisabledTrack& t : mDisabledTracks) {
--- a/dom/media/MediaStreamListener.h
+++ b/dom/media/MediaStreamListener.h
@@ -74,35 +74,36 @@ class MediaStreamTrackListener {
   /**
    * Notify that the enabled state for the track this listener is attached to
    * has changed.
    *
    * The enabled state here is referring to whether audio should be audible
    * (enabled) or silent (not enabled); or whether video should be displayed as
    * is (enabled), or black (not enabled).
    */
-  virtual void NotifyEnabledStateChanged(bool aEnabled) {}
+  virtual void NotifyEnabledStateChanged(MediaStreamGraph* aGraph,
+                                         bool aEnabled) {}
 
   /**
    * Notify that the stream output is advancing. aCurrentTrackTime is the number
    * of samples that has been played out for this track in stream time.
    */
   virtual void NotifyOutput(MediaStreamGraph* aGraph,
                             StreamTime aCurrentTrackTime) {}
 
   /**
    * Notify that this track has been ended and all data has been played out.
    */
-  virtual void NotifyEnded() {}
+  virtual void NotifyEnded(MediaStreamGraph* aGraph) {}
 
   /**
    * Notify that this track listener has been removed from the graph, either
    * after shutdown or RemoveTrackListener.
    */
-  virtual void NotifyRemoved() {}
+  virtual void NotifyRemoved(MediaStreamGraph* aGraph) {}
 
  protected:
   virtual ~MediaStreamTrackListener() {}
 };
 
 /**
  * This is a base class for media graph thread listener direct callbacks from
  * within AppendToTrack(). It is bound to a certain track and can only be
--- a/dom/media/MediaStreamTrack.cpp
+++ b/dom/media/MediaStreamTrack.cpp
@@ -7,16 +7,17 @@
 
 #include "DOMMediaStream.h"
 #include "MediaStreamError.h"
 #include "MediaStreamGraphImpl.h"
 #include "MediaStreamListener.h"
 #include "mozilla/BasePrincipal.h"
 #include "mozilla/dom/Promise.h"
 #include "nsContentUtils.h"
+#include "nsGlobalWindowInner.h"
 #include "nsIUUIDGenerator.h"
 #include "nsServiceManagerUtils.h"
 #include "systemservices/MediaUtils.h"
 
 #ifdef LOG
 #  undef LOG
 #endif
 
@@ -73,73 +74,75 @@ auto MediaStreamTrackSource::ApplyConstr
  * under it cannot leak to consumers.
  *
  * In case of multiple changes to the main thread state, the track's principal
  * will be a combination of its old principal and all the new ones until the
  * latest main thread principal matches the PrincipalHandle on the MSG thread.
  */
 class MediaStreamTrack::MSGListener : public MediaStreamTrackListener {
  public:
-  explicit MSGListener(MediaStreamTrack* aTrack)
-      : mGraph(aTrack->GraphImpl()), mTrack(aTrack) {
-    MOZ_ASSERT(mGraph);
-  }
+  explicit MSGListener(MediaStreamTrack* aTrack) : mTrack(aTrack) {}
 
   void DoNotifyPrincipalHandleChanged(
       const PrincipalHandle& aNewPrincipalHandle) {
     MOZ_ASSERT(NS_IsMainThread());
 
     if (!mTrack) {
       return;
     }
 
     mTrack->NotifyPrincipalHandleChanged(aNewPrincipalHandle);
   }
 
   void NotifyPrincipalHandleChanged(
       MediaStreamGraph* aGraph,
       const PrincipalHandle& aNewPrincipalHandle) override {
-    mGraph->DispatchToMainThreadStableState(
+    aGraph->DispatchToMainThreadStableState(
         NewRunnableMethod<StoreCopyPassByConstLRef<PrincipalHandle>>(
             "dom::MediaStreamTrack::MSGListener::"
             "DoNotifyPrincipalHandleChanged",
             this, &MSGListener::DoNotifyPrincipalHandleChanged,
             aNewPrincipalHandle));
   }
 
-  void NotifyRemoved() override {
+  void NotifyRemoved(MediaStreamGraph* aGraph) override {
     // `mTrack` is a WeakPtr and must be destroyed on main thread.
     // We dispatch ourselves to main thread here in case the MediaStreamGraph
     // is holding the last reference to us.
-    mGraph->DispatchToMainThreadStableState(
+    aGraph->DispatchToMainThreadStableState(
         NS_NewRunnableFunction("MediaStreamTrack::MSGListener::mTrackReleaser",
                                [self = RefPtr<MSGListener>(this)]() {}));
   }
 
   void DoNotifyEnded() {
     MOZ_ASSERT(NS_IsMainThread());
 
     if (!mTrack) {
       return;
     }
 
-    mGraph->AbstractMainThread()->Dispatch(
-        NewRunnableMethod("MediaStreamTrack::OverrideEnded", mTrack.get(),
-                          &MediaStreamTrack::OverrideEnded));
+    if (!mTrack->GetParentObject()) {
+      return;
+    }
+
+    AbstractThread* mainThread =
+        nsGlobalWindowInner::Cast(mTrack->GetParentObject())
+            ->AbstractMainThreadFor(TaskCategory::Other);
+    mainThread->Dispatch(NewRunnableMethod("MediaStreamTrack::OverrideEnded",
+                                           mTrack.get(),
+                                           &MediaStreamTrack::OverrideEnded));
   }
 
-  void NotifyEnded() override {
-    mGraph->DispatchToMainThreadStableState(
+  void NotifyEnded(MediaStreamGraph* aGraph) override {
+    aGraph->DispatchToMainThreadStableState(
         NewRunnableMethod("MediaStreamTrack::MSGListener::DoNotifyEnded", this,
                           &MSGListener::DoNotifyEnded));
   }
 
  protected:
-  const RefPtr<MediaStreamGraphImpl> mGraph;
-
   // Main thread only.
   WeakPtr<MediaStreamTrack> mTrack;
 };
 
 class MediaStreamTrack::TrackSink : public MediaStreamTrackSource::Sink {
  public:
   explicit TrackSink(MediaStreamTrack* aTrack) : mTrack(aTrack) {}
 
--- a/dom/media/VideoOutput.h
+++ b/dom/media/VideoOutput.h
@@ -144,17 +144,17 @@ class VideoOutput : public DirectMediaSt
         mFrames.ClearAndRetainStorage();
       }
       mFrames.AppendElement(MakePair(mVideoFrameContainer->NewFrameID(), *i));
       mLastFrameTime = i->mTimeStamp;
     }
 
     SendFramesEnsureLocked();
   }
-  void NotifyRemoved() override {
+  void NotifyRemoved(MediaStreamGraph* aGraph) override {
     // Doesn't need locking by mMutex, since the direct listener is removed from
     // the track before we get notified.
     if (mFrames.Length() <= 1) {
       // The compositor has already received the last frame.
       mFrames.ClearAndRetainStorage();
       mVideoFrameContainer->ClearFutureFrames();
       return;
     }
@@ -164,29 +164,30 @@ class VideoOutput : public DirectMediaSt
     // SetCurrentFrames() once we've received the last frame in a track, so
     // there might be old frames lingering. We'll find the current one and
     // re-send that.
     DropPastFrames();
     mFrames.RemoveElementsAt(1, mFrames.Length() - 1);
     SendFrames();
     mFrames.ClearAndRetainStorage();
   }
-  void NotifyEnded() override {
+  void NotifyEnded(MediaStreamGraph* aGraph) override {
     // Doesn't need locking by mMutex, since for the track to end, it must have
     // been ended by the source, meaning that the source won't append more data.
     if (mFrames.IsEmpty()) {
       return;
     }
 
     // Re-send only the last one to the compositor.
     mFrames.RemoveElementsAt(0, mFrames.Length() - 1);
     SendFrames();
     mFrames.ClearAndRetainStorage();
   }
-  void NotifyEnabledStateChanged(bool aEnabled) override {
+  void NotifyEnabledStateChanged(MediaStreamGraph* aGraph,
+                                 bool aEnabled) override {
     MutexAutoLock lock(mMutex);
     mEnabled = aEnabled;
     // Since mEnabled will affect whether frames are real, or black, we assign
     // new FrameIDs whenever this changes.
     for (auto& idChunkPair : mFrames) {
       idChunkPair.first() = mVideoFrameContainer->NewFrameID();
     }
     SendFramesEnsureLocked();
--- a/dom/media/encoder/MediaEncoder.cpp
+++ b/dom/media/encoder/MediaEncoder.cpp
@@ -107,32 +107,32 @@ class MediaEncoder::AudioTrackListener :
     nsresult rv = mEncoderThread->Dispatch(
         NewRunnableMethod<StoreCopyPassByRRef<AudioSegment>>(
             "mozilla::AudioTrackEncoder::AppendAudioSegment", mEncoder,
             &AudioTrackEncoder::AppendAudioSegment, std::move(copy)));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
     Unused << rv;
   }
 
-  void NotifyEnded() override {
+  void NotifyEnded(MediaStreamGraph* aGraph) override {
     MOZ_ASSERT(mEncoder);
     MOZ_ASSERT(mEncoderThread);
 
     if (mShutdown) {
       return;
     }
 
     nsresult rv = mEncoderThread->Dispatch(
         NewRunnableMethod("mozilla::AudioTrackEncoder::NotifyEndOfStream",
                           mEncoder, &AudioTrackEncoder::NotifyEndOfStream));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
     Unused << rv;
   }
 
-  void NotifyRemoved() override {
+  void NotifyRemoved(MediaStreamGraph* aGraph) override {
     if (!mShutdown) {
       nsresult rv = mEncoderThread->Dispatch(
           NewRunnableMethod("mozilla::AudioTrackEncoder::NotifyEndOfStream",
                             mEncoder, &AudioTrackEncoder::NotifyEndOfStream));
       MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
       Unused << rv;
     }
 
@@ -241,17 +241,18 @@ class MediaEncoder::VideoTrackListener :
     nsresult rv = mEncoderThread->Dispatch(
         NewRunnableMethod<StoreCopyPassByRRef<VideoSegment>>(
             "mozilla::VideoTrackEncoder::AppendVideoSegment", mEncoder,
             &VideoTrackEncoder::AppendVideoSegment, std::move(copy)));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
     Unused << rv;
   }
 
-  void NotifyEnabledStateChanged(bool aEnabled) override {
+  void NotifyEnabledStateChanged(MediaStreamGraph* aGraph,
+                                 bool aEnabled) override {
     MOZ_ASSERT(mEncoder);
     MOZ_ASSERT(mEncoderThread);
 
     if (mShutdown) {
       return;
     }
 
     nsresult rv;
@@ -263,32 +264,32 @@ class MediaEncoder::VideoTrackListener :
       rv = mEncoderThread->Dispatch(NewRunnableMethod<TimeStamp>(
           "mozilla::VideoTrackEncoder::Disable", mEncoder,
           &VideoTrackEncoder::Disable, TimeStamp::Now()));
     }
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
     Unused << rv;
   }
 
-  void NotifyEnded() override {
+  void NotifyEnded(MediaStreamGraph* aGraph) override {
     MOZ_ASSERT(mEncoder);
     MOZ_ASSERT(mEncoderThread);
 
     if (mShutdown) {
       return;
     }
 
     nsresult rv = mEncoderThread->Dispatch(
         NewRunnableMethod("mozilla::VideoTrackEncoder::NotifyEndOfStream",
                           mEncoder, &VideoTrackEncoder::NotifyEndOfStream));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
     Unused << rv;
   }
 
-  void NotifyRemoved() override {
+  void NotifyRemoved(MediaStreamGraph* aGraph) override {
     if (!mShutdown) {
       nsresult rv = mEncoderThread->Dispatch(
           NewRunnableMethod("mozilla::VideoTrackEncoder::NotifyEndOfStream",
                             mEncoder, &VideoTrackEncoder::NotifyEndOfStream));
       MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
       Unused << rv;
     }
 
--- a/dom/media/imagecapture/CaptureTask.cpp
+++ b/dom/media/imagecapture/CaptureTask.cpp
@@ -16,17 +16,19 @@
 namespace mozilla {
 
 class CaptureTask::MediaStreamEventListener : public MediaStreamTrackListener {
  public:
   explicit MediaStreamEventListener(CaptureTask* aCaptureTask)
       : mCaptureTask(aCaptureTask){};
 
   // MediaStreamTrackListener methods.
-  void NotifyEnded() override { mCaptureTask->PostTrackEndEvent(); }
+  void NotifyEnded(MediaStreamGraph* aGraph) override {
+    mCaptureTask->PostTrackEndEvent();
+  }
 
  private:
   CaptureTask* mCaptureTask;
 };
 
 CaptureTask::CaptureTask(dom::ImageCapture* aImageCapture)
     : mImageCapture(aImageCapture),
       mEventListener(new MediaStreamEventListener(this)),
--- a/dom/media/mediasink/DecodedStream.cpp
+++ b/dom/media/mediasink/DecodedStream.cpp
@@ -38,17 +38,17 @@ class DecodedStreamGraphListener;
 
 class DecodedStreamTrackListener : public MediaStreamTrackListener {
  public:
   DecodedStreamTrackListener(DecodedStreamGraphListener* aGraphListener,
                              SourceMediaStream* aStream);
 
   void NotifyOutput(MediaStreamGraph* aGraph,
                     StreamTime aCurrentTrackTime) override;
-  void NotifyEnded() override;
+  void NotifyEnded(MediaStreamGraph* aGraph) override;
 
  private:
   const RefPtr<DecodedStreamGraphListener> mGraphListener;
   const RefPtr<SourceMediaStream> mStream;
 };
 
 class DecodedStreamGraphListener {
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(DecodedStreamGraphListener)
@@ -219,17 +219,17 @@ DecodedStreamTrackListener::DecodedStrea
     DecodedStreamGraphListener* aGraphListener, SourceMediaStream* aStream)
     : mGraphListener(aGraphListener), mStream(aStream) {}
 
 void DecodedStreamTrackListener::NotifyOutput(MediaStreamGraph* aGraph,
                                               StreamTime aCurrentTrackTime) {
   mGraphListener->NotifyOutput(mStream, aCurrentTrackTime);
 }
 
-void DecodedStreamTrackListener::NotifyEnded() {
+void DecodedStreamTrackListener::NotifyEnded(MediaStreamGraph* aGraph) {
   mGraphListener->NotifyEnded(mStream);
 }
 
 /**
  * All MediaStream-related data is protected by the decoder's monitor. We have
  * at most one DecodedStreamData per MediaDecoder. Its streams are used as
  * inputs for all output tracks created by OutputStreamManager after calls to
  * captureStream/UntilEnded. Seeking creates new source streams, as does
--- a/dom/media/webspeech/recognition/SpeechTrackListener.cpp
+++ b/dom/media/webspeech/recognition/SpeechTrackListener.cpp
@@ -73,18 +73,18 @@ void SpeechTrackListener::ConvertAndDisp
                                                     sizeof(int16_t)));
 
   int16_t* to = static_cast<int16_t*>(samples->Data());
   ConvertAudioSamplesWithScale(aData, to, aDuration, aVolume);
 
   mRecognition->FeedAudioData(samples.forget(), aDuration, this, aTrackRate);
 }
 
-void SpeechTrackListener::NotifyEnded() {
+void SpeechTrackListener::NotifyEnded(MediaStreamGraph* aGraph) {
   // TODO dispatch SpeechEnd event so services can be informed
 }
 
-void SpeechTrackListener::NotifyRemoved() {
+void SpeechTrackListener::NotifyRemoved(MediaStreamGraph* aGraph) {
   mRemovedHolder.ResolveIfExists(true, __func__);
 }
 
 }  // namespace dom
 }  // namespace mozilla
--- a/dom/media/webspeech/recognition/SpeechTrackListener.h
+++ b/dom/media/webspeech/recognition/SpeechTrackListener.h
@@ -23,19 +23,19 @@ class SpeechRecognition;
 class SpeechTrackListener : public MediaStreamTrackListener {
  public:
   explicit SpeechTrackListener(SpeechRecognition* aRecognition);
   ~SpeechTrackListener() = default;
 
   void NotifyQueuedChanges(MediaStreamGraph* aGraph, StreamTime aTrackOffset,
                            const MediaSegment& aQueuedMedia) override;
 
-  void NotifyEnded() override;
+  void NotifyEnded(MediaStreamGraph* aGraph) override;
 
-  void NotifyRemoved() override;
+  void NotifyRemoved(MediaStreamGraph* aGraph) override;
 
  private:
   template <typename SampleFormatType>
   void ConvertAndDispatchAudioChunk(int aDuration, float aVolume,
                                     SampleFormatType* aData,
                                     TrackRate aTrackRate);
   RefPtr<SpeechRecognition> mRecognition;
   MozPromiseHolder<GenericNonExclusivePromise> mRemovedHolder;
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ -698,17 +698,18 @@ class MediaPipelineTransmit::PipelineLis
     MOZ_RELEASE_ASSERT(mConduit->type() == MediaSessionConduit::VIDEO);
     static_cast<VideoSessionConduit*>(mConduit.get())
         ->SendVideoFrame(aVideoFrame);
   }
 
   // Implement MediaStreamTrackListener
   void NotifyQueuedChanges(MediaStreamGraph* aGraph, StreamTime aTrackOffset,
                            const MediaSegment& aQueuedMedia) override;
-  void NotifyEnabledStateChanged(bool aEnabled) override;
+  void NotifyEnabledStateChanged(MediaStreamGraph* aGraph,
+                                 bool aEnabled) override;
 
   // Implement DirectMediaStreamTrackListener
   void NotifyRealtimeTrackData(MediaStreamGraph* aGraph,
                                StreamTime aTrackOffset,
                                const MediaSegment& aMedia) override;
   void NotifyDirectListenerInstalled(InstallationResult aResult) override;
   void NotifyDirectListenerUninstalled() override;
 
@@ -1083,17 +1084,17 @@ void MediaPipelineTransmit::PipelineList
   } else {
     // When running tests, graph may be null. In that case use a default.
     rate = 16000;
   }
   NewData(aQueuedMedia, rate);
 }
 
 void MediaPipelineTransmit::PipelineListener::NotifyEnabledStateChanged(
-    bool aEnabled) {
+    MediaStreamGraph* aGraph, bool aEnabled) {
   if (mConduit->type() != MediaSessionConduit::VIDEO) {
     return;
   }
   MOZ_ASSERT(mConverter);
   mConverter->SetTrackEnabled(aEnabled);
 }
 
 void MediaPipelineTransmit::PipelineListener::NotifyDirectListenerInstalled(