| 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 12 matching lines...) Expand all  Loading... | 
| 23 #include <string> | 23 #include <string> | 
| 24 | 24 | 
| 25 #include "base/memory/ref_counted.h" | 25 #include "base/memory/ref_counted.h" | 
| 26 #include "base/memory/scoped_ptr.h" | 26 #include "base/memory/scoped_ptr.h" | 
| 27 #include "base/memory/weak_ptr.h" | 27 #include "base/memory/weak_ptr.h" | 
| 28 #include "base/threading/thread.h" | 28 #include "base/threading/thread.h" | 
| 29 #include "googleurl/src/gurl.h" | 29 #include "googleurl/src/gurl.h" | 
| 30 #include "media/base/audio_renderer_sink.h" | 30 #include "media/base/audio_renderer_sink.h" | 
| 31 #include "media/base/decryptor.h" | 31 #include "media/base/decryptor.h" | 
| 32 #include "media/base/pipeline.h" | 32 #include "media/base/pipeline.h" | 
|  | 33 #include "media/filters/gpu_video_decoder.h" | 
| 33 #include "media/filters/skcanvas_video_renderer.h" | 34 #include "media/filters/skcanvas_video_renderer.h" | 
| 34 #include "skia/ext/platform_canvas.h" | 35 #include "skia/ext/platform_canvas.h" | 
| 35 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
     D.h" | 36 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
     D.h" | 
| 36 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAudioSourceProvide
     r.h" | 37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAudioSourceProvide
     r.h" | 
| 37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayer.h" | 38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayer.h" | 
| 38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerClient.
     h" | 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerClient.
     h" | 
| 39 #include "webkit/media/crypto/key_systems.h" | 40 #include "webkit/media/crypto/key_systems.h" | 
| 40 #include "webkit/media/crypto/proxy_decryptor.h" | 41 #include "webkit/media/crypto/proxy_decryptor.h" | 
| 41 | 42 | 
| 42 class RenderAudioSourceProvider; | 43 class RenderAudioSourceProvider; | 
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 246   // Gets the duration value reported by the pipeline. | 247   // Gets the duration value reported by the pipeline. | 
| 247   double GetPipelineDuration() const; | 248   double GetPipelineDuration() const; | 
| 248 | 249 | 
| 249   // Notifies WebKit of the duration change. | 250   // Notifies WebKit of the duration change. | 
| 250   void OnDurationChange(); | 251   void OnDurationChange(); | 
| 251 | 252 | 
| 252   // Called by VideoRendererBase on its internal thread with the new frame to be | 253   // Called by VideoRendererBase on its internal thread with the new frame to be | 
| 253   // painted. | 254   // painted. | 
| 254   void FrameReady(const scoped_refptr<media::VideoFrame>& frame); | 255   void FrameReady(const scoped_refptr<media::VideoFrame>& frame); | 
| 255 | 256 | 
|  | 257   // Builds a FilterCollection based on the current configuration of | 
|  | 258   // WebMediaPlayerImpl. | 
|  | 259   scoped_ptr<media::FilterCollection> BuildFilterCollection(); | 
|  | 260 | 
| 256   WebKit::WebFrame* frame_; | 261   WebKit::WebFrame* frame_; | 
| 257 | 262 | 
| 258   // TODO(hclam): get rid of these members and read from the pipeline directly. | 263   // TODO(hclam): get rid of these members and read from the pipeline directly. | 
| 259   WebKit::WebMediaPlayer::NetworkState network_state_; | 264   WebKit::WebMediaPlayer::NetworkState network_state_; | 
| 260   WebKit::WebMediaPlayer::ReadyState ready_state_; | 265   WebKit::WebMediaPlayer::ReadyState ready_state_; | 
| 261 | 266 | 
| 262   // Keep a list of buffered time ranges. | 267   // Keep a list of buffered time ranges. | 
| 263   WebKit::WebTimeRanges buffered_; | 268   WebKit::WebTimeRanges buffered_; | 
| 264 | 269 | 
| 265   // Message loops for posting tasks on Chrome's main thread. Also used | 270   // Message loops for posting tasks on Chrome's main thread. Also used | 
| 266   // for DCHECKs so methods calls won't execute in the wrong thread. | 271   // for DCHECKs so methods calls won't execute in the wrong thread. | 
| 267   const scoped_refptr<base::MessageLoopProxy> main_loop_; | 272   const scoped_refptr<base::MessageLoopProxy> main_loop_; | 
| 268 | 273 | 
| 269   scoped_ptr<media::FilterCollection> filter_collection_; |  | 
| 270   scoped_refptr<media::Pipeline> pipeline_; | 274   scoped_refptr<media::Pipeline> pipeline_; | 
| 271   base::Thread media_thread_; | 275   base::Thread media_thread_; | 
| 272 | 276 | 
| 273   // The currently selected key system. Empty string means that no key system | 277   // The currently selected key system. Empty string means that no key system | 
| 274   // has been selected. | 278   // has been selected. | 
| 275   WebKit::WebString current_key_system_; | 279   WebKit::WebString current_key_system_; | 
| 276 | 280 | 
| 277   // Playback state. | 281   // Playback state. | 
| 278   // | 282   // | 
| 279   // TODO(scherkus): we have these because Pipeline favours the simplicity of a | 283   // TODO(scherkus): we have these because Pipeline favours the simplicity of a | 
| (...skipping 23 matching lines...) Expand all  Loading... | 
| 303   MediaStreamClient* media_stream_client_; | 307   MediaStreamClient* media_stream_client_; | 
| 304 | 308 | 
| 305   scoped_refptr<media::MediaLog> media_log_; | 309   scoped_refptr<media::MediaLog> media_log_; | 
| 306 | 310 | 
| 307   // Since accelerated compositing status is only known after the first layout, | 311   // Since accelerated compositing status is only known after the first layout, | 
| 308   // we delay reporting it to UMA until that time. | 312   // we delay reporting it to UMA until that time. | 
| 309   bool accelerated_compositing_reported_; | 313   bool accelerated_compositing_reported_; | 
| 310 | 314 | 
| 311   bool incremented_externally_allocated_memory_; | 315   bool incremented_externally_allocated_memory_; | 
| 312 | 316 | 
|  | 317   // Factories for supporting GpuVideoDecoder. May be null. | 
|  | 318   scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories_; | 
|  | 319 | 
| 313   // Routes audio playback to either AudioRendererSink or WebAudio. | 320   // Routes audio playback to either AudioRendererSink or WebAudio. | 
| 314   scoped_refptr<WebAudioSourceProviderImpl> audio_source_provider_; | 321   scoped_refptr<WebAudioSourceProviderImpl> audio_source_provider_; | 
| 315 | 322 | 
| 316   bool is_local_source_; | 323   bool is_local_source_; | 
| 317   bool supports_save_; | 324   bool supports_save_; | 
| 318 | 325 | 
| 319   // The decryptor that manages decryption keys and decrypts encrypted frames. | 326   // The decryptor that manages decryption keys and decrypts encrypted frames. | 
| 320   scoped_ptr<ProxyDecryptor> decryptor_; | 327   scoped_ptr<ProxyDecryptor> decryptor_; | 
| 321 | 328 | 
| 322   bool starting_; | 329   bool starting_; | 
| (...skipping 17 matching lines...) Expand all  Loading... | 
| 340   media::SkCanvasVideoRenderer skcanvas_video_renderer_; | 347   media::SkCanvasVideoRenderer skcanvas_video_renderer_; | 
| 341   scoped_refptr<media::VideoFrame> current_frame_; | 348   scoped_refptr<media::VideoFrame> current_frame_; | 
| 342   bool pending_repaint_; | 349   bool pending_repaint_; | 
| 343 | 350 | 
| 344   DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 351   DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 
| 345 }; | 352 }; | 
| 346 | 353 | 
| 347 }  // namespace webkit_media | 354 }  // namespace webkit_media | 
| 348 | 355 | 
| 349 #endif  // WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ | 356 #endif  // WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ | 
| OLD | NEW | 
|---|