| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Delegate calls from WebCore::MediaPlayerPrivate to Chrome's video player. | 5 // Delegate calls from WebCore::MediaPlayerPrivate to Chrome's video player. |
| 6 // It contains Pipeline which is the actual media player pipeline, it glues | 6 // It contains Pipeline which is the actual media player pipeline, it glues |
| 7 // the media player pipeline, data source, audio renderer and renderer. | 7 // the media player pipeline, data source, audio renderer and renderer. |
| 8 // Pipeline would creates multiple threads and access some public methods | 8 // Pipeline would creates multiple threads and access some public methods |
| 9 // of this class, so we need to be extra careful about concurrent access of | 9 // of this class, so we need to be extra careful about concurrent access of |
| 10 // methods and members. | 10 // methods and members. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 #include "webkit/media/crypto/proxy_decryptor.h" | 68 #include "webkit/media/crypto/proxy_decryptor.h" |
| 69 | 69 |
| 70 class RenderAudioSourceProvider; | 70 class RenderAudioSourceProvider; |
| 71 | 71 |
| 72 namespace WebKit { | 72 namespace WebKit { |
| 73 class WebAudioSourceProvider; | 73 class WebAudioSourceProvider; |
| 74 class WebFrame; | 74 class WebFrame; |
| 75 } | 75 } |
| 76 | 76 |
| 77 namespace media { | 77 namespace media { |
| 78 class AudioRendererSink; |
| 78 class MediaLog; | 79 class MediaLog; |
| 79 } | 80 } |
| 80 | 81 |
| 81 namespace webkit_media { | 82 namespace webkit_media { |
| 82 | 83 |
| 83 class MediaStreamClient; | 84 class MediaStreamClient; |
| 84 class WebMediaPlayerDelegate; | 85 class WebMediaPlayerDelegate; |
| 85 class WebMediaPlayerProxy; | 86 class WebMediaPlayerProxy; |
| 86 | 87 |
| 87 class WebMediaPlayerImpl | 88 class WebMediaPlayerImpl |
| 88 : public WebKit::WebMediaPlayer, | 89 : public WebKit::WebMediaPlayer, |
| 89 public MessageLoop::DestructionObserver, | 90 public MessageLoop::DestructionObserver, |
| 90 public base::SupportsWeakPtr<WebMediaPlayerImpl> { | 91 public base::SupportsWeakPtr<WebMediaPlayerImpl> { |
| 91 public: | 92 public: |
| 92 // Construct a WebMediaPlayerImpl with reference to the client, and media | 93 // Construct a WebMediaPlayerImpl with reference to the client, and media |
| 93 // filter collection. By providing the filter collection the implementor can | 94 // filter collection. By providing the filter collection the implementor can |
| 94 // provide more specific media filters that does resource loading and | 95 // provide more specific media filters that does resource loading and |
| 95 // rendering. | 96 // rendering. |
| 96 // | 97 // |
| 97 // WebMediaPlayerImpl comes packaged with the following media filters: | 98 // WebMediaPlayerImpl comes packaged with the following media filters: |
| 98 // - URL fetching | 99 // - URL fetching |
| 99 // - Demuxing | 100 // - Demuxing |
| 100 // - Software audio/video decoding | 101 // - Software audio/video decoding |
| 101 // - Video rendering | 102 // - Video rendering |
| 102 // | 103 // |
| 103 // Clients are expected to add their platform-specific audio rendering media | 104 // Clients are expected to add their platform-specific audio rendering media |
| 104 // filter if they wish to hear any sound coming out the speakers, otherwise | 105 // filter if they wish to hear any sound coming out the speakers, otherwise |
| 105 // audio data is discarded and media plays back based on wall clock time. | 106 // audio data is discarded and media plays back based on wall clock time. |
| 106 // | 107 // |
| 108 // When calling this, the |audio_source_provider| and |
| 109 // |audio_renderer_sink| arguments should be the same object. |
| 110 // |
| 111 // TODO(scherkus): Remove WebAudioSourceProvider parameter once we |
| 112 // refactor RenderAudioSourceProvider to live under webkit/media/ |
| 113 // instead of content/renderer/, see http://crbug.com/136442 |
| 114 |
| 107 WebMediaPlayerImpl(WebKit::WebFrame* frame, | 115 WebMediaPlayerImpl(WebKit::WebFrame* frame, |
| 108 WebKit::WebMediaPlayerClient* client, | 116 WebKit::WebMediaPlayerClient* client, |
| 109 base::WeakPtr<WebMediaPlayerDelegate> delegate, | 117 base::WeakPtr<WebMediaPlayerDelegate> delegate, |
| 110 media::FilterCollection* collection, | 118 media::FilterCollection* collection, |
| 111 WebKit::WebAudioSourceProvider* audio_source_provider, | 119 WebKit::WebAudioSourceProvider* audio_source_provider, |
| 120 media::AudioRendererSink* audio_renderer_sink, |
| 112 media::MessageLoopFactory* message_loop_factory, | 121 media::MessageLoopFactory* message_loop_factory, |
| 113 MediaStreamClient* media_stream_client, | 122 MediaStreamClient* media_stream_client, |
| 114 media::MediaLog* media_log); | 123 media::MediaLog* media_log); |
| 115 virtual ~WebMediaPlayerImpl(); | 124 virtual ~WebMediaPlayerImpl(); |
| 116 | 125 |
| 117 virtual void load(const WebKit::WebURL& url, CORSMode cors_mode); | 126 virtual void load(const WebKit::WebURL& url, CORSMode cors_mode); |
| 118 virtual void cancelLoad(); | 127 virtual void cancelLoad(); |
| 119 | 128 |
| 120 // Playback controls. | 129 // Playback controls. |
| 121 virtual void play(); | 130 virtual void play(); |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 scoped_refptr<media::MediaLog> media_log_; | 342 scoped_refptr<media::MediaLog> media_log_; |
| 334 | 343 |
| 335 // Since accelerated compositing status is only known after the first layout, | 344 // Since accelerated compositing status is only known after the first layout, |
| 336 // we delay reporting it to UMA until that time. | 345 // we delay reporting it to UMA until that time. |
| 337 bool accelerated_compositing_reported_; | 346 bool accelerated_compositing_reported_; |
| 338 | 347 |
| 339 bool incremented_externally_allocated_memory_; | 348 bool incremented_externally_allocated_memory_; |
| 340 | 349 |
| 341 WebKit::WebAudioSourceProvider* audio_source_provider_; | 350 WebKit::WebAudioSourceProvider* audio_source_provider_; |
| 342 | 351 |
| 352 scoped_refptr<media::AudioRendererSink> audio_renderer_sink_; |
| 353 |
| 343 bool is_local_source_; | 354 bool is_local_source_; |
| 344 | 355 |
| 345 // The decryptor that manages decryption keys and decrypts encrypted frames. | 356 // The decryptor that manages decryption keys and decrypts encrypted frames. |
| 346 ProxyDecryptor decryptor_; | 357 ProxyDecryptor decryptor_; |
| 347 | 358 |
| 348 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 359 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
| 349 }; | 360 }; |
| 350 | 361 |
| 351 } // namespace webkit_media | 362 } // namespace webkit_media |
| 352 | 363 |
| 353 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ | 364 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ |
| OLD | NEW |