| 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 } | 162 } |
| 163 | 163 |
| 164 void set_is_key_frame(bool is_key_frame) { | 164 void set_is_key_frame(bool is_key_frame) { |
| 165 DCHECK(!end_of_stream()); | 165 DCHECK(!end_of_stream()); |
| 166 is_key_frame_ = is_key_frame; | 166 is_key_frame_ = is_key_frame; |
| 167 } | 167 } |
| 168 | 168 |
| 169 // Returns a human-readable string describing |*this|. | 169 // Returns a human-readable string describing |*this|. |
| 170 std::string AsHumanReadableString(); | 170 std::string AsHumanReadableString(); |
| 171 | 171 |
| 172 // Replaces any existing side data with data copied from |side_data|. |
| 173 void CopySideDataFrom(const uint8* side_data, int side_data_size); |
| 174 |
| 172 protected: | 175 protected: |
| 173 friend class base::RefCountedThreadSafe<DecoderBuffer>; | 176 friend class base::RefCountedThreadSafe<DecoderBuffer>; |
| 174 | 177 |
| 175 // Allocates a buffer of size |size| >= 0 and copies |data| into it. Buffer | 178 // Allocates a buffer of size |size| >= 0 and copies |data| into it. Buffer |
| 176 // will be padded and aligned as necessary. If |data| is NULL then |data_| is | 179 // will be padded and aligned as necessary. If |data| is NULL then |data_| is |
| 177 // set to NULL and |buffer_size_| to 0. |is_key_frame_| will default to | 180 // set to NULL and |buffer_size_| to 0. |is_key_frame_| will default to |
| 178 // false. | 181 // false. |
| 179 DecoderBuffer(const uint8* data, int size, | 182 DecoderBuffer(const uint8* data, int size, |
| 180 const uint8* side_data, int side_data_size); | 183 const uint8* side_data, int side_data_size); |
| 181 virtual ~DecoderBuffer(); | 184 virtual ~DecoderBuffer(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 195 | 198 |
| 196 // Constructor helper method for memory allocations. | 199 // Constructor helper method for memory allocations. |
| 197 void Initialize(); | 200 void Initialize(); |
| 198 | 201 |
| 199 DISALLOW_COPY_AND_ASSIGN(DecoderBuffer); | 202 DISALLOW_COPY_AND_ASSIGN(DecoderBuffer); |
| 200 }; | 203 }; |
| 201 | 204 |
| 202 } // namespace media | 205 } // namespace media |
| 203 | 206 |
| 204 #endif // MEDIA_BASE_DECODER_BUFFER_H_ | 207 #endif // MEDIA_BASE_DECODER_BUFFER_H_ |
| OLD | NEW |