Bug 1316211. P3 - remove unused members. r=gerald
authorJW Wang <jwwang@mozilla.com>
Wed, 19 Jul 2017 11:51:53 +0800
changeset 418802 8ffd2e8a12adcf84b451d4676986d2eb20e7df33
parent 418801 1bc3e813c0e2e8123a3924f2563c64bd79002d71
child 418803 1e93396b093c1181ff08f643c3bc7784279a349b
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1316211
milestone56.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 1316211. P3 - remove unused members. r=gerald MozReview-Commit-ID: 4cAHEvMEm9Q
dom/media/MediaDecoderReader.cpp
dom/media/MediaDecoderReader.h
--- a/dom/media/MediaDecoderReader.cpp
+++ b/dom/media/MediaDecoderReader.cpp
@@ -64,25 +64,22 @@ public:
     mSize += audioData->SizeOfIncludingThis(MallocSizeOf);
     return nullptr;
   }
 
   size_t mSize;
 };
 
 MediaDecoderReader::MediaDecoderReader(MediaDecoderReaderInit& aInit)
-  : mAudioCompactor(mAudioQueue)
-  , mDecoder(aInit.mDecoder)
+  : mDecoder(aInit.mDecoder)
   , mTaskQueue(new TaskQueue(
       GetMediaThreadPool(MediaThreadType::PLAYBACK),
       "MediaDecoderReader::mTaskQueue",
       /* aSupportsTailDispatch = */ true))
   , mBuffered(mTaskQueue, TimeIntervals(), "MediaDecoderReader::mBuffered (Canonical)")
-  , mIgnoreAudioOutputFormat(false)
-  , mHitAudioDecodeError(false)
   , mShutdown(false)
   , mResource(aInit.mResource)
 {
   MOZ_COUNT_CTOR(MediaDecoderReader);
   MOZ_ASSERT(NS_IsMainThread());
 }
 
 nsresult
@@ -128,36 +125,31 @@ MediaDecoderReader::UpdateDuration(const
   mDuration = Some(aDuration);
   UpdateBuffered();
 }
 
 nsresult MediaDecoderReader::ResetDecode(TrackSet aTracks)
 {
   if (aTracks.contains(TrackInfo::kVideoTrack)) {
     VideoQueue().Reset();
-    mBaseVideoPromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED, __func__);
   }
 
   if (aTracks.contains(TrackInfo::kAudioTrack)) {
     AudioQueue().Reset();
-    mBaseAudioPromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED, __func__);
   }
 
   return NS_OK;
 }
 
 RefPtr<ShutdownPromise>
 MediaDecoderReader::Shutdown()
 {
   MOZ_ASSERT(OnTaskQueue());
   mShutdown = true;
 
-  mBaseAudioPromise.RejectIfExists(NS_ERROR_DOM_MEDIA_END_OF_STREAM, __func__);
-  mBaseVideoPromise.RejectIfExists(NS_ERROR_DOM_MEDIA_END_OF_STREAM, __func__);
-
   ReleaseResources();
   mBuffered.DisconnectAll();
 
   mDecoder = nullptr;
 
   return mTaskQueue->BeginShutdown();
 }
 
--- a/dom/media/MediaDecoderReader.h
+++ b/dom/media/MediaDecoderReader.h
@@ -182,17 +182,16 @@ public:
 
   virtual void SetCDMProxy(CDMProxy* aProxy) = 0;
 
   // Tell the reader that the data decoded are not for direct playback, so it
   // can accept more files, in particular those which have more channels than
   // available in the audio output.
   void SetIgnoreAudioOutputFormat()
   {
-    mIgnoreAudioOutputFormat = true;
   }
 
   // The MediaDecoderStateMachine uses various heuristics that assume that
   // raw media data is arriving sequentially from a network channel. This
   // makes sense in the <video src="foo"> case, but not for more advanced use
   // cases like MSE.
   virtual bool UseBufferingHeuristics() const = 0;
 
@@ -293,46 +292,30 @@ protected:
   // Queue of audio frames. This queue is threadsafe, and is accessed from
   // the audio, decoder, state machine, and main threads.
   MediaQueue<AudioData> mAudioQueue;
 
   // Queue of video frames. This queue is threadsafe, and is accessed from
   // the decoder, state machine, and main threads.
   MediaQueue<VideoData> mVideoQueue;
 
-  // An adapter to the audio queue which first copies data to buffers with
-  // minimal allocation slop and then pushes them to the queue.  This is
-  // useful for decoders working with formats that give awkward numbers of
-  // frames such as mp3.
-  AudioCompactor mAudioCompactor;
-
   // Reference to the owning decoder object.
   AbstractMediaDecoder* mDecoder;
 
   // Decode task queue.
   RefPtr<TaskQueue> mTaskQueue;
 
   // Buffered range.
   Canonical<media::TimeIntervals> mBuffered;
 
   // Stores presentation info required for playback.
   MediaInfo mInfo;
 
   media::NullableTimeUnit mDuration;
 
-  // Whether we should accept media that we know we can't play
-  // directly, because they have a number of channel higher than
-  // what we support.
-  bool mIgnoreAudioOutputFormat;
-
-  // This is a quick-and-dirty way for DecodeAudioData implementations to
-  // communicate the presence of a decoding error to RequestAudioData. We should
-  // replace this with a promise-y mechanism as we make this stuff properly
-  // async.
-  bool mHitAudioDecodeError;
   bool mShutdown;
 
   // Used to send TimedMetadata to the listener.
   TimedMetadataEventProducer mTimedMetadataEvent;
 
   // Notify if this media is not seekable.
   MediaEventProducer<void> mOnMediaNotSeekable;
 
@@ -344,18 +327,13 @@ protected:
   MediaEventProducer<void> mOnWaitingForKey;
 
   MediaEventProducer<MediaResult> mOnDecodeWarning;
 
   RefPtr<MediaResource> mResource;
 
 private:
   virtual nsresult InitInternal() = 0;
-
-  // Promises used only for the base-class (sync->async adapter) implementation
-  // of Request{Audio,Video}Data.
-  MozPromiseHolder<AudioDataPromise> mBaseAudioPromise;
-  MozPromiseHolder<VideoDataPromise> mBaseVideoPromise;
 };
 
 } // namespace mozilla
 
 #endif