Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(503)

Unified Diff: media/base/download_rate_monitor.h

Issue 8661002: Fire CanPlayThrough immediately for local and streaming media files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase ToT Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/base/download_rate_monitor.h
diff --git a/media/base/download_rate_monitor.h b/media/base/download_rate_monitor.h
index ac88f7ffbed5b58a967cf04df407f4d64f44559c..e3b29dd104b8281455aee6c7dd4a40ee3c58b260 100644
--- a/media/base/download_rate_monitor.h
+++ b/media/base/download_rate_monitor.h
@@ -25,7 +25,8 @@ class MEDIA_EXPORT DownloadRateMonitor {
// Begin measuring download rate. The monitor will run |canplaythrough_cb|
// when it believes the media can be played back without needing to pause to
// buffer. |media_bitrate| is the bitrate of the video.
- void Start(const base::Closure& canplaythrough_cb, int media_bitrate);
+ void Start(const base::Closure& canplaythrough_cb, int media_bitrate,
+ bool streaming, bool local_source);
// Notifies the monitor of the current number of bytes buffered by the media
// file at what timestamp. The monitor expects subsequent calls to
@@ -40,8 +41,6 @@ class MEDIA_EXPORT DownloadRateMonitor {
void set_total_bytes(int64 total_bytes) { total_bytes_ = total_bytes; }
- void set_loaded(bool loaded) { loaded_ = loaded; }
-
// Stop monitoring download rate. This does not discard previously learned
// information, but it will no longer factor incoming information into its
// canplaythrough estimation.
@@ -137,8 +136,9 @@ class MEDIA_EXPORT DownloadRateMonitor {
// Amount of bytes buffered.
int64 buffered_bytes_;
- // True if the media file is a fully loaded source, e.g. file:// protocol.
- bool loaded_;
+ // True if the media file is from a local source, e.g. file:// protocol or a
+ // webcam stream.
+ bool local_source_;
// Bitrate of the media file, 0 if unknown.
int bitrate_;
@@ -147,6 +147,9 @@ class MEDIA_EXPORT DownloadRateMonitor {
// otherwise.
bool stopped_;
+ // True if the data source is a streaming source, false otherwise.
+ bool streaming_;
+
DISALLOW_COPY_AND_ASSIGN(DownloadRateMonitor);
};

Powered by Google App Engine
This is Rietveld 408576698