| 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_MULTIBUFFER_DATA_SOURCE_H_ | 5 #ifndef MEDIA_BLINK_MULTIBUFFER_DATA_SOURCE_H_ |
| 6 #define MEDIA_BLINK_MULTIBUFFER_DATA_SOURCE_H_ | 6 #define MEDIA_BLINK_MULTIBUFFER_DATA_SOURCE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 // Notifies changes in playback state for controlling media buffering | 86 // Notifies changes in playback state for controlling media buffering |
| 87 // behavior. | 87 // behavior. |
| 88 void MediaPlaybackRateChanged(double playback_rate) override; | 88 void MediaPlaybackRateChanged(double playback_rate) override; |
| 89 void MediaIsPlaying() override; | 89 void MediaIsPlaying() override; |
| 90 bool media_has_played() const override; | 90 bool media_has_played() const override; |
| 91 | 91 |
| 92 // Returns true if the resource is local. | 92 // Returns true if the resource is local. |
| 93 bool assume_fully_buffered() override; | 93 bool assume_fully_buffered() override; |
| 94 | 94 |
| 95 // Cancels any open network connections once reaching the deferred state for | 95 // Cancels any open network connections once reaching the deferred state. If |
| 96 // preload=metadata, non-streaming resources that have not started playback. | 96 // |always_cancel| is false this is done only for preload=metadata, non- |
| 97 // If already deferred, connections will be immediately closed. | 97 // streaming resources that have not started playback. If |always_cancel| is |
| 98 void OnBufferingHaveEnough() override; | 98 // true, all resource types will have their connections canceled. If already |
| 99 // deferred, connections will be immediately closed. |
| 100 void OnBufferingHaveEnough(bool always_cancel) override; |
| 99 | 101 |
| 100 int64_t GetMemoryUsage() const override; | 102 int64_t GetMemoryUsage() const override; |
| 101 | 103 |
| 102 // DataSource implementation. | 104 // DataSource implementation. |
| 103 // Called from demuxer thread. | 105 // Called from demuxer thread. |
| 104 void Stop() override; | 106 void Stop() override; |
| 105 | 107 |
| 106 void Read(int64_t position, | 108 void Read(int64_t position, |
| 107 int size, | 109 int size, |
| 108 uint8_t* data, | 110 uint8_t* data, |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 // reaching into this class from multiple threads to attain a WeakPtr. | 242 // reaching into this class from multiple threads to attain a WeakPtr. |
| 241 base::WeakPtr<MultibufferDataSource> weak_ptr_; | 243 base::WeakPtr<MultibufferDataSource> weak_ptr_; |
| 242 base::WeakPtrFactory<MultibufferDataSource> weak_factory_; | 244 base::WeakPtrFactory<MultibufferDataSource> weak_factory_; |
| 243 | 245 |
| 244 DISALLOW_COPY_AND_ASSIGN(MultibufferDataSource); | 246 DISALLOW_COPY_AND_ASSIGN(MultibufferDataSource); |
| 245 }; | 247 }; |
| 246 | 248 |
| 247 } // namespace media | 249 } // namespace media |
| 248 | 250 |
| 249 #endif // MEDIA_BLINK_MULTIBUFFER_DATA_SOURCE_H_ | 251 #endif // MEDIA_BLINK_MULTIBUFFER_DATA_SOURCE_H_ |
| OLD | NEW |