| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 |
| 11 #include "webrtc/modules/audio_coding/codecs/opus/include/audio_encoder_opus.h" | 11 #include "webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.h" |
| 12 | 12 |
| 13 #include "webrtc/base/checks.h" | 13 #include "webrtc/base/checks.h" |
| 14 #include "webrtc/base/safe_conversions.h" | 14 #include "webrtc/base/safe_conversions.h" |
| 15 #include "webrtc/common_types.h" | 15 #include "webrtc/common_types.h" |
| 16 #include "webrtc/modules/audio_coding/codecs/opus/include/opus_interface.h" | 16 #include "webrtc/modules/audio_coding/codecs/opus/opus_interface.h" |
| 17 | 17 |
| 18 namespace webrtc { | 18 namespace webrtc { |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 const int kSampleRateHz = 48000; | 22 const int kSampleRateHz = 48000; |
| 23 const int kMinBitrateBps = 500; | 23 const int kMinBitrateBps = 500; |
| 24 const int kMaxBitrateBps = 512000; | 24 const int kMaxBitrateBps = 512000; |
| 25 | 25 |
| 26 AudioEncoderOpus::Config CreateConfig(const CodecInst& codec_inst) { | 26 AudioEncoderOpus::Config CreateConfig(const CodecInst& codec_inst) { |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 RTC_CHECK_EQ(0, WebRtcOpus_DisableDtx(inst_)); | 249 RTC_CHECK_EQ(0, WebRtcOpus_DisableDtx(inst_)); |
| 250 } | 250 } |
| 251 RTC_CHECK_EQ(0, | 251 RTC_CHECK_EQ(0, |
| 252 WebRtcOpus_SetPacketLossRate( | 252 WebRtcOpus_SetPacketLossRate( |
| 253 inst_, static_cast<int32_t>(packet_loss_rate_ * 100 + .5))); | 253 inst_, static_cast<int32_t>(packet_loss_rate_ * 100 + .5))); |
| 254 config_ = config; | 254 config_ = config; |
| 255 return true; | 255 return true; |
| 256 } | 256 } |
| 257 | 257 |
| 258 } // namespace webrtc | 258 } // namespace webrtc |
| OLD | NEW |