mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1173001 - Fix up some task queue naming to make MediaDecoderReader consistent with MDSM. r=jww
This commit is contained in:
parent
5fc7348183
commit
325afd46d8
@ -221,7 +221,7 @@ public:
|
||||
|
||||
NS_METHOD Run()
|
||||
{
|
||||
MOZ_ASSERT(mReader->GetTaskQueue()->IsCurrentThreadIn());
|
||||
MOZ_ASSERT(mReader->OnTaskQueue());
|
||||
|
||||
// Make sure ResetDecode hasn't been called in the mean time.
|
||||
if (!mReader->mBaseVideoPromise.IsEmpty()) {
|
||||
@ -246,7 +246,7 @@ public:
|
||||
|
||||
NS_METHOD Run()
|
||||
{
|
||||
MOZ_ASSERT(mReader->GetTaskQueue()->IsCurrentThreadIn());
|
||||
MOZ_ASSERT(mReader->OnTaskQueue());
|
||||
|
||||
// Make sure ResetDecode hasn't been called in the mean time.
|
||||
if (!mReader->mBaseAudioPromise.IsEmpty()) {
|
||||
@ -353,7 +353,7 @@ MediaDecoderReader::Shutdown()
|
||||
|
||||
// Spin down the task queue if necessary. We wait until BreakCycles to null
|
||||
// out mTaskQueue, since otherwise any remaining tasks could crash when they
|
||||
// invoke GetTaskQueue()->IsCurrentThreadIn().
|
||||
// invoke OnTaskQueue().
|
||||
if (mTaskQueue && !mTaskQueueIsBorrowed) {
|
||||
// If we own our task queue, shutdown ends when the task queue is done.
|
||||
p = mTaskQueue->BeginShutdown();
|
||||
|
@ -109,7 +109,7 @@ public:
|
||||
|
||||
virtual bool OnTaskQueue()
|
||||
{
|
||||
return GetTaskQueue()->IsCurrentThreadIn();
|
||||
return TaskQueue()->IsCurrentThreadIn();
|
||||
}
|
||||
|
||||
// Resets all state related to decoding, emptying all buffers etc.
|
||||
@ -257,7 +257,7 @@ public:
|
||||
virtual bool IsMediaSeekable() = 0;
|
||||
void SetStartTime(int64_t aStartTime);
|
||||
|
||||
MediaTaskQueue* GetTaskQueue() {
|
||||
MediaTaskQueue* TaskQueue() {
|
||||
return mTaskQueue;
|
||||
}
|
||||
|
||||
|
@ -846,7 +846,7 @@ public:
|
||||
// The task queue in which we run decode tasks. This is referred to as
|
||||
// the "decode thread", though in practise tasks can run on a different
|
||||
// thread every time they're called.
|
||||
MediaTaskQueue* DecodeTaskQueue() const { return mReader->GetTaskQueue(); }
|
||||
MediaTaskQueue* DecodeTaskQueue() const { return mReader->TaskQueue(); }
|
||||
|
||||
// The time that playback started from the system clock. This is used for
|
||||
// timing the presentation of video frames when there's no audio.
|
||||
|
@ -281,7 +281,7 @@ MediaFormatReader::AsyncReadMetadata()
|
||||
nsRefPtr<MetadataPromise> p = mMetadataPromise.Ensure(__func__);
|
||||
|
||||
mDemuxerInitRequest.Begin(mDemuxer->Init()
|
||||
->Then(GetTaskQueue(), __func__, this,
|
||||
->Then(TaskQueue(), __func__, this,
|
||||
&MediaFormatReader::OnDemuxerInitDone,
|
||||
&MediaFormatReader::OnDemuxerInitFailed));
|
||||
return p;
|
||||
@ -588,7 +588,7 @@ MediaFormatReader::DoDemuxVideo()
|
||||
{
|
||||
// TODO Use DecodeAhead value rather than 1.
|
||||
mVideo.mDemuxRequest.Begin(mVideo.mTrackDemuxer->GetSamples(1)
|
||||
->Then(GetTaskQueue(), __func__, this,
|
||||
->Then(TaskQueue(), __func__, this,
|
||||
&MediaFormatReader::OnVideoDemuxCompleted,
|
||||
&MediaFormatReader::OnVideoDemuxFailed));
|
||||
}
|
||||
@ -643,7 +643,7 @@ MediaFormatReader::DoDemuxAudio()
|
||||
{
|
||||
// TODO Use DecodeAhead value rather than 1.
|
||||
mAudio.mDemuxRequest.Begin(mAudio.mTrackDemuxer->GetSamples(1)
|
||||
->Then(GetTaskQueue(), __func__, this,
|
||||
->Then(TaskQueue(), __func__, this,
|
||||
&MediaFormatReader::OnAudioDemuxCompleted,
|
||||
&MediaFormatReader::OnAudioDemuxFailed));
|
||||
}
|
||||
@ -748,7 +748,7 @@ MediaFormatReader::ScheduleUpdate(TrackType aTrack)
|
||||
decoder.mUpdateScheduled = true;
|
||||
RefPtr<nsIRunnable> task(
|
||||
NS_NewRunnableMethodWithArg<TrackType>(this, &MediaFormatReader::Update, aTrack));
|
||||
GetTaskQueue()->Dispatch(task.forget());
|
||||
TaskQueue()->Dispatch(task.forget());
|
||||
}
|
||||
|
||||
bool
|
||||
@ -1043,7 +1043,7 @@ MediaFormatReader::Output(TrackType aTrack, MediaData* aSample)
|
||||
RefPtr<nsIRunnable> task =
|
||||
NS_NewRunnableMethodWithArgs<TrackType, MediaData*>(
|
||||
this, &MediaFormatReader::NotifyNewOutput, aTrack, aSample);
|
||||
GetTaskQueue()->Dispatch(task.forget());
|
||||
TaskQueue()->Dispatch(task.forget());
|
||||
}
|
||||
|
||||
void
|
||||
@ -1052,7 +1052,7 @@ MediaFormatReader::DrainComplete(TrackType aTrack)
|
||||
RefPtr<nsIRunnable> task =
|
||||
NS_NewRunnableMethodWithArg<TrackType>(
|
||||
this, &MediaFormatReader::NotifyDrainComplete, aTrack);
|
||||
GetTaskQueue()->Dispatch(task.forget());
|
||||
TaskQueue()->Dispatch(task.forget());
|
||||
}
|
||||
|
||||
void
|
||||
@ -1061,7 +1061,7 @@ MediaFormatReader::InputExhausted(TrackType aTrack)
|
||||
RefPtr<nsIRunnable> task =
|
||||
NS_NewRunnableMethodWithArg<TrackType>(
|
||||
this, &MediaFormatReader::NotifyInputExhausted, aTrack);
|
||||
GetTaskQueue()->Dispatch(task.forget());
|
||||
TaskQueue()->Dispatch(task.forget());
|
||||
}
|
||||
|
||||
void
|
||||
@ -1070,7 +1070,7 @@ MediaFormatReader::Error(TrackType aTrack)
|
||||
RefPtr<nsIRunnable> task =
|
||||
NS_NewRunnableMethodWithArg<TrackType>(
|
||||
this, &MediaFormatReader::NotifyError, aTrack);
|
||||
GetTaskQueue()->Dispatch(task.forget());
|
||||
TaskQueue()->Dispatch(task.forget());
|
||||
}
|
||||
|
||||
void
|
||||
@ -1110,7 +1110,7 @@ MediaFormatReader::SkipVideoDemuxToNextKeyFrame(media::TimeUnit aTimeThreshold)
|
||||
}
|
||||
|
||||
mSkipRequest.Begin(mVideo.mTrackDemuxer->SkipToNextRandomAccessPoint(aTimeThreshold)
|
||||
->Then(GetTaskQueue(), __func__, this,
|
||||
->Then(TaskQueue(), __func__, this,
|
||||
&MediaFormatReader::OnVideoSkipCompleted,
|
||||
&MediaFormatReader::OnVideoSkipFailed));
|
||||
return;
|
||||
@ -1213,7 +1213,7 @@ MediaFormatReader::DoVideoSeek()
|
||||
LOGV("Seeking video to %lld", mPendingSeekTime.ref().ToMicroseconds());
|
||||
media::TimeUnit seekTime = mPendingSeekTime.ref();
|
||||
mVideoSeekRequest.Begin(mVideo.mTrackDemuxer->Seek(seekTime)
|
||||
->Then(GetTaskQueue(), __func__, this,
|
||||
->Then(TaskQueue(), __func__, this,
|
||||
&MediaFormatReader::OnVideoSeekCompleted,
|
||||
&MediaFormatReader::OnVideoSeekFailed));
|
||||
}
|
||||
@ -1242,7 +1242,7 @@ MediaFormatReader::DoAudioSeek()
|
||||
LOGV("Seeking audio to %lld", mPendingSeekTime.ref().ToMicroseconds());
|
||||
media::TimeUnit seekTime = mPendingSeekTime.ref();
|
||||
mAudioSeekRequest.Begin(mAudio.mTrackDemuxer->Seek(seekTime)
|
||||
->Then(GetTaskQueue(), __func__, this,
|
||||
->Then(TaskQueue(), __func__, this,
|
||||
&MediaFormatReader::OnAudioSeekCompleted,
|
||||
&MediaFormatReader::OnAudioSeekFailed));
|
||||
}
|
||||
@ -1434,7 +1434,7 @@ MediaFormatReader::NotifyDataArrived(const char* aBuffer, uint32_t aLength, int6
|
||||
NS_NewRunnableMethodWithArgs<int32_t, uint64_t>(
|
||||
this, &MediaFormatReader::NotifyDemuxer,
|
||||
aLength, aOffset);
|
||||
GetTaskQueue()->Dispatch(task.forget());
|
||||
TaskQueue()->Dispatch(task.forget());
|
||||
}
|
||||
|
||||
void
|
||||
@ -1457,7 +1457,7 @@ MediaFormatReader::NotifyDataRemoved()
|
||||
NS_NewRunnableMethodWithArgs<int32_t, uint64_t>(
|
||||
this, &MediaFormatReader::NotifyDemuxer,
|
||||
0, 0);
|
||||
GetTaskQueue()->Dispatch(task.forget());
|
||||
TaskQueue()->Dispatch(task.forget());
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
@ -172,7 +172,7 @@ MP4Reader::~MP4Reader()
|
||||
nsRefPtr<ShutdownPromise>
|
||||
MP4Reader::Shutdown()
|
||||
{
|
||||
MOZ_ASSERT(GetTaskQueue()->IsCurrentThreadIn());
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
if (mAudio.mDecoder) {
|
||||
Flush(TrackInfo::kAudioTrack);
|
||||
@ -611,7 +611,7 @@ nsRefPtr<MediaDecoderReader::VideoDataPromise>
|
||||
MP4Reader::RequestVideoData(bool aSkipToNextKeyframe,
|
||||
int64_t aTimeThreshold)
|
||||
{
|
||||
MOZ_ASSERT(GetTaskQueue()->IsCurrentThreadIn());
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
VLOG("skip=%d time=%lld", aSkipToNextKeyframe, aTimeThreshold);
|
||||
|
||||
if (!EnsureDecodersSetup()) {
|
||||
@ -652,7 +652,7 @@ MP4Reader::RequestVideoData(bool aSkipToNextKeyframe,
|
||||
nsRefPtr<MediaDecoderReader::AudioDataPromise>
|
||||
MP4Reader::RequestAudioData()
|
||||
{
|
||||
MOZ_ASSERT(GetTaskQueue()->IsCurrentThreadIn());
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
VLOG("");
|
||||
|
||||
if (!EnsureDecodersSetup()) {
|
||||
@ -683,7 +683,7 @@ MP4Reader::ScheduleUpdate(TrackType aTrack)
|
||||
decoder.mUpdateScheduled = true;
|
||||
RefPtr<nsIRunnable> task(
|
||||
NS_NewRunnableMethodWithArg<TrackType>(this, &MP4Reader::Update, aTrack));
|
||||
GetTaskQueue()->Dispatch(task.forget());
|
||||
TaskQueue()->Dispatch(task.forget());
|
||||
}
|
||||
|
||||
bool
|
||||
@ -707,7 +707,7 @@ MP4Reader::NeedInput(DecoderData& aDecoder)
|
||||
void
|
||||
MP4Reader::Update(TrackType aTrack)
|
||||
{
|
||||
MOZ_ASSERT(GetTaskQueue()->IsCurrentThreadIn());
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
if (mShutdown) {
|
||||
return;
|
||||
@ -873,7 +873,7 @@ MP4Reader::SizeOfQueue(TrackType aTrack)
|
||||
nsresult
|
||||
MP4Reader::ResetDecode()
|
||||
{
|
||||
MOZ_ASSERT(GetTaskQueue()->IsCurrentThreadIn());
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
Flush(TrackInfo::kVideoTrack);
|
||||
{
|
||||
MonitorAutoLock mon(mDemuxerMonitor);
|
||||
@ -955,7 +955,7 @@ MP4Reader::Error(TrackType aTrack)
|
||||
void
|
||||
MP4Reader::Flush(TrackType aTrack)
|
||||
{
|
||||
MOZ_ASSERT(GetTaskQueue()->IsCurrentThreadIn());
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
VLOG("Flush(%s) BEGIN", TrackTypeToStr(aTrack));
|
||||
DecoderData& data = GetDecoderData(aTrack);
|
||||
if (!data.mDecoder) {
|
||||
@ -993,7 +993,7 @@ MP4Reader::Flush(TrackType aTrack)
|
||||
bool
|
||||
MP4Reader::SkipVideoDemuxToNextKeyFrame(int64_t aTimeThreshold, uint32_t& parsed)
|
||||
{
|
||||
MOZ_ASSERT(GetTaskQueue()->IsCurrentThreadIn());
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
MOZ_ASSERT(mVideo.mDecoder);
|
||||
|
||||
@ -1024,7 +1024,7 @@ nsRefPtr<MediaDecoderReader::SeekPromise>
|
||||
MP4Reader::Seek(int64_t aTime, int64_t aEndTime)
|
||||
{
|
||||
LOG("aTime=(%lld)", aTime);
|
||||
MOZ_ASSERT(GetTaskQueue()->IsCurrentThreadIn());
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
MonitorAutoLock mon(mDemuxerMonitor);
|
||||
if (!mDemuxer->CanSeek()) {
|
||||
VLOG("Seek() END (Unseekable)");
|
||||
|
@ -56,7 +56,7 @@ private:
|
||||
virtual ~TestBinding()
|
||||
{
|
||||
{
|
||||
nsRefPtr<MediaTaskQueue> queue = reader->GetTaskQueue();
|
||||
nsRefPtr<MediaTaskQueue> queue = reader->TaskQueue();
|
||||
nsCOMPtr<nsIRunnable> task = NS_NewRunnableMethod(reader, &MP4Reader::Shutdown);
|
||||
// Hackily bypass the tail dispatcher so that we can AwaitShutdownAndIdle.
|
||||
// In production code we'd use BeginShutdown + promises.
|
||||
|
@ -161,7 +161,7 @@ MediaSourceReader::RequestAudioData()
|
||||
case SOURCE_NEW:
|
||||
GetAudioReader()->ResetDecode();
|
||||
mAudioSeekRequest.Begin(GetAudioReader()->Seek(GetReaderAudioTime(mLastAudioTime), 0)
|
||||
->Then(GetTaskQueue(), __func__, this,
|
||||
->Then(TaskQueue(), __func__, this,
|
||||
&MediaSourceReader::CompleteAudioSeekAndDoRequest,
|
||||
&MediaSourceReader::CompleteAudioSeekAndRejectPromise));
|
||||
break;
|
||||
@ -186,7 +186,7 @@ MediaSourceReader::RequestAudioData()
|
||||
void MediaSourceReader::DoAudioRequest()
|
||||
{
|
||||
mAudioRequest.Begin(GetAudioReader()->RequestAudioData()
|
||||
->Then(GetTaskQueue(), __func__, this,
|
||||
->Then(TaskQueue(), __func__, this,
|
||||
&MediaSourceReader::OnAudioDecoded,
|
||||
&MediaSourceReader::OnAudioNotDecoded));
|
||||
}
|
||||
@ -209,7 +209,7 @@ MediaSourceReader::OnAudioDecoded(AudioData* aSample)
|
||||
MSE_DEBUG("mTime=%lld < mTimeThreshold=%lld",
|
||||
ourTime, mTimeThreshold);
|
||||
mAudioRequest.Begin(GetAudioReader()->RequestAudioData()
|
||||
->Then(GetTaskQueue(), __func__, this,
|
||||
->Then(TaskQueue(), __func__, this,
|
||||
&MediaSourceReader::OnAudioDecoded,
|
||||
&MediaSourceReader::OnAudioNotDecoded));
|
||||
return;
|
||||
@ -279,7 +279,7 @@ MediaSourceReader::OnAudioNotDecoded(NotDecodedReason aReason)
|
||||
if (result == SOURCE_NEW) {
|
||||
GetAudioReader()->ResetDecode();
|
||||
mAudioSeekRequest.Begin(GetAudioReader()->Seek(GetReaderAudioTime(mLastAudioTime), 0)
|
||||
->Then(GetTaskQueue(), __func__, this,
|
||||
->Then(TaskQueue(), __func__, this,
|
||||
&MediaSourceReader::CompleteAudioSeekAndDoRequest,
|
||||
&MediaSourceReader::CompleteAudioSeekAndRejectPromise));
|
||||
return;
|
||||
@ -334,7 +334,7 @@ MediaSourceReader::RequestVideoData(bool aSkipToNextKeyframe, int64_t aTimeThres
|
||||
case SOURCE_NEW:
|
||||
GetVideoReader()->ResetDecode();
|
||||
mVideoSeekRequest.Begin(GetVideoReader()->Seek(GetReaderVideoTime(mLastVideoTime), 0)
|
||||
->Then(GetTaskQueue(), __func__, this,
|
||||
->Then(TaskQueue(), __func__, this,
|
||||
&MediaSourceReader::CompleteVideoSeekAndDoRequest,
|
||||
&MediaSourceReader::CompleteVideoSeekAndRejectPromise));
|
||||
break;
|
||||
@ -361,7 +361,7 @@ void
|
||||
MediaSourceReader::DoVideoRequest()
|
||||
{
|
||||
mVideoRequest.Begin(GetVideoReader()->RequestVideoData(mDropVideoBeforeThreshold, GetReaderVideoTime(mTimeThreshold))
|
||||
->Then(GetTaskQueue(), __func__, this,
|
||||
->Then(TaskQueue(), __func__, this,
|
||||
&MediaSourceReader::OnVideoDecoded,
|
||||
&MediaSourceReader::OnVideoNotDecoded));
|
||||
}
|
||||
@ -431,7 +431,7 @@ MediaSourceReader::OnVideoNotDecoded(NotDecodedReason aReason)
|
||||
if (result == SOURCE_NEW) {
|
||||
GetVideoReader()->ResetDecode();
|
||||
mVideoSeekRequest.Begin(GetVideoReader()->Seek(GetReaderVideoTime(mLastVideoTime), 0)
|
||||
->Then(GetTaskQueue(), __func__, this,
|
||||
->Then(TaskQueue(), __func__, this,
|
||||
&MediaSourceReader::CompleteVideoSeekAndDoRequest,
|
||||
&MediaSourceReader::CompleteVideoSeekAndRejectPromise));
|
||||
return;
|
||||
@ -502,7 +502,7 @@ MediaSourceReader::ContinueShutdown()
|
||||
{
|
||||
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
|
||||
if (mTrackBuffers.Length()) {
|
||||
mTrackBuffers[0]->Shutdown()->Then(GetTaskQueue(), __func__, this,
|
||||
mTrackBuffers[0]->Shutdown()->Then(TaskQueue(), __func__, this,
|
||||
&MediaSourceReader::ContinueShutdown,
|
||||
&MediaSourceReader::ContinueShutdown);
|
||||
mShutdownTrackBuffers.AppendElement(mTrackBuffers[0]);
|
||||
@ -723,7 +723,7 @@ MediaSourceReader::CreateSubDecoder(const nsACString& aType, int64_t aTimestampO
|
||||
// borrowing.
|
||||
nsRefPtr<SourceBufferDecoder> decoder =
|
||||
new SourceBufferDecoder(new SourceBufferResource(aType), mDecoder, aTimestampOffset);
|
||||
nsRefPtr<MediaDecoderReader> reader(CreateReaderForType(aType, decoder, GetTaskQueue()));
|
||||
nsRefPtr<MediaDecoderReader> reader(CreateReaderForType(aType, decoder, TaskQueue()));
|
||||
if (!reader) {
|
||||
return nullptr;
|
||||
}
|
||||
@ -813,7 +813,7 @@ MediaSourceReader::NotifyTimeRangesChanged()
|
||||
//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());
|
||||
TaskQueue()->Dispatch(task.forget());
|
||||
} else {
|
||||
MaybeNotifyHaveData();
|
||||
}
|
||||
@ -929,7 +929,7 @@ MediaSourceReader::DoAudioSeek()
|
||||
}
|
||||
GetAudioReader()->ResetDecode();
|
||||
mAudioSeekRequest.Begin(GetAudioReader()->Seek(GetReaderAudioTime(seekTime), 0)
|
||||
->Then(GetTaskQueue(), __func__, this,
|
||||
->Then(TaskQueue(), __func__, this,
|
||||
&MediaSourceReader::OnAudioSeekCompleted,
|
||||
&MediaSourceReader::OnAudioSeekFailed));
|
||||
MSE_DEBUG("reader=%p", GetAudioReader());
|
||||
@ -1001,7 +1001,7 @@ MediaSourceReader::DoVideoSeek()
|
||||
}
|
||||
GetVideoReader()->ResetDecode();
|
||||
mVideoSeekRequest.Begin(GetVideoReader()->Seek(GetReaderVideoTime(seekTime), 0)
|
||||
->Then(GetTaskQueue(), __func__, this,
|
||||
->Then(TaskQueue(), __func__, this,
|
||||
&MediaSourceReader::OnVideoSeekCompleted,
|
||||
&MediaSourceReader::OnVideoSeekFailed));
|
||||
MSE_DEBUG("reader=%p", GetVideoReader());
|
||||
@ -1202,7 +1202,7 @@ MediaSourceReader::Ended(bool aEnded)
|
||||
// seek or wait
|
||||
RefPtr<nsIRunnable> task(NS_NewRunnableMethod(
|
||||
this, &MediaSourceReader::NotifyTimeRangesChanged));
|
||||
GetTaskQueue()->Dispatch(task.forget());
|
||||
TaskQueue()->Dispatch(task.forget());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ TrackBuffer::Shutdown()
|
||||
RefPtr<MediaTaskQueue> queue = mTaskQueue;
|
||||
mTaskQueue = nullptr;
|
||||
queue->BeginShutdown()
|
||||
->Then(mParentDecoder->GetReader()->GetTaskQueue(), __func__, this,
|
||||
->Then(mParentDecoder->GetReader()->TaskQueue(), __func__, this,
|
||||
&TrackBuffer::ContinueShutdown, &TrackBuffer::ContinueShutdown);
|
||||
|
||||
return p;
|
||||
@ -124,7 +124,7 @@ TrackBuffer::ContinueShutdown()
|
||||
ReentrantMonitorAutoEnter mon(mParentDecoder->GetReentrantMonitor());
|
||||
if (mDecoders.Length()) {
|
||||
mDecoders[0]->GetReader()->Shutdown()
|
||||
->Then(mParentDecoder->GetReader()->GetTaskQueue(), __func__, this,
|
||||
->Then(mParentDecoder->GetReader()->TaskQueue(), __func__, this,
|
||||
&TrackBuffer::ContinueShutdown, &TrackBuffer::ContinueShutdown);
|
||||
mShutdownDecoders.AppendElement(mDecoders[0]);
|
||||
mDecoders.RemoveElementAt(0);
|
||||
@ -274,7 +274,7 @@ TrackBuffer::NotifyTimeRangesChanged()
|
||||
RefPtr<nsIRunnable> task =
|
||||
NS_NewRunnableMethod(mParentDecoder->GetReader(),
|
||||
&MediaSourceReader::NotifyTimeRangesChanged);
|
||||
mParentDecoder->GetReader()->GetTaskQueue()->Dispatch(task.forget());
|
||||
mParentDecoder->GetReader()->TaskQueue()->Dispatch(task.forget());
|
||||
}
|
||||
|
||||
class DecoderSorter
|
||||
@ -566,7 +566,7 @@ TrackBuffer::NewDecoder(TimeUnit aTimestampOffset)
|
||||
mLastEndTimestamp.reset();
|
||||
mLastTimestampOffset = aTimestampOffset;
|
||||
|
||||
decoder->SetTaskQueue(decoder->GetReader()->GetTaskQueue());
|
||||
decoder->SetTaskQueue(decoder->GetReader()->TaskQueue());
|
||||
return decoder.forget();
|
||||
}
|
||||
|
||||
@ -582,7 +582,7 @@ TrackBuffer::QueueInitializeDecoder(SourceBufferDecoder* aDecoder)
|
||||
&TrackBuffer::InitializeDecoder,
|
||||
aDecoder);
|
||||
// We need to initialize the reader on its own task queue
|
||||
aDecoder->GetReader()->GetTaskQueue()->Dispatch(task.forget());
|
||||
aDecoder->GetReader()->TaskQueue()->Dispatch(task.forget());
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -646,7 +646,7 @@ TrackBuffer::InitializeDecoder(SourceBufferDecoder* aDecoder)
|
||||
return;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(aDecoder->GetReader()->GetTaskQueue()->IsCurrentThreadIn());
|
||||
MOZ_ASSERT(aDecoder->GetReader()->OnTaskQueue());
|
||||
|
||||
MediaDecoderReader* reader = aDecoder->GetReader();
|
||||
|
||||
@ -681,7 +681,7 @@ TrackBuffer::InitializeDecoder(SourceBufferDecoder* aDecoder)
|
||||
return;
|
||||
}
|
||||
|
||||
mMetadataRequest.Begin(promise->Then(reader->GetTaskQueue(), __func__,
|
||||
mMetadataRequest.Begin(promise->Then(reader->TaskQueue(), __func__,
|
||||
recipient.get(),
|
||||
&MetadataRecipient::OnMetadataRead,
|
||||
&MetadataRecipient::OnMetadataNotRead));
|
||||
@ -692,7 +692,7 @@ TrackBuffer::OnMetadataRead(MetadataHolder* aMetadata,
|
||||
SourceBufferDecoder* aDecoder,
|
||||
bool aWasEnded)
|
||||
{
|
||||
MOZ_ASSERT(aDecoder->GetReader()->GetTaskQueue()->IsCurrentThreadIn());
|
||||
MOZ_ASSERT(aDecoder->GetReader()->OnTaskQueue());
|
||||
|
||||
mParentDecoder->GetReentrantMonitor().AssertNotCurrentThreadIn();
|
||||
ReentrantMonitorAutoEnter mon(mParentDecoder->GetReentrantMonitor());
|
||||
@ -752,7 +752,7 @@ void
|
||||
TrackBuffer::OnMetadataNotRead(ReadMetadataFailureReason aReason,
|
||||
SourceBufferDecoder* aDecoder)
|
||||
{
|
||||
MOZ_ASSERT(aDecoder->GetReader()->GetTaskQueue()->IsCurrentThreadIn());
|
||||
MOZ_ASSERT(aDecoder->GetReader()->TaskQueue()->IsCurrentThreadIn());
|
||||
|
||||
mParentDecoder->GetReentrantMonitor().AssertNotCurrentThreadIn();
|
||||
ReentrantMonitorAutoEnter mon(mParentDecoder->GetReentrantMonitor());
|
||||
@ -1073,7 +1073,7 @@ TrackBuffer::RemoveDecoder(SourceBufferDecoder* aDecoder)
|
||||
mInitializedDecoders.RemoveElement(aDecoder);
|
||||
mDecoders.RemoveElement(aDecoder);
|
||||
}
|
||||
aDecoder->GetReader()->GetTaskQueue()->Dispatch(task.forget());
|
||||
aDecoder->GetReader()->TaskQueue()->Dispatch(task.forget());
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -340,7 +340,7 @@ MediaCodecReader::DispatchVideoTask(int64_t aTimeThreshold)
|
||||
nsRefPtr<MediaDecoderReader::AudioDataPromise>
|
||||
MediaCodecReader::RequestAudioData()
|
||||
{
|
||||
MOZ_ASSERT(GetTaskQueue()->IsCurrentThreadIn());
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
MOZ_ASSERT(HasAudio());
|
||||
|
||||
MonitorAutoLock al(mAudioTrack.mTrackMonitor);
|
||||
@ -355,7 +355,7 @@ nsRefPtr<MediaDecoderReader::VideoDataPromise>
|
||||
MediaCodecReader::RequestVideoData(bool aSkipToNextKeyframe,
|
||||
int64_t aTimeThreshold)
|
||||
{
|
||||
MOZ_ASSERT(GetTaskQueue()->IsCurrentThreadIn());
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
MOZ_ASSERT(HasVideo());
|
||||
|
||||
int64_t threshold = sInvalidTimestampUs;
|
||||
@ -659,7 +659,7 @@ MediaCodecReader::AsyncReadMetadata()
|
||||
|
||||
nsRefPtr<MediaCodecReader> self = this;
|
||||
mMediaResourceRequest.Begin(CreateMediaCodecs()
|
||||
->Then(GetTaskQueue(), __func__,
|
||||
->Then(TaskQueue(), __func__,
|
||||
[self] (bool) -> void {
|
||||
self->mMediaResourceRequest.Complete();
|
||||
self->HandleResourceAllocated();
|
||||
|
@ -252,7 +252,7 @@ MediaOmxReader::AsyncReadMetadata()
|
||||
|
||||
nsRefPtr<MediaOmxReader> self = this;
|
||||
mMediaResourceRequest.Begin(mOmxDecoder->AllocateMediaResources()
|
||||
->Then(GetTaskQueue(), __func__,
|
||||
->Then(TaskQueue(), __func__,
|
||||
[self] (bool) -> void {
|
||||
self->mMediaResourceRequest.Complete();
|
||||
self->HandleResourceAllocated();
|
||||
|
@ -245,14 +245,14 @@ MediaDecodeTask::Decode()
|
||||
{
|
||||
MOZ_ASSERT(!NS_IsMainThread());
|
||||
|
||||
mBufferDecoder->BeginDecoding(mDecoderReader->GetTaskQueue());
|
||||
mBufferDecoder->BeginDecoding(mDecoderReader->TaskQueue());
|
||||
|
||||
// Tell the decoder reader that we are not going to play the data directly,
|
||||
// and that we should not reject files with more channels than the audio
|
||||
// backend support.
|
||||
mDecoderReader->SetIgnoreAudioOutputFormat();
|
||||
|
||||
mDecoderReader->AsyncReadMetadata()->Then(mDecoderReader->GetTaskQueue(), __func__, this,
|
||||
mDecoderReader->AsyncReadMetadata()->Then(mDecoderReader->TaskQueue(), __func__, this,
|
||||
&MediaDecodeTask::OnMetadataRead,
|
||||
&MediaDecodeTask::OnMetadataNotRead);
|
||||
}
|
||||
@ -281,7 +281,7 @@ MediaDecodeTask::OnMetadataNotRead(ReadMetadataFailureReason aReason)
|
||||
void
|
||||
MediaDecodeTask::RequestSample()
|
||||
{
|
||||
mDecoderReader->RequestAudioData()->Then(mDecoderReader->GetTaskQueue(), __func__, this,
|
||||
mDecoderReader->RequestAudioData()->Then(mDecoderReader->TaskQueue(), __func__, this,
|
||||
&MediaDecodeTask::SampleDecoded,
|
||||
&MediaDecodeTask::SampleNotDecoded);
|
||||
}
|
||||
@ -504,10 +504,10 @@ AsyncDecodeWebAudio(const char* aContentType, uint8_t* aBuffer,
|
||||
NS_DispatchToMainThread(event);
|
||||
} else {
|
||||
// If we did this without a temporary:
|
||||
// task->Reader()->GetTaskQueue()->Dispatch(task.forget())
|
||||
// task->Reader()->TaskQueue()->Dispatch(task.forget())
|
||||
// we might evaluate the task.forget() before calling Reader(). Enforce
|
||||
// a non-crashy order-of-operations.
|
||||
MediaTaskQueue* taskQueue = task->Reader()->GetTaskQueue();
|
||||
MediaTaskQueue* taskQueue = task->Reader()->TaskQueue();
|
||||
taskQueue->Dispatch(task.forget());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user