| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 PipelineImpl which is the actual media player pipeline, it glues | 6 // It contains PipelineImpl 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 // PipelineImpl would creates multiple threads and access some public methods | 8 // PipelineImpl 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 class WebMediaPlayerProxy; | 79 class WebMediaPlayerProxy; |
| 80 | 80 |
| 81 class WebMediaPlayerImpl | 81 class WebMediaPlayerImpl |
| 82 : public WebKit::WebMediaPlayer, | 82 : public WebKit::WebMediaPlayer, |
| 83 public MessageLoop::DestructionObserver, | 83 public MessageLoop::DestructionObserver, |
| 84 public base::SupportsWeakPtr<WebMediaPlayerImpl> { | 84 public base::SupportsWeakPtr<WebMediaPlayerImpl> { |
| 85 public: | 85 public: |
| 86 // Construct a WebMediaPlayerImpl with reference to the client, and media | 86 // Construct a WebMediaPlayerImpl with reference to the client, and media |
| 87 // filter collection. By providing the filter collection the implementor can | 87 // filter collection. By providing the filter collection the implementor can |
| 88 // provide more specific media filters that does resource loading and | 88 // provide more specific media filters that does resource loading and |
| 89 // rendering. |collection| should contain filter factories for: | 89 // rendering. |
| 90 // 1. Data source | |
| 91 // 2. Audio renderer | |
| 92 // 3. Video renderer (optional) | |
| 93 // | 90 // |
| 94 // There are some default filters provided by this method: | 91 // WebMediaPlayerImpl comes packaged with the following media filters: |
| 95 // 1. FFmpeg demuxer | 92 // - URL fetching |
| 96 // 2. FFmpeg audio decoder | 93 // - Demuxing |
| 97 // 3. FFmpeg video decoder | 94 // - Software audio/video decoding |
| 98 // 4. Video renderer | 95 // - Video rendering |
| 99 // 5. Null audio renderer | 96 // |
| 100 // The video renderer provided by this class is using the graphics context | 97 // Clients are expected to add their platform-specific audio rendering media |
| 101 // provided by WebKit to perform renderering. The simple data source does | 98 // filter if they wish to hear any sound coming out the speakers, otherwise |
| 102 // resource loading by loading the whole resource object into memory. Null | 99 // audio data is discarded and media plays back based on wall clock time. |
| 103 // audio renderer is a fake audio device that plays silence. Provider of the | 100 // |
| 104 // |collection| can override the default filters by adding extra filters to | |
| 105 // |collection| before calling this method. | |
| 106 // This object takes ownership of the |audio_source_provider|. | 101 // This object takes ownership of the |audio_source_provider|. |
| 107 // | 102 // |
| 108 // Callers must call |Initialize()| before they can use the object. | 103 // Callers must call |Initialize()| before they can use the object. |
| 109 WebMediaPlayerImpl(WebKit::WebMediaPlayerClient* client, | 104 WebMediaPlayerImpl(WebKit::WebMediaPlayerClient* client, |
| 110 base::WeakPtr<WebMediaPlayerDelegate> delegate, | 105 base::WeakPtr<WebMediaPlayerDelegate> delegate, |
| 111 media::FilterCollection* collection, | 106 media::FilterCollection* collection, |
| 112 WebKit::WebAudioSourceProvider* audio_source_provider, | 107 WebKit::WebAudioSourceProvider* audio_source_provider, |
| 113 media::MessageLoopFactory* message_loop_factory, | 108 media::MessageLoopFactory* message_loop_factory, |
| 114 MediaStreamClient* media_stream_client, | 109 MediaStreamClient* media_stream_client, |
| 115 media::MediaLog* media_log); | 110 media::MediaLog* media_log); |
| 116 virtual ~WebMediaPlayerImpl(); | 111 virtual ~WebMediaPlayerImpl(); |
| 117 | 112 |
| 118 // Finalizes initialization of the object. | 113 // Finalizes initialization of the object using the given WebFrame. |
| 119 bool Initialize(WebKit::WebFrame* frame, bool use_simple_data_source); | 114 // |
| 115 // TODO(scherkus): fold this into the constructor http://crbug.com/109958 |
| 116 void Initialize(WebKit::WebFrame* frame); |
| 120 | 117 |
| 121 virtual void load(const WebKit::WebURL& url); | 118 virtual void load(const WebKit::WebURL& url); |
| 122 virtual void cancelLoad(); | 119 virtual void cancelLoad(); |
| 123 | 120 |
| 124 // Playback controls. | 121 // Playback controls. |
| 125 virtual void play(); | 122 virtual void play(); |
| 126 virtual void pause(); | 123 virtual void pause(); |
| 127 virtual bool supportsFullscreen() const; | 124 virtual bool supportsFullscreen() const; |
| 128 virtual bool supportsSave() const; | 125 virtual bool supportsSave() const; |
| 129 virtual void seek(float seconds); | 126 virtual void seek(float seconds); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 bool incremented_externally_allocated_memory_; | 272 bool incremented_externally_allocated_memory_; |
| 276 | 273 |
| 277 WebKit::WebAudioSourceProvider* audio_source_provider_; | 274 WebKit::WebAudioSourceProvider* audio_source_provider_; |
| 278 | 275 |
| 279 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 276 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
| 280 }; | 277 }; |
| 281 | 278 |
| 282 } // namespace webkit_media | 279 } // namespace webkit_media |
| 283 | 280 |
| 284 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ | 281 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ |
| OLD | NEW |