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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
226 // (Public for testing.) | 226 // (Public for testing.) |
227 struct PlayState { | 227 struct PlayState { |
228 DelegateState delegate_state; | 228 DelegateState delegate_state; |
229 bool is_memory_reporting_enabled; | 229 bool is_memory_reporting_enabled; |
230 bool is_suspended; | 230 bool is_suspended; |
231 }; | 231 }; |
232 | 232 |
233 private: | 233 private: |
234 friend class WebMediaPlayerImplTest; | 234 friend class WebMediaPlayerImplTest; |
235 | 235 |
236 void EnableOverlay(); | |
237 void DisableOverlay(); | |
liberato (no reviews please)
2016/07/18 20:19:58
EnableOverlay actually allocates the overlay, but
AndyWu
2016/07/18 22:21:49
Done, thanks a lot.
| |
238 | |
236 void OnPipelineSuspended(); | 239 void OnPipelineSuspended(); |
237 void OnDemuxerOpened(); | 240 void OnDemuxerOpened(); |
238 | 241 |
239 // Pipeline::Client overrides. | 242 // Pipeline::Client overrides. |
240 void OnError(PipelineStatus status) override; | 243 void OnError(PipelineStatus status) override; |
241 void OnEnded() override; | 244 void OnEnded() override; |
242 void OnMetadata(PipelineMetadata metadata) override; | 245 void OnMetadata(PipelineMetadata metadata) override; |
243 void OnBufferingStateChange(BufferingState state) override; | 246 void OnBufferingStateChange(BufferingState state) override; |
244 void OnDurationChange() override; | 247 void OnDurationChange() override; |
245 void OnAddTextTrack(const TextTrackConfig& config, | 248 void OnAddTextTrack(const TextTrackConfig& config, |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
423 bool pending_suspend_resume_cycle_; | 426 bool pending_suspend_resume_cycle_; |
424 | 427 |
425 // TODO(scherkus): Replace with an explicit ended signal to HTMLMediaElement, | 428 // TODO(scherkus): Replace with an explicit ended signal to HTMLMediaElement, |
426 // see http://crbug.com/409280 | 429 // see http://crbug.com/409280 |
427 bool ended_; | 430 bool ended_; |
428 | 431 |
429 // Tracks whether to issue time changed notifications during buffering state | 432 // Tracks whether to issue time changed notifications during buffering state |
430 // changes. | 433 // changes. |
431 bool should_notify_time_changed_; | 434 bool should_notify_time_changed_; |
432 | 435 |
433 bool fullscreen_; | 436 bool overlay_enabled_; |
434 | 437 |
435 // Whether the current decoder requires a restart on fullscreen transitions. | 438 // Whether the current decoder requires a restart on fullscreen transitions. |
436 bool decoder_requires_restart_for_fullscreen_; | 439 bool decoder_requires_restart_for_fullscreen_; |
437 | 440 |
438 blink::WebMediaPlayerClient* client_; | 441 blink::WebMediaPlayerClient* client_; |
439 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client_; | 442 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client_; |
440 | 443 |
441 // WebMediaPlayer notifies the |delegate_| of playback state changes using | 444 // WebMediaPlayer notifies the |delegate_| of playback state changes using |
442 // |delegate_id_|; an id provided after registering with the delegate. The | 445 // |delegate_id_|; an id provided after registering with the delegate. The |
443 // WebMediaPlayer may also receive directives (play, pause) from the delegate | 446 // WebMediaPlayer may also receive directives (play, pause) from the delegate |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
499 | 502 |
500 std::unique_ptr<RendererFactory> renderer_factory_; | 503 std::unique_ptr<RendererFactory> renderer_factory_; |
501 | 504 |
502 // For requesting surfaces on behalf of the Android H/W decoder in fullscreen. | 505 // For requesting surfaces on behalf of the Android H/W decoder in fullscreen. |
503 // This will be null everywhere but Android. | 506 // This will be null everywhere but Android. |
504 SurfaceManager* surface_manager_; | 507 SurfaceManager* surface_manager_; |
505 | 508 |
506 // For canceling ongoing surface creation requests when exiting fullscreen. | 509 // For canceling ongoing surface creation requests when exiting fullscreen. |
507 base::CancelableCallback<void(int)> surface_created_cb_; | 510 base::CancelableCallback<void(int)> surface_created_cb_; |
508 | 511 |
509 // The current fullscreen surface id. Populated while in fullscreen once the | 512 // The current overlay surface id. Populated while in fullscreen once the |
510 // surface is created. | 513 // surface is created. |
511 int fullscreen_surface_id_; | 514 int overlay_surface_id_; |
512 | 515 |
513 // If a surface is requested before it's finished being created, the request | 516 // If a surface is requested before it's finished being created, the request |
514 // is saved and satisfied once the surface is available. | 517 // is saved and satisfied once the surface is available. |
515 SurfaceCreatedCB pending_surface_request_cb_; | 518 SurfaceCreatedCB pending_surface_request_cb_; |
516 | 519 |
520 bool use_overlay_only_; | |
liberato (no reviews please)
2016/07/18 20:19:58
please comment. also, since it's just a cached co
AndyWu
2016/07/18 22:21:50
Done, thanks.
| |
521 | |
517 // Suppresses calls to OnPipelineError() after destruction / shutdown has been | 522 // Suppresses calls to OnPipelineError() after destruction / shutdown has been |
518 // started; prevents us from spuriously logging errors that are transient or | 523 // started; prevents us from spuriously logging errors that are transient or |
519 // unimportant. | 524 // unimportant. |
520 bool suppress_destruction_errors_; | 525 bool suppress_destruction_errors_; |
521 | 526 |
522 // State indicating if it's okay to suspend or not. Updated on the first time | 527 // State indicating if it's okay to suspend or not. Updated on the first time |
523 // OnSuspendRequested() is called. If the state is UNKNOWN, the current frame | 528 // OnSuspendRequested() is called. If the state is UNKNOWN, the current frame |
524 // from the compositor will be queried to see if suspend is supported; the | 529 // from the compositor will be queried to see if suspend is supported; the |
525 // state will be set to YES or NO respectively if a frame is available. | 530 // state will be set to YES or NO respectively if a frame is available. |
526 enum class CanSuspendState { UNKNOWN, YES, NO }; | 531 enum class CanSuspendState { UNKNOWN, YES, NO }; |
527 CanSuspendState can_suspend_state_; | 532 CanSuspendState can_suspend_state_; |
528 | 533 |
529 // Called some-time after OnHidden() if the media was suspended in a playing | 534 // Called some-time after OnHidden() if the media was suspended in a playing |
530 // state as part of the call to OnHidden(). | 535 // state as part of the call to OnHidden(). |
531 base::OneShotTimer background_pause_timer_; | 536 base::OneShotTimer background_pause_timer_; |
532 | 537 |
533 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 538 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
534 }; | 539 }; |
535 | 540 |
536 } // namespace media | 541 } // namespace media |
537 | 542 |
538 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ | 543 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ |
OLD | NEW |