Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc

Issue 2661043003: Allow ANA to receive RPLR (recoverable packet loss rate) indications (Closed)
Patch Set: Rebased Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 packet_loss_fraction_smoother_->GetAverage(); 301 packet_loss_fraction_smoother_->GetAverage();
302 SetProjectedPacketLossRate(average_fraction_loss); 302 SetProjectedPacketLossRate(average_fraction_loss);
303 } 303 }
304 } else { 304 } else {
305 audio_network_adaptor_->SetUplinkPacketLossFraction( 305 audio_network_adaptor_->SetUplinkPacketLossFraction(
306 uplink_packet_loss_fraction); 306 uplink_packet_loss_fraction);
307 ApplyAudioNetworkAdaptor(); 307 ApplyAudioNetworkAdaptor();
308 } 308 }
309 } 309 }
310 310
311 void AudioEncoderOpus::OnReceivedUplinkRecoverablePacketLossFraction(
312 const rtc::Optional<float>& uplink_recoverable_packet_loss_fraction) {
313 if (!audio_network_adaptor_)
314 return;
315 audio_network_adaptor_->SetUplinkRecoverablePacketLossFraction(
316 uplink_recoverable_packet_loss_fraction);
317 ApplyAudioNetworkAdaptor();
318 }
319
311 void AudioEncoderOpus::OnReceivedUplinkBandwidth( 320 void AudioEncoderOpus::OnReceivedUplinkBandwidth(
312 int target_audio_bitrate_bps, 321 int target_audio_bitrate_bps,
313 rtc::Optional<int64_t> probing_interval_ms) { 322 rtc::Optional<int64_t> probing_interval_ms) {
314 if (audio_network_adaptor_) { 323 if (audio_network_adaptor_) {
315 audio_network_adaptor_->SetTargetAudioBitrate(target_audio_bitrate_bps); 324 audio_network_adaptor_->SetTargetAudioBitrate(target_audio_bitrate_bps);
316 // We give smoothed bitrate allocation to audio network adaptor as 325 // We give smoothed bitrate allocation to audio network adaptor as
317 // the uplink bandwidth. 326 // the uplink bandwidth.
318 // The probing spikes should not affect the bitrate smoother more than 25%. 327 // The probing spikes should not affect the bitrate smoother more than 25%.
319 // To simplify the calculations we use a step response as input signal. 328 // To simplify the calculations we use a step response as input signal.
320 // The step response of an exponential filter is 329 // The step response of an exponential filter is
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 config_.uplink_bandwidth_update_interval_ms) { 574 config_.uplink_bandwidth_update_interval_ms) {
566 rtc::Optional<float> smoothed_bitrate = bitrate_smoother_->GetAverage(); 575 rtc::Optional<float> smoothed_bitrate = bitrate_smoother_->GetAverage();
567 if (smoothed_bitrate) 576 if (smoothed_bitrate)
568 audio_network_adaptor_->SetUplinkBandwidth(*smoothed_bitrate); 577 audio_network_adaptor_->SetUplinkBandwidth(*smoothed_bitrate);
569 bitrate_smoother_last_update_time_ = rtc::Optional<int64_t>(now_ms); 578 bitrate_smoother_last_update_time_ = rtc::Optional<int64_t>(now_ms);
570 } 579 }
571 } 580 }
572 } 581 }
573 582
574 } // namespace webrtc 583 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698