| 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> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/cancelable_callback.h" | 14 #include "base/cancelable_callback.h" |
| 15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/memory/linked_ptr.h" | 17 #include "base/memory/linked_ptr.h" |
| 18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 19 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
| 20 #include "base/threading/thread.h" | 20 #include "base/threading/thread.h" |
| 21 #include "base/time/default_tick_clock.h" |
| 21 #include "base/timer/elapsed_timer.h" | 22 #include "base/timer/elapsed_timer.h" |
| 22 #include "base/timer/timer.h" | 23 #include "base/timer/timer.h" |
| 23 #include "build/build_config.h" | 24 #include "build/build_config.h" |
| 24 #include "media/base/media_observer.h" | 25 #include "media/base/media_observer.h" |
| 25 #include "media/base/media_tracks.h" | 26 #include "media/base/media_tracks.h" |
| 26 #include "media/base/pipeline_impl.h" | 27 #include "media/base/pipeline_impl.h" |
| 27 #include "media/base/renderer_factory.h" | 28 #include "media/base/renderer_factory.h" |
| 28 #include "media/base/surface_manager.h" | 29 #include "media/base/surface_manager.h" |
| 29 #include "media/base/text_track.h" | 30 #include "media/base/text_track.h" |
| 30 #include "media/blink/buffered_data_source_host_impl.h" | 31 #include "media/blink/buffered_data_source_host_impl.h" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 blink::WebContentDecryptionModule* cdm, | 180 blink::WebContentDecryptionModule* cdm, |
| 180 blink::WebContentDecryptionModuleResult result) override; | 181 blink::WebContentDecryptionModuleResult result) override; |
| 181 | 182 |
| 182 bool supportsOverlayFullscreenVideo() override; | 183 bool supportsOverlayFullscreenVideo() override; |
| 183 void enteredFullscreen() override; | 184 void enteredFullscreen() override; |
| 184 void exitedFullscreen() override; | 185 void exitedFullscreen() override; |
| 185 | 186 |
| 186 // WebMediaPlayerDelegate::Observer implementation. | 187 // WebMediaPlayerDelegate::Observer implementation. |
| 187 void OnHidden() override; | 188 void OnHidden() override; |
| 188 void OnShown() override; | 189 void OnShown() override; |
| 189 void OnSuspendRequested(bool must_suspend) override; | 190 bool OnSuspendRequested(bool must_suspend) override; |
| 190 void OnPlay() override; | 191 void OnPlay() override; |
| 191 void OnPause() override; | 192 void OnPause() override; |
| 192 void OnVolumeMultiplierUpdate(double multiplier) override; | 193 void OnVolumeMultiplierUpdate(double multiplier) override; |
| 193 | 194 |
| 194 #if defined(OS_ANDROID) // WMPI_CAST | 195 #if defined(OS_ANDROID) // WMPI_CAST |
| 195 bool isRemote() const override; | 196 bool isRemote() const override; |
| 196 void requestRemotePlayback() override; | 197 void requestRemotePlayback() override; |
| 197 void requestRemotePlaybackControl() override; | 198 void requestRemotePlaybackControl() override; |
| 198 | 199 |
| 199 void SetMediaPlayerManager( | 200 void SetMediaPlayerManager( |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 base::OneShotTimer background_pause_timer_; | 557 base::OneShotTimer background_pause_timer_; |
| 557 | 558 |
| 558 // Monitors the watch time of the played content. | 559 // Monitors the watch time of the played content. |
| 559 std::unique_ptr<WatchTimeReporter> watch_time_reporter_; | 560 std::unique_ptr<WatchTimeReporter> watch_time_reporter_; |
| 560 bool is_encrypted_; | 561 bool is_encrypted_; |
| 561 | 562 |
| 562 // Number of times we've reached BUFFERING_HAVE_NOTHING during playback. | 563 // Number of times we've reached BUFFERING_HAVE_NOTHING during playback. |
| 563 int underflow_count_; | 564 int underflow_count_; |
| 564 std::unique_ptr<base::ElapsedTimer> underflow_timer_; | 565 std::unique_ptr<base::ElapsedTimer> underflow_timer_; |
| 565 | 566 |
| 567 // The last time didLoadingProgress() returned true. |
| 568 base::TimeTicks last_time_loading_progressed_; |
| 569 |
| 570 std::unique_ptr<base::TickClock> tick_clock_; |
| 571 |
| 566 // Monitors the player events. | 572 // Monitors the player events. |
| 567 base::WeakPtr<MediaObserver> observer_; | 573 base::WeakPtr<MediaObserver> observer_; |
| 568 | 574 |
| 569 // Whether the player is currently in autoplay muted state. | 575 // Whether the player is currently in autoplay muted state. |
| 570 bool autoplay_muted_ = false; | 576 bool autoplay_muted_ = false; |
| 571 | 577 |
| 572 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 578 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
| 573 }; | 579 }; |
| 574 | 580 |
| 575 } // namespace media | 581 } // namespace media |
| 576 | 582 |
| 577 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ | 583 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ |
| OLD | NEW |