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

Side by Side Diff: media/base/decoder_buffer.cc

Issue 760523008: Switch from a DataPipe per DecoderBuffer to a single one. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Fix. Created 6 years 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
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/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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698