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

Unified Diff: media/blink/watch_time_reporter.cc

Issue 2822543006: Start reporting watch time if ABR adapts above 200p. (Closed)
Patch Set: Simplify 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 | « media/blink/watch_time_reporter.h ('k') | media/blink/watch_time_reporter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/watch_time_reporter.cc
diff --git a/media/blink/watch_time_reporter.cc b/media/blink/watch_time_reporter.cc
index f279e9c238cf3abe07986f225a4fb343b8ef0d90..b0127d749181380c611f089bf94ebca97db623f0 100644
--- a/media/blink/watch_time_reporter.cc
+++ b/media/blink/watch_time_reporter.cc
@@ -162,6 +162,11 @@ void WatchTimeReporter::OnHidden() {
MaybeFinalizeWatchTime(FinalizeTime::ON_NEXT_UPDATE);
}
+bool WatchTimeReporter::IsSizeLargeEnoughToReportWatchTime() const {
+ return initial_video_size_.height() >= kMinimumVideoSize.height() &&
+ initial_video_size_.width() >= kMinimumVideoSize.width();
+}
+
void WatchTimeReporter::OnPowerStateChange(bool on_battery_power) {
if (!reporting_timer_.IsRunning())
return;
@@ -184,9 +189,7 @@ bool WatchTimeReporter::ShouldReportWatchTime() {
// Report listen time or watch time only for tracks that are audio-only or
// have both an audio and video track of sufficient size.
return (!has_video_ && has_audio_) ||
- (has_video_ && has_audio_ &&
- initial_video_size_.height() >= kMinimumVideoSize.height() &&
- initial_video_size_.width() >= kMinimumVideoSize.width());
+ (has_video_ && has_audio_ && IsSizeLargeEnoughToReportWatchTime());
}
void WatchTimeReporter::MaybeStartReportingTimer(
« no previous file with comments | « media/blink/watch_time_reporter.h ('k') | media/blink/watch_time_reporter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698