diff --git a/dom/media/AbstractThread.cpp b/dom/media/AbstractThread.cpp index 632446563548..e2ae094fb9d5 100644 --- a/dom/media/AbstractThread.cpp +++ b/dom/media/AbstractThread.cpp @@ -6,7 +6,7 @@ #include "AbstractThread.h" -#include "MediaTaskQueue.h" +#include "TaskQueue.h" #include "nsThreadUtils.h" #include "TaskDispatcher.h" diff --git a/dom/media/AbstractThread.h b/dom/media/AbstractThread.h index 587b6eb212c8..2668802862e9 100644 --- a/dom/media/AbstractThread.h +++ b/dom/media/AbstractThread.h @@ -17,18 +17,18 @@ namespace mozilla { -class MediaTaskQueue; +class TaskQueue; class TaskDispatcher; /* * We often want to run tasks on a target that guarantees that events will never * run in parallel. There are various target types that achieve this - namely - * nsIThread and MediaTaskQueue. Note that nsIThreadPool (which implements + * nsIThread and TaskQueue. Note that nsIThreadPool (which implements * nsIEventTarget) does not have this property, so we do not want to use * nsIEventTarget for this purpose. This class encapsulates the specifics of * the structures we might use here and provides a consistent interface. * - * At present, the supported AbstractThread implementations are MediaTaskQueue + * At present, the supported AbstractThread implementations are TaskQueue * and AbstractThread::MainThread. If you add support for another thread that is * not the MainThread, you'll need to figure out how to make it unique such that * comparing AbstractThread pointers is equivalent to comparing nsIThread pointers. @@ -53,7 +53,7 @@ public: virtual bool IsCurrentThreadIn() = 0; // Returns true if dispatch is generally reliable. This is used to guard - // against FlushableMediaTaskQueues, which should go away. + // against FlushableTaskQueues, which should go away. virtual bool IsDispatchReliable() { return true; } // Returns a TaskDispatcher that will dispatch its tasks when the currently- @@ -70,7 +70,7 @@ public: // aThread go through the tail dispatcher. bool RequiresTailDispatch(AbstractThread* aThread) const; - virtual MediaTaskQueue* AsTaskQueue() { MOZ_CRASH("Not a task queue!"); } + virtual TaskQueue* AsTaskQueue() { MOZ_CRASH("Not a task queue!"); } virtual nsIThread* AsXPCOMThread() { MOZ_CRASH("Not an XPCOM thread!"); } // Convenience method for getting an AbstractThread for the main thread. diff --git a/dom/media/MediaDecoder.h b/dom/media/MediaDecoder.h index 8811a0a9cf68..c9773be5f6fb 100644 --- a/dom/media/MediaDecoder.h +++ b/dom/media/MediaDecoder.h @@ -6,7 +6,7 @@ /* Each video element based on MediaDecoder has a state machine to manage its play state and keep the current frame up to date. All state machines -share time in a single shared thread. Each decoder also has a MediaTaskQueue +share time in a single shared thread. Each decoder also has a TaskQueue running in a SharedThreadPool to decode audio and video data. Each decoder also has a thread to push decoded audio to the hardware. This thread is not created until playback starts, but diff --git a/dom/media/MediaDecoderReader.cpp b/dom/media/MediaDecoderReader.cpp index 43a4cef102ee..9a843e77b32d 100644 --- a/dom/media/MediaDecoderReader.cpp +++ b/dom/media/MediaDecoderReader.cpp @@ -63,12 +63,12 @@ public: }; MediaDecoderReader::MediaDecoderReader(AbstractMediaDecoder* aDecoder, - MediaTaskQueue* aBorrowedTaskQueue) + TaskQueue* aBorrowedTaskQueue) : mAudioCompactor(mAudioQueue) , mDecoder(aDecoder) , mTaskQueue(aBorrowedTaskQueue ? aBorrowedTaskQueue - : new MediaTaskQueue(GetMediaThreadPool(MediaThreadType::PLAYBACK), - /* aSupportsTailDispatch = */ true)) + : new TaskQueue(GetMediaThreadPool(MediaThreadType::PLAYBACK), + /* aSupportsTailDispatch = */ true)) , mWatchManager(this, mTaskQueue) , mTimer(new MediaTimer()) , mBuffered(mTaskQueue, TimeIntervals(), "MediaDecoderReader::mBuffered (Canonical)") diff --git a/dom/media/MediaDecoderReader.h b/dom/media/MediaDecoderReader.h index 3377bb0d1a64..6d0dfb058532 100644 --- a/dom/media/MediaDecoderReader.h +++ b/dom/media/MediaDecoderReader.h @@ -81,7 +81,7 @@ public: // The caller must ensure that Shutdown() is called before aDecoder is // destroyed. - explicit MediaDecoderReader(AbstractMediaDecoder* aDecoder, MediaTaskQueue* aBorrowedTaskQueue = nullptr); + explicit MediaDecoderReader(AbstractMediaDecoder* aDecoder, TaskQueue* aBorrowedTaskQueue = nullptr); // Does any spinup that needs to happen on this task queue. This runs on a // different thread than Init, and there should not be ordering dependencies @@ -310,7 +310,7 @@ public: OwnerThread()->Dispatch(r.forget()); } - MediaTaskQueue* OwnerThread() { + TaskQueue* OwnerThread() { return mTaskQueue; } @@ -365,7 +365,7 @@ protected: AbstractMediaDecoder* mDecoder; // Decode task queue. - nsRefPtr mTaskQueue; + nsRefPtr mTaskQueue; // State-watching manager. WatchManager mWatchManager; diff --git a/dom/media/MediaDecoderStateMachine.cpp b/dom/media/MediaDecoderStateMachine.cpp index 6fe05e4de984..3494ddc84d21 100644 --- a/dom/media/MediaDecoderStateMachine.cpp +++ b/dom/media/MediaDecoderStateMachine.cpp @@ -31,7 +31,7 @@ #include "nsContentUtils.h" #include "MediaShutdownManager.h" #include "SharedThreadPool.h" -#include "MediaTaskQueue.h" +#include "TaskQueue.h" #include "nsIEventTarget.h" #include "prenv.h" #include "mozilla/Preferences.h" @@ -182,8 +182,8 @@ MediaDecoderStateMachine::MediaDecoderStateMachine(MediaDecoder* aDecoder, MediaDecoderReader* aReader, bool aRealTime) : mDecoder(aDecoder), - mTaskQueue(new MediaTaskQueue(GetMediaThreadPool(MediaThreadType::PLAYBACK), - /* aSupportsTailDispatch = */ true)), + mTaskQueue(new TaskQueue(GetMediaThreadPool(MediaThreadType::PLAYBACK), + /* aSupportsTailDispatch = */ true)), mWatchManager(this, mTaskQueue), mProducerID(ImageContainer::AllocateProducerID()), mRealTime(aRealTime), diff --git a/dom/media/MediaDecoderStateMachine.h b/dom/media/MediaDecoderStateMachine.h index 56b01407384f..16dd85fa1b2d 100644 --- a/dom/media/MediaDecoderStateMachine.h +++ b/dom/media/MediaDecoderStateMachine.h @@ -15,7 +15,7 @@ AudioStream will be refactored to have a callback interface where it asks for data and this thread will no longer be needed. -The element/state machine also has a MediaTaskQueue which runs in a +The element/state machine also has a TaskQueue which runs in a SharedThreadPool that is shared with all other elements/decoders. The state machine dispatches tasks to this to call into the MediaDecoderReader to request decoded audio or video data. The Reader will callback with decoded @@ -98,7 +98,7 @@ hardware (via AudioStream). namespace mozilla { class AudioSegment; -class MediaTaskQueue; +class TaskQueue; class AudioSink; extern PRLogModuleInfo* gMediaDecoderLog; @@ -264,7 +264,7 @@ public: } // Returns the state machine task queue. - MediaTaskQueue* OwnerThread() const { return mTaskQueue; } + TaskQueue* OwnerThread() const { return mTaskQueue; } // Calls ScheduleStateMachine() after taking the decoder lock. Also // notifies the decoder thread in case it's waiting on the decoder lock. @@ -709,7 +709,7 @@ private: nsRefPtr mDecoder; // Task queue for running the state machine. - nsRefPtr mTaskQueue; + nsRefPtr mTaskQueue; // State-watching manager. WatchManager mWatchManager; @@ -920,7 +920,7 @@ private: // 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->OwnerThread(); } + TaskQueue* DecodeTaskQueue() const { return mReader->OwnerThread(); } // The time that playback started from the system clock. This is used for // timing the presentation of video frames when there's no audio. diff --git a/dom/media/MediaFormatReader.cpp b/dom/media/MediaFormatReader.cpp index 743f3ca7cb8d..1ff2bc8949be 100644 --- a/dom/media/MediaFormatReader.cpp +++ b/dom/media/MediaFormatReader.cpp @@ -62,7 +62,7 @@ TrackTypeToStr(TrackInfo::TrackType aTrack) MediaFormatReader::MediaFormatReader(AbstractMediaDecoder* aDecoder, MediaDataDemuxer* aDemuxer, - MediaTaskQueue* aBorrowedTaskQueue) + TaskQueue* aBorrowedTaskQueue) : MediaDecoderReader(aDecoder, aBorrowedTaskQueue) , mDemuxer(aDemuxer) , mAudio(this, MediaData::AUDIO_DATA, Preferences::GetUint("media.audio-decode-ahead", 2)) @@ -188,9 +188,9 @@ MediaFormatReader::Init(MediaDecoderReader* aCloneDonor) InitLayersBackendType(); mAudio.mTaskQueue = - new FlushableMediaTaskQueue(GetMediaThreadPool(MediaThreadType::PLATFORM_DECODER)); + new FlushableTaskQueue(GetMediaThreadPool(MediaThreadType::PLATFORM_DECODER)); mVideo.mTaskQueue = - new FlushableMediaTaskQueue(GetMediaThreadPool(MediaThreadType::PLATFORM_DECODER)); + new FlushableTaskQueue(GetMediaThreadPool(MediaThreadType::PLATFORM_DECODER)); static bool sSetupPrefCache = false; if (!sSetupPrefCache) { diff --git a/dom/media/MediaFormatReader.h b/dom/media/MediaFormatReader.h index 134af24ec422..f0626852e5bc 100644 --- a/dom/media/MediaFormatReader.h +++ b/dom/media/MediaFormatReader.h @@ -11,7 +11,7 @@ #include "mozilla/Maybe.h" #include "MediaDataDemuxer.h" #include "MediaDecoderReader.h" -#include "MediaTaskQueue.h" +#include "TaskQueue.h" #include "PlatformDecoderModule.h" namespace mozilla { @@ -24,7 +24,7 @@ class MediaFormatReader final : public MediaDecoderReader public: explicit MediaFormatReader(AbstractMediaDecoder* aDecoder, MediaDataDemuxer* aDemuxer, - MediaTaskQueue* aBorrowedTaskQueue = nullptr); + TaskQueue* aBorrowedTaskQueue = nullptr); virtual ~MediaFormatReader(); @@ -213,7 +213,7 @@ private: nsRefPtr mDecoder; // TaskQueue on which decoder can choose to decode. // Only non-null up until the decoder is created. - nsRefPtr mTaskQueue; + nsRefPtr mTaskQueue; // Callback that receives output and error notifications from the decoder. nsAutoPtr mCallback; diff --git a/dom/media/MediaQueue.h b/dom/media/MediaQueue.h index 019801017bb0..10eb71ba4935 100644 --- a/dom/media/MediaQueue.h +++ b/dom/media/MediaQueue.h @@ -10,7 +10,7 @@ #include "nsTArray.h" #include "mozilla/ReentrantMonitor.h" #include "mozilla/RefPtr.h" -#include "MediaTaskQueue.h" +#include "TaskQueue.h" namespace mozilla { @@ -159,7 +159,7 @@ template class MediaQueue : private nsDeque { mPopListeners.Clear(); } - void AddPopListener(nsIRunnable* aRunnable, MediaTaskQueue* aTarget) { + void AddPopListener(nsIRunnable* aRunnable, TaskQueue* aTarget) { ReentrantMonitorAutoEnter mon(mReentrantMonitor); mPopListeners.AppendElement(Listener(aRunnable, aTarget)); } @@ -168,7 +168,7 @@ private: mutable ReentrantMonitor mReentrantMonitor; struct Listener { - Listener(nsIRunnable* aRunnable, MediaTaskQueue* aTarget) + Listener(nsIRunnable* aRunnable, TaskQueue* aTarget) : mRunnable(aRunnable) , mTarget(aTarget) { @@ -179,7 +179,7 @@ private: { } nsCOMPtr mRunnable; - RefPtr mTarget; + RefPtr mTarget; }; nsTArray mPopListeners; diff --git a/dom/media/MediaStreamGraph.cpp b/dom/media/MediaStreamGraph.cpp index 76bd7a01937a..a8ebde584b72 100644 --- a/dom/media/MediaStreamGraph.cpp +++ b/dom/media/MediaStreamGraph.cpp @@ -2670,7 +2670,7 @@ SourceMediaStream::GetEndOfAppendedData(TrackID aID) void SourceMediaStream::DispatchWhenNotEnoughBuffered(TrackID aID, - MediaTaskQueue* aSignalQueue, nsIRunnable* aSignalRunnable) + TaskQueue* aSignalQueue, nsIRunnable* aSignalRunnable) { MutexAutoLock lock(mMutex); TrackData* data = FindDataForTrack(aID); diff --git a/dom/media/MediaStreamGraph.h b/dom/media/MediaStreamGraph.h index 5e975660cec1..5765ea00e599 100644 --- a/dom/media/MediaStreamGraph.h +++ b/dom/media/MediaStreamGraph.h @@ -16,7 +16,7 @@ #include "VideoFrameContainer.h" #include "VideoSegment.h" #include "MainThreadUtils.h" -#include "MediaTaskQueue.h" +#include "TaskQueue.h" #include "nsAutoRef.h" #include "GraphDriver.h" #include @@ -832,7 +832,7 @@ public: * does not exist. No op if a runnable is already present for this track. */ void DispatchWhenNotEnoughBuffered(TrackID aID, - MediaTaskQueue* aSignalQueue, nsIRunnable* aSignalRunnable); + TaskQueue* aSignalQueue, nsIRunnable* aSignalRunnable); /** * Indicate that a track has ended. Do not do any more API calls * affecting this track. @@ -896,13 +896,13 @@ public: protected: struct ThreadAndRunnable { - void Init(MediaTaskQueue* aTarget, nsIRunnable* aRunnable) + void Init(TaskQueue* aTarget, nsIRunnable* aRunnable) { mTarget = aTarget; mRunnable = aRunnable; } - nsRefPtr mTarget; + nsRefPtr mTarget; nsCOMPtr mRunnable; }; enum TrackCommands { diff --git a/dom/media/MediaTimer.h b/dom/media/MediaTimer.h index 117a5e52088d..721a5ec99b17 100644 --- a/dom/media/MediaTimer.h +++ b/dom/media/MediaTimer.h @@ -31,7 +31,7 @@ extern PRLogModuleInfo* gMediaTimerLog; typedef MozPromise MediaTimerPromise; // Timers only know how to fire at a given thread, which creates an impedence -// mismatch with code that operates with MediaTaskQueues. This class solves +// mismatch with code that operates with TaskQueues. This class solves // that mismatch with a dedicated (but shared) thread and a nice MozPromise-y // interface. class MediaTimer diff --git a/dom/media/MediaTaskQueue.cpp b/dom/media/TaskQueue.cpp similarity index 84% rename from dom/media/MediaTaskQueue.cpp rename to dom/media/TaskQueue.cpp index eabd0b97d19e..b8136a1cb77a 100644 --- a/dom/media/MediaTaskQueue.cpp +++ b/dom/media/TaskQueue.cpp @@ -4,34 +4,34 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "MediaTaskQueue.h" +#include "TaskQueue.h" #include "nsThreadUtils.h" #include "SharedThreadPool.h" namespace mozilla { -MediaTaskQueue::MediaTaskQueue(already_AddRefed aPool, +TaskQueue::TaskQueue(already_AddRefed aPool, bool aRequireTailDispatch) : AbstractThread(aRequireTailDispatch) , mPool(aPool) - , mQueueMonitor("MediaTaskQueue::Queue") + , mQueueMonitor("TaskQueue::Queue") , mTailDispatcher(nullptr) , mIsRunning(false) , mIsShutdown(false) , mIsFlushing(false) { - MOZ_COUNT_CTOR(MediaTaskQueue); + MOZ_COUNT_CTOR(TaskQueue); } -MediaTaskQueue::~MediaTaskQueue() +TaskQueue::~TaskQueue() { MonitorAutoLock mon(mQueueMonitor); MOZ_ASSERT(mIsShutdown); - MOZ_COUNT_DTOR(MediaTaskQueue); + MOZ_COUNT_DTOR(TaskQueue); } TaskDispatcher& -MediaTaskQueue::TailDispatcher() +TaskQueue::TailDispatcher() { MOZ_ASSERT(IsCurrentThreadIn()); MOZ_ASSERT(mTailDispatcher); @@ -39,7 +39,7 @@ MediaTaskQueue::TailDispatcher() } nsresult -MediaTaskQueue::DispatchLocked(already_AddRefed aRunnable, +TaskQueue::DispatchLocked(already_AddRefed aRunnable, DispatchMode aMode, DispatchFailureHandling aFailureHandling, DispatchReason aReason) { @@ -64,7 +64,7 @@ MediaTaskQueue::DispatchLocked(already_AddRefed aRunnable, RefPtr runner(new Runner(this)); nsresult rv = mPool->Dispatch(runner, NS_DISPATCH_NORMAL); if (NS_FAILED(rv)) { - NS_WARNING("Failed to dispatch runnable to run MediaTaskQueue"); + NS_WARNING("Failed to dispatch runnable to run TaskQueue"); return rv; } mIsRunning = true; @@ -72,11 +72,11 @@ MediaTaskQueue::DispatchLocked(already_AddRefed aRunnable, return NS_OK; } -class MediaTaskQueueSyncRunnable : public nsRunnable { +class TaskQueueSyncRunnable : public nsRunnable { public: - explicit MediaTaskQueueSyncRunnable(already_AddRefed aRunnable) + explicit TaskQueueSyncRunnable(already_AddRefed aRunnable) : mRunnable(aRunnable) - , mMonitor("MediaTaskQueueSyncRunnable") + , mMonitor("TaskQueueSyncRunnable") , mDone(false) { } @@ -104,30 +104,30 @@ private: }; void -MediaTaskQueue::SyncDispatch(already_AddRefed aRunnable) { - NS_WARNING("MediaTaskQueue::SyncDispatch is dangerous and deprecated. Stop using this!"); - nsRefPtr task(new MediaTaskQueueSyncRunnable(Move(aRunnable))); +TaskQueue::SyncDispatch(already_AddRefed aRunnable) { + NS_WARNING("TaskQueue::SyncDispatch is dangerous and deprecated. Stop using this!"); + nsRefPtr task(new TaskQueueSyncRunnable(Move(aRunnable))); // Tail dispatchers don't interact nicely with sync dispatch. We require that // nothing is already in the tail dispatcher, and then sidestep it for this // task. MOZ_ASSERT_IF(AbstractThread::GetCurrent(), !AbstractThread::GetCurrent()->TailDispatcher().HasTasksFor(this)); - nsRefPtr taskRef = task; + nsRefPtr taskRef = task; Dispatch(taskRef.forget(), AssertDispatchSuccess, TailDispatch); task->WaitUntilDone(); } void -MediaTaskQueue::AwaitIdle() +TaskQueue::AwaitIdle() { MonitorAutoLock mon(mQueueMonitor); AwaitIdleLocked(); } void -MediaTaskQueue::AwaitIdleLocked() +TaskQueue::AwaitIdleLocked() { // Make sure there are no tasks for this queue waiting in the caller's tail // dispatcher. @@ -142,7 +142,7 @@ MediaTaskQueue::AwaitIdleLocked() } void -MediaTaskQueue::AwaitShutdownAndIdle() +TaskQueue::AwaitShutdownAndIdle() { // Make sure there are no tasks for this queue waiting in the caller's tail // dispatcher. @@ -157,7 +157,7 @@ MediaTaskQueue::AwaitShutdownAndIdle() } nsRefPtr -MediaTaskQueue::BeginShutdown() +TaskQueue::BeginShutdown() { // Dispatch any tasks for this queue waiting in the caller's tail dispatcher, // since this is the last opportunity to do so. @@ -174,7 +174,7 @@ MediaTaskQueue::BeginShutdown() } void -FlushableMediaTaskQueue::Flush() +FlushableTaskQueue::Flush() { MonitorAutoLock mon(mQueueMonitor); AutoSetFlushing autoFlush(this); @@ -183,7 +183,7 @@ FlushableMediaTaskQueue::Flush() } nsresult -FlushableMediaTaskQueue::FlushAndDispatch(already_AddRefed aRunnable) +FlushableTaskQueue::FlushAndDispatch(already_AddRefed aRunnable) { MonitorAutoLock mon(mQueueMonitor); AutoSetFlushing autoFlush(this); @@ -196,7 +196,7 @@ FlushableMediaTaskQueue::FlushAndDispatch(already_AddRefed aRunnabl } void -FlushableMediaTaskQueue::FlushLocked() +FlushableTaskQueue::FlushLocked() { // Make sure there are no tasks for this queue waiting in the caller's tail // dispatcher. @@ -207,21 +207,21 @@ FlushableMediaTaskQueue::FlushLocked() MOZ_ASSERT(mIsFlushing); // Clear the tasks. If this strikes you as awful, stop using a - // FlushableMediaTaskQueue. + // FlushableTaskQueue. while (!mTasks.empty()) { mTasks.pop(); } } bool -MediaTaskQueue::IsEmpty() +TaskQueue::IsEmpty() { MonitorAutoLock mon(mQueueMonitor); return mTasks.empty(); } bool -MediaTaskQueue::IsCurrentThreadIn() +TaskQueue::IsCurrentThreadIn() { bool in = NS_GetCurrentThread() == mRunningThread; MOZ_ASSERT(in == (GetCurrent() == this)); @@ -229,7 +229,7 @@ MediaTaskQueue::IsCurrentThreadIn() } nsresult -MediaTaskQueue::Runner::Run() +TaskQueue::Runner::Run() { RefPtr event; { diff --git a/dom/media/MediaTaskQueue.h b/dom/media/TaskQueue.h similarity index 87% rename from dom/media/MediaTaskQueue.h rename to dom/media/TaskQueue.h index 5371d5ff9211..6056987fdfbf 100644 --- a/dom/media/MediaTaskQueue.h +++ b/dom/media/TaskQueue.h @@ -4,8 +4,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef MediaTaskQueue_h_ -#define MediaTaskQueue_h_ +#ifndef TaskQueue_h_ +#define TaskQueue_h_ #include #include "mozilla/RefPtr.h" @@ -25,17 +25,17 @@ class SharedThreadPool; typedef MozPromise ShutdownPromise; // Abstracts executing runnables in order in a thread pool. The runnables -// dispatched to the MediaTaskQueue will be executed in the order in which +// dispatched to the TaskQueue will be executed in the order in which // they're received, and are guaranteed to not be executed concurrently. // They may be executed on different threads, and a memory barrier is used // to make this threadsafe for objects that aren't already threadsafe. -class MediaTaskQueue : public AbstractThread { +class TaskQueue : public AbstractThread { public: - explicit MediaTaskQueue(already_AddRefed aPool, bool aSupportsTailDispatch = false); + explicit TaskQueue(already_AddRefed aPool, bool aSupportsTailDispatch = false); TaskDispatcher& TailDispatcher() override; - MediaTaskQueue* AsTaskQueue() override { return this; } + TaskQueue* AsTaskQueue() override { return this; } void Dispatch(already_AddRefed aRunnable, DispatchFailureHandling aFailureHandling = AssertDispatchSuccess, @@ -73,7 +73,7 @@ public: bool IsCurrentThreadIn() override; protected: - virtual ~MediaTaskQueue(); + virtual ~TaskQueue(); // Blocks until all task finish executing. Called internally by methods @@ -118,7 +118,7 @@ protected: class AutoTaskGuard : public AutoTaskDispatcher { public: - explicit AutoTaskGuard(MediaTaskQueue* aQueue) + explicit AutoTaskGuard(TaskQueue* aQueue) : AutoTaskDispatcher(/* aIsTailDispatcher = */ true), mQueue(aQueue) { // NB: We don't hold the lock to aQueue here. Don't do anything that @@ -145,7 +145,7 @@ protected: } private: - MediaTaskQueue* mQueue; + TaskQueue* mQueue; }; TaskDispatcher* mTailDispatcher; @@ -163,20 +163,20 @@ protected: class Runner : public nsRunnable { public: - explicit Runner(MediaTaskQueue* aQueue) + explicit Runner(TaskQueue* aQueue) : mQueue(aQueue) { } NS_METHOD Run() override; private: - RefPtr mQueue; + RefPtr mQueue; }; }; -class FlushableMediaTaskQueue : public MediaTaskQueue +class FlushableTaskQueue : public TaskQueue { public: - explicit FlushableMediaTaskQueue(already_AddRefed aPool) : MediaTaskQueue(Move(aPool)) {} + explicit FlushableTaskQueue(already_AddRefed aPool) : TaskQueue(Move(aPool)) {} nsresult FlushAndDispatch(already_AddRefed aRunnable); void Flush(); @@ -187,7 +187,7 @@ private: class MOZ_STACK_CLASS AutoSetFlushing { public: - explicit AutoSetFlushing(FlushableMediaTaskQueue* aTaskQueue) : mTaskQueue(aTaskQueue) + explicit AutoSetFlushing(FlushableTaskQueue* aTaskQueue) : mTaskQueue(aTaskQueue) { mTaskQueue->mQueueMonitor.AssertCurrentThreadOwns(); mTaskQueue->mIsFlushing = true; @@ -199,7 +199,7 @@ private: } private: - FlushableMediaTaskQueue* mTaskQueue; + FlushableTaskQueue* mTaskQueue; }; void FlushLocked(); @@ -208,4 +208,4 @@ private: } // namespace mozilla -#endif // MediaTaskQueue_h_ +#endif // TaskQueue_h_ diff --git a/dom/media/VideoUtils.cpp b/dom/media/VideoUtils.cpp index f22ea9891d38..0b29385962ec 100644 --- a/dom/media/VideoUtils.cpp +++ b/dom/media/VideoUtils.cpp @@ -15,7 +15,7 @@ #include "mozilla/Telemetry.h" #include "nsIRandomGenerator.h" #include "nsIServiceManager.h" -#include "MediaTaskQueue.h" +#include "TaskQueue.h" #include @@ -325,10 +325,10 @@ public: NS_IMETHOD Run() { MOZ_ASSERT(NS_IsMainThread()); mTaskQueue = - new MediaTaskQueue(GetMediaThreadPool(MediaThreadType::PLATFORM_DECODER)); + new TaskQueue(GetMediaThreadPool(MediaThreadType::PLATFORM_DECODER)); return NS_OK; } - nsRefPtr mTaskQueue; + nsRefPtr mTaskQueue; }; class CreateFlushableTaskQueueTask : public nsRunnable { @@ -336,26 +336,26 @@ public: NS_IMETHOD Run() { MOZ_ASSERT(NS_IsMainThread()); mTaskQueue = - new FlushableMediaTaskQueue(GetMediaThreadPool(MediaThreadType::PLATFORM_DECODER)); + new FlushableTaskQueue(GetMediaThreadPool(MediaThreadType::PLATFORM_DECODER)); return NS_OK; } - nsRefPtr mTaskQueue; + nsRefPtr mTaskQueue; }; -already_AddRefed +already_AddRefed CreateMediaDecodeTaskQueue() { - // We must create the MediaTaskQueue/SharedThreadPool on the main thread. + // We must create the TaskQueue/SharedThreadPool on the main thread. nsRefPtr t(new CreateTaskQueueTask()); nsresult rv = NS_DispatchToMainThread(t, NS_DISPATCH_SYNC); NS_ENSURE_SUCCESS(rv, nullptr); return t->mTaskQueue.forget(); } -already_AddRefed +already_AddRefed CreateFlushableMediaDecodeTaskQueue() { - // We must create the MediaTaskQueue/SharedThreadPool on the main thread. + // We must create the TaskQueue/SharedThreadPool on the main thread. nsRefPtr t(new CreateFlushableTaskQueueTask()); nsresult rv = NS_DispatchToMainThread(t, NS_DISPATCH_SYNC); NS_ENSURE_SUCCESS(rv, nullptr); diff --git a/dom/media/VideoUtils.h b/dom/media/VideoUtils.h index e2274302ed5b..bf3df68fe626 100644 --- a/dom/media/VideoUtils.h +++ b/dom/media/VideoUtils.h @@ -274,13 +274,13 @@ GenerateRandomName(nsCString& aOutSalt, uint32_t aLength); nsresult GenerateRandomPathName(nsCString& aOutSalt, uint32_t aLength); -class MediaTaskQueue; -class FlushableMediaTaskQueue; +class TaskQueue; +class FlushableTaskQueue; -already_AddRefed +already_AddRefed CreateMediaDecodeTaskQueue(); -already_AddRefed +already_AddRefed CreateFlushableMediaDecodeTaskQueue(); // Iteratively invokes aWork until aCondition returns true, or aWork returns false. diff --git a/dom/media/fmp4/MP4Reader.cpp b/dom/media/fmp4/MP4Reader.cpp index 83cee56cacc6..b31e1c0b1e1d 100644 --- a/dom/media/fmp4/MP4Reader.cpp +++ b/dom/media/fmp4/MP4Reader.cpp @@ -111,7 +111,7 @@ InvokeAndRetry(ThisType* aThisVal, ReturnType(ThisType::*aMethod)(), MP4Stream* } } -MP4Reader::MP4Reader(AbstractMediaDecoder* aDecoder, MediaTaskQueue* aBorrowedTaskQueue) +MP4Reader::MP4Reader(AbstractMediaDecoder* aDecoder, TaskQueue* aBorrowedTaskQueue) : MediaDecoderReader(aDecoder, aBorrowedTaskQueue) , mAudio(MediaData::AUDIO_DATA, Preferences::GetUint("media.mp4-audio-decode-ahead", 2)) , mVideo(MediaData::VIDEO_DATA, Preferences::GetUint("media.mp4-video-decode-ahead", 2)) @@ -210,11 +210,11 @@ MP4Reader::Init(MediaDecoderReader* aCloneDonor) InitLayersBackendType(); mAudio.mTaskQueue = - new FlushableMediaTaskQueue(GetMediaThreadPool(MediaThreadType::PLATFORM_DECODER)); + new FlushableTaskQueue(GetMediaThreadPool(MediaThreadType::PLATFORM_DECODER)); NS_ENSURE_TRUE(mAudio.mTaskQueue, NS_ERROR_FAILURE); mVideo.mTaskQueue = - new FlushableMediaTaskQueue(GetMediaThreadPool(MediaThreadType::PLATFORM_DECODER)); + new FlushableTaskQueue(GetMediaThreadPool(MediaThreadType::PLATFORM_DECODER)); NS_ENSURE_TRUE(mVideo.mTaskQueue, NS_ERROR_FAILURE); static bool sSetupPrefCache = false; diff --git a/dom/media/fmp4/MP4Reader.h b/dom/media/fmp4/MP4Reader.h index 32d1617a8028..369f8a9296f2 100644 --- a/dom/media/fmp4/MP4Reader.h +++ b/dom/media/fmp4/MP4Reader.h @@ -12,7 +12,7 @@ #include "PlatformDecoderModule.h" #include "mp4_demuxer/mp4_demuxer.h" #include "demuxer/TrackDemuxer.h" -#include "MediaTaskQueue.h" +#include "TaskQueue.h" #include #include "mozilla/Monitor.h" @@ -28,7 +28,7 @@ class MP4Reader final : public MediaDecoderReader typedef TrackInfo::TrackType TrackType; public: - explicit MP4Reader(AbstractMediaDecoder* aDecoder, MediaTaskQueue* aBorrowedTaskQueue = nullptr); + explicit MP4Reader(AbstractMediaDecoder* aDecoder, TaskQueue* aBorrowedTaskQueue = nullptr); virtual ~MP4Reader(); @@ -184,7 +184,7 @@ private: nsRefPtr mDecoder; // TaskQueue on which decoder can choose to decode. // Only non-null up until the decoder is created. - nsRefPtr mTaskQueue; + nsRefPtr mTaskQueue; // Callback that receives output and error notifications from the decoder. nsAutoPtr mCallback; // Decoded samples returned my mDecoder awaiting being returned to diff --git a/dom/media/gtest/TestMP4Reader.cpp b/dom/media/gtest/TestMP4Reader.cpp index 074e5f72427e..fee2a43d8a7b 100644 --- a/dom/media/gtest/TestMP4Reader.cpp +++ b/dom/media/gtest/TestMP4Reader.cpp @@ -53,7 +53,7 @@ private: virtual ~TestBinding() { { - nsRefPtr queue = reader->OwnerThread(); + nsRefPtr queue = reader->OwnerThread(); nsCOMPtr task = NS_NewRunnableMethod(reader, &MP4Reader::Shutdown); // Hackily bypass the tail dispatcher so that we can AwaitShutdownAndIdle. // In production code we'd use BeginShutdown + promises. diff --git a/dom/media/gtest/TestMozPromise.cpp b/dom/media/gtest/TestMozPromise.cpp index 24a00954649c..fd344fe44c71 100644 --- a/dom/media/gtest/TestMozPromise.cpp +++ b/dom/media/gtest/TestMozPromise.cpp @@ -5,7 +5,7 @@ #include "gtest/gtest.h" #include "nsISupportsImpl.h" -#include "MediaTaskQueue.h" +#include "TaskQueue.h" #include "MozPromise.h" #include "SharedThreadPool.h" #include "VideoUtils.h" @@ -19,7 +19,7 @@ class MOZ_STACK_CLASS AutoTaskQueue { public: AutoTaskQueue() - : mTaskQueue(new MediaTaskQueue(GetMediaThreadPool(MediaThreadType::PLAYBACK))) + : mTaskQueue(new TaskQueue(GetMediaThreadPool(MediaThreadType::PLAYBACK))) {} ~AutoTaskQueue() @@ -27,15 +27,15 @@ public: mTaskQueue->AwaitShutdownAndIdle(); } - MediaTaskQueue* Queue() { return mTaskQueue; } + TaskQueue* Queue() { return mTaskQueue; } private: - nsRefPtr mTaskQueue; + nsRefPtr mTaskQueue; }; class DelayedResolveOrReject : public nsRunnable { public: - DelayedResolveOrReject(MediaTaskQueue* aTaskQueue, + DelayedResolveOrReject(TaskQueue* aTaskQueue, TestPromise::Private* aPromise, TestPromise::ResolveOrRejectValue aValue, int aIterations) @@ -71,7 +71,7 @@ protected: ~DelayedResolveOrReject() {} private: - nsRefPtr mTaskQueue; + nsRefPtr mTaskQueue; nsRefPtr mPromise; TestPromise::ResolveOrRejectValue mValue; int mIterations; @@ -79,7 +79,7 @@ private: template void -RunOnTaskQueue(MediaTaskQueue* aQueue, FunctionType aFun) +RunOnTaskQueue(TaskQueue* aQueue, FunctionType aFun) { nsCOMPtr r = NS_NewRunnableFunction(aFun); aQueue->Dispatch(r.forget()); @@ -91,7 +91,7 @@ RunOnTaskQueue(MediaTaskQueue* aQueue, FunctionType aFun) TEST(MozPromise, BasicResolve) { AutoTaskQueue atq; - nsRefPtr queue = atq.Queue(); + nsRefPtr queue = atq.Queue(); RunOnTaskQueue(queue, [queue] () -> void { TestPromise::CreateAndResolve(42, __func__)->Then(queue, __func__, [queue] (int aResolveValue) -> void { EXPECT_EQ(aResolveValue, 42); queue->BeginShutdown(); }, @@ -102,7 +102,7 @@ TEST(MozPromise, BasicResolve) TEST(MozPromise, BasicReject) { AutoTaskQueue atq; - nsRefPtr queue = atq.Queue(); + nsRefPtr queue = atq.Queue(); RunOnTaskQueue(queue, [queue] () -> void { TestPromise::CreateAndReject(42.0, __func__)->Then(queue, __func__, DO_FAIL, @@ -113,7 +113,7 @@ TEST(MozPromise, BasicReject) TEST(MozPromise, AsyncResolve) { AutoTaskQueue atq; - nsRefPtr queue = atq.Queue(); + nsRefPtr queue = atq.Queue(); RunOnTaskQueue(queue, [queue] () -> void { nsRefPtr p = new TestPromise::Private(__func__); @@ -143,7 +143,7 @@ TEST(MozPromise, CompletionPromises) { bool invokedPass = false; AutoTaskQueue atq; - nsRefPtr queue = atq.Queue(); + nsRefPtr queue = atq.Queue(); RunOnTaskQueue(queue, [queue, &invokedPass] () -> void { TestPromise::CreateAndResolve(40, __func__) ->Then(queue, __func__, @@ -174,7 +174,7 @@ TEST(MozPromise, CompletionPromises) TEST(MozPromise, PromiseAllResolve) { AutoTaskQueue atq; - nsRefPtr queue = atq.Queue(); + nsRefPtr queue = atq.Queue(); RunOnTaskQueue(queue, [queue] () -> void { nsTArray> promises; @@ -198,7 +198,7 @@ TEST(MozPromise, PromiseAllResolve) TEST(MozPromise, PromiseAllReject) { AutoTaskQueue atq; - nsRefPtr queue = atq.Queue(); + nsRefPtr queue = atq.Queue(); RunOnTaskQueue(queue, [queue] () -> void { nsTArray> promises; diff --git a/dom/media/mediasource/MediaSourceDemuxer.cpp b/dom/media/mediasource/MediaSourceDemuxer.cpp index 9f7fd9905643..46aa44cfd35e 100644 --- a/dom/media/mediasource/MediaSourceDemuxer.cpp +++ b/dom/media/mediasource/MediaSourceDemuxer.cpp @@ -24,8 +24,8 @@ using media::TimeIntervals; #define EOS_FUZZ_US 125000 MediaSourceDemuxer::MediaSourceDemuxer() - : mTaskQueue(new MediaTaskQueue(GetMediaThreadPool(MediaThreadType::PLAYBACK), - /* aSupportsTailDispatch = */ true)) + : mTaskQueue(new TaskQueue(GetMediaThreadPool(MediaThreadType::PLAYBACK), + /* aSupportsTailDispatch = */ true)) , mMonitor("MediaSourceDemuxer") { MOZ_ASSERT(NS_IsMainThread()); diff --git a/dom/media/mediasource/MediaSourceDemuxer.h b/dom/media/mediasource/MediaSourceDemuxer.h index 61f0651f49ba..6974001724a9 100644 --- a/dom/media/mediasource/MediaSourceDemuxer.h +++ b/dom/media/mediasource/MediaSourceDemuxer.h @@ -12,7 +12,7 @@ #include "MediaDecoderReader.h" #include "MediaResource.h" #include "MediaSource.h" -#include "MediaTaskQueue.h" +#include "TaskQueue.h" #include "TrackBuffersManager.h" #include "mozilla/Atomics.h" #include "mozilla/Monitor.h" @@ -52,7 +52,7 @@ public: /* interface for TrackBuffersManager */ void AttachSourceBuffer(TrackBuffersManager* aSourceBuffer); void DetachSourceBuffer(TrackBuffersManager* aSourceBuffer); - MediaTaskQueue* GetTaskQueue() { return mTaskQueue; } + TaskQueue* GetTaskQueue() { return mTaskQueue; } void NotifyTimeRangesChanged(); // Returns a string describing the state of the MediaSource internal @@ -74,7 +74,7 @@ private: return !GetTaskQueue() || GetTaskQueue()->IsCurrentThreadIn(); } - RefPtr mTaskQueue; + RefPtr mTaskQueue; nsTArray> mDemuxers; nsTArray> mSourceBuffers; diff --git a/dom/media/mediasource/MediaSourceReader.cpp b/dom/media/mediasource/MediaSourceReader.cpp index 972c6917d945..e11a01ff489a 100644 --- a/dom/media/mediasource/MediaSourceReader.cpp +++ b/dom/media/mediasource/MediaSourceReader.cpp @@ -697,7 +697,7 @@ MediaSourceReader::ReleaseMediaResources() MediaDecoderReader* CreateReaderForType(const nsACString& aType, AbstractMediaDecoder* aDecoder, - MediaTaskQueue* aBorrowedTaskQueue) + TaskQueue* aBorrowedTaskQueue) { #ifdef MOZ_FMP4 // The MP4Reader that supports fragmented MP4 and uses diff --git a/dom/media/mediasource/SourceBufferDecoder.h b/dom/media/mediasource/SourceBufferDecoder.h index df2e3d4f0f8a..1d9b89aaa298 100644 --- a/dom/media/mediasource/SourceBufferDecoder.h +++ b/dom/media/mediasource/SourceBufferDecoder.h @@ -75,7 +75,7 @@ public: return mReader; } - void SetTaskQueue(MediaTaskQueue* aTaskQueue) + void SetTaskQueue(TaskQueue* aTaskQueue) { MOZ_ASSERT((!mTaskQueue && aTaskQueue) || (mTaskQueue && !aTaskQueue)); mTaskQueue = aTaskQueue; @@ -138,7 +138,7 @@ private: virtual ~SourceBufferDecoder(); // Our TrackBuffer's task queue, this is only non-null during initialization. - RefPtr mTaskQueue; + RefPtr mTaskQueue; nsRefPtr mResource; diff --git a/dom/media/mediasource/TrackBuffer.cpp b/dom/media/mediasource/TrackBuffer.cpp index 0349b4e0e595..c9421b993769 100644 --- a/dom/media/mediasource/TrackBuffer.cpp +++ b/dom/media/mediasource/TrackBuffer.cpp @@ -10,7 +10,7 @@ #include "MediaData.h" #include "MediaSourceDecoder.h" #include "SharedThreadPool.h" -#include "MediaTaskQueue.h" +#include "TaskQueue.h" #include "SourceBufferDecoder.h" #include "SourceBufferResource.h" #include "VideoUtils.h" @@ -51,7 +51,7 @@ TrackBuffer::TrackBuffer(MediaSourceDecoder* aParentDecoder, const nsACString& a MOZ_COUNT_CTOR(TrackBuffer); mParser = ContainerParser::CreateForMIMEType(aType); mTaskQueue = - new MediaTaskQueue(GetMediaThreadPool(MediaThreadType::PLAYBACK)); + new TaskQueue(GetMediaThreadPool(MediaThreadType::PLAYBACK)); aParentDecoder->AddTrackBuffer(this); mDecoderPerSegment = Preferences::GetBool("media.mediasource.decoder-per-segment", false); MSE_DEBUG("TrackBuffer created for parent decoder %p", aParentDecoder); @@ -112,7 +112,7 @@ TrackBuffer::Shutdown() MOZ_ASSERT(mShutdownPromise.IsEmpty()); nsRefPtr p = mShutdownPromise.Ensure(__func__); - RefPtr queue = mTaskQueue; + RefPtr queue = mTaskQueue; mTaskQueue = nullptr; queue->BeginShutdown() ->Then(mParentDecoder->GetReader()->OwnerThread(), __func__, this, diff --git a/dom/media/mediasource/TrackBuffer.h b/dom/media/mediasource/TrackBuffer.h index f7bf11eeb39a..5bd72325804d 100644 --- a/dom/media/mediasource/TrackBuffer.h +++ b/dom/media/mediasource/TrackBuffer.h @@ -185,7 +185,7 @@ private: // A task queue using the shared media thread pool. Used exclusively to // initialize (i.e. call ReadMetadata on) decoders as they are created via // NewDecoder. - RefPtr mTaskQueue; + RefPtr mTaskQueue; // All of the decoders managed by this TrackBuffer. Access protected by // mParentDecoder's monitor. diff --git a/dom/media/mediasource/TrackBuffersManager.h b/dom/media/mediasource/TrackBuffersManager.h index 6b10eb084f39..7366c73b0aa3 100644 --- a/dom/media/mediasource/TrackBuffersManager.h +++ b/dom/media/mediasource/TrackBuffersManager.h @@ -304,7 +304,7 @@ private: { return !GetTaskQueue() || GetTaskQueue()->IsCurrentThreadIn(); } - RefPtr mTaskQueue; + RefPtr mTaskQueue; TimeInterval mAppendWindow; TimeUnit mTimestampOffset; diff --git a/dom/media/moz.build b/dom/media/moz.build index 4ed5ee3973dd..d7fa81aadb5c 100644 --- a/dom/media/moz.build +++ b/dom/media/moz.build @@ -129,7 +129,6 @@ EXPORTS += [ 'MediaResource.h', 'MediaSegment.h', 'MediaStreamGraph.h', - 'MediaTaskQueue.h', 'MediaTimer.h', 'MediaTrack.h', 'MediaTrackList.h', @@ -146,6 +145,7 @@ EXPORTS += [ 'StateWatching.h', 'StreamBuffer.h', 'TaskDispatcher.h', + 'TaskQueue.h', 'ThreadPoolCOMListener.h', 'TimeUnits.h', 'TimeVarying.h', @@ -228,7 +228,6 @@ UNIFIED_SOURCES += [ 'MediaStreamError.cpp', 'MediaStreamGraph.cpp', 'MediaStreamTrack.cpp', - 'MediaTaskQueue.cpp', 'MediaTimer.cpp', 'MediaTrack.cpp', 'MediaTrackList.cpp', @@ -238,6 +237,7 @@ UNIFIED_SOURCES += [ 'RtspMediaResource.cpp', 'SharedThreadPool.cpp', 'StreamBuffer.cpp', + 'TaskQueue.cpp', 'TextTrack.cpp', 'TextTrackCue.cpp', 'TextTrackCueList.cpp', diff --git a/dom/media/omx/MediaCodecReader.cpp b/dom/media/omx/MediaCodecReader.cpp index 26e80c8adc65..5ec93417c1d5 100644 --- a/dom/media/omx/MediaCodecReader.cpp +++ b/dom/media/omx/MediaCodecReader.cpp @@ -31,7 +31,7 @@ #include "gfx2DGlue.h" #include "MediaStreamSource.h" -#include "MediaTaskQueue.h" +#include "TaskQueue.h" #include "MP3FrameParser.h" #include "nsMimeTypes.h" #include "nsThreadUtils.h" diff --git a/dom/media/omx/MediaCodecReader.h b/dom/media/omx/MediaCodecReader.h index ae4715825caa..5fdecd8fba3c 100644 --- a/dom/media/omx/MediaCodecReader.h +++ b/dom/media/omx/MediaCodecReader.h @@ -41,7 +41,7 @@ class GonkNativeWindow; namespace mozilla { -class FlushableMediaTaskQueue; +class FlushableTaskQueue; class MP3FrameParser; namespace layers { @@ -77,7 +77,7 @@ protected: virtual void NotifyDataArrivedInternal(uint32_t aLength, int64_t aOffset) override; public: - // Flush the MediaTaskQueue, flush MediaCodec and raise the mDiscontinuity. + // Flush the TaskQueue, flush MediaCodec and raise the mDiscontinuity. virtual nsresult ResetDecode() override; // Disptach a DecodeVideoFrameTask to decode video data. @@ -154,7 +154,7 @@ protected: int64_t mSeekTimeUs; bool mFlushed; // meaningless when mSeekTimeUs is invalid. bool mDiscontinuity; - nsRefPtr mTaskQueue; + nsRefPtr mTaskQueue; Monitor mTrackMonitor; private: @@ -240,7 +240,7 @@ private: // Protected by mTrackMonitor. MozPromiseHolder mVideoPromise; - nsRefPtr mReleaseBufferTaskQueue; + nsRefPtr mReleaseBufferTaskQueue; private: // Forbidden VideoTrack(const VideoTrack &rhs) = delete; diff --git a/dom/media/platforms/PlatformDecoderModule.cpp b/dom/media/platforms/PlatformDecoderModule.cpp index d364d7153a80..d0476ab3d127 100644 --- a/dom/media/platforms/PlatformDecoderModule.cpp +++ b/dom/media/platforms/PlatformDecoderModule.cpp @@ -29,7 +29,7 @@ #include "mozilla/CDMProxy.h" #endif #include "SharedThreadPool.h" -#include "MediaTaskQueue.h" +#include "TaskQueue.h" #include "MediaInfo.h" #include "H264Converter.h" @@ -176,7 +176,7 @@ PlatformDecoderModule::CreatePDM() already_AddRefed PlatformDecoderModule::CreateDecoder(const TrackInfo& aConfig, - FlushableMediaTaskQueue* aTaskQueue, + FlushableTaskQueue* aTaskQueue, MediaDataDecoderCallback* aCallback, layers::LayersBackend aLayersBackend, layers::ImageContainer* aImageContainer) diff --git a/dom/media/platforms/PlatformDecoderModule.h b/dom/media/platforms/PlatformDecoderModule.h index 8847797a1946..dc1fc7f13f26 100644 --- a/dom/media/platforms/PlatformDecoderModule.h +++ b/dom/media/platforms/PlatformDecoderModule.h @@ -25,7 +25,7 @@ class ImageContainer; class MediaDataDecoder; class MediaDataDecoderCallback; -class FlushableMediaTaskQueue; +class FlushableTaskQueue; class CDMProxy; // The PlatformDecoderModule interface is used by the MP4Reader to abstract @@ -82,7 +82,7 @@ public: // See CreateVideoDecoder and CreateAudioDecoder for implementation details. virtual already_AddRefed CreateDecoder(const TrackInfo& aConfig, - FlushableMediaTaskQueue* aTaskQueue, + FlushableTaskQueue* aTaskQueue, MediaDataDecoderCallback* aCallback, layers::LayersBackend aLayersBackend = layers::LayersBackend::LAYERS_NONE, layers::ImageContainer* aImageContainer = nullptr); @@ -130,7 +130,7 @@ protected: CreateVideoDecoder(const VideoInfo& aConfig, layers::LayersBackend aLayersBackend, layers::ImageContainer* aImageContainer, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback) = 0; // Creates an Audio decoder with the specified properties. @@ -145,7 +145,7 @@ protected: // This is called on the decode task queue. virtual already_AddRefed CreateAudioDecoder(const AudioInfo& aConfig, - FlushableMediaTaskQueue* aAudioTaskQueue, + FlushableTaskQueue* aAudioTaskQueue, MediaDataDecoderCallback* aCallback) = 0; // Caches pref media.fragmented-mp4.use-blank-decoder @@ -195,7 +195,7 @@ public: // should (like in Flush()). // // Decoding is done asynchronously. Any async work can be done on the -// MediaTaskQueue passed into the PlatformDecoderModules's Create*Decoder() +// TaskQueue passed into the PlatformDecoderModules's Create*Decoder() // function. This may not be necessary for platforms with async APIs // for decoding. class MediaDataDecoder { diff --git a/dom/media/platforms/SharedDecoderManager.cpp b/dom/media/platforms/SharedDecoderManager.cpp index 30ba5ebb5249..ed551119165f 100644 --- a/dom/media/platforms/SharedDecoderManager.cpp +++ b/dom/media/platforms/SharedDecoderManager.cpp @@ -70,7 +70,7 @@ private: }; SharedDecoderManager::SharedDecoderManager() - : mTaskQueue(new FlushableMediaTaskQueue(GetMediaThreadPool(MediaThreadType::PLATFORM_DECODER))) + : mTaskQueue(new FlushableTaskQueue(GetMediaThreadPool(MediaThreadType::PLATFORM_DECODER))) , mActiveProxy(nullptr) , mActiveCallback(nullptr) , mWaitForInternalDrain(false) @@ -91,7 +91,7 @@ SharedDecoderManager::CreateVideoDecoder( const VideoInfo& aConfig, layers::LayersBackend aLayersBackend, layers::ImageContainer* aImageContainer, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback) { if (!mDecoder) { diff --git a/dom/media/platforms/SharedDecoderManager.h b/dom/media/platforms/SharedDecoderManager.h index 30da9af29c0b..15d9d83b2bd5 100644 --- a/dom/media/platforms/SharedDecoderManager.h +++ b/dom/media/platforms/SharedDecoderManager.h @@ -29,7 +29,7 @@ public: const VideoInfo& aConfig, layers::LayersBackend aLayersBackend, layers::ImageContainer* aImageContainer, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback); void SetReader(MediaDecoderReader* aReader); @@ -52,7 +52,7 @@ private: nsRefPtr mDecoder; layers::LayersBackend mLayersBackend; nsRefPtr mImageContainer; - nsRefPtr mTaskQueue; + nsRefPtr mTaskQueue; SharedDecoderProxy* mActiveProxy; MediaDataDecoderCallback* mActiveCallback; nsAutoPtr mCallback; diff --git a/dom/media/platforms/agnostic/BlankDecoderModule.cpp b/dom/media/platforms/agnostic/BlankDecoderModule.cpp index 0da3cb6a3dad..65d0cecd6d32 100644 --- a/dom/media/platforms/agnostic/BlankDecoderModule.cpp +++ b/dom/media/platforms/agnostic/BlankDecoderModule.cpp @@ -12,7 +12,7 @@ #include "VideoUtils.h" #include "ImageContainer.h" #include "MediaInfo.h" -#include "MediaTaskQueue.h" +#include "TaskQueue.h" #include "TimeUnits.h" namespace mozilla { @@ -24,7 +24,7 @@ class BlankMediaDataDecoder : public MediaDataDecoder { public: BlankMediaDataDecoder(BlankMediaDataCreator* aCreator, - FlushableMediaTaskQueue* aTaskQueue, + FlushableTaskQueue* aTaskQueue, MediaDataDecoderCallback* aCallback) : mCreator(aCreator) , mTaskQueue(aTaskQueue) @@ -87,7 +87,7 @@ public: private: nsAutoPtr mCreator; - RefPtr mTaskQueue; + RefPtr mTaskQueue; MediaDataDecoderCallback* mCallback; }; @@ -214,7 +214,7 @@ public: CreateVideoDecoder(const VideoInfo& aConfig, layers::LayersBackend aLayersBackend, layers::ImageContainer* aImageContainer, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback) override { BlankVideoDataCreator* creator = new BlankVideoDataCreator( aConfig.mDisplay.width, aConfig.mDisplay.height, aImageContainer); @@ -228,7 +228,7 @@ public: // Decode thread. virtual already_AddRefed CreateAudioDecoder(const AudioInfo& aConfig, - FlushableMediaTaskQueue* aAudioTaskQueue, + FlushableTaskQueue* aAudioTaskQueue, MediaDataDecoderCallback* aCallback) override { BlankAudioDataCreator* creator = new BlankAudioDataCreator( aConfig.mChannels, aConfig.mRate); diff --git a/dom/media/platforms/agnostic/eme/EMEAudioDecoder.h b/dom/media/platforms/agnostic/eme/EMEAudioDecoder.h index 05192141defa..419941ecbfff 100644 --- a/dom/media/platforms/agnostic/eme/EMEAudioDecoder.h +++ b/dom/media/platforms/agnostic/eme/EMEAudioDecoder.h @@ -25,7 +25,7 @@ class EMEAudioDecoder : public GMPAudioDecoder { public: EMEAudioDecoder(CDMProxy* aProxy, const AudioInfo& aConfig, - MediaTaskQueue* aTaskQueue, + TaskQueue* aTaskQueue, MediaDataDecoderCallbackProxy* aCallback) : GMPAudioDecoder(aConfig, aTaskQueue, aCallback, new EMEAudioCallbackAdapter(aCallback)) , mProxy(aProxy) diff --git a/dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp b/dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp index a1ea1edec172..1fc3c7c68d67 100644 --- a/dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp +++ b/dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp @@ -35,7 +35,7 @@ public: EMEDecryptor(MediaDataDecoder* aDecoder, MediaDataDecoderCallback* aCallback, CDMProxy* aProxy, - MediaTaskQueue* aDecodeTaskQueue) + TaskQueue* aDecodeTaskQueue) : mDecoder(aDecoder) , mCallback(aCallback) , mTaskQueue(aDecodeTaskQueue) @@ -141,7 +141,7 @@ private: nsRefPtr mDecoder; MediaDataDecoderCallback* mCallback; - nsRefPtr mTaskQueue; + nsRefPtr mTaskQueue; nsRefPtr mProxy; nsClassHashtable, DecryptPromiseRequestHolder> mDecrypts; nsRefPtr mSamplesWaitingForKey; @@ -150,7 +150,7 @@ private: class EMEMediaDataDecoderProxy : public MediaDataDecoderProxy { public: - EMEMediaDataDecoderProxy(nsIThread* aProxyThread, MediaDataDecoderCallback* aCallback, CDMProxy* aProxy, FlushableMediaTaskQueue* aTaskQueue) + EMEMediaDataDecoderProxy(nsIThread* aProxyThread, MediaDataDecoderCallback* aCallback, CDMProxy* aProxy, FlushableTaskQueue* aTaskQueue) : MediaDataDecoderProxy(aProxyThread, aCallback) , mSamplesWaitingForKey(new SamplesWaitingForKey(this, aTaskQueue, aProxy)) , mProxy(aProxy) @@ -207,7 +207,7 @@ EMEDecoderModule::~EMEDecoderModule() } static already_AddRefed -CreateDecoderWrapper(MediaDataDecoderCallback* aCallback, CDMProxy* aProxy, FlushableMediaTaskQueue* aTaskQueue) +CreateDecoderWrapper(MediaDataDecoderCallback* aCallback, CDMProxy* aProxy, FlushableTaskQueue* aTaskQueue) { nsCOMPtr gmpService = do_GetService("@mozilla.org/gecko-media-plugin-service;1"); if (!gmpService) { @@ -228,7 +228,7 @@ already_AddRefed EMEDecoderModule::CreateVideoDecoder(const VideoInfo& aConfig, layers::LayersBackend aLayersBackend, layers::ImageContainer* aImageContainer, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback) { if (mCDMDecodesVideo && aConfig.mCrypto.mValid) { @@ -266,7 +266,7 @@ EMEDecoderModule::CreateVideoDecoder(const VideoInfo& aConfig, already_AddRefed EMEDecoderModule::CreateAudioDecoder(const AudioInfo& aConfig, - FlushableMediaTaskQueue* aAudioTaskQueue, + FlushableTaskQueue* aAudioTaskQueue, MediaDataDecoderCallback* aCallback) { if (mCDMDecodesAudio && aConfig.mCrypto.mValid) { diff --git a/dom/media/platforms/agnostic/eme/EMEDecoderModule.h b/dom/media/platforms/agnostic/eme/EMEDecoderModule.h index 78dd22db579d..2ae92c288939 100644 --- a/dom/media/platforms/agnostic/eme/EMEDecoderModule.h +++ b/dom/media/platforms/agnostic/eme/EMEDecoderModule.h @@ -30,13 +30,13 @@ public: CreateVideoDecoder(const VideoInfo& aConfig, layers::LayersBackend aLayersBackend, layers::ImageContainer* aImageContainer, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback) override; // Decode thread. virtual already_AddRefed CreateAudioDecoder(const AudioInfo& aConfig, - FlushableMediaTaskQueue* aAudioTaskQueue, + FlushableTaskQueue* aAudioTaskQueue, MediaDataDecoderCallback* aCallback) override; virtual ConversionRequired @@ -47,7 +47,7 @@ private: // Will be null if CDM has decoding capability. nsRefPtr mPDM; // We run the PDM on its own task queue. - nsRefPtr mTaskQueue; + nsRefPtr mTaskQueue; bool mCDMDecodesAudio; bool mCDMDecodesVideo; diff --git a/dom/media/platforms/agnostic/eme/EMEVideoDecoder.h b/dom/media/platforms/agnostic/eme/EMEVideoDecoder.h index 868e0df0fa5a..f95c71e0bfab 100644 --- a/dom/media/platforms/agnostic/eme/EMEVideoDecoder.h +++ b/dom/media/platforms/agnostic/eme/EMEVideoDecoder.h @@ -13,7 +13,7 @@ namespace mozilla { class CDMProxy; -class MediaTaskQueue; +class TaskQueue; class EMEVideoCallbackAdapter : public VideoCallbackAdapter { public: @@ -32,7 +32,7 @@ public: const VideoInfo& aConfig, layers::LayersBackend aLayersBackend, layers::ImageContainer* aImageContainer, - MediaTaskQueue* aTaskQueue, + TaskQueue* aTaskQueue, MediaDataDecoderCallbackProxy* aCallback) : GMPVideoDecoder(aConfig, aLayersBackend, diff --git a/dom/media/platforms/agnostic/eme/SamplesWaitingForKey.cpp b/dom/media/platforms/agnostic/eme/SamplesWaitingForKey.cpp index ce800008c06f..bf65286597f2 100644 --- a/dom/media/platforms/agnostic/eme/SamplesWaitingForKey.cpp +++ b/dom/media/platforms/agnostic/eme/SamplesWaitingForKey.cpp @@ -12,7 +12,7 @@ namespace mozilla { SamplesWaitingForKey::SamplesWaitingForKey(MediaDataDecoder* aDecoder, - MediaTaskQueue* aTaskQueue, + TaskQueue* aTaskQueue, CDMProxy* aProxy) : mMutex("SamplesWaitingForKey") , mDecoder(aDecoder) diff --git a/dom/media/platforms/agnostic/eme/SamplesWaitingForKey.h b/dom/media/platforms/agnostic/eme/SamplesWaitingForKey.h index 4aedd6c1a951..017b69411a43 100644 --- a/dom/media/platforms/agnostic/eme/SamplesWaitingForKey.h +++ b/dom/media/platforms/agnostic/eme/SamplesWaitingForKey.h @@ -7,7 +7,7 @@ #ifndef SamplesWaitingForKey_h_ #define SamplesWaitingForKey_h_ -#include "MediaTaskQueue.h" +#include "TaskQueue.h" #include "PlatformDecoderModule.h" namespace mozilla { @@ -24,7 +24,7 @@ public: NS_INLINE_DECL_THREADSAFE_REFCOUNTING(SamplesWaitingForKey) explicit SamplesWaitingForKey(MediaDataDecoder* aDecoder, - MediaTaskQueue* aTaskQueue, + TaskQueue* aTaskQueue, CDMProxy* aProxy); // Returns true if we need to wait for a key to become usable. @@ -45,7 +45,7 @@ protected: private: Mutex mMutex; nsRefPtr mDecoder; - nsRefPtr mTaskQueue; + nsRefPtr mTaskQueue; nsRefPtr mProxy; nsTArray> mSamples; }; diff --git a/dom/media/platforms/agnostic/gmp/GMPAudioDecoder.h b/dom/media/platforms/agnostic/gmp/GMPAudioDecoder.h index 413d6a1a141c..f4737575b3f9 100644 --- a/dom/media/platforms/agnostic/gmp/GMPAudioDecoder.h +++ b/dom/media/platforms/agnostic/gmp/GMPAudioDecoder.h @@ -48,7 +48,7 @@ private: class GMPAudioDecoder : public MediaDataDecoder { protected: GMPAudioDecoder(const AudioInfo& aConfig, - MediaTaskQueue* aTaskQueue, + TaskQueue* aTaskQueue, MediaDataDecoderCallbackProxy* aCallback, AudioCallbackAdapter* aAdapter) : mConfig(aConfig) @@ -60,7 +60,7 @@ protected: public: GMPAudioDecoder(const AudioInfo& aConfig, - MediaTaskQueue* aTaskQueue, + TaskQueue* aTaskQueue, MediaDataDecoderCallbackProxy* aCallback) : mConfig(aConfig) , mCallback(aCallback) diff --git a/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp b/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp index df7cd3129456..b38b2755a740 100644 --- a/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp +++ b/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp @@ -43,7 +43,7 @@ already_AddRefed GMPDecoderModule::CreateVideoDecoder(const VideoInfo& aConfig, layers::LayersBackend aLayersBackend, layers::ImageContainer* aImageContainer, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback) { if (!aConfig.mMimeType.EqualsLiteral("video/avc")) { @@ -61,7 +61,7 @@ GMPDecoderModule::CreateVideoDecoder(const VideoInfo& aConfig, already_AddRefed GMPDecoderModule::CreateAudioDecoder(const AudioInfo& aConfig, - FlushableMediaTaskQueue* aAudioTaskQueue, + FlushableTaskQueue* aAudioTaskQueue, MediaDataDecoderCallback* aCallback) { if (!aConfig.mMimeType.EqualsLiteral("audio/mp4a-latm")) { diff --git a/dom/media/platforms/agnostic/gmp/GMPDecoderModule.h b/dom/media/platforms/agnostic/gmp/GMPDecoderModule.h index 6a0fa80d868c..4c060018f0ef 100644 --- a/dom/media/platforms/agnostic/gmp/GMPDecoderModule.h +++ b/dom/media/platforms/agnostic/gmp/GMPDecoderModule.h @@ -22,13 +22,13 @@ public: CreateVideoDecoder(const VideoInfo& aConfig, layers::LayersBackend aLayersBackend, layers::ImageContainer* aImageContainer, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback) override; // Decode thread. virtual already_AddRefed CreateAudioDecoder(const AudioInfo& aConfig, - FlushableMediaTaskQueue* aAudioTaskQueue, + FlushableTaskQueue* aAudioTaskQueue, MediaDataDecoderCallback* aCallback) override; virtual ConversionRequired diff --git a/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.h b/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.h index 946f0cbea685..488ce9261790 100644 --- a/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.h +++ b/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.h @@ -54,7 +54,7 @@ protected: GMPVideoDecoder(const VideoInfo& aConfig, layers::LayersBackend aLayersBackend, layers::ImageContainer* aImageContainer, - MediaTaskQueue* aTaskQueue, + TaskQueue* aTaskQueue, MediaDataDecoderCallbackProxy* aCallback, VideoCallbackAdapter* aAdapter) : mConfig(aConfig) @@ -70,7 +70,7 @@ public: GMPVideoDecoder(const VideoInfo& aConfig, layers::LayersBackend aLayersBackend, layers::ImageContainer* aImageContainer, - MediaTaskQueue* aTaskQueue, + TaskQueue* aTaskQueue, MediaDataDecoderCallbackProxy* aCallback) : mConfig(aConfig) , mCallback(aCallback) diff --git a/dom/media/platforms/android/AndroidDecoderModule.cpp b/dom/media/platforms/android/AndroidDecoderModule.cpp index 569cbd8a50fd..6575b68bdd8b 100644 --- a/dom/media/platforms/android/AndroidDecoderModule.cpp +++ b/dom/media/platforms/android/AndroidDecoderModule.cpp @@ -267,7 +267,7 @@ AndroidDecoderModule::CreateVideoDecoder( const VideoInfo& aConfig, layers::LayersBackend aLayersBackend, layers::ImageContainer* aImageContainer, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback) { MediaFormat::LocalRef format; @@ -286,7 +286,7 @@ AndroidDecoderModule::CreateVideoDecoder( already_AddRefed AndroidDecoderModule::CreateAudioDecoder(const AudioInfo& aConfig, - FlushableMediaTaskQueue* aAudioTaskQueue, + FlushableTaskQueue* aAudioTaskQueue, MediaDataDecoderCallback* aCallback) { MOZ_ASSERT(aConfig.mBitDepth == 16, "We only handle 16-bit audio!"); diff --git a/dom/media/platforms/android/AndroidDecoderModule.h b/dom/media/platforms/android/AndroidDecoderModule.h index 895518945406..68b23555cf1e 100644 --- a/dom/media/platforms/android/AndroidDecoderModule.h +++ b/dom/media/platforms/android/AndroidDecoderModule.h @@ -24,12 +24,12 @@ public: CreateVideoDecoder(const VideoInfo& aConfig, layers::LayersBackend aLayersBackend, layers::ImageContainer* aImageContainer, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback) override; virtual already_AddRefed CreateAudioDecoder(const AudioInfo& aConfig, - FlushableMediaTaskQueue* aAudioTaskQueue, + FlushableTaskQueue* aAudioTaskQueue, MediaDataDecoderCallback* aCallback) override; diff --git a/dom/media/platforms/apple/AppleATDecoder.cpp b/dom/media/platforms/apple/AppleATDecoder.cpp index cdafba67ea33..062ab39ec1ba 100644 --- a/dom/media/platforms/apple/AppleATDecoder.cpp +++ b/dom/media/platforms/apple/AppleATDecoder.cpp @@ -19,7 +19,7 @@ PRLogModuleInfo* GetAppleMediaLog(); namespace mozilla { AppleATDecoder::AppleATDecoder(const AudioInfo& aConfig, - FlushableMediaTaskQueue* aAudioTaskQueue, + FlushableTaskQueue* aAudioTaskQueue, MediaDataDecoderCallback* aCallback) : mConfig(aConfig) , mFileStreamError(false) diff --git a/dom/media/platforms/apple/AppleATDecoder.h b/dom/media/platforms/apple/AppleATDecoder.h index 97c340a2e997..9447142fcaa0 100644 --- a/dom/media/platforms/apple/AppleATDecoder.h +++ b/dom/media/platforms/apple/AppleATDecoder.h @@ -15,13 +15,13 @@ namespace mozilla { -class FlushableMediaTaskQueue; +class FlushableTaskQueue; class MediaDataDecoderCallback; class AppleATDecoder : public MediaDataDecoder { public: AppleATDecoder(const AudioInfo& aConfig, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback); virtual ~AppleATDecoder(); @@ -41,7 +41,7 @@ public: bool mFileStreamError; private: - nsRefPtr mTaskQueue; + nsRefPtr mTaskQueue; MediaDataDecoderCallback* mCallback; AudioConverterRef mConverter; AudioStreamBasicDescription mOutputFormat; diff --git a/dom/media/platforms/apple/AppleDecoderModule.cpp b/dom/media/platforms/apple/AppleDecoderModule.cpp index f01b6461d3ee..1e4692f4304c 100644 --- a/dom/media/platforms/apple/AppleDecoderModule.cpp +++ b/dom/media/platforms/apple/AppleDecoderModule.cpp @@ -80,7 +80,7 @@ already_AddRefed AppleDecoderModule::CreateVideoDecoder(const VideoInfo& aConfig, layers::LayersBackend aLayersBackend, layers::ImageContainer* aImageContainer, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback) { nsRefPtr decoder; @@ -106,7 +106,7 @@ AppleDecoderModule::CreateVideoDecoder(const VideoInfo& aConfig, already_AddRefed AppleDecoderModule::CreateAudioDecoder(const AudioInfo& aConfig, - FlushableMediaTaskQueue* aAudioTaskQueue, + FlushableTaskQueue* aAudioTaskQueue, MediaDataDecoderCallback* aCallback) { nsRefPtr decoder = diff --git a/dom/media/platforms/apple/AppleDecoderModule.h b/dom/media/platforms/apple/AppleDecoderModule.h index 83040e008275..f1b9952770ed 100644 --- a/dom/media/platforms/apple/AppleDecoderModule.h +++ b/dom/media/platforms/apple/AppleDecoderModule.h @@ -23,13 +23,13 @@ public: CreateVideoDecoder(const VideoInfo& aConfig, layers::LayersBackend aLayersBackend, layers::ImageContainer* aImageContainer, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback) override; // Decode thread. virtual already_AddRefed CreateAudioDecoder(const AudioInfo& aConfig, - FlushableMediaTaskQueue* aAudioTaskQueue, + FlushableTaskQueue* aAudioTaskQueue, MediaDataDecoderCallback* aCallback) override; virtual bool SupportsMimeType(const nsACString& aMimeType) override; diff --git a/dom/media/platforms/apple/AppleVDADecoder.cpp b/dom/media/platforms/apple/AppleVDADecoder.cpp index 1daaef4ac77a..45118446790a 100644 --- a/dom/media/platforms/apple/AppleVDADecoder.cpp +++ b/dom/media/platforms/apple/AppleVDADecoder.cpp @@ -30,7 +30,7 @@ PRLogModuleInfo* GetAppleMediaLog(); namespace mozilla { AppleVDADecoder::AppleVDADecoder(const VideoInfo& aConfig, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback, layers::ImageContainer* aImageContainer) : mTaskQueue(aVideoTaskQueue) @@ -501,7 +501,7 @@ AppleVDADecoder::CreateOutputConfiguration() already_AddRefed AppleVDADecoder::CreateVDADecoder( const VideoInfo& aConfig, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback, layers::ImageContainer* aImageContainer) { diff --git a/dom/media/platforms/apple/AppleVDADecoder.h b/dom/media/platforms/apple/AppleVDADecoder.h index 5096129c0e92..d7898e899b0f 100644 --- a/dom/media/platforms/apple/AppleVDADecoder.h +++ b/dom/media/platforms/apple/AppleVDADecoder.h @@ -19,7 +19,7 @@ namespace mozilla { -class FlushableMediaTaskQueue; +class FlushableTaskQueue; class MediaDataDecoderCallback; namespace layers { class ImageContainer; @@ -62,12 +62,12 @@ public: // not supported by current configuration. static already_AddRefed CreateVDADecoder( const VideoInfo& aConfig, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback, layers::ImageContainer* aImageContainer); AppleVDADecoder(const VideoInfo& aConfig, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback, layers::ImageContainer* aImageContainer); virtual ~AppleVDADecoder(); @@ -91,7 +91,7 @@ public: CFDictionaryRef CreateOutputConfiguration(); nsRefPtr mExtraData; - nsRefPtr mTaskQueue; + nsRefPtr mTaskQueue; MediaDataDecoderCallback* mCallback; nsRefPtr mImageContainer; ReorderQueue mReorderQueue; diff --git a/dom/media/platforms/apple/AppleVTDecoder.cpp b/dom/media/platforms/apple/AppleVTDecoder.cpp index bf2a1cd7a24d..950675ed8f2c 100644 --- a/dom/media/platforms/apple/AppleVTDecoder.cpp +++ b/dom/media/platforms/apple/AppleVTDecoder.cpp @@ -31,7 +31,7 @@ PRLogModuleInfo* GetAppleMediaLog(); namespace mozilla { AppleVTDecoder::AppleVTDecoder(const VideoInfo& aConfig, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback, layers::ImageContainer* aImageContainer) : AppleVDADecoder(aConfig, aVideoTaskQueue, aCallback, aImageContainer) diff --git a/dom/media/platforms/apple/AppleVTDecoder.h b/dom/media/platforms/apple/AppleVTDecoder.h index 154eb1a4aef9..63063f4e055d 100644 --- a/dom/media/platforms/apple/AppleVTDecoder.h +++ b/dom/media/platforms/apple/AppleVTDecoder.h @@ -16,7 +16,7 @@ namespace mozilla { class AppleVTDecoder : public AppleVDADecoder { public: AppleVTDecoder(const VideoInfo& aConfig, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback, layers::ImageContainer* aImageContainer); virtual ~AppleVTDecoder(); diff --git a/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.cpp index a8630a303049..e91bc77bf22d 100644 --- a/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.cpp +++ b/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.cpp @@ -4,7 +4,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "MediaTaskQueue.h" +#include "TaskQueue.h" #include "FFmpegRuntimeLinker.h" #include "FFmpegAudioDecoder.h" @@ -16,7 +16,7 @@ namespace mozilla { FFmpegAudioDecoder::FFmpegAudioDecoder( - FlushableMediaTaskQueue* aTaskQueue, MediaDataDecoderCallback* aCallback, + FlushableTaskQueue* aTaskQueue, MediaDataDecoderCallback* aCallback, const AudioInfo& aConfig) : FFmpegDataDecoder(aTaskQueue, GetCodecId(aConfig.mMimeType)) , mCallback(aCallback) diff --git a/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.h b/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.h index d0934fcda54c..320c7bb3904d 100644 --- a/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.h +++ b/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.h @@ -20,7 +20,7 @@ template <> class FFmpegAudioDecoder : public FFmpegDataDecoder { public: - FFmpegAudioDecoder(FlushableMediaTaskQueue* aTaskQueue, + FFmpegAudioDecoder(FlushableTaskQueue* aTaskQueue, MediaDataDecoderCallback* aCallback, const AudioInfo& aConfig); virtual ~FFmpegAudioDecoder(); diff --git a/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp index 7b9133d23754..c3b44fc979c6 100644 --- a/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp +++ b/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp @@ -7,7 +7,7 @@ #include #include -#include "MediaTaskQueue.h" +#include "TaskQueue.h" #include "FFmpegLibs.h" #include "FFmpegLog.h" #include "FFmpegDataDecoder.h" @@ -19,7 +19,7 @@ namespace mozilla bool FFmpegDataDecoder::sFFmpegInitDone = false; StaticMutex FFmpegDataDecoder::sMonitor; -FFmpegDataDecoder::FFmpegDataDecoder(FlushableMediaTaskQueue* aTaskQueue, +FFmpegDataDecoder::FFmpegDataDecoder(FlushableTaskQueue* aTaskQueue, AVCodecID aCodecID) : mTaskQueue(aTaskQueue) , mCodecContext(nullptr) diff --git a/dom/media/platforms/ffmpeg/FFmpegDataDecoder.h b/dom/media/platforms/ffmpeg/FFmpegDataDecoder.h index afbaac7a3bf3..55065a2f799f 100644 --- a/dom/media/platforms/ffmpeg/FFmpegDataDecoder.h +++ b/dom/media/platforms/ffmpeg/FFmpegDataDecoder.h @@ -24,7 +24,7 @@ template <> class FFmpegDataDecoder : public MediaDataDecoder { public: - FFmpegDataDecoder(FlushableMediaTaskQueue* aTaskQueue, AVCodecID aCodecID); + FFmpegDataDecoder(FlushableTaskQueue* aTaskQueue, AVCodecID aCodecID); virtual ~FFmpegDataDecoder(); static bool Link(); @@ -38,7 +38,7 @@ public: protected: AVFrame* PrepareFrame(); - FlushableMediaTaskQueue* mTaskQueue; + FlushableTaskQueue* mTaskQueue; AVCodecContext* mCodecContext; AVFrame* mFrame; nsRefPtr mExtraData; diff --git a/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h b/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h index 6a8fdd9bb069..d285216abc66 100644 --- a/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h +++ b/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h @@ -32,7 +32,7 @@ public: CreateVideoDecoder(const VideoInfo& aConfig, layers::LayersBackend aLayersBackend, layers::ImageContainer* aImageContainer, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback) override { nsRefPtr decoder = @@ -43,7 +43,7 @@ public: virtual already_AddRefed CreateAudioDecoder(const AudioInfo& aConfig, - FlushableMediaTaskQueue* aAudioTaskQueue, + FlushableTaskQueue* aAudioTaskQueue, MediaDataDecoderCallback* aCallback) override { nsRefPtr decoder = diff --git a/dom/media/platforms/ffmpeg/FFmpegH264Decoder.cpp b/dom/media/platforms/ffmpeg/FFmpegH264Decoder.cpp index 94735a869762..9aebd1dd56b0 100644 --- a/dom/media/platforms/ffmpeg/FFmpegH264Decoder.cpp +++ b/dom/media/platforms/ffmpeg/FFmpegH264Decoder.cpp @@ -4,7 +4,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "MediaTaskQueue.h" +#include "TaskQueue.h" #include "nsThreadUtils.h" #include "nsAutoPtr.h" #include "ImageContainer.h" @@ -23,7 +23,7 @@ namespace mozilla { FFmpegH264Decoder::FFmpegH264Decoder( - FlushableMediaTaskQueue* aTaskQueue, MediaDataDecoderCallback* aCallback, + FlushableTaskQueue* aTaskQueue, MediaDataDecoderCallback* aCallback, const VideoInfo& aConfig, ImageContainer* aImageContainer) : FFmpegDataDecoder(aTaskQueue, GetCodecId(aConfig.mMimeType)) diff --git a/dom/media/platforms/ffmpeg/FFmpegH264Decoder.h b/dom/media/platforms/ffmpeg/FFmpegH264Decoder.h index 0ff1f5bed42a..6b110542474b 100644 --- a/dom/media/platforms/ffmpeg/FFmpegH264Decoder.h +++ b/dom/media/platforms/ffmpeg/FFmpegH264Decoder.h @@ -30,7 +30,7 @@ class FFmpegH264Decoder : public FFmpegDataDecoder }; public: - FFmpegH264Decoder(FlushableMediaTaskQueue* aTaskQueue, + FFmpegH264Decoder(FlushableTaskQueue* aTaskQueue, MediaDataDecoderCallback* aCallback, const VideoInfo& aConfig, ImageContainer* aImageContainer); diff --git a/dom/media/platforms/gonk/GonkDecoderModule.cpp b/dom/media/platforms/gonk/GonkDecoderModule.cpp index d1e849a82c32..a2e78a205d61 100644 --- a/dom/media/platforms/gonk/GonkDecoderModule.cpp +++ b/dom/media/platforms/gonk/GonkDecoderModule.cpp @@ -30,7 +30,7 @@ already_AddRefed GonkDecoderModule::CreateVideoDecoder(const VideoInfo& aConfig, mozilla::layers::LayersBackend aLayersBackend, mozilla::layers::ImageContainer* aImageContainer, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback) { nsRefPtr decoder = @@ -41,7 +41,7 @@ GonkDecoderModule::CreateVideoDecoder(const VideoInfo& aConfig, already_AddRefed GonkDecoderModule::CreateAudioDecoder(const AudioInfo& aConfig, - FlushableMediaTaskQueue* aAudioTaskQueue, + FlushableTaskQueue* aAudioTaskQueue, MediaDataDecoderCallback* aCallback) { nsRefPtr decoder = diff --git a/dom/media/platforms/gonk/GonkDecoderModule.h b/dom/media/platforms/gonk/GonkDecoderModule.h index 599c0160beca..8dc4f931b3a7 100644 --- a/dom/media/platforms/gonk/GonkDecoderModule.h +++ b/dom/media/platforms/gonk/GonkDecoderModule.h @@ -21,13 +21,13 @@ public: CreateVideoDecoder(const VideoInfo& aConfig, mozilla::layers::LayersBackend aLayersBackend, mozilla::layers::ImageContainer* aImageContainer, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback) override; // Decode thread. virtual already_AddRefed CreateAudioDecoder(const AudioInfo& aConfig, - FlushableMediaTaskQueue* aAudioTaskQueue, + FlushableTaskQueue* aAudioTaskQueue, MediaDataDecoderCallback* aCallback) override; static void Init(); diff --git a/dom/media/platforms/gonk/GonkMediaDataDecoder.cpp b/dom/media/platforms/gonk/GonkMediaDataDecoder.cpp index 6c478414d015..e0b91a321683 100644 --- a/dom/media/platforms/gonk/GonkMediaDataDecoder.cpp +++ b/dom/media/platforms/gonk/GonkMediaDataDecoder.cpp @@ -21,7 +21,7 @@ using namespace android; namespace mozilla { GonkMediaDataDecoder::GonkMediaDataDecoder(GonkDecoderManager* aManager, - FlushableMediaTaskQueue* aTaskQueue, + FlushableTaskQueue* aTaskQueue, MediaDataDecoderCallback* aCallback) : mTaskQueue(aTaskQueue) , mCallback(aCallback) diff --git a/dom/media/platforms/gonk/GonkMediaDataDecoder.h b/dom/media/platforms/gonk/GonkMediaDataDecoder.h index 663828457e40..988fc42394ed 100644 --- a/dom/media/platforms/gonk/GonkMediaDataDecoder.h +++ b/dom/media/platforms/gonk/GonkMediaDataDecoder.h @@ -56,7 +56,7 @@ protected: class GonkMediaDataDecoder : public MediaDataDecoder { public: GonkMediaDataDecoder(GonkDecoderManager* aDecoderManager, - FlushableMediaTaskQueue* aTaskQueue, + FlushableTaskQueue* aTaskQueue, MediaDataDecoderCallback* aCallback); ~GonkMediaDataDecoder(); @@ -87,7 +87,7 @@ private: // all available output. void ProcessDrain(); - RefPtr mTaskQueue; + RefPtr mTaskQueue; MediaDataDecoderCallback* mCallback; android::sp mDecoder; diff --git a/dom/media/platforms/wmf/WMFDecoderModule.cpp b/dom/media/platforms/wmf/WMFDecoderModule.cpp index 671474ec06b0..ca25fafb3d1e 100644 --- a/dom/media/platforms/wmf/WMFDecoderModule.cpp +++ b/dom/media/platforms/wmf/WMFDecoderModule.cpp @@ -66,7 +66,7 @@ already_AddRefed WMFDecoderModule::CreateVideoDecoder(const VideoInfo& aConfig, layers::LayersBackend aLayersBackend, layers::ImageContainer* aImageContainer, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback) { nsRefPtr decoder = @@ -81,7 +81,7 @@ WMFDecoderModule::CreateVideoDecoder(const VideoInfo& aConfig, already_AddRefed WMFDecoderModule::CreateAudioDecoder(const AudioInfo& aConfig, - FlushableMediaTaskQueue* aAudioTaskQueue, + FlushableTaskQueue* aAudioTaskQueue, MediaDataDecoderCallback* aCallback) { nsRefPtr decoder = diff --git a/dom/media/platforms/wmf/WMFDecoderModule.h b/dom/media/platforms/wmf/WMFDecoderModule.h index f34ca924e6a7..5cbc5fa7d60b 100644 --- a/dom/media/platforms/wmf/WMFDecoderModule.h +++ b/dom/media/platforms/wmf/WMFDecoderModule.h @@ -23,12 +23,12 @@ public: CreateVideoDecoder(const VideoInfo& aConfig, layers::LayersBackend aLayersBackend, layers::ImageContainer* aImageContainer, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback) override; virtual already_AddRefed CreateAudioDecoder(const AudioInfo& aConfig, - FlushableMediaTaskQueue* aAudioTaskQueue, + FlushableTaskQueue* aAudioTaskQueue, MediaDataDecoderCallback* aCallback) override; bool SupportsMimeType(const nsACString& aMimeType) override; diff --git a/dom/media/platforms/wmf/WMFMediaDataDecoder.cpp b/dom/media/platforms/wmf/WMFMediaDataDecoder.cpp index 0927d3876d36..c7e242cdf67f 100644 --- a/dom/media/platforms/wmf/WMFMediaDataDecoder.cpp +++ b/dom/media/platforms/wmf/WMFMediaDataDecoder.cpp @@ -18,7 +18,7 @@ PRLogModuleInfo* GetDemuxerLog(); namespace mozilla { WMFMediaDataDecoder::WMFMediaDataDecoder(MFTManager* aMFTManager, - FlushableMediaTaskQueue* aTaskQueue, + FlushableTaskQueue* aTaskQueue, MediaDataDecoderCallback* aCallback) : mTaskQueue(aTaskQueue) , mCallback(aCallback) diff --git a/dom/media/platforms/wmf/WMFMediaDataDecoder.h b/dom/media/platforms/wmf/WMFMediaDataDecoder.h index 93d18a9fa7f9..746f5398b162 100644 --- a/dom/media/platforms/wmf/WMFMediaDataDecoder.h +++ b/dom/media/platforms/wmf/WMFMediaDataDecoder.h @@ -55,7 +55,7 @@ public: class WMFMediaDataDecoder : public MediaDataDecoder { public: WMFMediaDataDecoder(MFTManager* aOutputSource, - FlushableMediaTaskQueue* aAudioTaskQueue, + FlushableTaskQueue* aAudioTaskQueue, MediaDataDecoderCallback* aCallback); ~WMFMediaDataDecoder(); @@ -91,7 +91,7 @@ private: void ProcessShutdown(); - RefPtr mTaskQueue; + RefPtr mTaskQueue; MediaDataDecoderCallback* mCallback; RefPtr mDecoder; diff --git a/dom/media/platforms/wrappers/H264Converter.cpp b/dom/media/platforms/wrappers/H264Converter.cpp index a4794224aee0..21a3cd197c80 100644 --- a/dom/media/platforms/wrappers/H264Converter.cpp +++ b/dom/media/platforms/wrappers/H264Converter.cpp @@ -6,7 +6,7 @@ #include "H264Converter.h" #include "ImageContainer.h" -#include "MediaTaskQueue.h" +#include "TaskQueue.h" #include "MediaInfo.h" #include "mp4_demuxer/AnnexB.h" #include "mp4_demuxer/H264.h" @@ -18,7 +18,7 @@ H264Converter::H264Converter(PlatformDecoderModule* aPDM, const VideoInfo& aConfig, layers::LayersBackend aLayersBackend, layers::ImageContainer* aImageContainer, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback) : mPDM(aPDM) , mCurrentConfig(aConfig) diff --git a/dom/media/platforms/wrappers/H264Converter.h b/dom/media/platforms/wrappers/H264Converter.h index 351281fccf31..7f92a0da2162 100644 --- a/dom/media/platforms/wrappers/H264Converter.h +++ b/dom/media/platforms/wrappers/H264Converter.h @@ -25,7 +25,7 @@ public: const VideoInfo& aConfig, layers::LayersBackend aLayersBackend, layers::ImageContainer* aImageContainer, - FlushableMediaTaskQueue* aVideoTaskQueue, + FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback); virtual ~H264Converter(); @@ -52,7 +52,7 @@ private: VideoInfo mCurrentConfig; layers::LayersBackend mLayersBackend; nsRefPtr mImageContainer; - nsRefPtr mVideoTaskQueue; + nsRefPtr mVideoTaskQueue; MediaDataDecoderCallback* mCallback; nsRefPtr mDecoder; bool mNeedAVCC; diff --git a/dom/media/systemservices/MediaSystemResourceManager.cpp b/dom/media/systemservices/MediaSystemResourceManager.cpp index 12ac6de01e7c..9071a40c15b6 100644 --- a/dom/media/systemservices/MediaSystemResourceManager.cpp +++ b/dom/media/systemservices/MediaSystemResourceManager.cpp @@ -6,7 +6,7 @@ #include "gfxPrefs.h" #include "MediaSystemResourceManagerChild.h" -#include "MediaTaskQueue.h" +#include "TaskQueue.h" #include "mozilla/layers/ImageBridgeChild.h" #include "MediaSystemResourceManager.h" diff --git a/dom/media/systemservices/MediaSystemResourceManager.h b/dom/media/systemservices/MediaSystemResourceManager.h index ecdd9ff95bd3..66e506ad9b3f 100644 --- a/dom/media/systemservices/MediaSystemResourceManager.h +++ b/dom/media/systemservices/MediaSystemResourceManager.h @@ -24,7 +24,7 @@ class MediaSystemResourceManagerChild; class MediaSystemResourceClient; class MediaSystemResourceReservationListener; -class MediaTaskQueue; +class TaskQueue; class ReentrantMonitor; /** diff --git a/dom/media/webaudio/BufferDecoder.cpp b/dom/media/webaudio/BufferDecoder.cpp index 2a119dfd9683..2b4c8feff05f 100644 --- a/dom/media/webaudio/BufferDecoder.cpp +++ b/dom/media/webaudio/BufferDecoder.cpp @@ -33,7 +33,7 @@ BufferDecoder::~BufferDecoder() } void -BufferDecoder::BeginDecoding(MediaTaskQueue* aTaskQueueIdentity) +BufferDecoder::BeginDecoding(TaskQueue* aTaskQueueIdentity) { MOZ_ASSERT(!mTaskQueueIdentity && aTaskQueueIdentity); mTaskQueueIdentity = aTaskQueueIdentity; diff --git a/dom/media/webaudio/BufferDecoder.h b/dom/media/webaudio/BufferDecoder.h index cf07293ab733..32427d95e8a4 100644 --- a/dom/media/webaudio/BufferDecoder.h +++ b/dom/media/webaudio/BufferDecoder.h @@ -8,7 +8,7 @@ #define BUFFER_DECODER_H_ #include "AbstractMediaDecoder.h" -#include "MediaTaskQueue.h" +#include "TaskQueue.h" #include "mozilla/Attributes.h" #include "mozilla/ReentrantMonitor.h" @@ -28,7 +28,7 @@ public: NS_DECL_THREADSAFE_ISUPPORTS // This has to be called before decoding begins - void BeginDecoding(MediaTaskQueue* aTaskQueueIdentity); + void BeginDecoding(TaskQueue* aTaskQueueIdentity); virtual ReentrantMonitor& GetReentrantMonitor() final override; @@ -78,7 +78,7 @@ private: // It's just there in order for us to be able to override // GetReentrantMonitor correctly. ReentrantMonitor mReentrantMonitor; - nsRefPtr mTaskQueueIdentity; + nsRefPtr mTaskQueueIdentity; nsRefPtr mResource; }; diff --git a/dom/media/webaudio/MediaBufferDecoder.cpp b/dom/media/webaudio/MediaBufferDecoder.cpp index 59bab5fa2318..445311dd8935 100644 --- a/dom/media/webaudio/MediaBufferDecoder.cpp +++ b/dom/media/webaudio/MediaBufferDecoder.cpp @@ -507,7 +507,7 @@ AsyncDecodeWebAudio(const char* aContentType, uint8_t* aBuffer, // task->Reader()->OwnerThread()->Dispatch(task.forget()) // we might evaluate the task.forget() before calling Reader(). Enforce // a non-crashy order-of-operations. - MediaTaskQueue* taskQueue = task->Reader()->OwnerThread(); + TaskQueue* taskQueue = task->Reader()->OwnerThread(); taskQueue->Dispatch(task.forget()); } } diff --git a/dom/media/webm/IntelWebMVideoDecoder.cpp b/dom/media/webm/IntelWebMVideoDecoder.cpp index 448c238ef48c..853854cd1075 100644 --- a/dom/media/webm/IntelWebMVideoDecoder.cpp +++ b/dom/media/webm/IntelWebMVideoDecoder.cpp @@ -8,7 +8,7 @@ #include "gfx2DGlue.h" #include "Layers.h" #include "MediaResource.h" -#include "MediaTaskQueue.h" +#include "TaskQueue.h" #include "mozilla/dom/HTMLMediaElement.h" #include "nsError.h" #include "SharedThreadPool.h" diff --git a/dom/media/webm/IntelWebMVideoDecoder.h b/dom/media/webm/IntelWebMVideoDecoder.h index 13e7409bc9d8..4b4f34a50e76 100644 --- a/dom/media/webm/IntelWebMVideoDecoder.h +++ b/dom/media/webm/IntelWebMVideoDecoder.h @@ -17,7 +17,7 @@ #include "MediaInfo.h" #include "MediaData.h" -class MediaTaskQueue; +class TaskQueue; namespace mozilla { @@ -70,7 +70,7 @@ private: // TaskQueue on which decoder can choose to decode. // Only non-null up until the decoder is created. - nsRefPtr mTaskQueue; + nsRefPtr mTaskQueue; // Monitor that protects all non-threadsafe state; the primitives // that follow. diff --git a/dom/media/webm/WebMReader.cpp b/dom/media/webm/WebMReader.cpp index a1bbbd89e7c2..d364c918454c 100644 --- a/dom/media/webm/WebMReader.cpp +++ b/dom/media/webm/WebMReader.cpp @@ -144,7 +144,7 @@ static void webm_log(nestegg * context, static bool sIsIntelDecoderEnabled = false; #endif -WebMReader::WebMReader(AbstractMediaDecoder* aDecoder, MediaTaskQueue* aBorrowedTaskQueue) +WebMReader::WebMReader(AbstractMediaDecoder* aDecoder, TaskQueue* aBorrowedTaskQueue) : MediaDecoderReader(aDecoder, aBorrowedTaskQueue) , mContext(nullptr) , mVideoTrack(0) @@ -209,7 +209,7 @@ nsresult WebMReader::Init(MediaDecoderReader* aCloneDonor) InitLayersBackendType(); - mVideoTaskQueue = new FlushableMediaTaskQueue( + mVideoTaskQueue = new FlushableTaskQueue( SharedThreadPool::Get(NS_LITERAL_CSTRING("IntelVP8 Video Decode"))); NS_ENSURE_TRUE(mVideoTaskQueue, NS_ERROR_FAILURE); } diff --git a/dom/media/webm/WebMReader.h b/dom/media/webm/WebMReader.h index 94e96ffc10b8..8761d2ecbbe1 100644 --- a/dom/media/webm/WebMReader.h +++ b/dom/media/webm/WebMReader.h @@ -148,7 +148,7 @@ public: class WebMReader : public MediaDecoderReader { public: - explicit WebMReader(AbstractMediaDecoder* aDecoder, MediaTaskQueue* aBorrowedTaskQueue = nullptr); + explicit WebMReader(AbstractMediaDecoder* aDecoder, TaskQueue* aBorrowedTaskQueue = nullptr); protected: ~WebMReader(); @@ -205,7 +205,7 @@ public: int64_t GetLastVideoFrameTime(); void SetLastVideoFrameTime(int64_t aFrameTime); layers::LayersBackend GetLayersBackendType() { return mLayersBackendType; } - FlushableMediaTaskQueue* GetVideoTaskQueue() { return mVideoTaskQueue; } + FlushableTaskQueue* GetVideoTaskQueue() { return mVideoTaskQueue; } uint64_t GetCodecDelay() { return mCodecDelay; } protected: @@ -293,7 +293,7 @@ private: layers::LayersBackend mLayersBackendType; // For hardware video decoding. - nsRefPtr mVideoTaskQueue; + nsRefPtr mVideoTaskQueue; // Booleans to indicate if we have audio and/or video data bool mHasVideo;