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 MEDIA_BASE_DECODER_BUFFER_H_ | 5 #ifndef MEDIA_BASE_DECODER_BUFFER_H_ |
6 #define MEDIA_BASE_DECODER_BUFFER_H_ | 6 #define MEDIA_BASE_DECODER_BUFFER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 const uint8* data() const { | 89 const uint8* data() const { |
90 DCHECK(!end_of_stream()); | 90 DCHECK(!end_of_stream()); |
91 return data_.get(); | 91 return data_.get(); |
92 } | 92 } |
93 | 93 |
94 uint8* writable_data() const { | 94 uint8* writable_data() const { |
95 DCHECK(!end_of_stream()); | 95 DCHECK(!end_of_stream()); |
96 return data_.get(); | 96 return data_.get(); |
97 } | 97 } |
98 | 98 |
| 99 // TODO(servolk): data_size should return size_t instead of int |
99 int data_size() const { | 100 int data_size() const { |
100 DCHECK(!end_of_stream()); | 101 DCHECK(!end_of_stream()); |
101 return size_; | 102 return size_; |
102 } | 103 } |
103 | 104 |
104 const uint8* side_data() const { | 105 const uint8* side_data() const { |
105 DCHECK(!end_of_stream()); | 106 DCHECK(!end_of_stream()); |
106 return side_data_.get(); | 107 return side_data_.get(); |
107 } | 108 } |
108 | 109 |
| 110 // TODO(servolk): side_data_size should return size_t instead of int |
109 int side_data_size() const { | 111 int side_data_size() const { |
110 DCHECK(!end_of_stream()); | 112 DCHECK(!end_of_stream()); |
111 return side_data_size_; | 113 return side_data_size_; |
112 } | 114 } |
113 | 115 |
114 // A discard window indicates the amount of data which should be discard from | 116 // A discard window indicates the amount of data which should be discard from |
115 // this buffer after decoding. The first value is the amount of the front and | 117 // this buffer after decoding. The first value is the amount of the front and |
116 // the second the amount off the back. A value of kInfiniteDuration() for the | 118 // the second the amount off the back. A value of kInfiniteDuration() for the |
117 // first value indicates the entire buffer should be discarded; the second | 119 // first value indicates the entire buffer should be discarded; the second |
118 // value must be base::TimeDelta() in this case. | 120 // value must be base::TimeDelta() in this case. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 // set to NULL and |buffer_size_| to 0. |is_key_frame_| will default to | 182 // set to NULL and |buffer_size_| to 0. |is_key_frame_| will default to |
181 // false. | 183 // false. |
182 DecoderBuffer(const uint8* data, int size, | 184 DecoderBuffer(const uint8* data, int size, |
183 const uint8* side_data, int side_data_size); | 185 const uint8* side_data, int side_data_size); |
184 virtual ~DecoderBuffer(); | 186 virtual ~DecoderBuffer(); |
185 | 187 |
186 private: | 188 private: |
187 base::TimeDelta timestamp_; | 189 base::TimeDelta timestamp_; |
188 base::TimeDelta duration_; | 190 base::TimeDelta duration_; |
189 | 191 |
| 192 // TODO(servolk): Consider changing size_/side_data_size_ types to size_t. |
190 int size_; | 193 int size_; |
191 scoped_ptr<uint8, base::AlignedFreeDeleter> data_; | 194 scoped_ptr<uint8, base::AlignedFreeDeleter> data_; |
192 int side_data_size_; | 195 int side_data_size_; |
193 scoped_ptr<uint8, base::AlignedFreeDeleter> side_data_; | 196 scoped_ptr<uint8, base::AlignedFreeDeleter> side_data_; |
194 scoped_ptr<DecryptConfig> decrypt_config_; | 197 scoped_ptr<DecryptConfig> decrypt_config_; |
195 DiscardPadding discard_padding_; | 198 DiscardPadding discard_padding_; |
196 base::TimeDelta splice_timestamp_; | 199 base::TimeDelta splice_timestamp_; |
197 bool is_key_frame_; | 200 bool is_key_frame_; |
198 | 201 |
199 // Constructor helper method for memory allocations. | 202 // Constructor helper method for memory allocations. |
200 void Initialize(); | 203 void Initialize(); |
201 | 204 |
202 DISALLOW_COPY_AND_ASSIGN(DecoderBuffer); | 205 DISALLOW_COPY_AND_ASSIGN(DecoderBuffer); |
203 }; | 206 }; |
204 | 207 |
205 } // namespace media | 208 } // namespace media |
206 | 209 |
207 #endif // MEDIA_BASE_DECODER_BUFFER_H_ | 210 #endif // MEDIA_BASE_DECODER_BUFFER_H_ |
OLD | NEW |