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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 default: | 192 default: |
193 error_code_ = kOtherError; | 193 error_code_ = kOtherError; |
194 } | 194 } |
195 return kFail; | 195 return kFail; |
196 } | 196 } |
197 return kOK; | 197 return kOK; |
198 } | 198 } |
199 | 199 |
200 int NetEqImpl::RegisterExternalDecoder(AudioDecoder* decoder, | 200 int NetEqImpl::RegisterExternalDecoder(AudioDecoder* decoder, |
201 NetEqDecoder codec, | 201 NetEqDecoder codec, |
| 202 const std::string& codec_name, |
202 uint8_t rtp_payload_type, | 203 uint8_t rtp_payload_type, |
203 int sample_rate_hz) { | 204 int sample_rate_hz) { |
204 CriticalSectionScoped lock(crit_sect_.get()); | 205 CriticalSectionScoped lock(crit_sect_.get()); |
205 LOG(LS_VERBOSE) << "RegisterExternalDecoder " | 206 LOG(LS_VERBOSE) << "RegisterExternalDecoder " |
206 << static_cast<int>(rtp_payload_type) << " " | 207 << static_cast<int>(rtp_payload_type) << " " |
207 << static_cast<int>(codec); | 208 << static_cast<int>(codec); |
208 if (!decoder) { | 209 if (!decoder) { |
209 LOG(LS_ERROR) << "Cannot register external decoder with NULL pointer"; | 210 LOG(LS_ERROR) << "Cannot register external decoder with NULL pointer"; |
210 assert(false); | 211 assert(false); |
211 return kFail; | 212 return kFail; |
212 } | 213 } |
213 int ret = decoder_database_->InsertExternal(rtp_payload_type, codec, | 214 int ret = decoder_database_->InsertExternal( |
214 sample_rate_hz, decoder); | 215 rtp_payload_type, codec, codec_name, sample_rate_hz, decoder); |
215 if (ret != DecoderDatabase::kOK) { | 216 if (ret != DecoderDatabase::kOK) { |
216 switch (ret) { | 217 switch (ret) { |
217 case DecoderDatabase::kInvalidRtpPayloadType: | 218 case DecoderDatabase::kInvalidRtpPayloadType: |
218 error_code_ = kInvalidRtpPayloadType; | 219 error_code_ = kInvalidRtpPayloadType; |
219 break; | 220 break; |
220 case DecoderDatabase::kCodecNotSupported: | 221 case DecoderDatabase::kCodecNotSupported: |
221 error_code_ = kCodecNotSupported; | 222 error_code_ = kCodecNotSupported; |
222 break; | 223 break; |
223 case DecoderDatabase::kDecoderExists: | 224 case DecoderDatabase::kDecoderExists: |
224 error_code_ = kDecoderExists; | 225 error_code_ = kDecoderExists; |
(...skipping 1815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2040 | 2041 |
2041 void NetEqImpl::CreateDecisionLogic() { | 2042 void NetEqImpl::CreateDecisionLogic() { |
2042 decision_logic_.reset(DecisionLogic::Create(fs_hz_, output_size_samples_, | 2043 decision_logic_.reset(DecisionLogic::Create(fs_hz_, output_size_samples_, |
2043 playout_mode_, | 2044 playout_mode_, |
2044 decoder_database_.get(), | 2045 decoder_database_.get(), |
2045 *packet_buffer_.get(), | 2046 *packet_buffer_.get(), |
2046 delay_manager_.get(), | 2047 delay_manager_.get(), |
2047 buffer_level_filter_.get())); | 2048 buffer_level_filter_.get())); |
2048 } | 2049 } |
2049 } // namespace webrtc | 2050 } // namespace webrtc |
OLD | NEW |