diff --git a/dom/media/mediasink/DecodedStream.cpp b/dom/media/mediasink/DecodedStream.cpp index a94992b735ba..76eceaec3651 100644 --- a/dom/media/mediasink/DecodedStream.cpp +++ b/dom/media/mediasink/DecodedStream.cpp @@ -193,44 +193,9 @@ DecodedStreamData::SetPlaying(bool aPlaying) } } -class OutputStreamListener : public MediaStreamListener { - typedef MediaStreamListener::MediaStreamGraphEvent MediaStreamGraphEvent; -public: - explicit OutputStreamListener(OutputStreamData* aOwner) : mOwner(aOwner) {} - - void NotifyEvent(MediaStreamGraph* aGraph, MediaStreamGraphEvent event) override - { - if (event == EVENT_FINISHED) { - nsCOMPtr r = NS_NewRunnableMethod( - this, &OutputStreamListener::DoNotifyFinished); - aGraph->DispatchToMainThreadAfterStreamStateUpdate(r.forget()); - } - } - - void Forget() - { - MOZ_ASSERT(NS_IsMainThread()); - mOwner = nullptr; - } - -private: - void DoNotifyFinished() - { - MOZ_ASSERT(NS_IsMainThread()); - if (mOwner) { - // Remove the finished stream so it won't block the decoded stream. - mOwner->Remove(); - } - } - - // Main thread only - OutputStreamData* mOwner; -}; - OutputStreamData::~OutputStreamData() { MOZ_ASSERT(NS_IsMainThread()); - mListener->Forget(); // Break the connection to the input stream if necessary. if (mPort) { mPort->Destroy(); @@ -242,8 +207,6 @@ OutputStreamData::Init(OutputStreamManager* aOwner, ProcessedMediaStream* aStrea { mOwner = aOwner; mStream = aStream; - mListener = new OutputStreamListener(this); - aStream->AddListener(mListener); } void @@ -282,13 +245,6 @@ OutputStreamData::Disconnect() return true; } -void -OutputStreamData::Remove() -{ - MOZ_ASSERT(NS_IsMainThread()); - mOwner->Remove(mStream); -} - MediaStreamGraph* OutputStreamData::Graph() const { diff --git a/dom/media/mediasink/DecodedStream.h b/dom/media/mediasink/DecodedStream.h index 08d67371283a..9d85e5d5adb2 100644 --- a/dom/media/mediasink/DecodedStream.h +++ b/dom/media/mediasink/DecodedStream.h @@ -26,17 +26,12 @@ class MediaData; class MediaInputPort; class MediaStream; class MediaStreamGraph; -class OutputStreamListener; class OutputStreamManager; class ProcessedMediaStream; class TimeStamp; template class MediaQueue; -namespace layers { -class Image; -} // namespace layers - class OutputStreamData { public: ~OutputStreamData(); @@ -47,9 +42,6 @@ public: // Disconnect mStream from its input stream. // Return false is mStream is already destroyed, otherwise true. bool Disconnect(); - // Called by OutputStreamListener to remove self from the output streams - // managed by OutputStreamManager. - void Remove(); // Return true if aStream points to the same object as mStream. // Used by OutputStreamManager to remove an output stream. bool Equals(MediaStream* aStream) @@ -64,7 +56,6 @@ private: nsRefPtr mStream; // mPort connects our mStream to an input stream. nsRefPtr mPort; - nsRefPtr mListener; }; class OutputStreamManager {