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

Side by Side 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 and adding pipeline integration test 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 unified diff | Download patch
« no previous file with comments | « no previous file | media/base/stream_parser_buffer.h » ('j') | media/webm/webm_tracks_parser.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/decrypt_config.h" 8 #include "media/base/decrypt_config.h"
9 9
10 namespace media { 10 namespace media {
(...skipping 15 matching lines...) Expand all
26 Initialize(); 26 Initialize();
27 memcpy(data_.get(), data, size_); 27 memcpy(data_.get(), data, size_);
28 } 28 }
29 29
30 DecoderBuffer::DecoderBuffer(const uint8* data, int size, 30 DecoderBuffer::DecoderBuffer(const uint8* data, int size,
31 const uint8* side_data, int side_data_size) 31 const uint8* side_data, int side_data_size)
32 : size_(size), 32 : size_(size),
33 side_data_size_(side_data_size) { 33 side_data_size_(side_data_size) {
34 if (!data) { 34 if (!data) {
35 CHECK_EQ(size_, 0); 35 CHECK_EQ(size_, 0);
36 CHECK(!side_data);
36 return; 37 return;
37 } 38 }
38 39
39 Initialize(); 40 Initialize();
40 memcpy(data_.get(), data, size_); 41 memcpy(data_.get(), data, size_);
41 memcpy(side_data_.get(), side_data, side_data_size_); 42 if (side_data_size_ > 0)
acolwell GONE FROM CHROMIUM 2013/05/21 19:47:48 nit: Per offline discussion. s/side_data_size_/sid
vignesh 2013/05/21 21:05:21 Done.
43 memcpy(side_data_.get(), side_data, side_data_size_);
42 } 44 }
43 45
44 DecoderBuffer::~DecoderBuffer() {} 46 DecoderBuffer::~DecoderBuffer() {}
45 47
46 void DecoderBuffer::Initialize() { 48 void DecoderBuffer::Initialize() {
47 CHECK_GE(size_, 0); 49 CHECK_GE(size_, 0);
48 data_.reset(reinterpret_cast<uint8*>( 50 data_.reset(reinterpret_cast<uint8*>(
49 base::AlignedAlloc(size_ + kPaddingSize, kAlignmentSize))); 51 base::AlignedAlloc(size_ + kPaddingSize, kAlignmentSize)));
50 memset(data_.get() + size_, 0, kPaddingSize); 52 memset(data_.get() + size_, 0, kPaddingSize);
51 if (side_data_size_ > 0) { 53 if (side_data_size_ > 0) {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 std::ostringstream s; 149 std::ostringstream s;
148 s << "timestamp: " << timestamp_.InMicroseconds() 150 s << "timestamp: " << timestamp_.InMicroseconds()
149 << " duration: " << duration_.InMicroseconds() 151 << " duration: " << duration_.InMicroseconds()
150 << " size: " << size_ 152 << " size: " << size_
151 << " side_data_size: " << side_data_size_ 153 << " side_data_size: " << side_data_size_
152 << " encrypted: " << (decrypt_config_ != NULL); 154 << " encrypted: " << (decrypt_config_ != NULL);
153 return s.str(); 155 return s.str();
154 } 156 }
155 157
156 } // namespace media 158 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/base/stream_parser_buffer.h » ('j') | media/webm/webm_tracks_parser.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698