nsRefPtr<MediaDecoderReader::WaitForDataPromise> MediaSourceReader::WaitForData(MediaData::Type aType) { ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor()); nsRefPtr<WaitForDataPromise> p = WaitPromise(aType).Ensure(__func__); MaybeNotifyHaveData(); return p; }
void MediaSourceReader::NotifyTimeRangesChanged() { ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor()); if (mWaitingForSeekData) { //post a task to the decode queue to try to complete the pending seek. RefPtr<nsIRunnable> task(NS_NewRunnableMethod( this, &MediaSourceReader::AttemptSeek)); GetTaskQueue()->Dispatch(task.forget()); } else { MaybeNotifyHaveData(); } }