Adds OnReceivedUplinkAllocation method to AudioEncoder.

This allows sending the full BitrateAllocationUpdate to the encoder.
This will be used in a later CL to use the link capacity field in the
update to control the Opus decoder.

Bug: webrtc:9718
Change-Id: I1c228cc318c7f9f1b0fec232e27732177b80705a
Reviewed-on: https://webrtc-review.googlesource.com/c/111509
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25739}
This commit is contained in:
Sebastian Jansson 2018-11-21 19:18:51 +01:00 committed by Commit Bot
parent 6736df1778
commit 540ef2898c
3 changed files with 11 additions and 0 deletions

View File

@ -30,6 +30,7 @@ rtc_source_set("audio_codecs_api") {
]
deps = [
"..:array_view",
"..:bitrate_allocation",
"../..:webrtc_common",
"../../rtc_base:checks",
"../../rtc_base:deprecation",

View File

@ -92,6 +92,11 @@ void AudioEncoder::OnReceivedUplinkBandwidth(
int target_audio_bitrate_bps,
absl::optional<int64_t> bwe_period_ms) {}
void AudioEncoder::OnReceivedUplinkAllocation(BitrateAllocationUpdate update) {
OnReceivedUplinkBandwidth(update.target_bitrate.bps(),
update.bwe_period.ms());
}
void AudioEncoder::OnReceivedRtt(int rtt_ms) {}
void AudioEncoder::OnReceivedOverhead(size_t overhead_bytes_per_packet) {}

View File

@ -17,6 +17,7 @@
#include "absl/types/optional.h"
#include "api/array_view.h"
#include "api/call/bitrate_allocation.h"
#include "rtc_base/buffer.h"
#include "rtc_base/deprecation.h"
@ -221,6 +222,10 @@ class AudioEncoder {
virtual void OnReceivedUplinkBandwidth(int target_audio_bitrate_bps,
absl::optional<int64_t> bwe_period_ms);
// Provides target audio bitrate and corresponding probing interval of
// the bandwidth estimator to this encoder to allow it to adapt.
virtual void OnReceivedUplinkAllocation(BitrateAllocationUpdate update);
// Provides RTT to this encoder to allow it to adapt.
virtual void OnReceivedRtt(int rtt_ms);