Chromium Code Reviews| 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 #include "media/base/decoder_buffer.h" | 5 #include "media/base/decoder_buffer.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "media/base/buffers.h" | 8 #include "media/base/buffers.h" |
| 9 #include "media/base/decrypt_config.h" | 9 #include "media/base/decrypt_config.h" |
| 10 | 10 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 97 << " discard_padding (ms): (" << discard_padding_.first.InMilliseconds() | 97 << " discard_padding (ms): (" << discard_padding_.first.InMilliseconds() |
| 98 << ", " << discard_padding_.second.InMilliseconds() << ")"; | 98 << ", " << discard_padding_.second.InMilliseconds() << ")"; |
| 99 return s.str(); | 99 return s.str(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 void DecoderBuffer::set_timestamp(base::TimeDelta timestamp) { | 102 void DecoderBuffer::set_timestamp(base::TimeDelta timestamp) { |
| 103 DCHECK(!end_of_stream()); | 103 DCHECK(!end_of_stream()); |
| 104 timestamp_ = timestamp; | 104 timestamp_ = timestamp; |
| 105 } | 105 } |
| 106 | 106 |
| 107 void DecoderBuffer::CopySideDataFrom(const uint8* side_data, | |
| 108 int side_data_size) { | |
| 109 if (side_data_size > 0) { | |
| 110 side_data_.reset(reinterpret_cast<uint8*>( | |
| 111 base::AlignedAlloc(side_data_size_ + kPaddingSize, kAlignmentSize))); | |
|
xhwang
2014/12/06 00:03:44
Can we have a centralized place to call AlignedAll
DaleCurtis
2014/12/06 00:42:59
Done.
| |
| 112 side_data_size_ = side_data_size; | |
| 113 memcpy(side_data_.get(), side_data, side_data_size_); | |
| 114 memset(side_data_.get() + side_data_size_, 0, kPaddingSize); | |
| 115 } else { | |
| 116 side_data_.reset(); | |
| 117 side_data_size_ = 0; | |
| 118 } | |
| 119 } | |
| 120 | |
| 107 } // namespace media | 121 } // namespace media |
| OLD | NEW |