| 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 |
| (...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 RTC_CHECK_EQ(0, WebRtcOpus_SetBitRate(inst_, GetBitrateBps(config_))); | 722 RTC_CHECK_EQ(0, WebRtcOpus_SetBitRate(inst_, GetBitrateBps(config_))); |
| 723 const auto new_complexity = GetNewComplexity(config_); | 723 const auto new_complexity = GetNewComplexity(config_); |
| 724 if (new_complexity && complexity_ != *new_complexity) { | 724 if (new_complexity && complexity_ != *new_complexity) { |
| 725 complexity_ = *new_complexity; | 725 complexity_ = *new_complexity; |
| 726 RTC_CHECK_EQ(0, WebRtcOpus_SetComplexity(inst_, complexity_)); | 726 RTC_CHECK_EQ(0, WebRtcOpus_SetComplexity(inst_, complexity_)); |
| 727 } | 727 } |
| 728 } | 728 } |
| 729 | 729 |
| 730 void AudioEncoderOpus::ApplyAudioNetworkAdaptor() { | 730 void AudioEncoderOpus::ApplyAudioNetworkAdaptor() { |
| 731 auto config = audio_network_adaptor_->GetEncoderRuntimeConfig(); | 731 auto config = audio_network_adaptor_->GetEncoderRuntimeConfig(); |
| 732 RTC_DCHECK(!config.frame_length_ms || *config.frame_length_ms == 20 || | |
| 733 *config.frame_length_ms == 60); | |
| 734 | 732 |
| 735 if (config.bitrate_bps) | 733 if (config.bitrate_bps) |
| 736 SetTargetBitrate(*config.bitrate_bps); | 734 SetTargetBitrate(*config.bitrate_bps); |
| 737 if (config.frame_length_ms) | 735 if (config.frame_length_ms) |
| 738 SetFrameLength(*config.frame_length_ms); | 736 SetFrameLength(*config.frame_length_ms); |
| 739 if (config.enable_fec) | 737 if (config.enable_fec) |
| 740 SetFec(*config.enable_fec); | 738 SetFec(*config.enable_fec); |
| 741 if (config.uplink_packet_loss_fraction) | 739 if (config.uplink_packet_loss_fraction) |
| 742 SetProjectedPacketLossRate(*config.uplink_packet_loss_fraction); | 740 SetProjectedPacketLossRate(*config.uplink_packet_loss_fraction); |
| 743 if (config.enable_dtx) | 741 if (config.enable_dtx) |
| (...skipping 24 matching lines...) Expand all Loading... |
| 768 config_.uplink_bandwidth_update_interval_ms) { | 766 config_.uplink_bandwidth_update_interval_ms) { |
| 769 rtc::Optional<float> smoothed_bitrate = bitrate_smoother_->GetAverage(); | 767 rtc::Optional<float> smoothed_bitrate = bitrate_smoother_->GetAverage(); |
| 770 if (smoothed_bitrate) | 768 if (smoothed_bitrate) |
| 771 audio_network_adaptor_->SetUplinkBandwidth(*smoothed_bitrate); | 769 audio_network_adaptor_->SetUplinkBandwidth(*smoothed_bitrate); |
| 772 bitrate_smoother_last_update_time_ = rtc::Optional<int64_t>(now_ms); | 770 bitrate_smoother_last_update_time_ = rtc::Optional<int64_t>(now_ms); |
| 773 } | 771 } |
| 774 } | 772 } |
| 775 } | 773 } |
| 776 | 774 |
| 777 } // namespace webrtc | 775 } // namespace webrtc |
| OLD | NEW |