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/audio_decoder_config.h" | 5 #include "media/base/audio_decoder_config.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "media/audio/sample_rates.h" | 9 #include "media/audio/sample_rates.h" |
10 #include "media/base/limits.h" | 10 #include "media/base/limits.h" |
11 #include "media/base/sample_format.h" | 11 #include "media/base/sample_format.h" |
12 | 12 |
13 namespace media { | 13 namespace media { |
14 | 14 |
15 AudioDecoderConfig::AudioDecoderConfig() | 15 AudioDecoderConfig::AudioDecoderConfig() |
16 : codec_(kUnknownAudioCodec), | 16 : codec_(kUnknownAudioCodec), |
17 sample_format_(kUnknownSampleFormat), | 17 sample_format_(kUnknownSampleFormat), |
18 bytes_per_channel_(0), | 18 bytes_per_channel_(0), |
19 channel_layout_(CHANNEL_LAYOUT_UNSUPPORTED), | 19 channel_layout_(CHANNEL_LAYOUT_UNSUPPORTED), |
20 samples_per_second_(0), | 20 samples_per_second_(0), |
21 bytes_per_frame_(0), | 21 bytes_per_frame_(0), |
22 is_encrypted_(false) { | 22 is_encrypted_(false), |
| 23 seek_pre_roll_(0), |
| 24 codec_delay_(0) { |
23 } | 25 } |
24 | 26 |
25 AudioDecoderConfig::AudioDecoderConfig(AudioCodec codec, | 27 AudioDecoderConfig::AudioDecoderConfig(AudioCodec codec, |
26 SampleFormat sample_format, | 28 SampleFormat sample_format, |
27 ChannelLayout channel_layout, | 29 ChannelLayout channel_layout, |
28 int samples_per_second, | 30 int samples_per_second, |
29 const uint8* extra_data, | 31 const uint8* extra_data, |
30 size_t extra_data_size, | 32 size_t extra_data_size, |
31 bool is_encrypted) { | 33 bool is_encrypted) { |
32 Initialize(codec, sample_format, channel_layout, samples_per_second, | 34 Initialize(codec, sample_format, channel_layout, samples_per_second, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 87 |
86 bool AudioDecoderConfig::Matches(const AudioDecoderConfig& config) const { | 88 bool AudioDecoderConfig::Matches(const AudioDecoderConfig& config) const { |
87 return ((codec() == config.codec()) && | 89 return ((codec() == config.codec()) && |
88 (bytes_per_channel() == config.bytes_per_channel()) && | 90 (bytes_per_channel() == config.bytes_per_channel()) && |
89 (channel_layout() == config.channel_layout()) && | 91 (channel_layout() == config.channel_layout()) && |
90 (samples_per_second() == config.samples_per_second()) && | 92 (samples_per_second() == config.samples_per_second()) && |
91 (extra_data_size() == config.extra_data_size()) && | 93 (extra_data_size() == config.extra_data_size()) && |
92 (!extra_data() || !memcmp(extra_data(), config.extra_data(), | 94 (!extra_data() || !memcmp(extra_data(), config.extra_data(), |
93 extra_data_size())) && | 95 extra_data_size())) && |
94 (is_encrypted() == config.is_encrypted()) && | 96 (is_encrypted() == config.is_encrypted()) && |
95 (sample_format() == config.sample_format())); | 97 (sample_format() == config.sample_format()) && |
| 98 (seek_pre_roll() == config.seek_pre_roll()) && |
| 99 (codec_delay() == config.codec_delay())); |
96 } | 100 } |
97 | 101 |
98 } // namespace media | 102 } // namespace media |
OLD | NEW |