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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 void SetMediaPlayerManager( | 198 void SetMediaPlayerManager( |
199 RendererMediaPlayerManagerInterface* media_player_manager); | 199 RendererMediaPlayerManagerInterface* media_player_manager); |
200 void OnRemotePlaybackEnded(); | 200 void OnRemotePlaybackEnded(); |
201 void OnDisconnectedFromRemoteDevice(double t); | 201 void OnDisconnectedFromRemoteDevice(double t); |
202 void SuspendForRemote(); | 202 void SuspendForRemote(); |
203 void DisplayCastFrameAfterSuspend(const scoped_refptr<VideoFrame>& new_frame, | 203 void DisplayCastFrameAfterSuspend(const scoped_refptr<VideoFrame>& new_frame, |
204 PipelineStatus status); | 204 PipelineStatus status); |
205 gfx::Size GetCanvasSize() const; | 205 gfx::Size GetCanvasSize() const; |
206 void SetDeviceScaleFactor(float scale_factor); | 206 void SetDeviceScaleFactor(float scale_factor); |
207 void setPoster(const blink::WebURL& poster) override; | 207 void setPoster(const blink::WebURL& poster) override; |
| 208 void SetUseFallbackPath(bool use_fallback_path); |
208 #endif | 209 #endif |
209 | 210 |
210 // Called from WebMediaPlayerCast. | 211 // Called from WebMediaPlayerCast. |
211 // TODO(hubbe): WMPI_CAST make private. | 212 // TODO(hubbe): WMPI_CAST make private. |
212 void OnPipelineSeeked(bool time_updated); | 213 void OnPipelineSeeked(bool time_updated); |
213 | 214 |
214 // Distinct states that |delegate_| can be in. | 215 // Distinct states that |delegate_| can be in. |
215 // TODO(sandersd): This should move into WebMediaPlayerDelegate. | 216 // TODO(sandersd): This should move into WebMediaPlayerDelegate. |
216 // (Public for testing.) | 217 // (Public for testing.) |
217 enum class DelegateState { | 218 enum class DelegateState { |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 // unimportant. | 536 // unimportant. |
536 bool suppress_destruction_errors_; | 537 bool suppress_destruction_errors_; |
537 | 538 |
538 // State indicating if it's okay to suspend or not. Updated on the first time | 539 // State indicating if it's okay to suspend or not. Updated on the first time |
539 // OnSuspendRequested() is called. If the state is UNKNOWN, the current frame | 540 // OnSuspendRequested() is called. If the state is UNKNOWN, the current frame |
540 // from the compositor will be queried to see if suspend is supported; the | 541 // from the compositor will be queried to see if suspend is supported; the |
541 // state will be set to YES or NO respectively if a frame is available. | 542 // state will be set to YES or NO respectively if a frame is available. |
542 enum class CanSuspendState { UNKNOWN, YES, NO }; | 543 enum class CanSuspendState { UNKNOWN, YES, NO }; |
543 CanSuspendState can_suspend_state_; | 544 CanSuspendState can_suspend_state_; |
544 | 545 |
| 546 // Used for HLS playback and in certain fallback paths (e.g. on older devices |
| 547 // that can't support the unified media pipeline). |
| 548 GURL fallback_url_; |
| 549 bool use_fallback_path_; |
| 550 |
545 // Called some-time after OnHidden() if the media was suspended in a playing | 551 // Called some-time after OnHidden() if the media was suspended in a playing |
546 // state as part of the call to OnHidden(). | 552 // state as part of the call to OnHidden(). |
547 base::OneShotTimer background_pause_timer_; | 553 base::OneShotTimer background_pause_timer_; |
548 | 554 |
549 // Monitors the watch time of the played content. | 555 // Monitors the watch time of the played content. |
550 std::unique_ptr<WatchTimeReporter> watch_time_reporter_; | 556 std::unique_ptr<WatchTimeReporter> watch_time_reporter_; |
551 bool is_encrypted_; | 557 bool is_encrypted_; |
552 | 558 |
553 // Number of times we've reached BUFFERING_HAVE_NOTHING during playback. | 559 // Number of times we've reached BUFFERING_HAVE_NOTHING during playback. |
554 int underflow_count_; | 560 int underflow_count_; |
555 std::unique_ptr<base::ElapsedTimer> underflow_timer_; | 561 std::unique_ptr<base::ElapsedTimer> underflow_timer_; |
556 | 562 |
557 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 563 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
558 }; | 564 }; |
559 | 565 |
560 } // namespace media | 566 } // namespace media |
561 | 567 |
562 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ | 568 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ |
OLD | NEW |