OLD | NEW |
---|---|
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 discard_padding_(0) { | |
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 discard_padding_(0) { | |
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 std::string DecoderBuffer::AsHumanReadableString() { | 75 std::string DecoderBuffer::AsHumanReadableString() { |
74 if (end_of_stream()) { | 76 if (end_of_stream()) { |
75 return "end of stream"; | 77 return "end of stream"; |
76 } | 78 } |
77 | 79 |
78 std::ostringstream s; | 80 std::ostringstream s; |
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); |
fgalligan1
2013/08/26 21:10:06
Add discard padding.
vignesh
2013/08/26 21:44:23
Done.
| |
84 return s.str(); | 86 return s.str(); |
85 } | 87 } |
86 | 88 |
87 } // namespace media | 89 } // namespace media |
OLD | NEW |