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

Unified Diff: webrtc/video/video_send_stream.cc

Issue 1952923005: Refactor before implementing per stream suspension. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase Created 4 years, 7 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/call/bitrate_allocator_unittest.cc ('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 840991b4baceadf16fe026bd02915d816aa84da8..dcacf56388b37f3ae6a5ee387c9a010d3dcc7c0f 100644
--- a/webrtc/video/video_send_stream.cc
+++ b/webrtc/video/video_send_stream.cc
@@ -562,7 +562,8 @@ void VideoSendStream::EncoderProcess() {
encoder_settings->video_codec.startBitrate =
bitrate_allocator_->AddObserver(
this, encoder_settings->video_codec.minBitrate * 1000,
- encoder_settings->video_codec.maxBitrate * 1000) /
+ encoder_settings->video_codec.maxBitrate * 1000,
+ !config_.suspend_below_min_bitrate) /
1000;
payload_router_.SetSendStreams(encoder_settings->streams);
@@ -570,16 +571,16 @@ void VideoSendStream::EncoderProcess() {
encoder_settings->min_transmit_bitrate_bps,
payload_router_.MaxPayloadLength(), this);
+ // vie_encoder_.SetEncoder must be called before this.
+ if (config_.suspend_below_min_bitrate)
+ video_sender_->SuspendBelowMinBitrate();
+
// Clear stats for disabled layers.
for (size_t i = encoder_settings->streams.size();
i < config_.rtp.ssrcs.size(); ++i) {
stats_proxy_.OnInactiveSsrc(config_.rtp.ssrcs[i]);
}
- if (config_.suspend_below_min_bitrate) {
- video_sender_->SuspendBelowMinBitrate();
- bitrate_allocator_->EnforceMinBitrate(false);
- }
// We might've gotten new settings while configuring the encoder settings,
// restart from the top to see if that's the case before trying to encode
// a frame (which might correspond to the last frame size).
« no previous file with comments | « webrtc/call/bitrate_allocator_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698