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
Родитель e31bc86b17
Коммит c4ef19aea8
3 изменённых файлов: 20 добавлений и 1 удалений

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

@ -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;
}

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

@ -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.

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

@ -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) {}