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

Side by Side 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: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | media/base/download_rate_monitor.cc » ('j') | media/base/download_rate_monitor.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 MEDIA_BASE_DOWNLOAD_RATE_MONITOR_H_ 5 #ifndef MEDIA_BASE_DOWNLOAD_RATE_MONITOR_H_
6 #define MEDIA_BASE_DOWNLOAD_RATE_MONITOR_H_ 6 #define MEDIA_BASE_DOWNLOAD_RATE_MONITOR_H_
7 7
8 #include <deque> 8 #include <deque>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 24 matching lines...) Expand all
35 void SetBufferedBytes(int64 buffered_bytes, const base::Time& timestamp); 35 void SetBufferedBytes(int64 buffered_bytes, const base::Time& timestamp);
36 36
37 // Notifies the monitor when the media file has paused or continued 37 // Notifies the monitor when the media file has paused or continued
38 // downloading data. 38 // downloading data.
39 void SetNetworkActivity(bool is_downloading_data); 39 void SetNetworkActivity(bool is_downloading_data);
40 40
41 void set_total_bytes(int64 total_bytes) { total_bytes_ = total_bytes; } 41 void set_total_bytes(int64 total_bytes) { total_bytes_ = total_bytes; }
42 42
43 void set_loaded(bool loaded) { loaded_ = loaded; } 43 void set_loaded(bool loaded) { loaded_ = loaded; }
44 44
45 void set_media_stream(bool media_stream) { media_stream_ = media_stream; }
46
47 void set_streaming(bool streaming) { streaming_ = streaming; }
48
45 // Stop monitoring download rate. This does not discard previously learned 49 // Stop monitoring download rate. This does not discard previously learned
46 // information, but it will no longer factor incoming information into its 50 // information, but it will no longer factor incoming information into its
47 // canplaythrough estimation. 51 // canplaythrough estimation.
48 void Stop(); 52 void Stop();
49 53
50 // Resets monitor to uninitialized state. 54 // Resets monitor to uninitialized state.
51 void Reset(); 55 void Reset();
52 56
53 private: 57 private:
54 // Represents a point in time in which the media was buffering data. 58 // Represents a point in time in which the media was buffering data.
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // True if the media file is a fully loaded source, e.g. file:// protocol. 144 // True if the media file is a fully loaded source, e.g. file:// protocol.
141 bool loaded_; 145 bool loaded_;
142 146
143 // Bitrate of the media file, 0 if unknown. 147 // Bitrate of the media file, 0 if unknown.
144 int bitrate_; 148 int bitrate_;
145 149
146 // True if the monitor has not yet started or has been stopped, false 150 // True if the monitor has not yet started or has been stopped, false
147 // otherwise. 151 // otherwise.
148 bool stopped_; 152 bool stopped_;
149 153
154 // True if the data source is a media stream, e.g. video input from a local
155 // capture device, false otherwise.
156 bool media_stream_;
157
158 // True if the data source is a streaming source, false otherwise.
159 bool streaming_;
scherkus (not reviewing) 2011/11/23 01:59:44 wouldn't setting streaming=true for web cams also
vrk (LEFT CHROMIUM) 2011/11/23 21:29:45 There were 2 reasons why I introduced media stream
160
150 DISALLOW_COPY_AND_ASSIGN(DownloadRateMonitor); 161 DISALLOW_COPY_AND_ASSIGN(DownloadRateMonitor);
151 }; 162 };
152 163
153 } // namespace media 164 } // namespace media
154 165
155 #endif // MEDIA_BASE_DOWNLOAD_RATE_MONITOR_H_ 166 #endif // MEDIA_BASE_DOWNLOAD_RATE_MONITOR_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/download_rate_monitor.cc » ('j') | media/base/download_rate_monitor.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698