| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 void set_decrypt_config(std::unique_ptr<DecryptConfig> decrypt_config) { | 141 void set_decrypt_config(std::unique_ptr<DecryptConfig> decrypt_config) { |
| 142 DCHECK(!end_of_stream()); | 142 DCHECK(!end_of_stream()); |
| 143 decrypt_config_ = std::move(decrypt_config); | 143 decrypt_config_ = std::move(decrypt_config); |
| 144 } | 144 } |
| 145 | 145 |
| 146 // If there's no data in this buffer, it represents end of stream. | 146 // If there's no data in this buffer, it represents end of stream. |
| 147 bool end_of_stream() const { | 147 bool end_of_stream() const { |
| 148 return data_ == NULL; | 148 return data_ == NULL; |
| 149 } | 149 } |
| 150 | 150 |
| 151 // Indicates this buffer is part of a splice around |splice_timestamp_|. | |
| 152 // Returns kNoTimestamp if the buffer is not part of a splice. | |
| 153 base::TimeDelta splice_timestamp() const { | |
| 154 DCHECK(!end_of_stream()); | |
| 155 return splice_timestamp_; | |
| 156 } | |
| 157 | |
| 158 // When set to anything but kNoTimestamp indicates this buffer is part of a | |
| 159 // splice around |splice_timestamp|. | |
| 160 void set_splice_timestamp(base::TimeDelta splice_timestamp) { | |
| 161 DCHECK(!end_of_stream()); | |
| 162 splice_timestamp_ = splice_timestamp; | |
| 163 } | |
| 164 | |
| 165 bool is_key_frame() const { | 151 bool is_key_frame() const { |
| 166 DCHECK(!end_of_stream()); | 152 DCHECK(!end_of_stream()); |
| 167 return is_key_frame_; | 153 return is_key_frame_; |
| 168 } | 154 } |
| 169 | 155 |
| 170 void set_is_key_frame(bool is_key_frame) { | 156 void set_is_key_frame(bool is_key_frame) { |
| 171 DCHECK(!end_of_stream()); | 157 DCHECK(!end_of_stream()); |
| 172 is_key_frame_ = is_key_frame; | 158 is_key_frame_ = is_key_frame; |
| 173 } | 159 } |
| 174 | 160 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 198 private: | 184 private: |
| 199 base::TimeDelta timestamp_; | 185 base::TimeDelta timestamp_; |
| 200 base::TimeDelta duration_; | 186 base::TimeDelta duration_; |
| 201 | 187 |
| 202 size_t size_; | 188 size_t size_; |
| 203 std::unique_ptr<uint8_t, base::AlignedFreeDeleter> data_; | 189 std::unique_ptr<uint8_t, base::AlignedFreeDeleter> data_; |
| 204 size_t side_data_size_; | 190 size_t side_data_size_; |
| 205 std::unique_ptr<uint8_t, base::AlignedFreeDeleter> side_data_; | 191 std::unique_ptr<uint8_t, base::AlignedFreeDeleter> side_data_; |
| 206 std::unique_ptr<DecryptConfig> decrypt_config_; | 192 std::unique_ptr<DecryptConfig> decrypt_config_; |
| 207 DiscardPadding discard_padding_; | 193 DiscardPadding discard_padding_; |
| 208 base::TimeDelta splice_timestamp_; | |
| 209 bool is_key_frame_; | 194 bool is_key_frame_; |
| 210 | 195 |
| 211 // Constructor helper method for memory allocations. | 196 // Constructor helper method for memory allocations. |
| 212 void Initialize(); | 197 void Initialize(); |
| 213 | 198 |
| 214 DISALLOW_COPY_AND_ASSIGN(DecoderBuffer); | 199 DISALLOW_COPY_AND_ASSIGN(DecoderBuffer); |
| 215 }; | 200 }; |
| 216 | 201 |
| 217 } // namespace media | 202 } // namespace media |
| 218 | 203 |
| 219 #endif // MEDIA_BASE_DECODER_BUFFER_H_ | 204 #endif // MEDIA_BASE_DECODER_BUFFER_H_ |
| OLD | NEW |