Index: media/base/audio_decoder_config.cc |
diff --git a/media/base/audio_decoder_config.cc b/media/base/audio_decoder_config.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3dd4fcd5cc2e3f97d77fd51984117c1a3ac3480e |
--- /dev/null |
+++ b/media/base/audio_decoder_config.cc |
@@ -0,0 +1,55 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "media/base/audio_decoder_config.h" |
+ |
+#include "base/logging.h" |
+ |
+namespace media { |
+ |
+AudioDecoderConfig::AudioDecoderConfig(AudioCodec codec, |
+ int bits_per_channel, |
+ ChannelLayout channel_layout, |
+ int sample_rate, |
+ const uint8* extra_data, |
+ size_t extra_data_size) |
+ : codec_(codec), |
+ bits_per_channel_(bits_per_channel), |
+ channel_layout_(channel_layout), |
+ sample_rate_(sample_rate), |
+ extra_data_size_(extra_data_size) { |
+ CHECK(extra_data_size_ == 0 || extra_data); |
Ami GONE FROM CHROMIUM
2011/09/12 20:54:21
CHECK, really?
Ami GONE FROM CHROMIUM
2011/09/12 20:54:21
IWBN to assert the stronger:
(size!=0) == (data!=N
scherkus (not reviewing)
2011/09/19 21:19:45
Done.
|
+ if (extra_data_size_ > 0) { |
+ extra_data_.reset(new uint8[extra_data_size_]); |
+ memcpy(extra_data_.get(), extra_data, extra_data_size_); |
+ } |
+} |
+ |
+AudioDecoderConfig::~AudioDecoderConfig() {} |
+ |
+AudioCodec AudioDecoderConfig::codec() const { |
+ return codec_; |
+} |
+ |
+int AudioDecoderConfig::bits_per_channel() const { |
+ return bits_per_channel_; |
+} |
+ |
+ChannelLayout AudioDecoderConfig::channel_layout() const { |
+ return channel_layout_; |
+} |
+ |
+int AudioDecoderConfig::sample_rate() const { |
+ return sample_rate_; |
+} |
+ |
+uint8* AudioDecoderConfig::extra_data() const { |
+ return extra_data_.get(); |
+} |
+ |
+size_t AudioDecoderConfig::extra_data_size() const { |
+ return extra_data_size_; |
+} |
+ |
+} // namespace media |