Bug 1498440 - part5 : rename PopEvent() to PopFrontEvent(). r=jya
authoralwu <alwu@mozilla.com>
Mon, 05 Nov 2018 22:05:58 +0000
changeset 444496 1cd5c63b4182d2b9117812666d7f809e45a072e3
parent 444495 2e61ba5a50f21511c80536cf6c4f7ebde528fc78
child 444497 93cfc552f067c2f3a2f888d3d8e0c206671b3f6a
push id34996
push userrgurzau@mozilla.com
push dateTue, 06 Nov 2018 09:53:23 +0000
treeherdermozilla-central@e160f0a60e4f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1498440
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1498440 - part5 : rename PopEvent() to PopFrontEvent(). r=jya We only have a interest in the data which is popped out from the front side of the queue. Differential Revision: https://phabricator.services.mozilla.com/D9190
dom/media/MediaDecoderStateMachine.cpp
dom/media/MediaQueue.h
dom/media/mediasink/AudioSink.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -2494,23 +2494,23 @@ DecodingState::Enter()
     HandleVideoSuspendTimeout();
   }
 
   if (!mMaster->IsVideoDecoding() && !mMaster->IsAudioDecoding()) {
     SetState<CompletedState>();
     return;
   }
 
-  mOnAudioPopped = AudioQueue().PopEvent().Connect(
+  mOnAudioPopped = AudioQueue().PopFrontEvent().Connect(
     OwnerThread(), [this] () {
     if (mMaster->IsAudioDecoding() && !mMaster->HaveEnoughDecodedAudio()) {
       EnsureAudioDecodeTaskQueued();
     }
   });
-  mOnVideoPopped = VideoQueue().PopEvent().Connect(
+  mOnVideoPopped = VideoQueue().PopFrontEvent().Connect(
     OwnerThread(), [this] () {
     if (mMaster->IsVideoDecoding() && !mMaster->HaveEnoughDecodedVideo()) {
       EnsureVideoDecodeTaskQueued();
     }
   });
 
   mMaster->mOnNextFrameStatus.Notify(MediaDecoderOwner::NEXT_FRAME_AVAILABLE);
 
@@ -3072,19 +3072,19 @@ nsresult MediaDecoderStateMachine::Init(
   // Dispatch initialization that needs to happen on that task queue.
   nsCOMPtr<nsIRunnable> r = NewRunnableMethod<RefPtr<MediaDecoder>>(
     "MediaDecoderStateMachine::InitializationTask",
     this,
     &MediaDecoderStateMachine::InitializationTask,
     aDecoder);
   mTaskQueue->DispatchStateChange(r.forget());
 
-  mAudioQueueListener = AudioQueue().PopEvent().Connect(
+  mAudioQueueListener = AudioQueue().PopFrontEvent().Connect(
     mTaskQueue, this, &MediaDecoderStateMachine::OnAudioPopped);
-  mVideoQueueListener = VideoQueue().PopEvent().Connect(
+  mVideoQueueListener = VideoQueue().PopFrontEvent().Connect(
     mTaskQueue, this, &MediaDecoderStateMachine::OnVideoPopped);
 
   mMetadataManager.Connect(mReader->TimedMetadataEvent(), OwnerThread());
 
   mOnMediaNotSeekable = mReader->OnMediaNotSeekable().Connect(
     OwnerThread(), this, &MediaDecoderStateMachine::SetMediaNotSeekable);
 
   mMediaSink = CreateMediaSink(mAudioCaptured);
--- a/dom/media/MediaQueue.h
+++ b/dom/media/MediaQueue.h
@@ -51,17 +51,17 @@ public:
     nsDeque::Push(aItem);
     mPushEvent.Notify(RefPtr<T>(aItem));
   }
 
   inline already_AddRefed<T> PopFront() {
     RecursiveMutexAutoLock lock(mRecursiveMutex);
     RefPtr<T> rv = dont_AddRef(static_cast<T*>(nsDeque::PopFront()));
     if (rv) {
-      mPopEvent.Notify(rv);
+      mPopFrontEvent.Notify(rv);
     }
     return rv.forget();
   }
 
   inline already_AddRefed<T> PopBack() {
     RecursiveMutexAutoLock lock(mRecursiveMutex);
     RefPtr<T> rv = dont_AddRef(static_cast<T*>(nsDeque::Pop()));
     return rv.forget();
@@ -160,31 +160,31 @@ public:
     uint32_t frames = 0;
     for (size_t i = 0; i < GetSize(); ++i) {
       T* v = static_cast<T*>(ObjectAt(i));
       frames += v->mFrames;
     }
     return frames;
   }
 
-  MediaEventSource<RefPtr<T>>& PopEvent() {
-    return mPopEvent;
+  MediaEventSource<RefPtr<T>>& PopFrontEvent() {
+    return mPopFrontEvent;
   }
 
   MediaEventSource<RefPtr<T>>& PushEvent() {
     return mPushEvent;
   }
 
   MediaEventSource<void>& FinishEvent() {
     return mFinishEvent;
   }
 
 private:
   mutable RecursiveMutex mRecursiveMutex;
-  MediaEventProducer<RefPtr<T>> mPopEvent;
+  MediaEventProducer<RefPtr<T>> mPopFrontEvent;
   MediaEventProducer<RefPtr<T>> mPushEvent;
   MediaEventProducer<void> mFinishEvent;
   // True when we've decoded the last frame of data in the
   // bitstream for which we're queueing frame data.
   bool mEndOfStream;
 };
 
 } // namespace mozilla
--- a/dom/media/mediasink/AudioSink.cpp
+++ b/dom/media/mediasink/AudioSink.cpp
@@ -75,17 +75,17 @@ nsresult
 AudioSink::Init(const PlaybackParams& aParams, RefPtr<GenericPromise>& aEndPromise)
 {
   MOZ_ASSERT(mOwnerThread->IsCurrentThreadIn());
 
   mAudioQueueListener = mAudioQueue.PushEvent().Connect(
     mOwnerThread, this, &AudioSink::OnAudioPushed);
   mAudioQueueFinishListener = mAudioQueue.FinishEvent().Connect(
     mOwnerThread, this, &AudioSink::NotifyAudioNeeded);
-  mProcessedQueueListener = mProcessedQueue.PopEvent().Connect(
+  mProcessedQueueListener = mProcessedQueue.PopFrontEvent().Connect(
     mOwnerThread, this, &AudioSink::OnAudioPopped);
 
   // To ensure at least one audio packet will be popped from AudioQueue and
   // ready to be played.
   NotifyAudioNeeded();
   aEndPromise = mEndPromise.Ensure(__func__);
   nsresult rv = InitializeAudioStream(aParams);
   if (NS_FAILED(rv)) {