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

Unified Diff: webrtc/video/video_send_stream.cc

Issue 2117493002: Auto pause video streams based on encoder target bitrate. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase Created 4 years, 6 months 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
« no previous file with comments | « webrtc/video/video_send_stream.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/video_send_stream.cc
diff --git a/webrtc/video/video_send_stream.cc b/webrtc/video/video_send_stream.cc
index 01c2fc836c7d4a35dde12d1a13b4cd2fbb8e5cf0..eeb9580b6b707e1c454491fc3339c9508eb5215a 100644
--- a/webrtc/video/video_send_stream.cc
+++ b/webrtc/video/video_send_stream.cc
@@ -866,15 +866,18 @@ void VideoSendStream::SignalNetworkState(NetworkState state) {
}
}
-void VideoSendStream::OnBitrateUpdated(uint32_t bitrate_bps,
- uint8_t fraction_loss,
- int64_t rtt) {
+uint32_t VideoSendStream::OnBitrateUpdated(uint32_t bitrate_bps,
+ uint8_t fraction_loss,
+ int64_t rtt) {
payload_router_.SetTargetSendBitrate(bitrate_bps);
// Get the encoder target rate. It is the estimated network rate -
// protection overhead.
- uint32_t encoder_target_rate = protection_bitrate_calculator_.SetTargetRates(
- bitrate_bps, stats_proxy_.GetSendFrameRate(), fraction_loss, rtt);
- vie_encoder_.OnBitrateUpdated(encoder_target_rate, fraction_loss, rtt);
+ uint32_t encoder_target_rate_bps =
+ protection_bitrate_calculator_.SetTargetRates(
+ bitrate_bps, stats_proxy_.GetSendFrameRate(), fraction_loss, rtt);
+ vie_encoder_.OnBitrateUpdated(encoder_target_rate_bps, fraction_loss, rtt);
+
+ return bitrate_bps - encoder_target_rate_bps;
}
int VideoSendStream::ProtectionRequest(const FecProtectionParams* delta_params,
« no previous file with comments | « webrtc/video/video_send_stream.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698