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

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

Issue 156783003: Enhance AudioSplicer to crossfade marked splice frames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clarity. Created 6 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 unified diff | Download patch | Annotate | Revision Log
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 {
11 11
12 DecoderBuffer::DecoderBuffer(int size) 12 DecoderBuffer::DecoderBuffer(int size)
13 : size_(size), 13 : size_(size),
14 side_data_size_(0) { 14 side_data_size_(0),
15 splice_preroll_(false) {
15 Initialize(); 16 Initialize();
16 } 17 }
17 18
18 DecoderBuffer::DecoderBuffer(const uint8* data, int size, 19 DecoderBuffer::DecoderBuffer(const uint8* data, int size,
19 const uint8* side_data, int side_data_size) 20 const uint8* side_data, int side_data_size)
20 : size_(size), 21 : size_(size),
21 side_data_size_(side_data_size) { 22 side_data_size_(side_data_size),
23 splice_preroll_(false) {
22 if (!data) { 24 if (!data) {
23 CHECK_EQ(size_, 0); 25 CHECK_EQ(size_, 0);
24 CHECK(!side_data); 26 CHECK(!side_data);
25 return; 27 return;
26 } 28 }
27 29
28 Initialize(); 30 Initialize();
29 memcpy(data_.get(), data, size_); 31 memcpy(data_.get(), data, size_);
30 if (side_data) 32 if (side_data)
31 memcpy(side_data_.get(), side_data, side_data_size_); 33 memcpy(side_data_.get(), side_data, side_data_size_);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 s << "timestamp: " << timestamp_.InMicroseconds() 81 s << "timestamp: " << timestamp_.InMicroseconds()
80 << " duration: " << duration_.InMicroseconds() 82 << " duration: " << duration_.InMicroseconds()
81 << " size: " << size_ 83 << " size: " << size_
82 << " side_data_size: " << side_data_size_ 84 << " side_data_size: " << side_data_size_
83 << " encrypted: " << (decrypt_config_ != NULL) 85 << " encrypted: " << (decrypt_config_ != NULL)
84 << " discard_padding (ms): " << discard_padding_.InMilliseconds(); 86 << " discard_padding (ms): " << discard_padding_.InMilliseconds();
85 return s.str(); 87 return s.str();
86 } 88 }
87 89
88 } // namespace media 90 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698