Bug 1324357 - Remove MediaDecoderReader::ForceZeroStartTime(); r=jya
authorKaku Kuo <kaku@mozilla.com>
Wed, 21 Dec 2016 14:58:38 +0800
changeset 326764 3230d21e2a8b15844fe040ca020bc1a29b425684
parent 326763 16849313bde4f6af045ca43a95b4266767b63e36
child 326765 ec8b5f4a653c75f947e3e982b0a100b1299e6e16
push id31110
push usercbook@mozilla.com
push dateWed, 21 Dec 2016 15:55:07 +0000
treeherdermozilla-central@e35285361628 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1324357
milestone53.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 1324357 - Remove MediaDecoderReader::ForceZeroStartTime(); r=jya MozReview-Commit-ID: Cm511lpJQ4W
dom/media/MediaDecoderReader.h
dom/media/MediaDecoderReaderWrapper.h
dom/media/MediaFormatReader.cpp
dom/media/MediaFormatReader.h
--- a/dom/media/MediaDecoderReader.h
+++ b/dom/media/MediaDecoderReader.h
@@ -159,19 +159,16 @@ public:
   // 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;
   }
 
-  // MediaSourceReader opts out of the start-time-guessing mechanism.
-  virtual bool ForceZeroStartTime() const { return false; }
-
   // 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 { return true; }
 
   // Returns the number of bytes of memory allocated by structures/frames in
   // the video queue.
--- a/dom/media/MediaDecoderReaderWrapper.h
+++ b/dom/media/MediaDecoderReaderWrapper.h
@@ -72,17 +72,16 @@ public:
 
   void ReleaseResources();
   void ResetDecode(TrackSet aTracks);
 
   nsresult Init() { return mReader->Init(); }
   bool IsWaitForDataSupported() const { return mReader->IsWaitForDataSupported(); }
   bool IsAsync() const { return mReader->IsAsync(); }
   bool UseBufferingHeuristics() const { return mReader->UseBufferingHeuristics(); }
-  bool ForceZeroStartTime() const { return mReader->ForceZeroStartTime(); }
 
   bool VideoIsHardwareAccelerated() const {
     return mReader->VideoIsHardwareAccelerated();
   }
   TimedMetadataEventSource& TimedMetadataEvent() {
     return mReader->TimedMetadataEvent();
   }
   MediaEventSource<void>& OnMediaNotSeekable() {
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -1089,17 +1089,17 @@ MediaFormatReader::OnDemuxerInitDone(nsr
 
   mTags = Move(tags);
   mInitDone = true;
 
   // Try to get the start time.
   // For MSE case, the start time of each track is assumed to be 0.
   // For others, we must demux the first sample to know the start time for each
   // track.
-  if (ForceZeroStartTime()) {
+  if (!mDemuxer->ShouldComputeStartTime()) {
     mAudio.mFirstDemuxedSampleTime.emplace(TimeUnit::FromMicroseconds(0));
     mVideo.mFirstDemuxedSampleTime.emplace(TimeUnit::FromMicroseconds(0));
   } else {
     if (HasAudio()) {
       RequestDemuxSamples(TrackInfo::kAudioTrack);
     }
 
     if (HasVideo()) {
@@ -2629,22 +2629,16 @@ MediaFormatReader::UpdateBuffered()
     // IntervalSet already starts at 0 or is empty, nothing to shift.
     mBuffered = intervals;
   } else {
     mBuffered =
       intervals.Shift(media::TimeUnit() - mInfo.mStartTime);
   }
 }
 
-bool
-MediaFormatReader::ForceZeroStartTime() const
-{
-  return !mDemuxer->ShouldComputeStartTime();
-}
-
 layers::ImageContainer*
 MediaFormatReader::GetImageContainer()
 {
   return mVideoFrameContainer
     ? mVideoFrameContainer->GetImageContainer() : nullptr;
 }
 
 void
--- a/dom/media/MediaFormatReader.h
+++ b/dom/media/MediaFormatReader.h
@@ -48,18 +48,16 @@ public:
 
   RefPtr<SeekPromise> Seek(const SeekTarget& aTarget) override;
 
 protected:
   void NotifyDataArrived() override;
   void UpdateBuffered() override;
 
 public:
-  bool ForceZeroStartTime() const override;
-
   // For Media Resource Management
   void ReleaseResources() override;
 
   nsresult ResetDecode(TrackSet aTracks) override;
 
   RefPtr<ShutdownPromise> Shutdown() override;
 
   bool IsAsync() const override { return true; }