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 |
11 #ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_AUDIO_DECODER_IMPL_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_AUDIO_DECODER_IMPL_H_ |
12 #define WEBRTC_MODULES_AUDIO_CODING_NETEQ_AUDIO_DECODER_IMPL_H_ | 12 #define WEBRTC_MODULES_AUDIO_CODING_NETEQ_AUDIO_DECODER_IMPL_H_ |
13 | 13 |
14 #include <assert.h> | 14 #include <assert.h> |
15 | 15 |
16 #include "webrtc/engine_configurations.h" | 16 #include "webrtc/engine_configurations.h" |
17 #include "webrtc/base/constructormagic.h" | 17 #include "webrtc/base/constructormagic.h" |
18 #include "webrtc/modules/audio_coding/codecs/audio_decoder.h" | 18 #include "webrtc/modules/audio_coding/codecs/audio_decoder.h" |
19 #include "webrtc/modules/audio_coding/codecs/cng/include/webrtc_cng.h" | 19 #include "webrtc/modules/audio_coding/codecs/cng/include/webrtc_cng.h" |
20 #ifdef WEBRTC_CODEC_G722 | 20 #ifdef WEBRTC_CODEC_G722 |
21 #include "webrtc/modules/audio_coding/codecs/g722/include/g722_interface.h" | 21 #include "webrtc/modules/audio_coding/codecs/g722/include/g722_interface.h" |
22 #endif | 22 #endif |
| 23 #include "webrtc/modules/audio_coding/main/acm2/rent_a_codec.h" |
23 #include "webrtc/typedefs.h" | 24 #include "webrtc/typedefs.h" |
24 | 25 |
25 namespace webrtc { | 26 namespace webrtc { |
26 | 27 |
27 // AudioDecoderCng is a special type of AudioDecoder. It inherits from | 28 // AudioDecoderCng is a special type of AudioDecoder. It inherits from |
28 // AudioDecoder just to fit in the DecoderDatabase. None of the class methods | 29 // AudioDecoder just to fit in the DecoderDatabase. None of the class methods |
29 // should be used, except constructor, destructor, and accessors. | 30 // should be used, except constructor, destructor, and accessors. |
30 // TODO(hlundin): Consider the possibility to create a super-class to | 31 // TODO(hlundin): Consider the possibility to create a super-class to |
31 // AudioDecoder that is stored in DecoderDatabase. Then AudioDecoder and a | 32 // AudioDecoder that is stored in DecoderDatabase. Then AudioDecoder and a |
32 // specific CngDecoder class could both inherit from that class. | 33 // specific CngDecoder class could both inherit from that class. |
(...skipping 16 matching lines...) Expand all Loading... |
49 size_t encoded_len, | 50 size_t encoded_len, |
50 int sample_rate_hz, | 51 int sample_rate_hz, |
51 int16_t* decoded, | 52 int16_t* decoded, |
52 SpeechType* speech_type) override; | 53 SpeechType* speech_type) override; |
53 | 54 |
54 private: | 55 private: |
55 CNG_dec_inst* dec_state_; | 56 CNG_dec_inst* dec_state_; |
56 RTC_DISALLOW_COPY_AND_ASSIGN(AudioDecoderCng); | 57 RTC_DISALLOW_COPY_AND_ASSIGN(AudioDecoderCng); |
57 }; | 58 }; |
58 | 59 |
59 enum NetEqDecoder { | 60 using NetEqDecoder = acm2::RentACodec::NetEqDecoder; |
60 kDecoderPCMu, | |
61 kDecoderPCMa, | |
62 kDecoderPCMu_2ch, | |
63 kDecoderPCMa_2ch, | |
64 kDecoderILBC, | |
65 kDecoderISAC, | |
66 kDecoderISACswb, | |
67 kDecoderPCM16B, | |
68 kDecoderPCM16Bwb, | |
69 kDecoderPCM16Bswb32kHz, | |
70 kDecoderPCM16Bswb48kHz, | |
71 kDecoderPCM16B_2ch, | |
72 kDecoderPCM16Bwb_2ch, | |
73 kDecoderPCM16Bswb32kHz_2ch, | |
74 kDecoderPCM16Bswb48kHz_2ch, | |
75 kDecoderPCM16B_5ch, | |
76 kDecoderG722, | |
77 kDecoderG722_2ch, | |
78 kDecoderRED, | |
79 kDecoderAVT, | |
80 kDecoderCNGnb, | |
81 kDecoderCNGwb, | |
82 kDecoderCNGswb32kHz, | |
83 kDecoderCNGswb48kHz, | |
84 kDecoderArbitrary, | |
85 kDecoderOpus, | |
86 kDecoderOpus_2ch, | |
87 }; | |
88 | 61 |
89 // Returns true if |codec_type| is supported. | 62 // Returns true if |codec_type| is supported. |
90 bool CodecSupported(NetEqDecoder codec_type); | 63 bool CodecSupported(NetEqDecoder codec_type); |
91 | 64 |
92 // Returns the sample rate for |codec_type|. | 65 // Returns the sample rate for |codec_type|. |
93 int CodecSampleRateHz(NetEqDecoder codec_type); | 66 int CodecSampleRateHz(NetEqDecoder codec_type); |
94 | 67 |
95 // Creates an AudioDecoder object of type |codec_type|. Returns NULL for for | 68 // Creates an AudioDecoder object of type |codec_type|. Returns NULL for for |
96 // unsupported codecs, and when creating an AudioDecoder is not applicable | 69 // unsupported codecs, and when creating an AudioDecoder is not applicable |
97 // (e.g., for RED and DTMF/AVT types). | 70 // (e.g., for RED and DTMF/AVT types). |
98 AudioDecoder* CreateAudioDecoder(NetEqDecoder codec_type); | 71 AudioDecoder* CreateAudioDecoder(NetEqDecoder codec_type); |
99 | 72 |
100 } // namespace webrtc | 73 } // namespace webrtc |
101 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_AUDIO_DECODER_IMPL_H_ | 74 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_AUDIO_DECODER_IMPL_H_ |
OLD | NEW |