Backed out 2 changesets (bug 1576836) for media failures on DOMMediaStream.cpp. CLOSED TREE

Backed out changeset 6c0f218a2988 (bug 1576836)
Backed out changeset 481ab3a1f913 (bug 1576836)
This commit is contained in:
Csoregi Natalia
2019-09-02 16:30:05 +03:00
parent 331faaf390
commit 869a0bf5ea
5 changed files with 21 additions and 137 deletions

View File

@@ -4720,8 +4720,10 @@ class HTMLMediaElement::MediaStreamTrackListener
mElement->NotifyMediaStreamTrackRemoved(aTrack);
}
void OnActive() {
MOZ_ASSERT(mElement);
void NotifyActive() override {
if (!mElement) {
return;
}
// mediacapture-main says:
// Note that once ended equals true the HTMLVideoElement will not play media
@@ -4754,70 +4756,20 @@ class HTMLMediaElement::MediaStreamTrackListener
mElement->DoLoad();
}
void NotifyActive() override {
void NotifyInactive() override {
if (!mElement) {
return;
}
if (!mElement->IsVideo()) {
// Audio elements use NotifyAudible().
return;
}
OnActive();
}
void NotifyAudible() override {
if (!mElement) {
return;
}
if (mElement->IsVideo()) {
// Video elements use NotifyActive().
return;
}
OnActive();
}
void OnInactive() {
MOZ_ASSERT(mElement);
if (mElement->IsPlaybackEnded()) {
return;
}
LOG(LogLevel::Debug, ("%p, mSrcStream %p became inactive", mElement.get(),
mElement->mSrcStream.get()));
MOZ_ASSERT(!mElement->mSrcStream->Active());
mElement->PlaybackEnded();
mElement->UpdateReadyStateInternal();
}
void NotifyInactive() override {
if (!mElement) {
return;
}
if (!mElement->IsVideo()) {
// Audio elements use NotifyInaudible().
return;
}
OnInactive();
}
void NotifyInaudible() override {
if (!mElement) {
return;
}
if (mElement->IsVideo()) {
// Video elements use NotifyInactive().
return;
}
OnInactive();
}
protected:
const WeakPtr<HTMLMediaElement> mElement;
};