Adds trial to calculate audio overhead based on available data.

This adds the ability to disable legacy overhead calculation so we'll
use the available data on per packet over head and frame length range
to set the min and max total  allocatable bitrate.

Bug: webrtc:11001
Change-Id: I2a94499433e15bad11a08f81fe7f1dfc27982cdf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155175
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29368}
This commit is contained in:
Sebastian Jansson
2019-10-02 12:27:06 +02:00
committed by Commit Bot
parent f1e97b9ebd
commit 62aee9379c
9 changed files with 93 additions and 28 deletions

View File

@ -879,4 +879,17 @@ ANAStats AudioEncoderOpusImpl::GetANAStats() const {
return ANAStats();
}
absl::optional<std::pair<TimeDelta, TimeDelta> >
AudioEncoderOpusImpl::GetFrameLengthRange() const {
if (config_.supported_frame_lengths_ms.empty()) {
return absl::nullopt;
} else if (audio_network_adaptor_) {
return {{TimeDelta::ms(config_.supported_frame_lengths_ms.front()),
TimeDelta::ms(config_.supported_frame_lengths_ms.back())}};
} else {
return {{TimeDelta::ms(config_.frame_size_ms),
TimeDelta::ms(config_.frame_size_ms)}};
}
}
} // namespace webrtc

View File

@ -115,6 +115,8 @@ class AudioEncoderOpusImpl final : public AudioEncoder {
void SetReceiverFrameLengthRange(int min_frame_length_ms,
int max_frame_length_ms) override;
ANAStats GetANAStats() const override;
absl::optional<std::pair<TimeDelta, TimeDelta> > GetFrameLengthRange()
const override;
rtc::ArrayView<const int> supported_frame_lengths_ms() const {
return config_.supported_frame_lengths_ms;
}