Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 various types of timestamped media buffers used for transporting | 5 // Defines various types of timestamped media buffers used for transporting |
| 6 // data between filters. Every buffer contains a timestamp in microseconds | 6 // data between filters. Every buffer contains a timestamp in microseconds |
| 7 // describing the relative position of the buffer within the media stream, and | 7 // describing the relative position of the buffer within the media stream, and |
| 8 // the duration in microseconds for the length of time the buffer will be | 8 // the duration in microseconds for the length of time the buffer will be |
| 9 // rendered. | 9 // rendered. |
| 10 // | 10 // |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 // Returns the size of valid data in bytes. | 84 // Returns the size of valid data in bytes. |
| 85 virtual size_t GetDataSize() const = 0; | 85 virtual size_t GetDataSize() const = 0; |
| 86 | 86 |
| 87 // If there's no data in this buffer, it represents end of stream. | 87 // If there's no data in this buffer, it represents end of stream. |
| 88 virtual bool IsEndOfStream() const; | 88 virtual bool IsEndOfStream() const; |
| 89 | 89 |
| 90 protected: | 90 protected: |
| 91 virtual ~Buffer() {} | 91 virtual ~Buffer() {} |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 // Simple implementation of the Buffer interface. | |
| 95 // NOTE: This class makes a copy of the data passed to the contructor. | |
| 96 class BufferImpl : public Buffer { | |
|
scherkus (not reviewing)
2011/06/22 17:31:09
so DataBuffer didn't do the trick?
also: this has
acolwell GONE FROM CHROMIUM
2011/06/23 16:51:28
oops. totally missed that class. I've updated the
| |
| 97 public: | |
| 98 BufferImpl(const base::TimeDelta& timestamp, | |
| 99 const base::TimeDelta& duration, | |
| 100 const uint8* data, size_t size); | |
| 101 virtual ~BufferImpl(); | |
| 102 | |
| 103 // Buffer implementation. | |
| 104 virtual const uint8* GetData() const; | |
| 105 virtual size_t GetDataSize() const; | |
| 106 | |
| 107 private: | |
| 108 uint8* data_; | |
|
scherkus (not reviewing)
2011/06/22 17:31:09
scoped_ptr ?
acolwell GONE FROM CHROMIUM
2011/06/23 16:51:28
No longer needed.
| |
| 109 size_t size_; | |
| 110 | |
| 111 DISALLOW_IMPLICIT_CONSTRUCTORS(BufferImpl); | |
| 112 }; | |
| 94 } // namespace media | 113 } // namespace media |
| 95 | 114 |
| 96 #endif // MEDIA_BASE_BUFFERS_H_ | 115 #endif // MEDIA_BASE_BUFFERS_H_ |
| OLD | NEW |