| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #define WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ | 49 #define WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ |
| 50 | 50 |
| 51 #include <string> | 51 #include <string> |
| 52 | 52 |
| 53 #include "base/memory/ref_counted.h" | 53 #include "base/memory/ref_counted.h" |
| 54 #include "base/memory/scoped_ptr.h" | 54 #include "base/memory/scoped_ptr.h" |
| 55 #include "base/memory/weak_ptr.h" | 55 #include "base/memory/weak_ptr.h" |
| 56 #include "base/message_loop.h" | 56 #include "base/message_loop.h" |
| 57 #include "googleurl/src/gurl.h" | 57 #include "googleurl/src/gurl.h" |
| 58 #include "media/base/audio_renderer_sink.h" | 58 #include "media/base/audio_renderer_sink.h" |
| 59 #include "media/base/decryptor.h" |
| 59 #include "media/base/filters.h" | 60 #include "media/base/filters.h" |
| 60 #include "media/base/message_loop_factory.h" | 61 #include "media/base/message_loop_factory.h" |
| 61 #include "media/base/pipeline.h" | 62 #include "media/base/pipeline.h" |
| 62 #include "media/crypto/aes_decryptor.h" | |
| 63 #include "skia/ext/platform_canvas.h" | 63 #include "skia/ext/platform_canvas.h" |
| 64 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAudioSourceProvide
r.h" | 64 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAudioSourceProvide
r.h" |
| 65 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayer.h" | 65 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayer.h" |
| 66 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerClient.
h" | 66 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerClient.
h" |
| 67 | 67 |
| 68 class RenderAudioSourceProvider; | 68 class RenderAudioSourceProvider; |
| 69 | 69 |
| 70 namespace WebKit { | 70 namespace WebKit { |
| 71 class WebAudioSourceProvider; | 71 class WebAudioSourceProvider; |
| 72 class WebFrame; | 72 class WebFrame; |
| 73 } | 73 } |
| 74 | 74 |
| 75 namespace media { | 75 namespace media { |
| 76 class AesDecryptor; | |
| 77 class MediaLog; | 76 class MediaLog; |
| 78 } | 77 } |
| 79 | 78 |
| 80 namespace webkit_media { | 79 namespace webkit_media { |
| 81 | 80 |
| 82 class MediaStreamClient; | 81 class MediaStreamClient; |
| 83 class WebMediaPlayerDelegate; | 82 class WebMediaPlayerDelegate; |
| 84 class WebMediaPlayerProxy; | 83 class WebMediaPlayerProxy; |
| 85 | 84 |
| 86 class WebMediaPlayerImpl | 85 class WebMediaPlayerImpl |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 void Repaint(); | 224 void Repaint(); |
| 226 | 225 |
| 227 void OnPipelineInitialize(media::PipelineStatus status); | 226 void OnPipelineInitialize(media::PipelineStatus status); |
| 228 void OnPipelineSeek(media::PipelineStatus status); | 227 void OnPipelineSeek(media::PipelineStatus status); |
| 229 void OnPipelineEnded(media::PipelineStatus status); | 228 void OnPipelineEnded(media::PipelineStatus status); |
| 230 void OnPipelineError(media::PipelineStatus error); | 229 void OnPipelineError(media::PipelineStatus error); |
| 231 void OnDemuxerOpened(); | 230 void OnDemuxerOpened(); |
| 232 void OnKeyAdded(const std::string& key_system, const std::string& session_id); | 231 void OnKeyAdded(const std::string& key_system, const std::string& session_id); |
| 233 void OnKeyError(const std::string& key_system, | 232 void OnKeyError(const std::string& key_system, |
| 234 const std::string& session_id, | 233 const std::string& session_id, |
| 235 media::AesDecryptor::KeyError error_code, | 234 media::Decryptor::KeyError error_code, |
| 236 int system_code); | 235 int system_code); |
| 237 void OnKeyMessage(const std::string& key_system, | 236 void OnKeyMessage(const std::string& key_system, |
| 238 const std::string& session_id, | 237 const std::string& session_id, |
| 239 scoped_array<uint8> message, | 238 scoped_array<uint8> message, |
| 240 int message_length, | 239 int message_length, |
| 241 const std::string& default_url); | 240 const std::string& default_url); |
| 242 void OnNeedKey(const std::string& key_system, | 241 void OnNeedKey(const std::string& key_system, |
| 243 const std::string& session_id, | 242 const std::string& session_id, |
| 244 scoped_array<uint8> init_data, | 243 scoped_array<uint8> init_data, |
| 245 int init_data_size); | 244 int init_data_size); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 | 286 |
| 288 // The media pipeline and a bool tracking whether we have started it yet. | 287 // The media pipeline and a bool tracking whether we have started it yet. |
| 289 // | 288 // |
| 290 // TODO(scherkus): replace |started_| with a pointer check for |pipeline_| and | 289 // TODO(scherkus): replace |started_| with a pointer check for |pipeline_| and |
| 291 // have WebMediaPlayerImpl return the default values to WebKit instead of | 290 // have WebMediaPlayerImpl return the default values to WebKit instead of |
| 292 // relying on Pipeline to take care of default values. | 291 // relying on Pipeline to take care of default values. |
| 293 scoped_refptr<media::Pipeline> pipeline_; | 292 scoped_refptr<media::Pipeline> pipeline_; |
| 294 bool started_; | 293 bool started_; |
| 295 | 294 |
| 296 // The decryptor that manages decryption keys and decrypts encrypted frames. | 295 // The decryptor that manages decryption keys and decrypts encrypted frames. |
| 297 scoped_ptr<media::AesDecryptor> decryptor_; | 296 scoped_ptr<media::Decryptor> decryptor_; |
| 298 | 297 |
| 299 scoped_ptr<media::MessageLoopFactory> message_loop_factory_; | 298 scoped_ptr<media::MessageLoopFactory> message_loop_factory_; |
| 300 | 299 |
| 301 // Playback state. | 300 // Playback state. |
| 302 // | 301 // |
| 303 // TODO(scherkus): we have these because Pipeline favours the simplicity of a | 302 // TODO(scherkus): we have these because Pipeline favours the simplicity of a |
| 304 // single "playback rate" over worrying about paused/stopped etc... It forces | 303 // single "playback rate" over worrying about paused/stopped etc... It forces |
| 305 // all clients to manage the pause+playback rate externally, but is that | 304 // all clients to manage the pause+playback rate externally, but is that |
| 306 // really a bad thing? | 305 // really a bad thing? |
| 307 // | 306 // |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 WebKit::WebAudioSourceProvider* audio_source_provider_; | 338 WebKit::WebAudioSourceProvider* audio_source_provider_; |
| 340 | 339 |
| 341 bool is_local_source_; | 340 bool is_local_source_; |
| 342 | 341 |
| 343 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 342 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
| 344 }; | 343 }; |
| 345 | 344 |
| 346 } // namespace webkit_media | 345 } // namespace webkit_media |
| 347 | 346 |
| 348 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ | 347 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ |
| OLD | NEW |