Backed out changeset a2c87cb66cce (bug 1281115) for causing frequent timeouts in test_ResumeAfterClearing_mp4.html
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Tue, 28 Jun 2016 13:53:10 +0200
changeset 302870 581d221488b88275575d6b11dc1a999918deb6bd
parent 302869 170e18a9341f79cdebd6cfa5114c1b4a2469c030
child 302871 e45890951ce77c3df05575bd54072b9f300d77b0
child 302935 a901563fd1811c0b9f48b657b4dfc4bd5444d716
push id30376
push usercbook@mozilla.com
push dateTue, 28 Jun 2016 14:09:36 +0000
treeherdermozilla-central@e45890951ce7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1281115
milestone50.0a1
backs outa2c87cb66ccef4ec2993433c5c7b1370dc11115c
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
Backed out changeset a2c87cb66cce (bug 1281115) for causing frequent timeouts in test_ResumeAfterClearing_mp4.html
dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp
dom/media/platforms/ffmpeg/FFmpegDataDecoder.h
dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
dom/media/platforms/wrappers/FuzzingWrapper.cpp
dom/media/platforms/wrappers/FuzzingWrapper.h
dom/media/platforms/wrappers/H264Converter.cpp
dom/media/platforms/wrappers/H264Converter.h
--- a/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp
@@ -159,35 +159,22 @@ FFmpegDataDecoder<LIBAV_VER>::Drain()
   MOZ_ASSERT(mCallback->OnReaderTaskQueue());
   nsCOMPtr<nsIRunnable> runnable =
     NewRunnableMethod(this, &FFmpegDataDecoder<LIBAV_VER>::ProcessDrain);
   mTaskQueue->Dispatch(runnable.forget());
   return NS_OK;
 }
 
 void
-FFmpegDataDecoder<LIBAV_VER>::SetSeekThreshold(const media::TimeUnit& aTime)
-{
-  MOZ_ASSERT(mCallback->OnReaderTaskQueue());
-  RefPtr<FFmpegDataDecoder<LIBAV_VER>> self = this;
-  nsCOMPtr<nsIRunnable> runnable =
-    NS_NewRunnableFunction([self, aTime] () {
-      self->mSeekTargetThreshold = Some(aTime);
-    });
-  mTaskQueue->Dispatch(runnable.forget());
-}
-
-void
 FFmpegDataDecoder<LIBAV_VER>::ProcessFlush()
 {
   MOZ_ASSERT(mTaskQueue->IsCurrentThreadIn());
   if (mCodecContext) {
     mLib->avcodec_flush_buffers(mCodecContext);
   }
-  mSeekTargetThreshold.reset();
 }
 
 void
 FFmpegDataDecoder<LIBAV_VER>::ProcessShutdown()
 {
   StaticMutexAutoLock mon(sMonitor);
 
   if (mCodecContext) {
--- a/dom/media/platforms/ffmpeg/FFmpegDataDecoder.h
+++ b/dom/media/platforms/ffmpeg/FFmpegDataDecoder.h
@@ -31,17 +31,16 @@ public:
 
   static bool Link();
 
   RefPtr<InitPromise> Init() override = 0;
   nsresult Input(MediaRawData* aSample) override;
   nsresult Flush() override;
   nsresult Drain() override;
   nsresult Shutdown() override;
-  void SetSeekThreshold(const media::TimeUnit& aTime) override;
 
   static AVCodec* FindAVCodec(FFmpegLibWrapper* aLib, AVCodecID aCodec);
 
 protected:
   enum DecodeResult {
     DECODE_FRAME,
     DECODE_NO_FRAME,
     DECODE_ERROR,
@@ -57,17 +56,16 @@ protected:
 
   FFmpegLibWrapper* mLib;
   MediaDataDecoderCallback* mCallback;
 
   AVCodecContext* mCodecContext;
   AVFrame*        mFrame;
   RefPtr<MediaByteBuffer> mExtraData;
   AVCodecID mCodecID;
-  Maybe<media::TimeUnit> mSeekTargetThreshold;
 
 private:
   void ProcessDecode(MediaRawData* aSample);
   virtual DecodeResult DoDecode(MediaRawData* aSample) = 0;
   virtual void ProcessDrain() = 0;
 
   static StaticMutex sMonitor;
   const RefPtr<TaskQueue> mTaskQueue;
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
@@ -256,25 +256,16 @@ FFmpegVideoDecoder<LIBAV_VER>::DoDecode(
     if (!mDurationMap.Find(mFrame->pkt_dts, duration)) {
       NS_WARNING("Unable to retrieve duration from map");
       duration = aSample->mDuration;
       // dts are probably incorrectly reported ; so clear the map as we're
       // unlikely to find them in the future anyway. This also guards
       // against the map becoming extremely big.
       mDurationMap.Clear();
     }
-
-    if (mSeekTargetThreshold) {
-      if ((pts + duration) < mSeekTargetThreshold.ref().ToMicroseconds()) {
-        FFMPEG_LOG("Dropping decoded frame with pts=%lld, duration=%lld", pts, duration);
-        return DecodeResult::DECODE_FRAME;
-      }
-      mSeekTargetThreshold.reset();
-    }
-
     FFMPEG_LOG("Got one frame output with pts=%lld dts=%lld duration=%lld opaque=%lld",
                pts, mFrame->pkt_dts, duration, mCodecContext->reordered_opaque);
 
     VideoData::YCbCrBuffer b;
     b.mPlanes[0].mData = mFrame->data[0];
     b.mPlanes[1].mData = mFrame->data[1];
     b.mPlanes[2].mData = mFrame->data[2];
 
--- a/dom/media/platforms/wrappers/FuzzingWrapper.cpp
+++ b/dom/media/platforms/wrappers/FuzzingWrapper.cpp
@@ -77,24 +77,16 @@ DecoderFuzzingWrapper::Shutdown()
   DFW_LOGV("");
   MOZ_ASSERT(mDecoder);
   // Both shutdowns below may block a bit.
   nsresult result = mDecoder->Shutdown();
   mCallbackWrapper->Shutdown();
   return result;
 }
 
-void
-DecoderFuzzingWrapper::SetSeekThreshold(const media::TimeUnit& aTime)
-{
-  DFW_LOGV("");
-  MOZ_ASSERT(mDecoder);
-  mDecoder->SetSeekThreshold(aTime);
-}
-
 bool
 DecoderFuzzingWrapper::IsHardwareAccelerated(nsACString& aFailureReason) const
 {
   DFW_LOGV("");
   MOZ_ASSERT(mDecoder);
   return mDecoder->IsHardwareAccelerated(aFailureReason);
 }
 
--- a/dom/media/platforms/wrappers/FuzzingWrapper.h
+++ b/dom/media/platforms/wrappers/FuzzingWrapper.h
@@ -108,17 +108,16 @@ public:
   nsresult Drain() override;
   nsresult Shutdown() override;
   bool IsHardwareAccelerated(nsACString& aFailureReason) const override;
   nsresult ConfigurationChanged(const TrackInfo& aConfig) override;
   const char* GetDescriptionName() const override
   {
     return mDecoder->GetDescriptionName();
   }
-  void SetSeekThreshold(const media::TimeUnit& aTime) override;
 
 private:
   virtual ~DecoderFuzzingWrapper();
   RefPtr<MediaDataDecoder> mDecoder;
   RefPtr<DecoderCallbackFuzzingWrapper> mCallbackWrapper;
 };
 
 } // namespace mozilla
--- a/dom/media/platforms/wrappers/H264Converter.cpp
+++ b/dom/media/platforms/wrappers/H264Converter.cpp
@@ -113,24 +113,16 @@ H264Converter::Shutdown()
     nsresult rv = mDecoder->Shutdown();
     mInitPromiseRequest.DisconnectIfExists();
     mDecoder = nullptr;
     return rv;
   }
   return NS_OK;
 }
 
-void
-H264Converter::SetSeekThreshold(const media::TimeUnit& aTime)
-{
-  if (mDecoder) {
-    mDecoder->SetSeekThreshold(aTime);
-  }
-}
-
 bool
 H264Converter::IsHardwareAccelerated(nsACString& aFailureReason) const
 {
   if (mDecoder) {
     return mDecoder->IsHardwareAccelerated(aFailureReason);
   }
   return MediaDataDecoder::IsHardwareAccelerated(aFailureReason);
 }
--- a/dom/media/platforms/wrappers/H264Converter.h
+++ b/dom/media/platforms/wrappers/H264Converter.h
@@ -33,17 +33,16 @@ public:
   bool IsHardwareAccelerated(nsACString& aFailureReason) const override;
   const char* GetDescriptionName() const override
   {
     if (mDecoder) {
       return mDecoder->GetDescriptionName();
     }
     return "H264Converter decoder (pending)";
   }
-  void SetSeekThreshold(const media::TimeUnit& aTime) override;
 
   // Return true if mimetype is H.264.
   static bool IsH264(const TrackInfo& aConfig);
   nsresult GetLastError() const { return mLastError; }
 
 private:
   // Will create the required MediaDataDecoder if need AVCC and we have a SPS NAL.
   // Returns NS_ERROR_FAILURE if error is permanent and can't be recovered and