Bug 1294605 - Notify MediaStreamTrackSource when ReadyState is overriden. r=jib

MozReview-Commit-ID: CSRWgYt4hqe
This commit is contained in:
Andreas Pehrson 2016-08-22 18:28:10 +02:00
Родитель 7e7913f113
Коммит 1b33cd6755
2 изменённых файлов: 17 добавлений и 1 удалений

Просмотреть файл

@ -387,6 +387,22 @@ MediaStreamTrack::Clone()
return newStream->CloneDOMTrack(*this, mTrackID);
}
void
MediaStreamTrack::SetReadyState(MediaStreamTrackState aState)
{
MOZ_ASSERT(!(mReadyState == MediaStreamTrackState::Ended &&
aState == MediaStreamTrackState::Live),
"We don't support overriding the ready state from ended to live");
if (mReadyState == MediaStreamTrackState::Live &&
aState == MediaStreamTrackState::Ended &&
mSource) {
mSource->UnregisterSink(this);
}
mReadyState = aState;
}
void
MediaStreamTrack::NotifyEnded()
{

Просмотреть файл

@ -297,7 +297,7 @@ public:
* Forces the ready state to a particular value, for instance when we're
* cloning an already ended track.
*/
void SetReadyState(MediaStreamTrackState aState) { mReadyState = aState; }
void SetReadyState(MediaStreamTrackState aState);
/**
* Notified by the MediaStreamGraph, through our owning MediaStream on the