OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 static inline rtc::Optional<CodecId> CodecIdFromIndex(int codec_index) { | 156 static inline rtc::Optional<CodecId> CodecIdFromIndex(int codec_index) { |
157 return static_cast<size_t>(codec_index) < NumberOfCodecs() | 157 return static_cast<size_t>(codec_index) < NumberOfCodecs() |
158 ? rtc::Optional<RentACodec::CodecId>( | 158 ? rtc::Optional<RentACodec::CodecId>( |
159 static_cast<RentACodec::CodecId>(codec_index)) | 159 static_cast<RentACodec::CodecId>(codec_index)) |
160 : rtc::Optional<RentACodec::CodecId>(); | 160 : rtc::Optional<RentACodec::CodecId>(); |
161 } | 161 } |
162 | 162 |
163 static rtc::Optional<CodecId> CodecIdByParams(const char* payload_name, | 163 static rtc::Optional<CodecId> CodecIdByParams(const char* payload_name, |
164 int sampling_freq_hz, | 164 int sampling_freq_hz, |
165 int channels); | 165 size_t channels); |
166 static rtc::Optional<CodecInst> CodecInstById(CodecId codec_id); | 166 static rtc::Optional<CodecInst> CodecInstById(CodecId codec_id); |
167 static rtc::Optional<CodecId> CodecIdByInst(const CodecInst& codec_inst); | 167 static rtc::Optional<CodecId> CodecIdByInst(const CodecInst& codec_inst); |
168 static rtc::Optional<CodecInst> CodecInstByParams(const char* payload_name, | 168 static rtc::Optional<CodecInst> CodecInstByParams(const char* payload_name, |
169 int sampling_freq_hz, | 169 int sampling_freq_hz, |
170 int channels); | 170 size_t channels); |
171 static bool IsCodecValid(const CodecInst& codec_inst); | 171 static bool IsCodecValid(const CodecInst& codec_inst); |
172 | 172 |
173 static inline bool IsPayloadTypeValid(int payload_type) { | 173 static inline bool IsPayloadTypeValid(int payload_type) { |
174 return payload_type >= 0 && payload_type <= 127; | 174 return payload_type >= 0 && payload_type <= 127; |
175 } | 175 } |
176 | 176 |
177 static rtc::ArrayView<const CodecInst> Database(); | 177 static rtc::ArrayView<const CodecInst> Database(); |
178 | 178 |
179 static rtc::Optional<bool> IsSupportedNumChannels(CodecId codec_id, | 179 static rtc::Optional<bool> IsSupportedNumChannels(CodecId codec_id, |
180 int num_channels); | 180 size_t num_channels); |
181 | 181 |
182 static rtc::Optional<NetEqDecoder> NetEqDecoderFromCodecId(CodecId codec_id, | 182 static rtc::Optional<NetEqDecoder> NetEqDecoderFromCodecId( |
183 int num_channels); | 183 CodecId codec_id, |
| 184 size_t num_channels); |
184 | 185 |
185 // Parse codec_inst and extract payload types. If the given CodecInst was for | 186 // Parse codec_inst and extract payload types. If the given CodecInst was for |
186 // the wrong sort of codec, return kSkip; otherwise, if the rate was illegal, | 187 // the wrong sort of codec, return kSkip; otherwise, if the rate was illegal, |
187 // return kBadFreq; otherwise, update the given RTP timestamp rate (Hz) -> | 188 // return kBadFreq; otherwise, update the given RTP timestamp rate (Hz) -> |
188 // payload type map and return kOk. | 189 // payload type map and return kOk. |
189 enum class RegistrationResult { kOk, kSkip, kBadFreq }; | 190 enum class RegistrationResult { kOk, kSkip, kBadFreq }; |
190 static RegistrationResult RegisterCngPayloadType(std::map<int, int>* pt_map, | 191 static RegistrationResult RegisterCngPayloadType(std::map<int, int>* pt_map, |
191 const CodecInst& codec_inst); | 192 const CodecInst& codec_inst); |
192 static RegistrationResult RegisterRedPayloadType(std::map<int, int>* pt_map, | 193 static RegistrationResult RegisterRedPayloadType(std::map<int, int>* pt_map, |
193 const CodecInst& codec_inst); | 194 const CodecInst& codec_inst); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 AudioEncoder* encoder_stack_ = nullptr; | 240 AudioEncoder* encoder_stack_ = nullptr; |
240 LockedIsacBandwidthInfo isac_bandwidth_info_; | 241 LockedIsacBandwidthInfo isac_bandwidth_info_; |
241 | 242 |
242 RTC_DISALLOW_COPY_AND_ASSIGN(RentACodec); | 243 RTC_DISALLOW_COPY_AND_ASSIGN(RentACodec); |
243 }; | 244 }; |
244 | 245 |
245 } // namespace acm2 | 246 } // namespace acm2 |
246 } // namespace webrtc | 247 } // namespace webrtc |
247 | 248 |
248 #endif // WEBRTC_MODULES_AUDIO_CODING_ACM2_RENT_A_CODEC_H_ | 249 #endif // WEBRTC_MODULES_AUDIO_CODING_ACM2_RENT_A_CODEC_H_ |
OLD | NEW |