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 2299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2310 base::TimeDelta time_to_first_frame = new_frame_time - foreground_time; | 2310 base::TimeDelta time_to_first_frame = new_frame_time - foreground_time; |
2311 if (hasAudio()) { | 2311 if (hasAudio()) { |
2312 UMA_HISTOGRAM_TIMES( | 2312 UMA_HISTOGRAM_TIMES( |
2313 "Media.Video.TimeFromForegroundToFirstFrame.DisableTrack", | 2313 "Media.Video.TimeFromForegroundToFirstFrame.DisableTrack", |
2314 time_to_first_frame); | 2314 time_to_first_frame); |
2315 } else { | 2315 } else { |
2316 UMA_HISTOGRAM_TIMES("Media.Video.TimeFromForegroundToFirstFrame.Paused", | 2316 UMA_HISTOGRAM_TIMES("Media.Video.TimeFromForegroundToFirstFrame.Paused", |
2317 time_to_first_frame); | 2317 time_to_first_frame); |
2318 } | 2318 } |
2319 } | 2319 } |
2320 void WebMediaPlayerImpl::SwitchRenderer(bool disable_pipeline_auto_suspend) { | 2320 void WebMediaPlayerImpl::SwitchRenderer(bool is_rendered_remotely) { |
2321 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 2321 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
2322 disable_pipeline_auto_suspend_ = disable_pipeline_auto_suspend; | 2322 disable_pipeline_auto_suspend_ = is_rendered_remotely; |
2323 ScheduleRestart(); | 2323 ScheduleRestart(); |
| 2324 if (client_) { |
| 2325 if (is_rendered_remotely) |
| 2326 client_->mediaRemotingStarted(); |
| 2327 else |
| 2328 client_->mediaRemotingStopped(); |
| 2329 } |
2324 } | 2330 } |
2325 | 2331 |
2326 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) { | 2332 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) { |
2327 DCHECK(data_source_ || chunk_demuxer_); | 2333 DCHECK(data_source_ || chunk_demuxer_); |
2328 if (data_source_) | 2334 if (data_source_) |
2329 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration); | 2335 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration); |
2330 else | 2336 else |
2331 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration); | 2337 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration); |
2332 } | 2338 } |
2333 | 2339 |
2334 } // namespace media | 2340 } // namespace media |
OLD | NEW |