OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 private: | 116 private: |
117 DISALLOW_COPY_AND_ASSIGN(AudioDecoderPcm16B); | 117 DISALLOW_COPY_AND_ASSIGN(AudioDecoderPcm16B); |
118 }; | 118 }; |
119 | 119 |
120 // This class handles all four types (i.e., sample rates) of PCM16B codecs. | 120 // This class handles all four types (i.e., sample rates) of PCM16B codecs. |
121 // The type is specified in the constructor parameter |type|, and the number | 121 // The type is specified in the constructor parameter |type|, and the number |
122 // of channels is derived from the type. | 122 // of channels is derived from the type. |
123 class AudioDecoderPcm16BMultiCh : public AudioDecoderPcm16B { | 123 class AudioDecoderPcm16BMultiCh : public AudioDecoderPcm16B { |
124 public: | 124 public: |
125 explicit AudioDecoderPcm16BMultiCh(int num_channels); | 125 explicit AudioDecoderPcm16BMultiCh(size_t num_channels); |
126 size_t Channels() const override; | 126 size_t Channels() const override; |
127 | 127 |
128 private: | 128 private: |
129 const size_t channels_; | 129 const size_t channels_; |
130 DISALLOW_COPY_AND_ASSIGN(AudioDecoderPcm16BMultiCh); | 130 DISALLOW_COPY_AND_ASSIGN(AudioDecoderPcm16BMultiCh); |
131 }; | 131 }; |
132 #endif | 132 #endif |
133 | 133 |
134 #ifdef WEBRTC_CODEC_ILBC | 134 #ifdef WEBRTC_CODEC_ILBC |
135 class AudioDecoderIlbc : public AudioDecoder { | 135 class AudioDecoderIlbc : public AudioDecoder { |
136 public: | 136 public: |
137 AudioDecoderIlbc(); | 137 AudioDecoderIlbc(); |
138 ~AudioDecoderIlbc() override; | 138 ~AudioDecoderIlbc() override; |
139 bool HasDecodePlc() const override; | 139 bool HasDecodePlc() const override; |
140 int DecodePlc(int num_frames, int16_t* decoded) override; | 140 size_t DecodePlc(size_t num_frames, int16_t* decoded) override; |
141 int Init() override; | 141 int Init() override; |
142 size_t Channels() const override; | 142 size_t Channels() const override; |
143 | 143 |
144 protected: | 144 protected: |
145 int DecodeInternal(const uint8_t* encoded, | 145 int DecodeInternal(const uint8_t* encoded, |
146 size_t encoded_len, | 146 size_t encoded_len, |
147 int sample_rate_hz, | 147 int sample_rate_hz, |
148 int16_t* decoded, | 148 int16_t* decoded, |
149 SpeechType* speech_type) override; | 149 SpeechType* speech_type) override; |
150 | 150 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 G722DecInst* dec_state_left_; | 202 G722DecInst* dec_state_left_; |
203 G722DecInst* dec_state_right_; | 203 G722DecInst* dec_state_right_; |
204 | 204 |
205 DISALLOW_COPY_AND_ASSIGN(AudioDecoderG722Stereo); | 205 DISALLOW_COPY_AND_ASSIGN(AudioDecoderG722Stereo); |
206 }; | 206 }; |
207 #endif | 207 #endif |
208 | 208 |
209 #ifdef WEBRTC_CODEC_OPUS | 209 #ifdef WEBRTC_CODEC_OPUS |
210 class AudioDecoderOpus : public AudioDecoder { | 210 class AudioDecoderOpus : public AudioDecoder { |
211 public: | 211 public: |
212 explicit AudioDecoderOpus(int num_channels); | 212 explicit AudioDecoderOpus(size_t num_channels); |
213 ~AudioDecoderOpus() override; | 213 ~AudioDecoderOpus() override; |
214 | 214 |
215 int Init() override; | 215 int Init() override; |
216 int PacketDuration(const uint8_t* encoded, size_t encoded_len) const override; | 216 int PacketDuration(const uint8_t* encoded, size_t encoded_len) const override; |
217 int PacketDurationRedundant(const uint8_t* encoded, | 217 int PacketDurationRedundant(const uint8_t* encoded, |
218 size_t encoded_len) const override; | 218 size_t encoded_len) const override; |
219 bool PacketHasFec(const uint8_t* encoded, size_t encoded_len) const override; | 219 bool PacketHasFec(const uint8_t* encoded, size_t encoded_len) const override; |
220 size_t Channels() const override; | 220 size_t Channels() const override; |
221 | 221 |
222 protected: | 222 protected: |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 // Returns the sample rate for |codec_type|. | 307 // Returns the sample rate for |codec_type|. |
308 int CodecSampleRateHz(NetEqDecoder codec_type); | 308 int CodecSampleRateHz(NetEqDecoder codec_type); |
309 | 309 |
310 // Creates an AudioDecoder object of type |codec_type|. Returns NULL for for | 310 // Creates an AudioDecoder object of type |codec_type|. Returns NULL for for |
311 // unsupported codecs, and when creating an AudioDecoder is not applicable | 311 // unsupported codecs, and when creating an AudioDecoder is not applicable |
312 // (e.g., for RED and DTMF/AVT types). | 312 // (e.g., for RED and DTMF/AVT types). |
313 AudioDecoder* CreateAudioDecoder(NetEqDecoder codec_type); | 313 AudioDecoder* CreateAudioDecoder(NetEqDecoder codec_type); |
314 | 314 |
315 } // namespace webrtc | 315 } // namespace webrtc |
316 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_AUDIO_DECODER_IMPL_H_ | 316 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_AUDIO_DECODER_IMPL_H_ |
OLD | NEW |