| 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 // Defines a base class for representing timestamped media data. Every buffer | 5 // Defines a base class for representing timestamped media data. Every buffer |
| 6 // contains a timestamp in microseconds describing the relative position of | 6 // contains a timestamp in microseconds describing the relative position of |
| 7 // the buffer within the media stream, and the duration in microseconds for | 7 // the buffer within the media stream, and the duration in microseconds for |
| 8 // the length of time the buffer will be rendered. | 8 // the length of time the buffer will be rendered. |
| 9 // | 9 // |
| 10 // Timestamps are derived directly from the encoded media file and are commonly | 10 // Timestamps are derived directly from the encoded media file and are commonly |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 MEDIA_EXPORT extern inline base::TimeDelta kInfiniteDuration() { | 44 MEDIA_EXPORT extern inline base::TimeDelta kInfiniteDuration() { |
| 45 return base::TimeDelta::FromMicroseconds(kint64max); | 45 return base::TimeDelta::FromMicroseconds(kint64max); |
| 46 } | 46 } |
| 47 | 47 |
| 48 class MEDIA_EXPORT Buffer : public base::RefCountedThreadSafe<Buffer> { | 48 class MEDIA_EXPORT Buffer : public base::RefCountedThreadSafe<Buffer> { |
| 49 public: | 49 public: |
| 50 // Returns a read only pointer to the buffer data. | 50 // Returns a read only pointer to the buffer data. |
| 51 virtual const uint8* GetData() const = 0; | 51 virtual const uint8* GetData() const = 0; |
| 52 | 52 |
| 53 // Returns the size of valid data in bytes. | 53 // Returns the size of valid data in bytes. |
| 54 virtual size_t GetDataSize() const = 0; | 54 virtual int GetDataSize() const = 0; |
| 55 | 55 |
| 56 // If there's no data in this buffer, it represents end of stream. | 56 // If there's no data in this buffer, it represents end of stream. |
| 57 bool IsEndOfStream() const; | 57 bool IsEndOfStream() const; |
| 58 | 58 |
| 59 // Return DecryptConfig if buffer is encrypted, or NULL otherwise. | 59 // Return DecryptConfig if buffer is encrypted, or NULL otherwise. |
| 60 virtual const DecryptConfig* GetDecryptConfig() const; | 60 virtual const DecryptConfig* GetDecryptConfig() const; |
| 61 | 61 |
| 62 base::TimeDelta GetTimestamp() const { | 62 base::TimeDelta GetTimestamp() const { |
| 63 return timestamp_; | 63 return timestamp_; |
| 64 } | 64 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 81 private: | 81 private: |
| 82 base::TimeDelta timestamp_; | 82 base::TimeDelta timestamp_; |
| 83 base::TimeDelta duration_; | 83 base::TimeDelta duration_; |
| 84 | 84 |
| 85 DISALLOW_COPY_AND_ASSIGN(Buffer); | 85 DISALLOW_COPY_AND_ASSIGN(Buffer); |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 } // namespace media | 88 } // namespace media |
| 89 | 89 |
| 90 #endif // MEDIA_BASE_BUFFERS_H_ | 90 #endif // MEDIA_BASE_BUFFERS_H_ |
| OLD | NEW |