Bug 1056537 - Bustage fix: move DecodeToFirstVideoData back to MediaDecoderReader for now. r=UNDISCLOSED TREETOPS
authorMatthew Gregan <kinetik@flim.org>
Fri, 22 Aug 2014 15:11:58 +1200
changeset 200994 4b5c00adecf9
parent 200993 b695c5227ce6
child 200995 4af6581e7c63
push id48053
push usermgregan@mozilla.com
push dateFri, 22 Aug 2014 03:12:11 +0000
treeherdermozilla-inbound@4b5c00adecf9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersUNDISCLOSED
bugs1056537
milestone34.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 1056537 - Bustage fix: move DecodeToFirstVideoData back to MediaDecoderReader for now. r=UNDISCLOSED TREETOPS
content/media/MediaDecoderReader.cpp
content/media/MediaDecoderReader.h
content/media/ogg/OggReader.cpp
content/media/ogg/OggReader.h
--- a/content/media/MediaDecoderReader.cpp
+++ b/content/media/MediaDecoderReader.cpp
@@ -100,16 +100,36 @@ nsresult MediaDecoderReader::ResetDecode
   AudioQueue().Reset();
 
   mAudioDiscontinuity = true;
   mVideoDiscontinuity = true;
 
   return res;
 }
 
+VideoData* MediaDecoderReader::DecodeToFirstVideoData()
+{
+  bool eof = false;
+  while (!eof && VideoQueue().GetSize() == 0) {
+    {
+      ReentrantMonitorAutoEnter decoderMon(mDecoder->GetReentrantMonitor());
+      if (mDecoder->IsShutdown()) {
+        return nullptr;
+      }
+    }
+    bool keyframeSkip = false;
+    eof = !DecodeVideoFrame(keyframeSkip, 0);
+  }
+  if (eof) {
+    VideoQueue().Finish();
+  }
+  VideoData* d = nullptr;
+  return (d = VideoQueue().PeekFront()) ? d : nullptr;
+}
+
 nsresult
 MediaDecoderReader::GetBuffered(mozilla::dom::TimeRanges* aBuffered,
                                 int64_t aStartTime)
 {
   MediaResource* stream = mDecoder->GetResource();
   int64_t durationUs = 0;
   {
     ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
--- a/content/media/MediaDecoderReader.h
+++ b/content/media/MediaDecoderReader.h
@@ -158,16 +158,19 @@ public:
   virtual MediaQueue<AudioData>& AudioQueue() { return mAudioQueue; }
   virtual MediaQueue<VideoData>& VideoQueue() { return mVideoQueue; }
 
   // Returns a pointer to the decoder.
   AbstractMediaDecoder* GetDecoder() {
     return mDecoder;
   }
 
+  // TODO: DEPRECATED.  This uses synchronous decoding.
+  VideoData* DecodeToFirstVideoData();
+
   MediaInfo GetMediaInfo() { return mInfo; }
 
   // Indicates if the media is seekable.
   // ReadMetada should be called before calling this method.
   virtual bool IsMediaSeekable() = 0;
 
 protected:
   virtual ~MediaDecoderReader();
--- a/content/media/ogg/OggReader.cpp
+++ b/content/media/ogg/OggReader.cpp
@@ -1889,36 +1889,16 @@ VideoData* OggReader::FindStartTime(int6
   int64_t startTime = std::min(videoStartTime, audioStartTime);
   if (startTime != INT64_MAX) {
     aOutStartTime = startTime;
   }
 
   return videoData;
 }
 
-VideoData* OggReader::DecodeToFirstVideoData()
-{
-  bool eof = false;
-  while (!eof && VideoQueue().GetSize() == 0) {
-    {
-      ReentrantMonitorAutoEnter decoderMon(mDecoder->GetReentrantMonitor());
-      if (mDecoder->IsShutdown()) {
-        return nullptr;
-      }
-    }
-    bool keyframeSkip = false;
-    eof = !DecodeVideoFrame(keyframeSkip, 0);
-  }
-  if (eof) {
-    VideoQueue().Finish();
-  }
-  VideoData* d = nullptr;
-  return (d = VideoQueue().PeekFront()) ? d : nullptr;
-}
-
 AudioData* OggReader::DecodeToFirstAudioData()
 {
   bool eof = false;
   while (!eof && AudioQueue().GetSize() == 0) {
     {
       ReentrantMonitorAutoEnter decoderMon(mDecoder->GetReentrantMonitor());
       if (mDecoder->IsShutdown()) {
         return nullptr;
--- a/content/media/ogg/OggReader.h
+++ b/content/media/ogg/OggReader.h
@@ -85,17 +85,16 @@ public:
 
 private:
   // TODO: DEPRECATED. This uses synchronous decoding.
   // Stores the presentation time of the first frame we'd be able to play if
   // we started playback at the current position. Returns the first video
   // frame, if we have video.
   VideoData* FindStartTime(int64_t& aOutStartTime);
   AudioData* DecodeToFirstAudioData();
-  VideoData* DecodeToFirstVideoData();
 
   // This monitor should be taken when reading or writing to mIsChained.
   ReentrantMonitor mMonitor;
 
   // Specialized Reset() method to signal if the seek is
   // to the start of the stream.
   nsresult ResetDecode(bool start);