| 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 MEDIA_BLINK_BUFFERED_DATA_SOURCE_H_ | 5 #ifndef MEDIA_BLINK_BUFFERED_DATA_SOURCE_H_ |
| 6 #define MEDIA_BLINK_BUFFERED_DATA_SOURCE_H_ | 6 #define MEDIA_BLINK_BUFFERED_DATA_SOURCE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 // Cancels initialization, any pending loaders, and any pending read calls | 94 // Cancels initialization, any pending loaders, and any pending read calls |
| 95 // from the demuxer. The caller is expected to release its reference to this | 95 // from the demuxer. The caller is expected to release its reference to this |
| 96 // object and never call it again. | 96 // object and never call it again. |
| 97 // | 97 // |
| 98 // Method called on the render thread. | 98 // Method called on the render thread. |
| 99 void Abort(); | 99 void Abort(); |
| 100 | 100 |
| 101 // Notifies changes in playback state for controlling media buffering | 101 // Notifies changes in playback state for controlling media buffering |
| 102 // behavior. | 102 // behavior. |
| 103 void MediaPlaybackRateChanged(float playback_rate); | 103 void MediaPlaybackRateChanged(double playback_rate); |
| 104 void MediaIsPlaying(); | 104 void MediaIsPlaying(); |
| 105 void MediaIsPaused(); | 105 void MediaIsPaused(); |
| 106 bool media_has_played() const { return media_has_played_; } | 106 bool media_has_played() const { return media_has_played_; } |
| 107 | 107 |
| 108 // Returns true if the resource is local. | 108 // Returns true if the resource is local. |
| 109 bool assume_fully_buffered() { return !url_.SchemeIsHTTPOrHTTPS(); } | 109 bool assume_fully_buffered() { return !url_.SchemeIsHTTPOrHTTPS(); } |
| 110 | 110 |
| 111 // Cancels any open network connections once reaching the deferred state for | 111 // Cancels any open network connections once reaching the deferred state for |
| 112 // preload=metadata, non-streaming resources that have not started playback. | 112 // preload=metadata, non-streaming resources that have not started playback. |
| 113 // If already deferred, connections will be immediately closed. | 113 // If already deferred, connections will be immediately closed. |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 bool media_has_played_; | 222 bool media_has_played_; |
| 223 | 223 |
| 224 // This variable holds the value of the preload attribute for the video | 224 // This variable holds the value of the preload attribute for the video |
| 225 // element. | 225 // element. |
| 226 Preload preload_; | 226 Preload preload_; |
| 227 | 227 |
| 228 // Bitrate of the content, 0 if unknown. | 228 // Bitrate of the content, 0 if unknown. |
| 229 int bitrate_; | 229 int bitrate_; |
| 230 | 230 |
| 231 // Current playback rate. | 231 // Current playback rate. |
| 232 float playback_rate_; | 232 double playback_rate_; |
| 233 | 233 |
| 234 scoped_refptr<MediaLog> media_log_; | 234 scoped_refptr<MediaLog> media_log_; |
| 235 | 235 |
| 236 // Host object to report buffered byte range changes to. | 236 // Host object to report buffered byte range changes to. |
| 237 BufferedDataSourceHost* host_; | 237 BufferedDataSourceHost* host_; |
| 238 | 238 |
| 239 DownloadingCB downloading_cb_; | 239 DownloadingCB downloading_cb_; |
| 240 | 240 |
| 241 // Disallow rebinding WeakReference ownership to a different thread by keeping | 241 // Disallow rebinding WeakReference ownership to a different thread by keeping |
| 242 // a persistent reference. This avoids problems with the thread-safety of | 242 // a persistent reference. This avoids problems with the thread-safety of |
| 243 // reaching into this class from multiple threads to attain a WeakPtr. | 243 // reaching into this class from multiple threads to attain a WeakPtr. |
| 244 base::WeakPtr<BufferedDataSource> weak_ptr_; | 244 base::WeakPtr<BufferedDataSource> weak_ptr_; |
| 245 base::WeakPtrFactory<BufferedDataSource> weak_factory_; | 245 base::WeakPtrFactory<BufferedDataSource> weak_factory_; |
| 246 | 246 |
| 247 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); | 247 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); |
| 248 }; | 248 }; |
| 249 | 249 |
| 250 } // namespace media | 250 } // namespace media |
| 251 | 251 |
| 252 #endif // MEDIA_BLINK_BUFFERED_DATA_SOURCE_H_ | 252 #endif // MEDIA_BLINK_BUFFERED_DATA_SOURCE_H_ |
| OLD | NEW |