зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
e31bc86b17
Коммит
c4ef19aea8
|
@ -2629,6 +2629,21 @@ bool SourceMediaStream::PullNewData(StreamTime aDesiredUpToTime) {
|
||||||
l->NotifyPull(GraphImpl(), t);
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -673,7 +673,7 @@ class SourceMediaStream : public MediaStream {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable or disable pulling. When pulling is enabled, NotifyPull
|
* 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.
|
* MediaStreamGraph control loop. Pulling is initially disabled.
|
||||||
* Due to unavoidable race conditions, after a call to SetPullEnabled(false)
|
* Due to unavoidable race conditions, after a call to SetPullEnabled(false)
|
||||||
* it is still possible for a NotifyPull to occur.
|
* it is still possible for a NotifyPull to occur.
|
||||||
|
|
|
@ -147,6 +147,10 @@ class MediaStreamTrackListener {
|
||||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaStreamTrackListener)
|
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaStreamTrackListener)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
virtual void NotifyPull(MediaStreamGraph* aGraph,
|
||||||
|
StreamTime aEndOfAppendedData,
|
||||||
|
StreamTime aDesiredTime) {}
|
||||||
|
|
||||||
virtual void NotifyQueuedChanges(MediaStreamGraph* aGraph,
|
virtual void NotifyQueuedChanges(MediaStreamGraph* aGraph,
|
||||||
StreamTime aTrackOffset,
|
StreamTime aTrackOffset,
|
||||||
const MediaSegment& aQueuedMedia) {}
|
const MediaSegment& aQueuedMedia) {}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче