| Index: webrtc/voice_engine/channel.cc
|
| diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc
|
| index 975d56aa986538e0522a4fce38d358b455067ca5..c1e3704fda059cc7e01d72c7d0d1f522371cce6d 100644
|
| --- a/webrtc/voice_engine/channel.cc
|
| +++ b/webrtc/voice_engine/channel.cc
|
| @@ -1318,12 +1318,6 @@ void Channel::SetBitRate(int bitrate_bps) {
|
| constexpr int64_t kDefaultBitrateSmoothingTimeConstantMs = 20000;
|
| bitrate_smoother_.SetTimeConstantMs(kDefaultBitrateSmoothingTimeConstantMs);
|
| bitrate_smoother_.AddSample(bitrate_bps);
|
| - audio_coding_->ModifyEncoder([&](std::unique_ptr<AudioEncoder>* encoder) {
|
| - if (*encoder) {
|
| - (*encoder)->OnReceivedUplinkBandwidth(
|
| - static_cast<int>(*bitrate_smoother_.GetAverage()));
|
| - }
|
| - });
|
| }
|
|
|
| void Channel::OnIncomingFractionLoss(int fraction_lost) {
|
| @@ -2720,6 +2714,18 @@ void Channel::SetNACKStatus(bool enable, int maxNumberOfPackets) {
|
| audio_coding_->DisableNack();
|
| }
|
|
|
| +void Channel::AdaptCodec() {
|
| + rtc::Optional<float> smoothed_bitrate = bitrate_smoother_.GetAverage();
|
| + if (smoothed_bitrate) {
|
| + audio_coding_->ModifyEncoder([&](std::unique_ptr<AudioEncoder>* encoder) {
|
| + if (*encoder) {
|
| + (*encoder)->OnReceivedUplinkBandwidth(
|
| + static_cast<int>(*smoothed_bitrate));
|
| + }
|
| + });
|
| + }
|
| +}
|
| +
|
| // Called when we are missing one or more packets.
|
| int Channel::ResendPackets(const uint16_t* sequence_numbers, int length) {
|
| return _rtpRtcpModule->SendNACK(sequence_numbers, length);
|
|
|