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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 case NetEqDecoder::kDecoderCNGswb48kHz: | 75 case NetEqDecoder::kDecoderCNGswb48kHz: |
76 case NetEqDecoder::kDecoderArbitrary: { | 76 case NetEqDecoder::kDecoderArbitrary: { |
77 return true; | 77 return true; |
78 } | 78 } |
79 default: { | 79 default: { |
80 return false; | 80 return false; |
81 } | 81 } |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
85 int CodecSampleRateHz(NetEqDecoder codec_type) { | |
86 switch (codec_type) { | |
87 case NetEqDecoder::kDecoderPCMu: | |
88 case NetEqDecoder::kDecoderPCMa: | |
89 case NetEqDecoder::kDecoderPCMu_2ch: | |
90 case NetEqDecoder::kDecoderPCMa_2ch: | |
91 #ifdef WEBRTC_CODEC_ILBC | |
92 case NetEqDecoder::kDecoderILBC: | |
93 #endif | |
94 case NetEqDecoder::kDecoderPCM16B: | |
95 case NetEqDecoder::kDecoderPCM16B_2ch: | |
96 case NetEqDecoder::kDecoderPCM16B_5ch: | |
97 case NetEqDecoder::kDecoderCNGnb: { | |
98 return 8000; | |
99 } | |
100 #if defined(WEBRTC_CODEC_ISACFX) || defined(WEBRTC_CODEC_ISAC) | |
101 case NetEqDecoder::kDecoderISAC: | |
102 #endif | |
103 case NetEqDecoder::kDecoderPCM16Bwb: | |
104 case NetEqDecoder::kDecoderPCM16Bwb_2ch: | |
105 #ifdef WEBRTC_CODEC_G722 | |
106 case NetEqDecoder::kDecoderG722: | |
107 case NetEqDecoder::kDecoderG722_2ch: | |
108 #endif | |
109 case NetEqDecoder::kDecoderCNGwb: { | |
110 return 16000; | |
111 } | |
112 #ifdef WEBRTC_CODEC_ISAC | |
113 case NetEqDecoder::kDecoderISACswb: | |
114 #endif | |
115 case NetEqDecoder::kDecoderPCM16Bswb32kHz: | |
116 case NetEqDecoder::kDecoderPCM16Bswb32kHz_2ch: | |
117 case NetEqDecoder::kDecoderCNGswb32kHz: { | |
118 return 32000; | |
119 } | |
120 case NetEqDecoder::kDecoderPCM16Bswb48kHz: | |
121 case NetEqDecoder::kDecoderPCM16Bswb48kHz_2ch: { | |
122 return 48000; | |
123 } | |
124 #ifdef WEBRTC_CODEC_OPUS | |
125 case NetEqDecoder::kDecoderOpus: | |
126 case NetEqDecoder::kDecoderOpus_2ch: { | |
127 return 48000; | |
128 } | |
129 #endif | |
130 case NetEqDecoder::kDecoderCNGswb48kHz: { | |
131 // TODO(tlegrand): Remove limitation once ACM has full 48 kHz support. | |
132 return 32000; | |
133 } | |
134 default: { | |
135 return -1; // Undefined sample rate. | |
136 } | |
137 } | |
138 } | |
139 | |
140 } // namespace webrtc | 85 } // namespace webrtc |
OLD | NEW |