Bug 1296531 - Remove MediaStream blocking logic from HTMLMediaElement. r=jesup

MediaStreamGraph only implements the blocking notifications for SourceMediaStreams,
but the MediaStream that gets attached as srcObject on a media element is always
a TrackUnionStream. Hence, this code is unused and can be removed.

MozReview-Commit-ID: 6DKtCGNsZec
This commit is contained in:
Andreas Pehrson
2017-05-08 18:41:28 +02:00
parent 656499f37a
commit c855651483

View File

@@ -4892,7 +4892,6 @@ public:
WatchTarget(aName),
mElement(aElement),
mHaveCurrentData(false),
mBlocked(false),
mFinished(false),
mMutex(aName),
mPendingNotifyOutput(false)
@@ -4910,21 +4909,9 @@ public:
if (!mElement || !mHaveCurrentData || mFinished) {
return MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE;
}
return mBlocked
? MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE_BUFFERING
: MediaDecoderOwner::NEXT_FRAME_AVAILABLE;
return MediaDecoderOwner::NEXT_FRAME_AVAILABLE;
}
void DoNotifyBlocked()
{
mBlocked = true;
NotifyWatchers();
}
void DoNotifyUnblocked()
{
mBlocked = false;
NotifyWatchers();
}
void DoNotifyOutput()
{
{
@@ -4949,22 +4936,6 @@ public:
// These notifications run on the media graph thread so we need to
// dispatch events to the main thread.
virtual void NotifyBlockingChanged(MediaStreamGraph* aGraph, Blocking aBlocked) override
{
nsCOMPtr<nsIRunnable> event;
if (aBlocked == BLOCKED) {
event = NewRunnableMethod(
"dom::HTMLMediaElement::StreamListener::DoNotifyBlocked",
this,
&StreamListener::DoNotifyBlocked);
} else {
event = NewRunnableMethod(
"dom::HTMLMediaElement::StreamListener::DoNotifyUnblocked",
this,
&StreamListener::DoNotifyUnblocked);
}
aGraph->DispatchToMainThreadAfterStreamStateUpdate(event.forget());
}
virtual void NotifyHasCurrentData(MediaStreamGraph* aGraph) override
{
MutexAutoLock lock(mMutex);
@@ -4991,7 +4962,6 @@ private:
// These fields may only be accessed on the main thread
HTMLMediaElement* mElement;
bool mHaveCurrentData;
bool mBlocked;
bool mFinished;
// mMutex protects the fields below; they can be accessed on any thread