Bug 1295831 - Report VIDEO_INTER_KEYFRAME_MAX_MS=0 when only 1 keyframe - r=kaku
authorGerald Squelart <gsquelart@mozilla.com>
Thu, 18 Aug 2016 11:54:00 +1000
changeset 309967 c592e44da5f31eeaca861e6e1af75b6ed2c9fe59
parent 309966 5576171f46151b38996fc96ff150ef311ddcc387
child 309968 f90d73ed026973d4e442d1711eede5626bc9cf01
push id31515
push usergsquelart@mozilla.com
push dateThu, 18 Aug 2016 21:35:42 +0000
treeherderautoland@c592e44da5f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskaku
bugs1295831
milestone51.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 1295831 - Report VIDEO_INTER_KEYFRAME_MAX_MS=0 when only 1 keyframe - r=kaku We will now record '0' in VIDEO_INTER_KEYFRAME_MAX_MS when only one keyframe is found when playing a video (played for at least enough time to be eligible for video-decode-suspend feature.) MozReview-Commit-ID: ALDmSYxs2f1
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -3220,16 +3220,31 @@ HTMLMediaElement::ReportTelemetry()
         Telemetry::Accumulate(Telemetry::VIDEO_INTER_KEYFRAME_MAX_MS,
                               key,
                               max_ms);
         Telemetry::Accumulate(Telemetry::VIDEO_INTER_KEYFRAME_MAX_MS,
                               NS_LITERAL_CSTRING("All"),
                               max_ms);
         LOG(LogLevel::Debug, ("%p VIDEO_INTER_KEYFRAME_MAX_MS = %u, keys: '%s' and 'All'",
                               this, max_ms, key.get()));
+      } else {
+        // Here, we have played *some* of the video, but didn't get more than 1
+        // keyframe. Report '0' if we have played for longer than the video-
+        // decode-suspend delay (showing recovery would be difficult).
+        uint32_t suspendDelay_ms = MediaPrefs::MDSMSuspendBackgroundVideoDelay();
+        if (uint32_t(playTime * 1000.0) > suspendDelay_ms) {
+          Telemetry::Accumulate(Telemetry::VIDEO_INTER_KEYFRAME_MAX_MS,
+                                key,
+                                0);
+          Telemetry::Accumulate(Telemetry::VIDEO_INTER_KEYFRAME_MAX_MS,
+                                NS_LITERAL_CSTRING("All"),
+                                0);
+          LOG(LogLevel::Debug, ("%p VIDEO_INTER_KEYFRAME_MAX_MS = 0 (only 1 keyframe), keys: '%s' and 'All'",
+                                this, key.get()));
+        }
       }
     }
   }
 }
 
 void HTMLMediaElement::UnbindFromTree(bool aDeep,
                                       bool aNullParent)
 {