зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1423241 - Implement MediaStreamTrackListener::NotifyOutput. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D9094 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
e6f44b02af
Коммит
b2d7b962cd
|
@ -188,22 +188,32 @@ void MediaStreamGraphImpl::UpdateCurrentTimeForStreams(
|
|||
MediaStreamListener* l = stream->mListeners[j];
|
||||
l->NotifyOutput(this, mProcessedTime);
|
||||
}
|
||||
}
|
||||
|
||||
for (StreamTracks::TrackIter track(stream->mTracks); !track.IsEnded();
|
||||
track.Next()) {
|
||||
if (track->IsEnded() &&
|
||||
track->GetEnd() <=
|
||||
stream->GraphTimeToStreamTime(mStateComputedTime) &&
|
||||
!track->NotifiedEnded()) {
|
||||
for (StreamTracks::TrackIter track(stream->mTracks); !track.IsEnded();
|
||||
track.Next()) {
|
||||
StreamTime streamCurrentTime =
|
||||
stream->GraphTimeToStreamTime(mStateComputedTime);
|
||||
if (track->IsEnded() && track->GetEnd() <= streamCurrentTime) {
|
||||
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()) {
|
||||
track->NotifyEnded();
|
||||
listener.mListener->NotifyOutput(this, track->GetEnd());
|
||||
listener.mListener->NotifyEnded();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (const TrackBound<MediaStreamTrackListener>& listener :
|
||||
stream->mTrackListeners) {
|
||||
if (listener.mTrackID == track->GetID()) {
|
||||
listener.mListener->NotifyOutput(
|
||||
this, streamCurrentTime - track->GetStart());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -158,6 +158,9 @@ class MediaStreamTrackListener {
|
|||
virtual void NotifyPrincipalHandleChanged(
|
||||
MediaStreamGraph* aGraph, const PrincipalHandle& aNewPrincipalHandle) {}
|
||||
|
||||
virtual void NotifyOutput(MediaStreamGraph* aGraph,
|
||||
StreamTime aCurrentTrackTime) {}
|
||||
|
||||
virtual void NotifyEnded() {}
|
||||
|
||||
virtual void NotifyRemoved() {}
|
||||
|
|
Загрузка…
Ссылка в новой задаче