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 #ifndef MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ | 5 #ifndef MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ |
6 #define MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ | 6 #define MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 | 383 |
384 // Whether the video track should be disabled when hidden. Uses metadata so | 384 // Whether the video track should be disabled when hidden. Uses metadata so |
385 // has meaning only after the pipeline has started, otherwise returns false. | 385 // has meaning only after the pipeline has started, otherwise returns false. |
386 bool ShouldDisableVideoWhenHidden() const; | 386 bool ShouldDisableVideoWhenHidden() const; |
387 | 387 |
388 // Whether the video is suitable for background playback optimizations (either | 388 // Whether the video is suitable for background playback optimizations (either |
389 // pausing it or disabling the video track). Uses metadata so has meaning only | 389 // pausing it or disabling the video track). Uses metadata so has meaning only |
390 // after the pipeline has started, otherwise returns false. | 390 // after the pipeline has started, otherwise returns false. |
391 bool IsBackgroundOptimizationCandidate() const; | 391 bool IsBackgroundOptimizationCandidate() const; |
392 | 392 |
| 393 // Pauses a hidden video only player to save power if possible. |
| 394 // Must be called when either of the following happens: |
| 395 // - right after the video was hidden, |
| 396 // - right ater the pipeline has resumed if the video is hidden. |
| 397 void PauseVideoIfNeeded(); |
| 398 |
393 // Disables the video track to save power if possible. | 399 // Disables the video track to save power if possible. |
394 // Must be called when either of the following happens: | 400 // Must be called when either of the following happens: |
395 // - right after the video was hidden, | 401 // - right after the video was hidden, |
396 // - right after the pipeline has started (|seeking_| is used to detect the | 402 // - right after the pipeline has started (|seeking_| is used to detect the |
397 // when pipeline started) if the video is hidden, | 403 // when pipeline started) if the video is hidden, |
398 // - right ater the pipeline has resumed if the video is hidden. | 404 // - right ater the pipeline has resumed if the video is hidden. |
399 void DisableVideoTrackIfNeeded(); | 405 void DisableVideoTrackIfNeeded(); |
400 | 406 |
401 // Enables the video track if it was disabled before to save power. | 407 // Enables the video track if it was disabled before to save power. |
402 // Must be called when either of the following happens: | 408 // Must be called when either of the following happens: |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 | 669 |
664 // Pipeline media duration overridden by tests. | 670 // Pipeline media duration overridden by tests. |
665 base::Optional<base::TimeDelta> pipeline_media_duration_for_test_; | 671 base::Optional<base::TimeDelta> pipeline_media_duration_for_test_; |
666 | 672 |
667 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 673 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
668 }; | 674 }; |
669 | 675 |
670 } // namespace media | 676 } // namespace media |
671 | 677 |
672 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ | 678 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ |
OLD | NEW |