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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 codec_owner_.SpeechEncoder()->SetFec(codec_fec_enabled_); | 319 codec_owner_.SpeechEncoder()->SetFec(codec_fec_enabled_); |
320 | 320 |
321 return 0; | 321 return 0; |
322 } | 322 } |
323 | 323 |
324 void CodecManager::RegisterEncoder( | 324 void CodecManager::RegisterEncoder( |
325 AudioEncoderMutable* external_speech_encoder) { | 325 AudioEncoderMutable* external_speech_encoder) { |
326 // Make up a CodecInst. | 326 // Make up a CodecInst. |
327 send_codec_inst_.channels = external_speech_encoder->NumChannels(); | 327 send_codec_inst_.channels = external_speech_encoder->NumChannels(); |
328 send_codec_inst_.plfreq = external_speech_encoder->SampleRateHz(); | 328 send_codec_inst_.plfreq = external_speech_encoder->SampleRateHz(); |
329 send_codec_inst_.pacsize = | 329 send_codec_inst_.pacsize = rtc::CheckedDivExact( |
330 rtc::CheckedDivExact(external_speech_encoder->Max10MsFramesInAPacket() * | 330 static_cast<int>(external_speech_encoder->Max10MsFramesInAPacket() * |
331 send_codec_inst_.plfreq, | 331 send_codec_inst_.plfreq), |
332 100); | 332 100); |
333 send_codec_inst_.pltype = -1; // Not valid. | 333 send_codec_inst_.pltype = -1; // Not valid. |
334 send_codec_inst_.rate = -1; // Not valid. | 334 send_codec_inst_.rate = -1; // Not valid. |
335 static const char kName[] = "external"; | 335 static const char kName[] = "external"; |
336 memcpy(send_codec_inst_.plname, kName, sizeof(kName)); | 336 memcpy(send_codec_inst_.plname, kName, sizeof(kName)); |
337 | 337 |
338 if (stereo_send_) | 338 if (stereo_send_) |
339 dtx_enabled_ = false; | 339 dtx_enabled_ = false; |
340 codec_fec_enabled_ = codec_fec_enabled_ && | 340 codec_fec_enabled_ = codec_fec_enabled_ && |
341 codec_owner_.SpeechEncoder()->SetFec(codec_fec_enabled_); | 341 codec_owner_.SpeechEncoder()->SetFec(codec_fec_enabled_); |
342 int cng_pt = dtx_enabled_ | 342 int cng_pt = dtx_enabled_ |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 case 48000: | 465 case 48000: |
466 return -1; | 466 return -1; |
467 default: | 467 default: |
468 FATAL() << sample_rate_hz << " Hz is not supported"; | 468 FATAL() << sample_rate_hz << " Hz is not supported"; |
469 return -1; | 469 return -1; |
470 } | 470 } |
471 } | 471 } |
472 | 472 |
473 } // namespace acm2 | 473 } // namespace acm2 |
474 } // namespace webrtc | 474 } // namespace webrtc |
OLD | NEW |