Bug 1423241 - Implement NotifyPull for MediaStreamTrackListener. r=padenot

Differential Revision: https://phabricator.services.mozilla.com/D12267

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andreas Pehrson 2018-11-23 15:00:14 +00:00
parent e31bc86b17
commit c4ef19aea8
3 changed files with 20 additions and 1 deletions

View File

@ -2629,6 +2629,21 @@ bool SourceMediaStream::PullNewData(StreamTime aDesiredUpToTime) {
l->NotifyPull(GraphImpl(), t);
}
}
for (const TrackData& track : mUpdateTracks) {
if (track.mCommands & TrackEventCommand::TRACK_EVENT_ENDED) {
continue;
}
current = track.mEndOfFlushedData + track.mData->GetDuration();
if (t <= current) {
continue;
}
MutexAutoUnlock unlock(mMutex);
for (TrackBound<MediaStreamTrackListener>& l : mTrackListeners) {
if (l.mTrackID == track.mID) {
l.mListener->NotifyPull(Graph(), current, t);
}
}
}
return true;
}

View File

@ -673,7 +673,7 @@ class SourceMediaStream : public MediaStream {
/**
* Enable or disable pulling. When pulling is enabled, NotifyPull
* gets called on MediaStreamListeners for this stream during the
* gets called on MediaStream/TrackListeners for this stream during the
* MediaStreamGraph control loop. Pulling is initially disabled.
* Due to unavoidable race conditions, after a call to SetPullEnabled(false)
* it is still possible for a NotifyPull to occur.

View File

@ -147,6 +147,10 @@ class MediaStreamTrackListener {
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaStreamTrackListener)
public:
virtual void NotifyPull(MediaStreamGraph* aGraph,
StreamTime aEndOfAppendedData,
StreamTime aDesiredTime) {}
virtual void NotifyQueuedChanges(MediaStreamGraph* aGraph,
StreamTime aTrackOffset,
const MediaSegment& aQueuedMedia) {}