| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // The canonical implementation of blink::WebMediaPlayer that's backed by | 83 // The canonical implementation of blink::WebMediaPlayer that's backed by |
| 84 // Pipeline. Handles normal resource loading, Media Source, and | 84 // Pipeline. Handles normal resource loading, Media Source, and |
| 85 // Encrypted Media. | 85 // Encrypted Media. |
| 86 class MEDIA_BLINK_EXPORT WebMediaPlayerImpl | 86 class MEDIA_BLINK_EXPORT WebMediaPlayerImpl |
| 87 : public NON_EXPORTED_BASE(blink::WebMediaPlayer), | 87 : public NON_EXPORTED_BASE(blink::WebMediaPlayer), |
| 88 public NON_EXPORTED_BASE(WebMediaPlayerDelegate::Observer), | 88 public NON_EXPORTED_BASE(WebMediaPlayerDelegate::Observer), |
| 89 public NON_EXPORTED_BASE(Pipeline::Client), | 89 public NON_EXPORTED_BASE(Pipeline::Client), |
| 90 public base::SupportsWeakPtr<WebMediaPlayerImpl> { | 90 public base::SupportsWeakPtr<WebMediaPlayerImpl> { |
| 91 public: | 91 public: |
| 92 // Constructs a WebMediaPlayer implementation using Chromium's media stack. | 92 // Constructs a WebMediaPlayer implementation using Chromium's media stack. |
| 93 // |delegate| may be null. |renderer_factory| must not be null. | 93 // |delegate| and |renderer_factory| must not be null. |
| 94 WebMediaPlayerImpl( | 94 WebMediaPlayerImpl( |
| 95 blink::WebLocalFrame* frame, | 95 blink::WebLocalFrame* frame, |
| 96 blink::WebMediaPlayerClient* client, | 96 blink::WebMediaPlayerClient* client, |
| 97 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client, | 97 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client, |
| 98 base::WeakPtr<WebMediaPlayerDelegate> delegate, | 98 WebMediaPlayerDelegate* delegate, |
| 99 std::unique_ptr<RendererFactory> renderer_factory, | 99 std::unique_ptr<RendererFactory> renderer_factory, |
| 100 linked_ptr<UrlIndex> url_index, | 100 linked_ptr<UrlIndex> url_index, |
| 101 const WebMediaPlayerParams& params); | 101 const WebMediaPlayerParams& params); |
| 102 ~WebMediaPlayerImpl() override; | 102 ~WebMediaPlayerImpl() override; |
| 103 | 103 |
| 104 void load(LoadType load_type, | 104 void load(LoadType load_type, |
| 105 const blink::WebMediaPlayerSource& source, | 105 const blink::WebMediaPlayerSource& source, |
| 106 CORSMode cors_mode) override; | 106 CORSMode cors_mode) override; |
| 107 | 107 |
| 108 // Playback controls. | 108 // Playback controls. |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 // Whether the current decoder requires a restart on overlay transitions. | 499 // Whether the current decoder requires a restart on overlay transitions. |
| 500 bool decoder_requires_restart_for_overlay_; | 500 bool decoder_requires_restart_for_overlay_; |
| 501 | 501 |
| 502 blink::WebMediaPlayerClient* client_; | 502 blink::WebMediaPlayerClient* client_; |
| 503 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client_; | 503 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client_; |
| 504 | 504 |
| 505 // WebMediaPlayer notifies the |delegate_| of playback state changes using | 505 // WebMediaPlayer notifies the |delegate_| of playback state changes using |
| 506 // |delegate_id_|; an id provided after registering with the delegate. The | 506 // |delegate_id_|; an id provided after registering with the delegate. The |
| 507 // WebMediaPlayer may also receive directives (play, pause) from the delegate | 507 // WebMediaPlayer may also receive directives (play, pause) from the delegate |
| 508 // via the WebMediaPlayerDelegate::Observer interface after registration. | 508 // via the WebMediaPlayerDelegate::Observer interface after registration. |
| 509 base::WeakPtr<WebMediaPlayerDelegate> delegate_; | 509 WebMediaPlayerDelegate* delegate_; |
| 510 int delegate_id_; | 510 int delegate_id_; |
| 511 | 511 |
| 512 WebMediaPlayerParams::DeferLoadCB defer_load_cb_; | 512 WebMediaPlayerParams::DeferLoadCB defer_load_cb_; |
| 513 WebMediaPlayerParams::Context3DCB context_3d_cb_; | 513 WebMediaPlayerParams::Context3DCB context_3d_cb_; |
| 514 | 514 |
| 515 // Members for notifying upstream clients about internal memory usage. The | 515 // Members for notifying upstream clients about internal memory usage. The |
| 516 // |adjust_allocated_memory_cb_| must only be called on |main_task_runner_|. | 516 // |adjust_allocated_memory_cb_| must only be called on |main_task_runner_|. |
| 517 base::RepeatingTimer memory_usage_reporting_timer_; | 517 base::RepeatingTimer memory_usage_reporting_timer_; |
| 518 WebMediaPlayerParams::AdjustAllocatedMemoryCB adjust_allocated_memory_cb_; | 518 WebMediaPlayerParams::AdjustAllocatedMemoryCB adjust_allocated_memory_cb_; |
| 519 int64_t last_reported_memory_usage_; | 519 int64_t last_reported_memory_usage_; |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 | 650 |
| 651 // Pipeline statistics overridden by tests. | 651 // Pipeline statistics overridden by tests. |
| 652 base::Optional<PipelineStatistics> pipeline_statistics_for_test_; | 652 base::Optional<PipelineStatistics> pipeline_statistics_for_test_; |
| 653 | 653 |
| 654 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 654 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
| 655 }; | 655 }; |
| 656 | 656 |
| 657 } // namespace media | 657 } // namespace media |
| 658 | 658 |
| 659 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ | 659 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ |
| OLD | NEW |