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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
222 }; | 222 }; |
223 | 223 |
224 // Playback state variables computed together in UpdatePlayState(). | 224 // Playback state variables computed together in UpdatePlayState(). |
225 // (Public for testing.) | 225 // (Public for testing.) |
226 struct PlayState { | 226 struct PlayState { |
227 DelegateState delegate_state; | 227 DelegateState delegate_state; |
228 bool is_memory_reporting_enabled; | 228 bool is_memory_reporting_enabled; |
229 bool is_suspended; | 229 bool is_suspended; |
230 }; | 230 }; |
231 | 231 |
232 // Notify that video entered/exited full screen playing back. We may switch | |
233 // the media renderer in these calls. | |
234 void videoEnteredFullscreen() override; | |
235 void videoExitedFullscreen() override; | |
liberato (no reviews please)
2016/08/29 16:49:12
these names are a little confusing with respect to
xjz
2016/09/09 23:13:06
Changed the names to ancestorEntered/exitedFullscr
| |
236 | |
232 private: | 237 private: |
233 friend class WebMediaPlayerImplTest; | 238 friend class WebMediaPlayerImplTest; |
234 | 239 |
235 void EnableOverlay(); | 240 void EnableOverlay(); |
236 void DisableOverlay(); | 241 void DisableOverlay(); |
237 | 242 |
238 void OnPipelineSuspended(); | 243 void OnPipelineSuspended(); |
239 void OnDemuxerOpened(); | 244 void OnDemuxerOpened(); |
240 | 245 |
241 // Pipeline::Client overrides. | 246 // Pipeline::Client overrides. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
342 // using for video playback. Called by |memory_usage_reporting_timer_|. | 347 // using for video playback. Called by |memory_usage_reporting_timer_|. |
343 // Memory usage reporting is done in two steps, because |demuxer_| must be | 348 // Memory usage reporting is done in two steps, because |demuxer_| must be |
344 // accessed on the media thread. | 349 // accessed on the media thread. |
345 void ReportMemoryUsage(); | 350 void ReportMemoryUsage(); |
346 void FinishMemoryUsageReport(int64_t demuxer_memory_usage); | 351 void FinishMemoryUsageReport(int64_t demuxer_memory_usage); |
347 | 352 |
348 // Called during OnHidden() when we want a suspended player to enter the | 353 // Called during OnHidden() when we want a suspended player to enter the |
349 // paused state after some idle timeout. | 354 // paused state after some idle timeout. |
350 void ScheduleIdlePauseTimer(); | 355 void ScheduleIdlePauseTimer(); |
351 | 356 |
357 // Remoter IPC messages handler to indicate mirroring session starts/ends. | |
358 void OnSinkAvailable(); | |
liberato (no reviews please)
2016/08/29 16:49:12
does anybody call these?
xjz
2016/09/09 23:13:06
This is called by Remoter, which is not implemente
| |
359 void OnSinkGone(); | |
360 | |
361 // Switch between the media renderer for local playing back and the remoting | |
362 // media renderer. |is_media_remoting_| should be set accordingly before | |
363 // calling this method. | |
364 void SwitchMediaRenderer(); | |
365 | |
352 blink::WebLocalFrame* frame_; | 366 blink::WebLocalFrame* frame_; |
353 | 367 |
354 // The playback state last reported to |delegate_|, to avoid setting duplicate | 368 // The playback state last reported to |delegate_|, to avoid setting duplicate |
355 // states. (Which can have undesired effects like resetting the idle timer.) | 369 // states. (Which can have undesired effects like resetting the idle timer.) |
356 DelegateState delegate_state_; | 370 DelegateState delegate_state_; |
357 | 371 |
358 // Set when OnSuspendRequested() is called with |must_suspend| unset. | 372 // Set when OnSuspendRequested() is called with |must_suspend| unset. |
359 bool is_idle_; | 373 bool is_idle_; |
360 | 374 |
361 // Set when OnSuspendRequested() is called with |must_suspend| set. | 375 // Set when OnSuspendRequested() is called with |must_suspend| set. |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
528 // OnSuspendRequested() is called. If the state is UNKNOWN, the current frame | 542 // OnSuspendRequested() is called. If the state is UNKNOWN, the current frame |
529 // from the compositor will be queried to see if suspend is supported; the | 543 // from the compositor will be queried to see if suspend is supported; the |
530 // state will be set to YES or NO respectively if a frame is available. | 544 // state will be set to YES or NO respectively if a frame is available. |
531 enum class CanSuspendState { UNKNOWN, YES, NO }; | 545 enum class CanSuspendState { UNKNOWN, YES, NO }; |
532 CanSuspendState can_suspend_state_; | 546 CanSuspendState can_suspend_state_; |
533 | 547 |
534 // Called some-time after OnHidden() if the media was suspended in a playing | 548 // Called some-time after OnHidden() if the media was suspended in a playing |
535 // state as part of the call to OnHidden(). | 549 // state as part of the call to OnHidden(). |
536 base::OneShotTimer background_pause_timer_; | 550 base::OneShotTimer background_pause_timer_; |
537 | 551 |
552 // Indicates whether is in media remoting. | |
553 // TODO(erickung): Use this as an indicator for the RendererType when creating | |
554 // media renderer. | |
555 bool is_media_remoting_; | |
556 | |
557 // Indicates whether is in mirroring or remoting. This is set through the | |
558 // Remoter IPC messages. | |
559 bool is_remote_sink_available_; | |
560 | |
561 // Set this true when demuxer encounters encrypted stream. | |
562 bool is_encrypted_content_; | |
563 | |
564 // Callback used to check whether the remoting CdmFactory is used. | |
565 WebMediaPlayerParams::IsRemoteCdmCB is_remote_cdm_cb_; | |
566 | |
538 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 567 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
539 }; | 568 }; |
540 | 569 |
541 } // namespace media | 570 } // namespace media |
542 | 571 |
543 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ | 572 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ |
OLD | NEW |