mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-20 00:57:49 +01:00
Corrects audio overhead correction in Scenario test.
This makes the calculation more similar to the one in WebRTCVoiceEngine. Bug: webrtc:9510 Change-Id: Ibca69842726e51c07b9cc9550ff9f15a24161e28 Reviewed-on: https://webrtc-review.googlesource.com/c/107653 Reviewed-by: Oskar Sundbom <ossu@webrtc.org> Commit-Queue: Sebastian Jansson <srte@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25448}
This commit is contained in:
parent
69807e8871
commit
ed45c57d98
1 changed files with 9 additions and 10 deletions
|
@ -106,20 +106,19 @@ SendAudioStream::SendAudioStream(
|
|||
max_rate = *config.encoder.max_rate;
|
||||
}
|
||||
if (field_trial::IsEnabled("WebRTC-SendSideBwe-WithOverhead")) {
|
||||
TimeDelta min_frame_length = config.encoder.initial_frame_length;
|
||||
TimeDelta max_frame_length = config.encoder.initial_frame_length;
|
||||
if (field_trial::IsEnabled("WebRTC-Audio-FrameLengthAdaptation") &&
|
||||
!config.adapt.frame.min_rate_for_20_ms.IsZero()) {
|
||||
if (!config.adapt.frame.min_rate_for_60_ms.IsZero()) {
|
||||
max_frame_length = TimeDelta::ms(120);
|
||||
} else {
|
||||
max_frame_length = TimeDelta::ms(60);
|
||||
}
|
||||
}
|
||||
TimeDelta min_frame_length = TimeDelta::ms(20);
|
||||
// Note, depends on WEBRTC_OPUS_SUPPORT_120MS_PTIME being set, which is
|
||||
// the default.
|
||||
TimeDelta max_frame_length = TimeDelta::ms(120);
|
||||
DataSize rtp_overhead = DataSize::bytes(12);
|
||||
// Note that this does not include rtp extension overhead and will not
|
||||
// follow updates in the transport overhead over time.
|
||||
DataSize total_overhead =
|
||||
sender_->transport_.packet_overhead() + rtp_overhead;
|
||||
|
||||
min_rate += total_overhead / max_frame_length;
|
||||
// In WebRTCVoiceEngine the max rate is also based on the max frame
|
||||
// length.
|
||||
max_rate += total_overhead / min_frame_length;
|
||||
}
|
||||
send_config.min_bitrate_bps = min_rate.bps();
|
||||
|
|
Loading…
Reference in a new issue