Bug 1139781 - Implement VideoPlaybackQuality for MediaCodecReader. r=cpearce
authorBenjamin Chen <bechen@mozilla.com>
Thu, 26 Mar 2015 17:06:06 +0800
changeset 266327 288a5197ce2a7bd51682ff009a12a9e830bd3b0e
parent 266326 3604d6055fe5404560cbc2b9c47e1cbb93f24bac
child 266328 37b979f090551cdd29e3f7a5120c22c05224e268
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1139781
milestone39.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 1139781 - Implement VideoPlaybackQuality for MediaCodecReader. r=cpearce
dom/media/omx/MediaCodecReader.cpp
--- a/dom/media/omx/MediaCodecReader.cpp
+++ b/dom/media/omx/MediaCodecReader.cpp
@@ -1001,16 +1001,18 @@ MediaCodecReader::DecodeVideoFrameSync(i
                             1, // We don't know the duration.
                             b,
                             bufferInfo.mFlags & MediaCodec::BUFFER_FLAG_SYNCFRAME,
                             -1,
                             mVideoTrack.mRelativePictureRect);
     }
 
     if (v) {
+      // Notify mDecoder that we have decoded a video frame.
+      mDecoder->NotifyDecodedFrames(0, 1, 0);
       VideoQueue().Push(v);
     } else {
       NS_WARNING("Unable to create VideoData");
     }
   }
 
   if ((bufferInfo.mFlags & MediaCodec::BUFFER_FLAG_EOS) ||
       (status == ERROR_END_OF_STREAM)) {
@@ -1812,16 +1814,20 @@ MediaCodecReader::GetCodecOutputData(Tra
         (info.mFlags & MediaCodec::BUFFER_FLAG_EOS)) {
       aBuffer = info;
       aBuffer.mBuffer = aTrack.mOutputBuffers[info.mIndex];
       aTrack.mOutputEndOfStream = true;
       return ERROR_END_OF_STREAM;
     }
 
     if (status == OK) {
+      // Notify mDecoder that we have parsed a video frame.
+      if (&aTrack == &mVideoTrack) {
+        mDecoder->NotifyDecodedFrames(1, 0, 0);
+      }
       if (!IsValidTimestampUs(aThreshold) || info.mTimeUs >= aThreshold) {
         // Get a valid output buffer.
         break;
       } else {
         aTrack.mCodec->releaseOutputBuffer(info.mIndex);
       }
     } else if (status == INFO_OUTPUT_BUFFERS_CHANGED) {
       // Update output buffers of MediaCodec.