| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/threading/thread.h" | 15 #include "base/threading/thread.h" |
| 16 #include "content/renderer/media/buffered_data_source_host_impl.h" |
| 16 #include "content/renderer/media/crypto/proxy_decryptor.h" | 17 #include "content/renderer/media/crypto/proxy_decryptor.h" |
| 17 #include "content/renderer/media/video_frame_compositor.h" | 18 #include "content/renderer/media/video_frame_compositor.h" |
| 18 #include "media/base/audio_renderer_sink.h" | 19 #include "media/base/audio_renderer_sink.h" |
| 19 #include "media/base/decryptor.h" | 20 #include "media/base/decryptor.h" |
| 20 // TODO(xhwang): Remove when we remove prefixed EME implementation. | 21 // TODO(xhwang): Remove when we remove prefixed EME implementation. |
| 21 #include "media/base/media_keys.h" | 22 #include "media/base/media_keys.h" |
| 22 #include "media/base/pipeline.h" | 23 #include "media/base/pipeline.h" |
| 23 #include "media/base/text_track.h" | 24 #include "media/base/text_track.h" |
| 24 #include "media/filters/skcanvas_video_renderer.h" | 25 #include "media/filters/skcanvas_video_renderer.h" |
| 25 #include "skia/ext/platform_canvas.h" | 26 #include "skia/ext/platform_canvas.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 virtual bool seeking() const; | 108 virtual bool seeking() const; |
| 108 virtual double duration() const; | 109 virtual double duration() const; |
| 109 virtual double currentTime() const; | 110 virtual double currentTime() const; |
| 110 | 111 |
| 111 // Internal states of loading and network. | 112 // Internal states of loading and network. |
| 112 // TODO(hclam): Ask the pipeline about the state rather than having reading | 113 // TODO(hclam): Ask the pipeline about the state rather than having reading |
| 113 // them from members which would cause race conditions. | 114 // them from members which would cause race conditions. |
| 114 virtual blink::WebMediaPlayer::NetworkState networkState() const; | 115 virtual blink::WebMediaPlayer::NetworkState networkState() const; |
| 115 virtual blink::WebMediaPlayer::ReadyState readyState() const; | 116 virtual blink::WebMediaPlayer::ReadyState readyState() const; |
| 116 | 117 |
| 118 // TODO(sandersd): Change this to non-const in blink::WebMediaPlayer. |
| 119 // http://crbug.com/360251 |
| 117 virtual bool didLoadingProgress() const; | 120 virtual bool didLoadingProgress() const; |
| 118 | 121 |
| 119 virtual bool hasSingleSecurityOrigin() const; | 122 virtual bool hasSingleSecurityOrigin() const; |
| 120 virtual bool didPassCORSAccessCheck() const; | 123 virtual bool didPassCORSAccessCheck() const; |
| 121 | 124 |
| 122 virtual double mediaTimeForTimeValue(double timeValue) const; | 125 virtual double mediaTimeForTimeValue(double timeValue) const; |
| 123 | 126 |
| 124 virtual unsigned decodedFrameCount() const; | 127 virtual unsigned decodedFrameCount() const; |
| 125 virtual unsigned droppedFrameCount() const; | 128 virtual unsigned droppedFrameCount() const; |
| 126 virtual unsigned audioDecodedByteCount() const; | 129 virtual unsigned audioDecodedByteCount() const; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 // If |decryptor_ready_cb| is null, the existing callback will be fired with | 240 // If |decryptor_ready_cb| is null, the existing callback will be fired with |
| 238 // NULL immediately and reset. | 241 // NULL immediately and reset. |
| 239 void SetDecryptorReadyCB(const media::DecryptorReadyCB& decryptor_ready_cb); | 242 void SetDecryptorReadyCB(const media::DecryptorReadyCB& decryptor_ready_cb); |
| 240 | 243 |
| 241 blink::WebLocalFrame* frame_; | 244 blink::WebLocalFrame* frame_; |
| 242 | 245 |
| 243 // TODO(hclam): get rid of these members and read from the pipeline directly. | 246 // TODO(hclam): get rid of these members and read from the pipeline directly. |
| 244 blink::WebMediaPlayer::NetworkState network_state_; | 247 blink::WebMediaPlayer::NetworkState network_state_; |
| 245 blink::WebMediaPlayer::ReadyState ready_state_; | 248 blink::WebMediaPlayer::ReadyState ready_state_; |
| 246 | 249 |
| 247 // Keep a list of buffered time ranges. | |
| 248 blink::WebTimeRanges buffered_; | |
| 249 | |
| 250 // Message loops for posting tasks on Chrome's main thread. Also used | 250 // Message loops for posting tasks on Chrome's main thread. Also used |
| 251 // for DCHECKs so methods calls won't execute in the wrong thread. | 251 // for DCHECKs so methods calls won't execute in the wrong thread. |
| 252 const scoped_refptr<base::MessageLoopProxy> main_loop_; | 252 const scoped_refptr<base::MessageLoopProxy> main_loop_; |
| 253 | 253 |
| 254 scoped_refptr<base::MessageLoopProxy> media_loop_; | 254 scoped_refptr<base::MessageLoopProxy> media_loop_; |
| 255 scoped_refptr<media::MediaLog> media_log_; | 255 scoped_refptr<media::MediaLog> media_log_; |
| 256 media::Pipeline pipeline_; | 256 media::Pipeline pipeline_; |
| 257 | 257 |
| 258 // The currently selected key system. Empty string means that no key system | 258 // The currently selected key system. Empty string means that no key system |
| 259 // has been selected. | 259 // has been selected. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 // These two are mutually exclusive: | 313 // These two are mutually exclusive: |
| 314 // |data_source_| is used for regular resource loads. | 314 // |data_source_| is used for regular resource loads. |
| 315 // |chunk_demuxer_| is used for Media Source resource loads. | 315 // |chunk_demuxer_| is used for Media Source resource loads. |
| 316 // | 316 // |
| 317 // |demuxer_| will contain the appropriate demuxer based on which resource | 317 // |demuxer_| will contain the appropriate demuxer based on which resource |
| 318 // load strategy we're using. | 318 // load strategy we're using. |
| 319 scoped_ptr<BufferedDataSource> data_source_; | 319 scoped_ptr<BufferedDataSource> data_source_; |
| 320 scoped_ptr<media::Demuxer> demuxer_; | 320 scoped_ptr<media::Demuxer> demuxer_; |
| 321 media::ChunkDemuxer* chunk_demuxer_; | 321 media::ChunkDemuxer* chunk_demuxer_; |
| 322 | 322 |
| 323 BufferedDataSourceHostImpl buffered_data_source_host_; |
| 324 // TODO(sandersd): Remove this cache. http://crbug.com/360254 |
| 325 blink::WebTimeRanges buffered_web_time_ranges_; |
| 326 |
| 323 // Temporary for EME v0.1. In the future the init data type should be passed | 327 // Temporary for EME v0.1. In the future the init data type should be passed |
| 324 // through GenerateKeyRequest() directly from WebKit. | 328 // through GenerateKeyRequest() directly from WebKit. |
| 325 std::string init_data_type_; | 329 std::string init_data_type_; |
| 326 | 330 |
| 327 // Video rendering members. | 331 // Video rendering members. |
| 328 VideoFrameCompositor compositor_; | 332 VideoFrameCompositor compositor_; |
| 329 media::SkCanvasVideoRenderer skcanvas_video_renderer_; | 333 media::SkCanvasVideoRenderer skcanvas_video_renderer_; |
| 330 | 334 |
| 331 // The compositor layer for displaying the video content when using composited | 335 // The compositor layer for displaying the video content when using composited |
| 332 // playback. | 336 // playback. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 343 WebContentDecryptionModuleImpl* web_cdm_; | 347 WebContentDecryptionModuleImpl* web_cdm_; |
| 344 | 348 |
| 345 media::DecryptorReadyCB decryptor_ready_cb_; | 349 media::DecryptorReadyCB decryptor_ready_cb_; |
| 346 | 350 |
| 347 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 351 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
| 348 }; | 352 }; |
| 349 | 353 |
| 350 } // namespace content | 354 } // namespace content |
| 351 | 355 |
| 352 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_ | 356 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_ |
| OLD | NEW |