Backed out changeset ed6f3ec5a71b (bug 1050667)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Fri, 19 Sep 2014 13:21:30 +0200
changeset 206178 eac61c961c1b43e57fb9e0fa363871de28ead456
parent 206177 41be329a952456ba0acaaeb3f038e1720a104006
child 206179 2cd08d771e60e2e515d2ba6abbc5a8626905393b
push id27515
push userryanvm@gmail.com
push dateFri, 19 Sep 2014 17:29:33 +0000
treeherdermozilla-central@74d4fc84e39e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1050667
milestone35.0a1
backs outed6f3ec5a71bfa6e51590d5720503bad865cf6be
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 ed6f3ec5a71b (bug 1050667)
content/media/omx/MediaCodecReader.cpp
content/media/omx/MediaCodecReader.h
--- a/content/media/omx/MediaCodecReader.cpp
+++ b/content/media/omx/MediaCodecReader.cpp
@@ -280,17 +280,16 @@ MediaCodecReader::ProcessCachedDataTask:
 MediaCodecReader::MediaCodecReader(AbstractMediaDecoder* aDecoder)
   : MediaOmxCommonReader(aDecoder)
   , mColorConverterBufferSize(0)
   , mExtractor(nullptr)
   , mParserMonitor("MediaCodecReader::mParserMonitor")
   , mParseDataFromCache(true)
   , mNextParserPosition(INT64_C(0))
   , mParsedDataLength(INT64_C(0))
-  , mIsWaitingResources(false)
 {
   mHandler = new MessageHandler(this);
   mVideoListener = new VideoResourceListener(this);
 }
 
 MediaCodecReader::~MediaCodecReader()
 {
   MOZ_ASSERT(NS_IsMainThread(), "Should be on main thread.");
@@ -300,24 +299,17 @@ nsresult
 MediaCodecReader::Init(MediaDecoderReader* aCloneDonor)
 {
   return NS_OK;
 }
 
 bool
 MediaCodecReader::IsWaitingMediaResources()
 {
-  return mIsWaitingResources;
-}
-
-void
-MediaCodecReader::UpdateIsWaitingMediaResources()
-{
-  mIsWaitingResources = (mVideoTrack.mCodec != nullptr) &&
-                        (!mVideoTrack.mCodec->allocated());
+  return mVideoTrack.mCodec != nullptr && !mVideoTrack.mCodec->allocated();
 }
 
 bool
 MediaCodecReader::IsDormantNeeded()
 {
   return mVideoTrack.mSource != nullptr;
 }
 
@@ -664,21 +656,16 @@ MediaCodecReader::ReadMetadata(MediaInfo
   if (!ReallocateResources()) {
     return NS_ERROR_FAILURE;
   }
 
   if (!TriggerIncrementalParser()) {
     return NS_ERROR_FAILURE;
   }
 
-  // Bug 1050667, both MediaDecoderStateMachine and MediaCodecReader
-  // relies on IsWaitingMediaResources() function. And the waiting state will be
-  // changed by binder thread, so we store the waiting state in a cache value to
-  // make them in the same waiting state.
-  UpdateIsWaitingMediaResources();
   if (IsWaitingMediaResources()) {
     return NS_OK;
   }
 
   // TODO: start streaming
 
   if (!UpdateDuration()) {
     return NS_ERROR_FAILURE;
--- a/content/media/omx/MediaCodecReader.h
+++ b/content/media/omx/MediaCodecReader.h
@@ -147,24 +147,17 @@ protected:
 
   // Receive a notify from ResourceListener.
   // Called on Binder thread.
   virtual void codecReserved(Track& aTrack);
   virtual void codecCanceled(Track& aTrack);
 
   virtual bool CreateExtractor();
 
-  // Check the underlying HW resource is available and store the result in
-  // mIsWaitingResources.
-  void UpdateIsWaitingMediaResources();
-
   android::sp<android::MediaExtractor> mExtractor;
-  // A cache value updated by UpdateIsWaitingMediaResources(), makes the
-  // "waiting resources state" is synchronous to StateMachine.
-  bool mIsWaitingResources;
 
 private:
   // An intermediary class that can be managed by android::sp<T>.
   // Redirect onMessageReceived() to MediaCodecReader.
   class MessageHandler : public android::AHandler
   {
   public:
     MessageHandler(MediaCodecReader* aReader);