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