Backed out changeset 43953e9233a2 (bug 831224)
authorEd Morley <emorley@mozilla.com>
Thu, 08 Aug 2013 09:59:49 -0700
changeset 154791 3ee2edd9e015847323f2a4fd46901b8bcaef11b2
parent 154790 99e7a2a7029e7f217561865723562d7b88fe1856
child 154792 7e1ba78b8ab69dbac9567cfd7dfc3c86f0cfe13f
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs831224
milestone26.0a1
backs out43953e9233a2de545b14b90abb29dac6c2a487a8
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 43953e9233a2 (bug 831224)
content/media/AbstractMediaDecoder.h
content/media/MediaDecoder.cpp
content/media/MediaDecoder.h
content/media/MediaDecoderStateMachine.cpp
content/media/MediaDecoderStateMachine.h
content/media/webaudio/MediaBufferDecoder.cpp
--- a/content/media/AbstractMediaDecoder.h
+++ b/content/media/AbstractMediaDecoder.h
@@ -67,21 +67,16 @@ public:
   virtual int64_t GetEndMediaTime() const = 0;
 
   // Return the duration of the media in microseconds.
   virtual int64_t GetMediaDuration() = 0;
 
   // Set the duration of the media in microseconds.
   virtual void SetMediaDuration(int64_t aDuration) = 0;
 
-  // Sets the duration of the media in microseconds. The MediaDecoder
-  // fires a durationchange event to its owner (e.g., an HTML audio
-  // tag).
-  virtual void UpdateMediaDuration(int64_t aDuration) = 0;
-
   // Set the media as being seekable or not.
   virtual void SetMediaSeekable(bool aMediaSeekable) = 0;
 
   // Set the transport level as being seekable or not.
   virtual void SetTransportSeekable(bool aTransportSeekable) = 0;
 
   virtual VideoFrameContainer* GetVideoFrameContainer() = 0;
   virtual mozilla::layers::ImageContainer* GetImageContainer() = 0;
--- a/content/media/MediaDecoder.cpp
+++ b/content/media/MediaDecoder.cpp
@@ -1267,22 +1267,16 @@ void MediaDecoder::SetDuration(double aD
 }
 
 void MediaDecoder::SetMediaDuration(int64_t aDuration)
 {
   NS_ENSURE_TRUE_VOID(GetStateMachine());
   GetStateMachine()->SetDuration(aDuration);
 }
 
-void MediaDecoder::UpdateMediaDuration(int64_t aDuration)
-{
-  NS_ENSURE_TRUE_VOID(GetStateMachine());
-  GetStateMachine()->UpdateDuration(aDuration);
-}
-
 void MediaDecoder::SetMediaSeekable(bool aMediaSeekable) {
   ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
   MOZ_ASSERT(NS_IsMainThread() || OnDecodeThread());
   mMediaSeekable = aMediaSeekable;
   if (mDecoderStateMachine) {
     mDecoderStateMachine->SetMediaSeekable(aMediaSeekable);
   }
 }
--- a/content/media/MediaDecoder.h
+++ b/content/media/MediaDecoder.h
@@ -501,17 +501,16 @@ public:
   virtual bool IsEnded() const;
 
   // Set the duration of the media resource in units of seconds.
   // This is called via a channel listener if it can pick up the duration
   // from a content header. Must be called from the main thread only.
   virtual void SetDuration(double aDuration);
 
   void SetMediaDuration(int64_t aDuration) MOZ_OVERRIDE;
-  void UpdateMediaDuration(int64_t aDuration) MOZ_OVERRIDE;
 
   // Set a flag indicating whether seeking is supported
   virtual void SetMediaSeekable(bool aMediaSeekable) MOZ_OVERRIDE;
   virtual void SetTransportSeekable(bool aTransportSeekable) MOZ_FINAL MOZ_OVERRIDE;
   // Returns true if this media supports seeking. False for example for WebM
   // files without an index and chained ogg files.
   virtual bool IsMediaSeekable() MOZ_FINAL MOZ_OVERRIDE;
   // Returns true if seeking is supported on a transport level (e.g. the server
--- a/content/media/MediaDecoderStateMachine.cpp
+++ b/content/media/MediaDecoderStateMachine.cpp
@@ -1441,26 +1441,16 @@ void MediaDecoderStateMachine::SetDurati
   if (mStartTime != -1) {
     mEndTime = mStartTime + aDuration;
   } else {
     mStartTime = 0;
     mEndTime = aDuration;
   }
 }
 
-void MediaDecoderStateMachine::UpdateDuration(int64_t aDuration)
-{
-  if (aDuration != GetDuration()) {
-    SetDuration(aDuration);
-    nsCOMPtr<nsIRunnable> event =
-      NS_NewRunnableMethod(mDecoder, &MediaDecoder::DurationChanged);
-    NS_DispatchToMainThread(event, NS_DISPATCH_NORMAL);
-  }
-}
-
 void MediaDecoderStateMachine::SetMediaEndTime(int64_t aEndTime)
 {
   NS_ASSERTION(OnDecodeThread(), "Should be on decode thread");
   mDecoder->GetReentrantMonitor().AssertCurrentThreadIn();
 
   mEndTime = aEndTime;
 }
 
--- a/content/media/MediaDecoderStateMachine.h
+++ b/content/media/MediaDecoderStateMachine.h
@@ -152,20 +152,16 @@ public:
   // aDuration is in microseconds.
   void SetDuration(int64_t aDuration);
 
   // Called while decoding metadata to set the end time of the media
   // resource. The decoder monitor must be obtained before calling this.
   // aEndTime is in microseconds.
   void SetMediaEndTime(int64_t aEndTime);
 
-  // Called from decode thread to update the duration. Can result in
-  // a durationchangeevent. aDuration is in microseconds.
-  void UpdateDuration(int64_t aDuration);
-
   // Functions used by assertions to ensure we're calling things
   // on the appropriate threads.
   bool OnDecodeThread() const {
     return IsCurrentThread(mDecodeThread);
   }
   bool OnStateMachineThread() const;
   bool OnAudioThread() const {
     return IsCurrentThread(mAudioThread);
--- a/content/media/webaudio/MediaBufferDecoder.cpp
+++ b/content/media/webaudio/MediaBufferDecoder.cpp
@@ -92,18 +92,16 @@ public:
   virtual void NotifyDecodedFrames(uint32_t aParsed, uint32_t aDecoded) MOZ_FINAL MOZ_OVERRIDE;
 
   virtual int64_t GetEndMediaTime() const MOZ_FINAL MOZ_OVERRIDE;
 
   virtual int64_t GetMediaDuration() MOZ_FINAL MOZ_OVERRIDE;
 
   virtual void SetMediaDuration(int64_t aDuration) MOZ_FINAL MOZ_OVERRIDE;
 
-  virtual void UpdateMediaDuration(int64_t aDuration) MOZ_FINAL MOZ_OVERRIDE;
-
   virtual void SetMediaSeekable(bool aMediaSeekable) MOZ_OVERRIDE;
 
   virtual void SetTransportSeekable(bool aTransportSeekable) MOZ_FINAL MOZ_OVERRIDE;
 
   virtual VideoFrameContainer* GetVideoFrameContainer() MOZ_FINAL MOZ_OVERRIDE;
   virtual mozilla::layers::ImageContainer* GetImageContainer() MOZ_FINAL MOZ_OVERRIDE;
 
   virtual bool IsTransportSeekable() MOZ_FINAL MOZ_OVERRIDE;
@@ -212,22 +210,16 @@ BufferDecoder::GetMediaDuration()
 
 void
 BufferDecoder::SetMediaDuration(int64_t aDuration)
 {
   // ignore
 }
 
 void
-BufferDecoder::UpdateMediaDuration(int64_t aDuration)
-{
-  // ignore
-}
-
-void
 BufferDecoder::SetMediaSeekable(bool aMediaSeekable)
 {
   // ignore
 }
 
 void
 BufferDecoder::SetTransportSeekable(bool aTransportSeekable)
 {