Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(619)

Unified Diff: media/blink/webmediaplayer_impl.h

Issue 2810333007: [Video] Record the results of background video optimization checks.
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webmediaplayer_impl.h
diff --git a/media/blink/webmediaplayer_impl.h b/media/blink/webmediaplayer_impl.h
index 5194a7e1ea5c611ce933e6562944b80f3dfd71b5..ec394b8016733124987cb6a964bb7df94ae09dd3 100644
--- a/media/blink/webmediaplayer_impl.h
+++ b/media/blink/webmediaplayer_impl.h
@@ -458,6 +458,33 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
// handling a src= or MSE based playback.
void RecordUnderflowDuration(base::TimeDelta duration);
+ // Indicates why ShouldPauseVideoWhenHidden() or
+ // ShouldDisableVideoWhenHidden() failed or succeeded for metrics recording.
+ // Must be in sync with the MediaBackgroundOptimizationCandidacyResult enum
+ // in histograms.xml.
+ enum BackgroundOptimizationResult {
+ // Was optimized because shorter than the threshold.
+ SUCCESS_FOR_DURATION,
+ // Was optimized because keyframe distance is shorter than the threshold.
+ SUCCESS_FOR_KEYFRAME_DISTANCE,
+ // Was optimized because it doesn't have audio ignoring the threshold.
+ SUCCESS_FOR_VIDEO_ONLY,
+ // Wasn't optimized because keyframe distance is too big.
+ FAIL_FOR_KEYFRAME_DISTANCE,
+ // Wasn't optimized because is being played remotely.
+ FAIL_FOR_REMOTE,
+ // Wasn't optimized because is a streaming video.
+ FAIL_FOR_STREAMING,
+
+ // Must be the last item and set to the previous item's value.
+ RESULT_MAX = FAIL_FOR_STREAMING
+ };
+
+ // Reports the result of each background optimization check.
+ // Figures the right bucket based on whether the video has audio or not.
+ void ReportBackgroundOptimizationResult(
+ BackgroundOptimizationResult result) const;
+
blink::WebLocalFrame* frame_;
// The playback state last reported to |delegate_|, to avoid setting duplicate
« no previous file with comments | « no previous file | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698