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 // SeekableBuffer to support backward and forward seeking in a buffer for | 5 // SeekableBuffer to support backward and forward seeking in a buffer for |
6 // reading a media data source. | 6 // reading a media data source. |
7 // | 7 // |
8 // In order to support backward and forward seeking, this class buffers data in | 8 // In order to support backward and forward seeking, this class buffers data in |
9 // both backward and forward directions, the current read position can be reset | 9 // both backward and forward directions, the current read position can be reset |
10 // to anywhere in the buffered data. | 10 // to anywhere in the buffered data. |
(...skipping 15 matching lines...) Expand all Loading... |
26 // advises a halt of append operation, further append operations are allowed but | 26 // advises a halt of append operation, further append operations are allowed but |
27 // are not advised. Since this class is used as a backend buffer for caching | 27 // are not advised. Since this class is used as a backend buffer for caching |
28 // media files downloaded from network we cannot afford losing data, we can | 28 // media files downloaded from network we cannot afford losing data, we can |
29 // only advise a halt of further writing to this buffer. | 29 // only advise a halt of further writing to this buffer. |
30 // This class is not inherently thread-safe. Concurrent access must be | 30 // This class is not inherently thread-safe. Concurrent access must be |
31 // externally serialized. | 31 // externally serialized. |
32 | 32 |
33 #ifndef MEDIA_BASE_SEEKABLE_BUFFER_H_ | 33 #ifndef MEDIA_BASE_SEEKABLE_BUFFER_H_ |
34 #define MEDIA_BASE_SEEKABLE_BUFFER_H_ | 34 #define MEDIA_BASE_SEEKABLE_BUFFER_H_ |
35 | 35 |
| 36 #include <stdint.h> |
| 37 |
36 #include <list> | 38 #include <list> |
37 | 39 |
38 #include "base/macros.h" | 40 #include "base/macros.h" |
39 #include "base/memory/ref_counted.h" | 41 #include "base/memory/ref_counted.h" |
40 #include "base/time/time.h" | 42 #include "base/time/time.h" |
41 #include "media/base/media_export.h" | 43 #include "media/base/media_export.h" |
42 | 44 |
43 namespace media { | 45 namespace media { |
44 | 46 |
45 class DataBuffer; | 47 class DataBuffer; |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 // Keeps track of the most recent time we've seen in case the |buffers_| is | 180 // Keeps track of the most recent time we've seen in case the |buffers_| is |
179 // empty when our owner asks what time it is. | 181 // empty when our owner asks what time it is. |
180 base::TimeDelta current_time_; | 182 base::TimeDelta current_time_; |
181 | 183 |
182 DISALLOW_COPY_AND_ASSIGN(SeekableBuffer); | 184 DISALLOW_COPY_AND_ASSIGN(SeekableBuffer); |
183 }; | 185 }; |
184 | 186 |
185 } // namespace media | 187 } // namespace media |
186 | 188 |
187 #endif // MEDIA_BASE_SEEKABLE_BUFFER_H_ | 189 #endif // MEDIA_BASE_SEEKABLE_BUFFER_H_ |
OLD | NEW |