| 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 2131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2142 // Don't change video track while the pipeline is resuming or seeking. | 2142 // Don't change video track while the pipeline is resuming or seeking. |
| 2143 if (is_pipeline_resuming_ || seeking_) | 2143 if (is_pipeline_resuming_ || seeking_) |
| 2144 return; | 2144 return; |
| 2145 | 2145 |
| 2146 if (!video_track_disabled_ && ShouldDisableVideoWhenHidden()) { | 2146 if (!video_track_disabled_ && ShouldDisableVideoWhenHidden()) { |
| 2147 video_track_disabled_ = true; | 2147 video_track_disabled_ = true; |
| 2148 selectedVideoTrackChanged(nullptr); | 2148 selectedVideoTrackChanged(nullptr); |
| 2149 } | 2149 } |
| 2150 } | 2150 } |
| 2151 | 2151 |
| 2152 void WebMediaPlayerImpl::SetMaxKeyframeDistanceToDisableBackgroundVideo( |
| 2153 base::TimeDelta distance) { |
| 2154 max_keyframe_distance_to_disable_background_video_ = distance; |
| 2155 } |
| 2156 |
| 2152 void WebMediaPlayerImpl::SetPipelineStatisticsForTest( | 2157 void WebMediaPlayerImpl::SetPipelineStatisticsForTest( |
| 2153 const PipelineStatistics& stats) { | 2158 const PipelineStatistics& stats) { |
| 2154 pipeline_statistics_for_test_ = base::make_optional(stats); | 2159 pipeline_statistics_for_test_ = base::make_optional(stats); |
| 2155 } | 2160 } |
| 2156 | 2161 |
| 2157 PipelineStatistics WebMediaPlayerImpl::GetPipelineStatistics() const { | 2162 PipelineStatistics WebMediaPlayerImpl::GetPipelineStatistics() const { |
| 2158 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 2163 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 2159 | 2164 |
| 2160 return pipeline_statistics_for_test_.value_or(pipeline_.GetStatistics()); | 2165 return pipeline_statistics_for_test_.value_or(pipeline_.GetStatistics()); |
| 2161 } | 2166 } |
| 2162 | 2167 |
| 2163 } // namespace media | 2168 } // namespace media |
| OLD | NEW |