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:

committed by
Commit Bot

parent
69807e8871
commit
ed45c57d98
@ -106,20 +106,19 @@ SendAudioStream::SendAudioStream(
|
|||||||
max_rate = *config.encoder.max_rate;
|
max_rate = *config.encoder.max_rate;
|
||||||
}
|
}
|
||||||
if (field_trial::IsEnabled("WebRTC-SendSideBwe-WithOverhead")) {
|
if (field_trial::IsEnabled("WebRTC-SendSideBwe-WithOverhead")) {
|
||||||
TimeDelta min_frame_length = config.encoder.initial_frame_length;
|
TimeDelta min_frame_length = TimeDelta::ms(20);
|
||||||
TimeDelta max_frame_length = config.encoder.initial_frame_length;
|
// Note, depends on WEBRTC_OPUS_SUPPORT_120MS_PTIME being set, which is
|
||||||
if (field_trial::IsEnabled("WebRTC-Audio-FrameLengthAdaptation") &&
|
// the default.
|
||||||
!config.adapt.frame.min_rate_for_20_ms.IsZero()) {
|
TimeDelta max_frame_length = TimeDelta::ms(120);
|
||||||
if (!config.adapt.frame.min_rate_for_60_ms.IsZero()) {
|
|
||||||
max_frame_length = TimeDelta::ms(120);
|
|
||||||
} else {
|
|
||||||
max_frame_length = TimeDelta::ms(60);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
DataSize rtp_overhead = DataSize::bytes(12);
|
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 =
|
DataSize total_overhead =
|
||||||
sender_->transport_.packet_overhead() + rtp_overhead;
|
sender_->transport_.packet_overhead() + rtp_overhead;
|
||||||
|
|
||||||
min_rate += total_overhead / max_frame_length;
|
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;
|
max_rate += total_overhead / min_frame_length;
|
||||||
}
|
}
|
||||||
send_config.min_bitrate_bps = min_rate.bps();
|
send_config.min_bitrate_bps = min_rate.bps();
|
||||||
|
Reference in New Issue
Block a user