OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "media/base/audio_decoder_config.h" | |
6 | |
7 #include "base/logging.h" | |
8 | |
9 namespace media { | |
10 | |
11 AudioDecoderConfig::AudioDecoderConfig(AudioCodec codec, | |
12 int bits_per_channel, | |
13 ChannelLayout channel_layout, | |
14 int sample_rate, | |
15 const uint8* extra_data, | |
16 size_t extra_data_size) | |
17 : codec_(codec), | |
18 bits_per_channel_(bits_per_channel), | |
19 channel_layout_(channel_layout), | |
20 sample_rate_(sample_rate), | |
21 extra_data_size_(extra_data_size) { | |
22 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.
| |
23 if (extra_data_size_ > 0) { | |
24 extra_data_.reset(new uint8[extra_data_size_]); | |
25 memcpy(extra_data_.get(), extra_data, extra_data_size_); | |
26 } | |
27 } | |
28 | |
29 AudioDecoderConfig::~AudioDecoderConfig() {} | |
30 | |
31 AudioCodec AudioDecoderConfig::codec() const { | |
32 return codec_; | |
33 } | |
34 | |
35 int AudioDecoderConfig::bits_per_channel() const { | |
36 return bits_per_channel_; | |
37 } | |
38 | |
39 ChannelLayout AudioDecoderConfig::channel_layout() const { | |
40 return channel_layout_; | |
41 } | |
42 | |
43 int AudioDecoderConfig::sample_rate() const { | |
44 return sample_rate_; | |
45 } | |
46 | |
47 uint8* AudioDecoderConfig::extra_data() const { | |
48 return extra_data_.get(); | |
49 } | |
50 | |
51 size_t AudioDecoderConfig::extra_data_size() const { | |
52 return extra_data_size_; | |
53 } | |
54 | |
55 } // namespace media | |
OLD | NEW |