OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_ | 5 #ifndef WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_ |
6 #define WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_ | 6 #define WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // BufferedResourceLoader for testing. | 78 // BufferedResourceLoader for testing. |
79 virtual BufferedResourceLoader* CreateResourceLoader( | 79 virtual BufferedResourceLoader* CreateResourceLoader( |
80 int64 first_byte_position, int64 last_byte_position); | 80 int64 first_byte_position, int64 last_byte_position); |
81 | 81 |
82 private: | 82 private: |
83 friend class BufferedDataSourceTest; | 83 friend class BufferedDataSourceTest; |
84 | 84 |
85 // Task posted to perform actual reading on the render thread. | 85 // Task posted to perform actual reading on the render thread. |
86 void ReadTask(int64 position, int read_size, uint8* read_buffer); | 86 void ReadTask(int64 position, int read_size, uint8* read_buffer); |
87 | 87 |
88 // Task posted when Stop() is called. Stops |watch_dog_timer_| and | 88 // Task posted when Stop() is called. Stops |loader_|, resets Read() |
89 // |loader_|, reset Read() variables, and set |stopped_on_render_loop_| | 89 // variables, and sets |stopped_on_render_loop_| to signal any remaining |
90 // to signal any remaining tasks to stop. | 90 // tasks to stop. |
91 void CleanupTask(); | 91 void CleanupTask(); |
92 | 92 |
93 // Restart resource loading on render thread. | |
94 void RestartLoadingTask(); | |
95 | |
96 // This task uses the current playback rate with the previous playback rate | 93 // This task uses the current playback rate with the previous playback rate |
97 // to determine whether we are going from pause to play and play to pause, | 94 // to determine whether we are going from pause to play and play to pause, |
98 // and signals the buffered resource loader accordingly. | 95 // and signals the buffered resource loader accordingly. |
99 void SetPlaybackRateTask(float playback_rate); | 96 void SetPlaybackRateTask(float playback_rate); |
100 | 97 |
101 // Tells |loader_| the bitrate of the media. | 98 // Tells |loader_| the bitrate of the media. |
102 void SetBitrateTask(int bitrate); | 99 void SetBitrateTask(int bitrate); |
103 | 100 |
104 // The method that performs actual read. This method can only be executed on | 101 // The method that performs actual read. This method can only be executed on |
105 // the render thread. | 102 // the render thread. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 float playback_rate_; | 203 float playback_rate_; |
207 | 204 |
208 scoped_refptr<media::MediaLog> media_log_; | 205 scoped_refptr<media::MediaLog> media_log_; |
209 | 206 |
210 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); | 207 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); |
211 }; | 208 }; |
212 | 209 |
213 } // namespace webkit_media | 210 } // namespace webkit_media |
214 | 211 |
215 #endif // WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_ | 212 #endif // WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_ |
OLD | NEW |