Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Unified Diff: webrtc/audio/audio_send_stream.cc

Issue 2546493002: Update smoothed bitrate. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/audio/audio_send_stream.cc
diff --git a/webrtc/audio/audio_send_stream.cc b/webrtc/audio/audio_send_stream.cc
index b031762b4cecd173e21766e4ab3f91c070a37fd9..5245d6b18f1bfa9ed12c0d2f10b28a79d04cdcca 100644
--- a/webrtc/audio/audio_send_stream.cc
+++ b/webrtc/audio/audio_send_stream.cc
@@ -240,6 +240,8 @@ uint32_t AudioSendStream::OnBitrateUpdated(uint32_t bitrate_bps,
channel_proxy_->SetBitrate(bitrate_bps);
+ if (first_update_bitrate_())
the sun 2016/12/01 09:16:55 nit: always {} in this file, even for one-liners
michaelt 2016/12/05 15:08:49 Done.
+ UpdateSmoothedBitrate();
// The amount of audio protection is not exposed by the encoder, hence
// always returning 0.
return 0;
@@ -382,5 +384,12 @@ bool AudioSendStream::SetupSendCodec() {
return true;
}
+void AudioSendStream::UpdateSmoothedBitrate() {
+ channel_proxy_->UpdateSmoothedBitrate();
+ constexpr uint32_t kUpdateSmoothedBitrateIntervalMs = 200;
+ worker_queue_->PostDelayedTask([this]() { UpdateSmoothedBitrate(); },
+ kUpdateSmoothedBitrateIntervalMs);
+}
+
} // namespace internal
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698