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

Unified Diff: media/base/decoder_buffer.cc

Issue 15342004: Adding VP8 Alpha support in Media Source (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing comments Created 7 years, 7 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
« no previous file with comments | « media/base/decoder_buffer.h ('k') | media/base/stream_parser_buffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/decoder_buffer.cc
diff --git a/media/base/decoder_buffer.cc b/media/base/decoder_buffer.cc
index aec45211f10d3d68998e304b445e463ea55b0f61..d3acc26687fb69125667317389df212da2727a08 100644
--- a/media/base/decoder_buffer.cc
+++ b/media/base/decoder_buffer.cc
@@ -15,30 +15,20 @@ DecoderBuffer::DecoderBuffer(int size)
Initialize();
}
-DecoderBuffer::DecoderBuffer(const uint8* data, int size)
- : size_(size),
- side_data_size_(0) {
- if (!data) {
- CHECK_EQ(size_, 0);
- return;
- }
-
- Initialize();
- memcpy(data_.get(), data, size_);
-}
-
DecoderBuffer::DecoderBuffer(const uint8* data, int size,
const uint8* side_data, int side_data_size)
: size_(size),
side_data_size_(side_data_size) {
if (!data) {
CHECK_EQ(size_, 0);
+ CHECK(!side_data);
return;
}
Initialize();
memcpy(data_.get(), data, size_);
- memcpy(side_data_.get(), side_data, side_data_size_);
+ if (side_data)
+ memcpy(side_data_.get(), side_data, side_data_size_);
}
DecoderBuffer::~DecoderBuffer() {}
@@ -60,7 +50,7 @@ scoped_refptr<DecoderBuffer> DecoderBuffer::CopyFrom(const uint8* data,
int data_size) {
// If you hit this CHECK you likely have a bug in a demuxer. Go fix it.
CHECK(data);
- return make_scoped_refptr(new DecoderBuffer(data, data_size));
+ return make_scoped_refptr(new DecoderBuffer(data, data_size, NULL, 0));
}
// static
@@ -77,7 +67,7 @@ scoped_refptr<DecoderBuffer> DecoderBuffer::CopyFrom(const uint8* data,
// static
scoped_refptr<DecoderBuffer> DecoderBuffer::CreateEOSBuffer() {
- return make_scoped_refptr(new DecoderBuffer(NULL, 0));
+ return make_scoped_refptr(new DecoderBuffer(NULL, 0, NULL, 0));
}
base::TimeDelta DecoderBuffer::GetTimestamp() const {
« no previous file with comments | « media/base/decoder_buffer.h ('k') | media/base/stream_parser_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698