Index: content/renderer/media/webmediaplayer_impl.h |
diff --git a/content/renderer/media/webmediaplayer_impl.h b/content/renderer/media/webmediaplayer_impl.h |
index d59b7c2a390fe0a6d82ec322f3886447643abe0b..3c2dcbf055d91b599cbf01a60841871ccc36c8ee 100644 |
--- a/content/renderer/media/webmediaplayer_impl.h |
+++ b/content/renderer/media/webmediaplayer_impl.h |
@@ -13,6 +13,7 @@ |
#include "base/memory/scoped_ptr.h" |
#include "base/memory/weak_ptr.h" |
#include "base/threading/thread.h" |
+#include "content/renderer/media/buffered_data_source.h" |
#include "content/renderer/media/crypto/proxy_decryptor.h" |
#include "content/renderer/media/video_frame_compositor.h" |
#include "media/base/audio_renderer_sink.h" |
@@ -65,6 +66,7 @@ class WebTextTrackImpl; |
// Encrypted Media. |
class WebMediaPlayerImpl |
: public blink::WebMediaPlayer, |
+ public BufferedDataSourceHost, |
public base::SupportsWeakPtr<WebMediaPlayerImpl> { |
public: |
// Constructs a WebMediaPlayer implementation using Chromium's media stack. |
@@ -114,6 +116,8 @@ class WebMediaPlayerImpl |
virtual blink::WebMediaPlayer::NetworkState networkState() const; |
virtual blink::WebMediaPlayer::ReadyState readyState() const; |
+ // FIXME: Change this to non-const in blink::WebMediaPlayer. |
scherkus (not reviewing)
2014/04/05 00:00:02
sillyness: blink uses FIXME (leftover from WebKit
|
+ // http://crbug.com/360251 |
virtual bool didLoadingProgress() const; |
virtual bool hasSingleSecurityOrigin() const; |
@@ -156,6 +160,10 @@ class WebMediaPlayerImpl |
virtual void setContentDecryptionModule( |
blink::WebContentDecryptionModule* cdm); |
+ // BufferedDataSourceHost implementation. |
+ virtual void SetTotalBytes(int64 total_bytes) OVERRIDE; |
+ virtual void AddBufferedByteRange(int64 start, int64 end) OVERRIDE; |
+ |
// Notifies blink that the entire media element region has been invalidated. |
// This path is slower than notifying the compositor directly as it performs |
// more work and can trigger layouts. It should only be used in two cases: |
@@ -244,7 +252,7 @@ class WebMediaPlayerImpl |
blink::WebMediaPlayer::NetworkState network_state_; |
blink::WebMediaPlayer::ReadyState ready_state_; |
- // Keep a list of buffered time ranges. |
+ // FIXME: Remove this cache. http://crbug.com/360254 |
scherkus (not reviewing)
2014/04/05 00:00:02
ditto
|
blink::WebTimeRanges buffered_; |
// Message loops for posting tasks on Chrome's main thread. Also used |
@@ -320,6 +328,16 @@ class WebMediaPlayerImpl |
scoped_ptr<media::Demuxer> demuxer_; |
media::ChunkDemuxer* chunk_demuxer_; |
+ // Total size of the data source. |
+ int64 total_bytes_; |
+ |
+ // List of buffered byte ranges for estimating buffered time. |
+ media::Ranges<int64> buffered_byte_ranges_; |
+ |
+ // True when AddBufferedByteRange() has been called more recently than |
+ // didLoadingProgress(). |
+ mutable bool did_loading_progress_; |
+ |
// Temporary for EME v0.1. In the future the init data type should be passed |
// through GenerateKeyRequest() directly from WebKit. |
std::string init_data_type_; |