| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #ifndef WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ | 48 #ifndef WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ |
| 49 #define WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ | 49 #define WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ |
| 50 | 50 |
| 51 #include "base/memory/ref_counted.h" | 51 #include "base/memory/ref_counted.h" |
| 52 #include "base/memory/scoped_ptr.h" | 52 #include "base/memory/scoped_ptr.h" |
| 53 #include "base/memory/weak_ptr.h" | 53 #include "base/memory/weak_ptr.h" |
| 54 #include "base/message_loop.h" | 54 #include "base/message_loop.h" |
| 55 #include "media/base/filters.h" | 55 #include "media/base/filters.h" |
| 56 #include "media/base/message_loop_factory.h" | 56 #include "media/base/message_loop_factory.h" |
| 57 #include "media/base/pipeline.h" | 57 #include "media/base/pipeline.h" |
| 58 #include "media/base/audio_renderer_sink.h" |
| 58 #include "skia/ext/platform_canvas.h" | 59 #include "skia/ext/platform_canvas.h" |
| 59 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayer.h" | 60 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayer.h" |
| 60 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerClient.
h" | 61 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerClient.
h" |
| 61 | 62 |
| 63 class RenderAudioSourceProvider; |
| 64 |
| 62 namespace WebKit { | 65 namespace WebKit { |
| 66 class WebAudioSourceProvider; |
| 63 class WebFrame; | 67 class WebFrame; |
| 64 } | 68 } |
| 65 | 69 |
| 66 namespace media { | 70 namespace media { |
| 67 class MediaLog; | 71 class MediaLog; |
| 68 } | 72 } |
| 69 | 73 |
| 70 namespace webkit_media { | 74 namespace webkit_media { |
| 71 | 75 |
| 72 class MediaStreamClient; | 76 class MediaStreamClient; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 96 // provided by WebKit to perform renderering. The simple data source does | 100 // provided by WebKit to perform renderering. The simple data source does |
| 97 // resource loading by loading the whole resource object into memory. Null | 101 // resource loading by loading the whole resource object into memory. Null |
| 98 // audio renderer is a fake audio device that plays silence. Provider of the | 102 // audio renderer is a fake audio device that plays silence. Provider of the |
| 99 // |collection| can override the default filters by adding extra filters to | 103 // |collection| can override the default filters by adding extra filters to |
| 100 // |collection| before calling this method. | 104 // |collection| before calling this method. |
| 101 // | 105 // |
| 102 // Callers must call |Initialize()| before they can use the object. | 106 // Callers must call |Initialize()| before they can use the object. |
| 103 WebMediaPlayerImpl(WebKit::WebMediaPlayerClient* client, | 107 WebMediaPlayerImpl(WebKit::WebMediaPlayerClient* client, |
| 104 base::WeakPtr<WebMediaPlayerDelegate> delegate, | 108 base::WeakPtr<WebMediaPlayerDelegate> delegate, |
| 105 media::FilterCollection* collection, | 109 media::FilterCollection* collection, |
| 110 bool disable_audio, |
| 106 media::MessageLoopFactory* message_loop_factory, | 111 media::MessageLoopFactory* message_loop_factory, |
| 107 MediaStreamClient* media_stream_client, | 112 MediaStreamClient* media_stream_client, |
| 108 media::MediaLog* media_log); | 113 media::MediaLog* media_log); |
| 109 virtual ~WebMediaPlayerImpl(); | 114 virtual ~WebMediaPlayerImpl(); |
| 110 | 115 |
| 111 // Finalizes initialization of the object. | 116 // Finalizes initialization of the object. |
| 112 bool Initialize(WebKit::WebFrame* frame, bool use_simple_data_source); | 117 bool Initialize(WebKit::WebFrame* frame, bool use_simple_data_source); |
| 113 | 118 |
| 114 virtual void load(const WebKit::WebURL& url); | 119 virtual void load(const WebKit::WebURL& url); |
| 115 virtual void cancelLoad(); | 120 virtual void cancelLoad(); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 virtual float mediaTimeForTimeValue(float timeValue) const; | 170 virtual float mediaTimeForTimeValue(float timeValue) const; |
| 166 | 171 |
| 167 virtual unsigned decodedFrameCount() const; | 172 virtual unsigned decodedFrameCount() const; |
| 168 virtual unsigned droppedFrameCount() const; | 173 virtual unsigned droppedFrameCount() const; |
| 169 virtual unsigned audioDecodedByteCount() const; | 174 virtual unsigned audioDecodedByteCount() const; |
| 170 virtual unsigned videoDecodedByteCount() const; | 175 virtual unsigned videoDecodedByteCount() const; |
| 171 | 176 |
| 172 virtual WebKit::WebVideoFrame* getCurrentFrame(); | 177 virtual WebKit::WebVideoFrame* getCurrentFrame(); |
| 173 virtual void putCurrentFrame(WebKit::WebVideoFrame* web_video_frame); | 178 virtual void putCurrentFrame(WebKit::WebVideoFrame* web_video_frame); |
| 174 | 179 |
| 180 virtual WebKit::WebAudioSourceProvider* audioSourceProvider(); |
| 181 |
| 175 virtual bool sourceAppend(const unsigned char* data, unsigned length); | 182 virtual bool sourceAppend(const unsigned char* data, unsigned length); |
| 176 virtual void sourceEndOfStream(EndOfStreamStatus status); | 183 virtual void sourceEndOfStream(EndOfStreamStatus status); |
| 177 | 184 |
| 178 // As we are closing the tab or even the browser, |main_loop_| is destroyed | 185 // As we are closing the tab or even the browser, |main_loop_| is destroyed |
| 179 // even before this object gets destructed, so we need to know when | 186 // even before this object gets destructed, so we need to know when |
| 180 // |main_loop_| is being destroyed and we can stop posting repaint task | 187 // |main_loop_| is being destroyed and we can stop posting repaint task |
| 181 // to it. | 188 // to it. |
| 182 virtual void WillDestroyCurrentMessageLoop() OVERRIDE; | 189 virtual void WillDestroyCurrentMessageLoop() OVERRIDE; |
| 183 | 190 |
| 184 void Repaint(); | 191 void Repaint(); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 #if WEBKIT_USING_CG | 264 #if WEBKIT_USING_CG |
| 258 scoped_ptr<skia::PlatformCanvas> skia_canvas_; | 265 scoped_ptr<skia::PlatformCanvas> skia_canvas_; |
| 259 #endif | 266 #endif |
| 260 | 267 |
| 261 scoped_refptr<media::MediaLog> media_log_; | 268 scoped_refptr<media::MediaLog> media_log_; |
| 262 | 269 |
| 263 bool is_accelerated_compositing_active_; | 270 bool is_accelerated_compositing_active_; |
| 264 | 271 |
| 265 bool incremented_externally_allocated_memory_; | 272 bool incremented_externally_allocated_memory_; |
| 266 | 273 |
| 274 scoped_refptr<RenderAudioSourceProvider> audio_source_provider_; |
| 275 |
| 267 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 276 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
| 268 }; | 277 }; |
| 269 | 278 |
| 270 } // namespace webkit_media | 279 } // namespace webkit_media |
| 271 | 280 |
| 272 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ | 281 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ |
| OLD | NEW |