| 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 13 matching lines...) Expand all Loading... |
| 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 "cc/layers/video_frame_provider.h" | 29 #include "cc/layers/video_frame_provider.h" |
| 30 #include "googleurl/src/gurl.h" | 30 #include "googleurl/src/gurl.h" |
| 31 #include "media/base/audio_renderer_sink.h" | 31 #include "media/base/audio_renderer_sink.h" |
| 32 #include "media/base/decryptor.h" | 32 #include "media/base/decryptor.h" |
| 33 #include "media/base/pipeline.h" | 33 #include "media/base/pipeline.h" |
| 34 #include "media/base/text_track.h" |
| 34 #include "media/filters/gpu_video_decoder.h" | 35 #include "media/filters/gpu_video_decoder.h" |
| 35 #include "media/filters/skcanvas_video_renderer.h" | 36 #include "media/filters/skcanvas_video_renderer.h" |
| 36 #include "skia/ext/platform_canvas.h" | 37 #include "skia/ext/platform_canvas.h" |
| 37 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" | 38 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" |
| 38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAudioSourceProvide
r.h" | 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAudioSourceProvide
r.h" |
| 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayer.h" | 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayer.h" |
| 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerClient.
h" | 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerClient.
h" |
| 41 #include "webkit/media/crypto/key_systems.h" | 42 #include "webkit/media/crypto/key_systems.h" |
| 42 #include "webkit/media/crypto/proxy_decryptor.h" | 43 #include "webkit/media/crypto/proxy_decryptor.h" |
| 43 | 44 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 61 class WebLayerImpl; | 62 class WebLayerImpl; |
| 62 } | 63 } |
| 63 | 64 |
| 64 namespace webkit_media { | 65 namespace webkit_media { |
| 65 | 66 |
| 66 class BufferedDataSource; | 67 class BufferedDataSource; |
| 67 class MediaStreamClient; | 68 class MediaStreamClient; |
| 68 class WebAudioSourceProviderImpl; | 69 class WebAudioSourceProviderImpl; |
| 69 class WebMediaPlayerDelegate; | 70 class WebMediaPlayerDelegate; |
| 70 class WebMediaPlayerParams; | 71 class WebMediaPlayerParams; |
| 72 class WebTextTrackImpl; |
| 71 | 73 |
| 72 class WebMediaPlayerImpl | 74 class WebMediaPlayerImpl |
| 73 : public WebKit::WebMediaPlayer, | 75 : public WebKit::WebMediaPlayer, |
| 74 public cc::VideoFrameProvider, | 76 public cc::VideoFrameProvider, |
| 75 public base::MessageLoop::DestructionObserver, | 77 public base::MessageLoop::DestructionObserver, |
| 76 public base::SupportsWeakPtr<WebMediaPlayerImpl> { | 78 public base::SupportsWeakPtr<WebMediaPlayerImpl> { |
| 77 public: | 79 public: |
| 78 // Constructs a WebMediaPlayer implementation using Chromium's media stack. | 80 // Constructs a WebMediaPlayer implementation using Chromium's media stack. |
| 79 // | 81 // |
| 80 // |delegate| may be null. | 82 // |delegate| may be null. |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 int system_code); | 205 int system_code); |
| 204 void OnKeyMessage(const std::string& key_system, | 206 void OnKeyMessage(const std::string& key_system, |
| 205 const std::string& session_id, | 207 const std::string& session_id, |
| 206 const std::string& message, | 208 const std::string& message, |
| 207 const std::string& default_url); | 209 const std::string& default_url); |
| 208 void OnNeedKey(const std::string& key_system, | 210 void OnNeedKey(const std::string& key_system, |
| 209 const std::string& type, | 211 const std::string& type, |
| 210 const std::string& session_id, | 212 const std::string& session_id, |
| 211 scoped_ptr<uint8[]> init_data, | 213 scoped_ptr<uint8[]> init_data, |
| 212 int init_data_size); | 214 int init_data_size); |
| 215 scoped_ptr<media::TextTrack> OnTextTrack(media::TextKind kind, |
| 216 const std::string& label, |
| 217 const std::string& language); |
| 213 void SetOpaque(bool); | 218 void SetOpaque(bool); |
| 214 | 219 |
| 215 private: | 220 private: |
| 216 // Contains common logic used across the different types loading. | 221 // Contains common logic used across the different types loading. |
| 217 void LoadSetup(const WebKit::WebURL& url); | 222 void LoadSetup(const WebKit::WebURL& url); |
| 218 | 223 |
| 219 // Called after asynchronous initialization of a data source completed. | 224 // Called after asynchronous initialization of a data source completed. |
| 220 void DataSourceInitialized(const GURL& gurl, bool success); | 225 void DataSourceInitialized(const GURL& gurl, bool success); |
| 221 | 226 |
| 222 // Called when the data source is downloading or paused. | 227 // Called when the data source is downloading or paused. |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 bool pending_size_change_; | 368 bool pending_size_change_; |
| 364 | 369 |
| 365 // The compositor layer for displaying the video content when using composited | 370 // The compositor layer for displaying the video content when using composited |
| 366 // playback. | 371 // playback. |
| 367 scoped_ptr<webkit::WebLayerImpl> video_weblayer_; | 372 scoped_ptr<webkit::WebLayerImpl> video_weblayer_; |
| 368 | 373 |
| 369 // A pointer back to the compositor to inform it about state changes. This is | 374 // A pointer back to the compositor to inform it about state changes. This is |
| 370 // not NULL while the compositor is actively using this webmediaplayer. | 375 // not NULL while the compositor is actively using this webmediaplayer. |
| 371 cc::VideoFrameProvider::Client* video_frame_provider_client_; | 376 cc::VideoFrameProvider::Client* video_frame_provider_client_; |
| 372 | 377 |
| 378 // Text track objects get a unique index value when they're created. |
| 379 int text_track_index_; |
| 380 |
| 373 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 381 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
| 374 }; | 382 }; |
| 375 | 383 |
| 376 } // namespace webkit_media | 384 } // namespace webkit_media |
| 377 | 385 |
| 378 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ | 386 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ |
| OLD | NEW |