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

Side by Side Diff: media/blink/webmediaplayer_impl.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 unified diff | Download patch
« no previous file with comments | « media/blink/watch_time_reporter_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/blink/webmediaplayer_impl.h" 5 #include "media/blink/webmediaplayer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 #include <string> 10 #include <string>
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 if (rotated_size == pipeline_metadata_.natural_size) 1414 if (rotated_size == pipeline_metadata_.natural_size)
1415 return; 1415 return;
1416 1416
1417 TRACE_EVENT0("media", "WebMediaPlayerImpl::OnNaturalSizeChanged"); 1417 TRACE_EVENT0("media", "WebMediaPlayerImpl::OnNaturalSizeChanged");
1418 media_log_->AddEvent(media_log_->CreateVideoSizeSetEvent( 1418 media_log_->AddEvent(media_log_->CreateVideoSizeSetEvent(
1419 rotated_size.width(), rotated_size.height())); 1419 rotated_size.width(), rotated_size.height()));
1420 1420
1421 if (overlay_enabled_ && surface_manager_) 1421 if (overlay_enabled_ && surface_manager_)
1422 surface_manager_->NaturalSizeChanged(rotated_size); 1422 surface_manager_->NaturalSizeChanged(rotated_size);
1423 1423
1424 gfx::Size old_size = pipeline_metadata_.natural_size;
1425 pipeline_metadata_.natural_size = rotated_size; 1424 pipeline_metadata_.natural_size = rotated_size;
1426 if (old_size.IsEmpty()) { 1425
1427 // WatchTimeReporter doesn't report metrics for empty videos. Re-create 1426 // Re-create |watch_time_reporter_| if we didn't originally know the video
1428 // |watch_time_reporter_| if we didn't originally know the video size. 1427 // size or the previous size was too small for reporting.
1428 if (!watch_time_reporter_->IsSizeLargeEnoughToReportWatchTime())
1429 CreateWatchTimeReporter(); 1429 CreateWatchTimeReporter();
1430 } 1430
1431 client_->SizeChanged(); 1431 client_->SizeChanged();
1432 1432
1433 if (observer_) 1433 if (observer_)
1434 observer_->OnMetadataChanged(pipeline_metadata_); 1434 observer_->OnMetadataChanged(pipeline_metadata_);
1435 } 1435 }
1436 1436
1437 void WebMediaPlayerImpl::OnVideoOpacityChange(bool opaque) { 1437 void WebMediaPlayerImpl::OnVideoOpacityChange(bool opaque) {
1438 DCHECK(main_task_runner_->BelongsToCurrentThread()); 1438 DCHECK(main_task_runner_->BelongsToCurrentThread());
1439 DCHECK_NE(ready_state_, WebMediaPlayer::kReadyStateHaveNothing); 1439 DCHECK_NE(ready_state_, WebMediaPlayer::kReadyStateHaveNothing);
1440 1440
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after
2359 2359
2360 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) { 2360 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) {
2361 DCHECK(data_source_ || chunk_demuxer_); 2361 DCHECK(data_source_ || chunk_demuxer_);
2362 if (data_source_) 2362 if (data_source_)
2363 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration); 2363 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration);
2364 else 2364 else
2365 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration); 2365 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration);
2366 } 2366 }
2367 2367
2368 } // namespace media 2368 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/watch_time_reporter_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698