OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 wmpi_->pipeline_metadata_.has_video = has_video; | 245 wmpi_->pipeline_metadata_.has_video = has_video; |
246 } | 246 } |
247 | 247 |
248 void OnMetadata(PipelineMetadata metadata) { wmpi_->OnMetadata(metadata); } | 248 void OnMetadata(PipelineMetadata metadata) { wmpi_->OnMetadata(metadata); } |
249 | 249 |
250 void OnVideoNaturalSizeChange(const gfx::Size& size) { | 250 void OnVideoNaturalSizeChange(const gfx::Size& size) { |
251 wmpi_->OnVideoNaturalSizeChange(size); | 251 wmpi_->OnVideoNaturalSizeChange(size); |
252 } | 252 } |
253 | 253 |
254 WebMediaPlayerImpl::PlayState ComputePlayState() { | 254 WebMediaPlayerImpl::PlayState ComputePlayState() { |
255 return wmpi_->UpdatePlayState_ComputePlayState(false, false, false, false); | 255 return wmpi_->UpdatePlayState_ComputePlayState(false, true, false, false); |
256 } | 256 } |
257 | 257 |
258 WebMediaPlayerImpl::PlayState ComputePlayState_FrameHidden() { | 258 WebMediaPlayerImpl::PlayState ComputePlayState_FrameHidden() { |
| 259 return wmpi_->UpdatePlayState_ComputePlayState(false, true, false, true); |
| 260 } |
| 261 |
| 262 WebMediaPlayerImpl::PlayState ComputePlayState_Suspended() { |
| 263 return wmpi_->UpdatePlayState_ComputePlayState(false, true, true, false); |
| 264 } |
| 265 |
| 266 WebMediaPlayerImpl::PlayState ComputePlayState_Remote() { |
| 267 return wmpi_->UpdatePlayState_ComputePlayState(true, true, false, false); |
| 268 } |
| 269 |
| 270 WebMediaPlayerImpl::PlayState ComputePlayState_BackgroundedStreaming() { |
259 return wmpi_->UpdatePlayState_ComputePlayState(false, false, false, true); | 271 return wmpi_->UpdatePlayState_ComputePlayState(false, false, false, true); |
260 } | 272 } |
261 | 273 |
262 WebMediaPlayerImpl::PlayState ComputePlayState_Suspended() { | |
263 return wmpi_->UpdatePlayState_ComputePlayState(false, false, true, false); | |
264 } | |
265 | |
266 WebMediaPlayerImpl::PlayState ComputePlayState_Remote() { | |
267 return wmpi_->UpdatePlayState_ComputePlayState(true, false, false, false); | |
268 } | |
269 | |
270 WebMediaPlayerImpl::PlayState ComputePlayState_BackgroundedStreaming() { | |
271 return wmpi_->UpdatePlayState_ComputePlayState(false, true, false, true); | |
272 } | |
273 | |
274 bool IsSuspended() { return wmpi_->pipeline_controller_.IsSuspended(); } | 274 bool IsSuspended() { return wmpi_->pipeline_controller_.IsSuspended(); } |
275 | 275 |
276 void AddBufferedRanges() { | 276 void AddBufferedRanges() { |
277 wmpi_->buffered_data_source_host_.AddBufferedByteRange(0, 1); | 277 wmpi_->buffered_data_source_host_.AddBufferedByteRange(0, 1); |
278 } | 278 } |
279 | 279 |
280 void SetDelegateState(WebMediaPlayerImpl::DelegateState state) { | 280 void SetDelegateState(WebMediaPlayerImpl::DelegateState state) { |
281 wmpi_->SetDelegateState(state, false); | 281 wmpi_->SetDelegateState(state, false); |
282 } | 282 } |
283 | 283 |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 | 781 |
782 // Average keyframe distance is too big. | 782 // Average keyframe distance is too big. |
783 SetVideoKeyframeDistanceAverage(base::TimeDelta::FromSeconds(100)); | 783 SetVideoKeyframeDistanceAverage(base::TimeDelta::FromSeconds(100)); |
784 SetDuration(base::TimeDelta::FromSeconds(300)); | 784 SetDuration(base::TimeDelta::FromSeconds(300)); |
785 EXPECT_FALSE(IsBackgroundOptimizationCandidate()); | 785 EXPECT_FALSE(IsBackgroundOptimizationCandidate()); |
786 EXPECT_FALSE(ShouldPauseVideoWhenHidden()); | 786 EXPECT_FALSE(ShouldPauseVideoWhenHidden()); |
787 EXPECT_FALSE(ShouldDisableVideoWhenHidden()); | 787 EXPECT_FALSE(ShouldDisableVideoWhenHidden()); |
788 } | 788 } |
789 | 789 |
790 } // namespace media | 790 } // namespace media |
OLD | NEW |