Index: media/base/decoder_buffer.cc |
diff --git a/media/base/decoder_buffer.cc b/media/base/decoder_buffer.cc |
index 03f9bbbc566abc70abb878bc0dc00b34c82b7093..674506cae2a5fc6fe8bde65088297e7229b901a5 100644 |
--- a/media/base/decoder_buffer.cc |
+++ b/media/base/decoder_buffer.cc |
@@ -32,6 +32,7 @@ void DecoderBuffer::Initialize() { |
data_.reset(reinterpret_cast<uint8*>( |
base::AlignedAlloc(size_ + kPaddingSize, kAlignmentSize))); |
memset(data_.get() + size_, 0, kPaddingSize); |
+ side_data_size_ = 0; |
} |
// static |
@@ -42,6 +43,16 @@ scoped_refptr<DecoderBuffer> DecoderBuffer::CopyFrom(const uint8* data, |
return make_scoped_refptr(new DecoderBuffer(data, data_size)); |
} |
+void DecoderBuffer::SetSideData(const uint8* side_data, int side_data_size) { |
+ DCHECK(side_data); |
+ DCHECK_GE(side_data_size_, 0); |
+ side_data_size_ = side_data_size; |
+ side_data_.reset(reinterpret_cast<uint8*>( |
+ base::AlignedAlloc(side_data_size_ + kPaddingSize, kAlignmentSize))); |
fgalligan1
2013/02/12 01:20:58
nit: 4 space indent
vigneshv
2013/02/14 19:06:14
Done.
|
+ memset(side_data_.get() + side_data_size_, 0, kPaddingSize); |
+ memcpy(side_data_.get(), side_data, side_data_size_); |
+} |
+ |
// static |
scoped_refptr<DecoderBuffer> DecoderBuffer::CreateEOSBuffer() { |
return make_scoped_refptr(new DecoderBuffer(NULL, 0)); |
@@ -82,6 +93,14 @@ int DecoderBuffer::GetDataSize() const { |
return size_; |
} |
+const uint8* DecoderBuffer::GetSideData() const { |
+ return side_data_.get(); |
+} |
+ |
+int DecoderBuffer::GetSideDataSize() const { |
+ return side_data_size_; |
+} |
+ |
const DecryptConfig* DecoderBuffer::GetDecryptConfig() const { |
DCHECK(!IsEndOfStream()); |
return decrypt_config_.get(); |