| 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_tracks.h" | 25 #include "media/base/media_tracks.h" |
| 25 #include "media/base/pipeline_impl.h" | 26 #include "media/base/pipeline_impl.h" |
| 26 #include "media/base/renderer_factory.h" | 27 #include "media/base/renderer_factory.h" |
| 27 #include "media/base/surface_manager.h" | 28 #include "media/base/surface_manager.h" |
| 28 #include "media/base/text_track.h" | 29 #include "media/base/text_track.h" |
| 29 #include "media/blink/buffered_data_source_host_impl.h" | 30 #include "media/blink/buffered_data_source_host_impl.h" |
| 30 #include "media/blink/media_blink_export.h" | 31 #include "media/blink/media_blink_export.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 blink::WebContentDecryptionModule* cdm, | 179 blink::WebContentDecryptionModule* cdm, |
| 179 blink::WebContentDecryptionModuleResult result) override; | 180 blink::WebContentDecryptionModuleResult result) override; |
| 180 | 181 |
| 181 bool supportsOverlayFullscreenVideo() override; | 182 bool supportsOverlayFullscreenVideo() override; |
| 182 void enteredFullscreen() override; | 183 void enteredFullscreen() override; |
| 183 void exitedFullscreen() override; | 184 void exitedFullscreen() override; |
| 184 | 185 |
| 185 // WebMediaPlayerDelegate::Observer implementation. | 186 // WebMediaPlayerDelegate::Observer implementation. |
| 186 void OnHidden() override; | 187 void OnHidden() override; |
| 187 void OnShown() override; | 188 void OnShown() override; |
| 188 void OnSuspendRequested(bool must_suspend) override; | 189 bool OnSuspendRequested(bool must_suspend) override; |
| 189 void OnPlay() override; | 190 void OnPlay() override; |
| 190 void OnPause() override; | 191 void OnPause() override; |
| 191 void OnVolumeMultiplierUpdate(double multiplier) override; | 192 void OnVolumeMultiplierUpdate(double multiplier) override; |
| 192 | 193 |
| 193 #if defined(OS_ANDROID) // WMPI_CAST | 194 #if defined(OS_ANDROID) // WMPI_CAST |
| 194 bool isRemote() const override; | 195 bool isRemote() const override; |
| 195 void requestRemotePlayback() override; | 196 void requestRemotePlayback() override; |
| 196 void requestRemotePlaybackControl() override; | 197 void requestRemotePlaybackControl() override; |
| 197 | 198 |
| 198 void SetMediaPlayerManager( | 199 void SetMediaPlayerManager( |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 base::OneShotTimer background_pause_timer_; | 548 base::OneShotTimer background_pause_timer_; |
| 548 | 549 |
| 549 // Monitors the watch time of the played content. | 550 // Monitors the watch time of the played content. |
| 550 std::unique_ptr<WatchTimeReporter> watch_time_reporter_; | 551 std::unique_ptr<WatchTimeReporter> watch_time_reporter_; |
| 551 bool is_encrypted_; | 552 bool is_encrypted_; |
| 552 | 553 |
| 553 // Number of times we've reached BUFFERING_HAVE_NOTHING during playback. | 554 // Number of times we've reached BUFFERING_HAVE_NOTHING during playback. |
| 554 int underflow_count_; | 555 int underflow_count_; |
| 555 std::unique_ptr<base::ElapsedTimer> underflow_timer_; | 556 std::unique_ptr<base::ElapsedTimer> underflow_timer_; |
| 556 | 557 |
| 558 // The last time didLoadingProgress() returned true. |
| 559 base::TimeTicks last_time_loading_progressed_; |
| 560 |
| 561 std::unique_ptr<base::TickClock> tick_clock_; |
| 562 |
| 557 // Whether the player is currently in autoplay muted state. | 563 // Whether the player is currently in autoplay muted state. |
| 558 bool autoplay_muted_ = false; | 564 bool autoplay_muted_ = false; |
| 559 | 565 |
| 560 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 566 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
| 561 }; | 567 }; |
| 562 | 568 |
| 563 } // namespace media | 569 } // namespace media |
| 564 | 570 |
| 565 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ | 571 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ |
| OLD | NEW |