OLD | NEW |
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/callback.h" | 10 #include "base/callback.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 // without needing to pause to buffer. | 119 // without needing to pause to buffer. |
120 base::Closure canplaythrough_cb_; | 120 base::Closure canplaythrough_cb_; |
121 | 121 |
122 // Indicates whether the monitor has run the |canplaythrough_cb_|. | 122 // Indicates whether the monitor has run the |canplaythrough_cb_|. |
123 bool has_notified_can_play_through_; | 123 bool has_notified_can_play_through_; |
124 | 124 |
125 // Measurements used to approximate download speed. | 125 // Measurements used to approximate download speed. |
126 Sample current_sample_; | 126 Sample current_sample_; |
127 std::deque<Sample> sample_window_; | 127 std::deque<Sample> sample_window_; |
128 | 128 |
129 // True if actively downloading bytes, false otherwise. | |
130 bool is_downloading_data_; | |
131 | |
132 // Total number of bytes in the media file, 0 if unknown or undefined. | 129 // Total number of bytes in the media file, 0 if unknown or undefined. |
133 int64 total_bytes_; | 130 int64 total_bytes_; |
134 | 131 |
135 // Amount of bytes buffered. | 132 // Amount of bytes buffered. |
136 int64 buffered_bytes_; | 133 int64 buffered_bytes_; |
137 | 134 |
138 // True if the media file is from a local source, e.g. file:// protocol or a | 135 // True if the media file is from a local source, e.g. file:// protocol or a |
139 // webcam stream. | 136 // webcam stream. |
140 bool local_source_; | 137 bool local_source_; |
141 | 138 |
142 // Bitrate of the media file, 0 if unknown. | 139 // Bitrate of the media file, 0 if unknown. |
143 int bitrate_; | 140 int bitrate_; |
144 | 141 |
145 // True if the monitor has not yet started or has been stopped, false | 142 // True if the monitor has not yet started or has been stopped, false |
146 // otherwise. | 143 // otherwise. |
147 bool stopped_; | 144 bool stopped_; |
148 | 145 |
149 // True if the data source is a streaming source, false otherwise. | 146 // True if the data source is a streaming source, false otherwise. |
150 bool streaming_; | 147 bool streaming_; |
151 | 148 |
| 149 // True if downloading has been deferred at least once, false otherwise. |
| 150 bool has_deferred_; |
| 151 |
152 DISALLOW_COPY_AND_ASSIGN(DownloadRateMonitor); | 152 DISALLOW_COPY_AND_ASSIGN(DownloadRateMonitor); |
153 }; | 153 }; |
154 | 154 |
155 } // namespace media | 155 } // namespace media |
156 | 156 |
157 #endif // MEDIA_BASE_DOWNLOAD_RATE_MONITOR_H_ | 157 #endif // MEDIA_BASE_DOWNLOAD_RATE_MONITOR_H_ |
OLD | NEW |