diff options
author | Sebastian Jansson <srte@webrtc.org> | 2018-11-21 19:18:51 +0100 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2018-11-21 20:46:01 +0000 |
commit | 540ef2898ccc3f40a6b351055b1e0e571850295b (patch) | |
tree | 403b8669ad8f9d15bf89bb03a5b29a0a00043052 /api/audio_codecs | |
parent | 6736df1778fe4c13d115f6449cff055f2af85b02 (diff) | |
download | webrtc-540ef2898ccc3f40a6b351055b1e0e571850295b.tar.gz |
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}
Diffstat (limited to 'api/audio_codecs')
-rw-r--r-- | api/audio_codecs/BUILD.gn | 1 | ||||
-rw-r--r-- | api/audio_codecs/audio_encoder.cc | 5 | ||||
-rw-r--r-- | api/audio_codecs/audio_encoder.h | 5 |
3 files changed, 11 insertions, 0 deletions
diff --git a/api/audio_codecs/BUILD.gn b/api/audio_codecs/BUILD.gn index 29c8fe2dda..31fe2bec58 100644 --- a/api/audio_codecs/BUILD.gn +++ b/api/audio_codecs/BUILD.gn @@ -30,6 +30,7 @@ rtc_source_set("audio_codecs_api") { ] deps = [ "..:array_view", + "..:bitrate_allocation", "../..:webrtc_common", "../../rtc_base:checks", "../../rtc_base:deprecation", diff --git a/api/audio_codecs/audio_encoder.cc b/api/audio_codecs/audio_encoder.cc index 595c11131e..1d885f9cec 100644 --- a/api/audio_codecs/audio_encoder.cc +++ b/api/audio_codecs/audio_encoder.cc @@ -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) {} diff --git a/api/audio_codecs/audio_encoder.h b/api/audio_codecs/audio_encoder.h index 562b42dd40..c908518063 100644 --- a/api/audio_codecs/audio_encoder.h +++ b/api/audio_codecs/audio_encoder.h @@ -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); |