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

Side by Side Diff: media/blink/webmediaplayer_impl.cc

Issue 2819323002: Merge M59: "Start reporting watch time if ABR adapts above 200p." (Closed)
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 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 1401 matching lines...) Expand 10 before | Expand all | Expand 10 after
1412 if (rotated_size == pipeline_metadata_.natural_size) 1412 if (rotated_size == pipeline_metadata_.natural_size)
1413 return; 1413 return;
1414 1414
1415 TRACE_EVENT0("media", "WebMediaPlayerImpl::OnNaturalSizeChanged"); 1415 TRACE_EVENT0("media", "WebMediaPlayerImpl::OnNaturalSizeChanged");
1416 media_log_->AddEvent(media_log_->CreateVideoSizeSetEvent( 1416 media_log_->AddEvent(media_log_->CreateVideoSizeSetEvent(
1417 rotated_size.width(), rotated_size.height())); 1417 rotated_size.width(), rotated_size.height()));
1418 1418
1419 if (overlay_enabled_ && surface_manager_) 1419 if (overlay_enabled_ && surface_manager_)
1420 surface_manager_->NaturalSizeChanged(rotated_size); 1420 surface_manager_->NaturalSizeChanged(rotated_size);
1421 1421
1422 gfx::Size old_size = pipeline_metadata_.natural_size;
1423 pipeline_metadata_.natural_size = rotated_size; 1422 pipeline_metadata_.natural_size = rotated_size;
1424 if (old_size.IsEmpty()) { 1423
1425 // WatchTimeReporter doesn't report metrics for empty videos. Re-create 1424 // Re-create |watch_time_reporter_| if we didn't originally know the video
1426 // |watch_time_reporter_| if we didn't originally know the video size. 1425 // size or the previous size was too small for reporting.
1426 if (!watch_time_reporter_->IsSizeLargeEnoughToReportWatchTime())
1427 CreateWatchTimeReporter(); 1427 CreateWatchTimeReporter();
1428 } 1428
1429 client_->SizeChanged(); 1429 client_->SizeChanged();
1430 1430
1431 if (observer_) 1431 if (observer_)
1432 observer_->OnMetadataChanged(pipeline_metadata_); 1432 observer_->OnMetadataChanged(pipeline_metadata_);
1433 } 1433 }
1434 1434
1435 void WebMediaPlayerImpl::OnVideoOpacityChange(bool opaque) { 1435 void WebMediaPlayerImpl::OnVideoOpacityChange(bool opaque) {
1436 DCHECK(main_task_runner_->BelongsToCurrentThread()); 1436 DCHECK(main_task_runner_->BelongsToCurrentThread());
1437 DCHECK_NE(ready_state_, WebMediaPlayer::kReadyStateHaveNothing); 1437 DCHECK_NE(ready_state_, WebMediaPlayer::kReadyStateHaveNothing);
1438 1438
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after
2357 2357
2358 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) { 2358 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) {
2359 DCHECK(data_source_ || chunk_demuxer_); 2359 DCHECK(data_source_ || chunk_demuxer_);
2360 if (data_source_) 2360 if (data_source_)
2361 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration); 2361 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration);
2362 else 2362 else
2363 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration); 2363 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration);
2364 } 2364 }
2365 2365
2366 } // namespace media 2366 } // 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