OLD | NEW |
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 2316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2327 base::TimeDelta time_to_first_frame = new_frame_time - foreground_time; | 2327 base::TimeDelta time_to_first_frame = new_frame_time - foreground_time; |
2328 if (HasAudio()) { | 2328 if (HasAudio()) { |
2329 UMA_HISTOGRAM_TIMES( | 2329 UMA_HISTOGRAM_TIMES( |
2330 "Media.Video.TimeFromForegroundToFirstFrame.DisableTrack", | 2330 "Media.Video.TimeFromForegroundToFirstFrame.DisableTrack", |
2331 time_to_first_frame); | 2331 time_to_first_frame); |
2332 } else { | 2332 } else { |
2333 UMA_HISTOGRAM_TIMES("Media.Video.TimeFromForegroundToFirstFrame.Paused", | 2333 UMA_HISTOGRAM_TIMES("Media.Video.TimeFromForegroundToFirstFrame.Paused", |
2334 time_to_first_frame); | 2334 time_to_first_frame); |
2335 } | 2335 } |
2336 } | 2336 } |
2337 void WebMediaPlayerImpl::SwitchRenderer(bool disable_pipeline_auto_suspend) { | 2337 void WebMediaPlayerImpl::SwitchRenderer(bool is_rendered_remotely) { |
2338 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 2338 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
2339 disable_pipeline_auto_suspend_ = disable_pipeline_auto_suspend; | 2339 disable_pipeline_auto_suspend_ = is_rendered_remotely; |
2340 ScheduleRestart(); | 2340 ScheduleRestart(); |
| 2341 if (client_) { |
| 2342 if (is_rendered_remotely) |
| 2343 client_->MediaRemotingStarted(); |
| 2344 else |
| 2345 client_->MediaRemotingStopped(); |
| 2346 } |
2341 } | 2347 } |
2342 | 2348 |
2343 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) { | 2349 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) { |
2344 DCHECK(data_source_ || chunk_demuxer_); | 2350 DCHECK(data_source_ || chunk_demuxer_); |
2345 if (data_source_) | 2351 if (data_source_) |
2346 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration); | 2352 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration); |
2347 else | 2353 else |
2348 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration); | 2354 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration); |
2349 } | 2355 } |
2350 | 2356 |
2351 } // namespace media | 2357 } // namespace media |
OLD | NEW |