mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
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:
parent
e31bc86b17
commit
c4ef19aea8
@ -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) {}
|
||||
|
Loading…
Reference in New Issue
Block a user