| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "media/blink/buffered_data_source.h" | 22 #include "media/blink/buffered_data_source.h" |
| 23 #include "media/blink/buffered_data_source_host_impl.h" | 23 #include "media/blink/buffered_data_source_host_impl.h" |
| 24 #include "media/blink/encrypted_media_player_support.h" | 24 #include "media/blink/encrypted_media_player_support.h" |
| 25 #include "media/blink/skcanvas_video_renderer.h" | 25 #include "media/blink/skcanvas_video_renderer.h" |
| 26 #include "media/blink/video_frame_compositor.h" | 26 #include "media/blink/video_frame_compositor.h" |
| 27 #include "media/blink/webmediaplayer_params.h" | 27 #include "media/blink/webmediaplayer_params.h" |
| 28 #include "third_party/WebKit/public/platform/WebAudioSourceProvider.h" | 28 #include "third_party/WebKit/public/platform/WebAudioSourceProvider.h" |
| 29 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h" | 29 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h" |
| 30 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" | 30 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" |
| 31 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h" | 31 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h" |
| 32 #include "third_party/WebKit/public/platform/WebMediaPlayerEncryptedMediaClient.
h" |
| 32 #include "url/gurl.h" | 33 #include "url/gurl.h" |
| 33 | 34 |
| 34 namespace blink { | 35 namespace blink { |
| 35 class WebGraphicsContext3D; | 36 class WebGraphicsContext3D; |
| 36 class WebLocalFrame; | 37 class WebLocalFrame; |
| 37 } | 38 } |
| 38 | 39 |
| 39 namespace base { | 40 namespace base { |
| 40 class SingleThreadTaskRunner; | 41 class SingleThreadTaskRunner; |
| 41 } | 42 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 55 class WebMediaPlayerDelegate; | 56 class WebMediaPlayerDelegate; |
| 56 class WebTextTrackImpl; | 57 class WebTextTrackImpl; |
| 57 | 58 |
| 58 // The canonical implementation of blink::WebMediaPlayer that's backed by | 59 // The canonical implementation of blink::WebMediaPlayer that's backed by |
| 59 // Pipeline. Handles normal resource loading, Media Source, and | 60 // Pipeline. Handles normal resource loading, Media Source, and |
| 60 // Encrypted Media. | 61 // Encrypted Media. |
| 61 class MEDIA_EXPORT WebMediaPlayerImpl | 62 class MEDIA_EXPORT WebMediaPlayerImpl |
| 62 : public NON_EXPORTED_BASE(blink::WebMediaPlayer), | 63 : public NON_EXPORTED_BASE(blink::WebMediaPlayer), |
| 63 public base::SupportsWeakPtr<WebMediaPlayerImpl> { | 64 public base::SupportsWeakPtr<WebMediaPlayerImpl> { |
| 64 public: | 65 public: |
| 65 // Constructs a WebMediaPlayer implementation using Chromium's media stack. | 66 // TODO(srirama): Remove this once blink updated. |
| 66 // |delegate| may be null. |renderer| may also be null, in which case an | |
| 67 // internal renderer will be created. | |
| 68 // TODO(xhwang): Drop the internal renderer path and always pass in a renderer | |
| 69 // here. | |
| 70 WebMediaPlayerImpl(blink::WebLocalFrame* frame, | 67 WebMediaPlayerImpl(blink::WebLocalFrame* frame, |
| 71 blink::WebMediaPlayerClient* client, | 68 blink::WebMediaPlayerClient* client, |
| 72 base::WeakPtr<WebMediaPlayerDelegate> delegate, | 69 base::WeakPtr<WebMediaPlayerDelegate> delegate, |
| 73 scoped_ptr<RendererFactory> renderer_factory, | 70 scoped_ptr<RendererFactory> renderer_factory, |
| 74 CdmFactory* cdm_factory, | 71 CdmFactory* cdm_factory, |
| 75 const WebMediaPlayerParams& params); | 72 const WebMediaPlayerParams& params); |
| 73 // Constructs a WebMediaPlayer implementation using Chromium's media stack. |
| 74 // |delegate| may be null. |renderer| may also be null, in which case an |
| 75 // internal renderer will be created. |
| 76 // TODO(xhwang): Drop the internal renderer path and always pass in a renderer |
| 77 // here. |
| 78 WebMediaPlayerImpl( |
| 79 blink::WebLocalFrame* frame, |
| 80 blink::WebMediaPlayerClient* client, |
| 81 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client, |
| 82 base::WeakPtr<WebMediaPlayerDelegate> delegate, |
| 83 scoped_ptr<RendererFactory> renderer_factory, |
| 84 CdmFactory* cdm_factory, |
| 85 const WebMediaPlayerParams& params); |
| 76 virtual ~WebMediaPlayerImpl(); | 86 virtual ~WebMediaPlayerImpl(); |
| 77 | 87 |
| 78 virtual void load(LoadType load_type, | 88 virtual void load(LoadType load_type, |
| 79 const blink::WebURL& url, | 89 const blink::WebURL& url, |
| 80 CORSMode cors_mode); | 90 CORSMode cors_mode); |
| 81 | 91 |
| 82 // Playback controls. | 92 // Playback controls. |
| 83 virtual void play(); | 93 virtual void play(); |
| 84 virtual void pause(); | 94 virtual void pause(); |
| 85 virtual bool supportsSave() const; | 95 virtual bool supportsSave() const; |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 // Seek gets pending if another seek is in progress. Only last pending seek | 296 // Seek gets pending if another seek is in progress. Only last pending seek |
| 287 // will have effect. | 297 // will have effect. |
| 288 bool pending_seek_; | 298 bool pending_seek_; |
| 289 double pending_seek_seconds_; | 299 double pending_seek_seconds_; |
| 290 | 300 |
| 291 // Tracks whether to issue time changed notifications during buffering state | 301 // Tracks whether to issue time changed notifications during buffering state |
| 292 // changes. | 302 // changes. |
| 293 bool should_notify_time_changed_; | 303 bool should_notify_time_changed_; |
| 294 | 304 |
| 295 blink::WebMediaPlayerClient* client_; | 305 blink::WebMediaPlayerClient* client_; |
| 306 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client_; |
| 296 | 307 |
| 297 base::WeakPtr<WebMediaPlayerDelegate> delegate_; | 308 base::WeakPtr<WebMediaPlayerDelegate> delegate_; |
| 298 | 309 |
| 299 WebMediaPlayerParams::DeferLoadCB defer_load_cb_; | 310 WebMediaPlayerParams::DeferLoadCB defer_load_cb_; |
| 300 WebMediaPlayerParams::Context3DCB context_3d_cb_; | 311 WebMediaPlayerParams::Context3DCB context_3d_cb_; |
| 301 | 312 |
| 302 // Routes audio playback to either AudioRendererSink or WebAudio. | 313 // Routes audio playback to either AudioRendererSink or WebAudio. |
| 303 scoped_refptr<WebAudioSourceProviderImpl> audio_source_provider_; | 314 scoped_refptr<WebAudioSourceProviderImpl> audio_source_provider_; |
| 304 | 315 |
| 305 bool supports_save_; | 316 bool supports_save_; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 328 EncryptedMediaPlayerSupport encrypted_media_support_; | 339 EncryptedMediaPlayerSupport encrypted_media_support_; |
| 329 | 340 |
| 330 scoped_ptr<RendererFactory> renderer_factory_; | 341 scoped_ptr<RendererFactory> renderer_factory_; |
| 331 | 342 |
| 332 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 343 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
| 333 }; | 344 }; |
| 334 | 345 |
| 335 } // namespace media | 346 } // namespace media |
| 336 | 347 |
| 337 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ | 348 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ |
| OLD | NEW |