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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 send_codec_inst_.plfreq), | 313 send_codec_inst_.plfreq), |
314 100); | 314 100); |
315 send_codec_inst_.pltype = -1; // Not valid. | 315 send_codec_inst_.pltype = -1; // Not valid. |
316 send_codec_inst_.rate = -1; // Not valid. | 316 send_codec_inst_.rate = -1; // Not valid. |
317 static const char kName[] = "external"; | 317 static const char kName[] = "external"; |
318 memcpy(send_codec_inst_.plname, kName, sizeof(kName)); | 318 memcpy(send_codec_inst_.plname, kName, sizeof(kName)); |
319 | 319 |
320 if (send_codec_inst_.channels != 1) | 320 if (send_codec_inst_.channels != 1) |
321 dtx_enabled_ = false; | 321 dtx_enabled_ = false; |
322 codec_fec_enabled_ = | 322 codec_fec_enabled_ = |
323 codec_fec_enabled_ && codec_owner_.Encoder()->SetFec(codec_fec_enabled_); | 323 codec_fec_enabled_ && external_speech_encoder->SetFec(codec_fec_enabled_); |
324 int cng_pt = dtx_enabled_ | 324 int cng_pt = dtx_enabled_ |
325 ? CngPayloadType(external_speech_encoder->SampleRateHz()) | 325 ? CngPayloadType(external_speech_encoder->SampleRateHz()) |
326 : -1; | 326 : -1; |
327 int red_pt = red_enabled_ ? RedPayloadType(send_codec_inst_.plfreq) : -1; | 327 int red_pt = red_enabled_ ? RedPayloadType(send_codec_inst_.plfreq) : -1; |
328 codec_owner_.SetEncoders(external_speech_encoder, cng_pt, vad_mode_, red_pt); | 328 codec_owner_.SetEncoders(external_speech_encoder, cng_pt, vad_mode_, red_pt); |
329 } | 329 } |
330 | 330 |
331 rtc::Optional<CodecInst> CodecManager::GetCodecInst() const { | 331 rtc::Optional<CodecInst> CodecManager::GetCodecInst() const { |
332 int dummy_id = 0; | 332 int dummy_id = 0; |
333 WEBRTC_TRACE(webrtc::kTraceStream, webrtc::kTraceAudioCoding, dummy_id, | 333 WEBRTC_TRACE(webrtc::kTraceStream, webrtc::kTraceAudioCoding, dummy_id, |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 case 48000: | 448 case 48000: |
449 return -1; | 449 return -1; |
450 default: | 450 default: |
451 FATAL() << sample_rate_hz << " Hz is not supported"; | 451 FATAL() << sample_rate_hz << " Hz is not supported"; |
452 return -1; | 452 return -1; |
453 } | 453 } |
454 } | 454 } |
455 | 455 |
456 } // namespace acm2 | 456 } // namespace acm2 |
457 } // namespace webrtc | 457 } // namespace webrtc |
OLD | NEW |