Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(923)

Unified Diff: media/base/decoder_buffer.cc

Issue 12157002: Adding YUVA support for enabling Alpha Playback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moving VP8 Alpha Playback behind its own flag Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698