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

Unified Diff: webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc

Issue 2304603002: Change SimulcastEncoderAdapter to allow a 0 for SetRates. (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc
diff --git a/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc b/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc
index eba59d0fdff8d4e280c2235f2a395f7b15e033df..37d8472a9ccb0e7120918db31a23c0a70ea90efd 100644
--- a/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc
+++ b/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc
@@ -363,12 +363,16 @@ int SimulcastEncoderAdapter::SetRates(uint32_t new_bitrate_kbit,
if (codec_.maxBitrate > 0 && new_bitrate_kbit > codec_.maxBitrate) {
new_bitrate_kbit = codec_.maxBitrate;
}
- if (new_bitrate_kbit < codec_.minBitrate) {
- new_bitrate_kbit = codec_.minBitrate;
- }
- if (codec_.numberOfSimulcastStreams > 0 &&
- new_bitrate_kbit < codec_.simulcastStream[0].minBitrate) {
- new_bitrate_kbit = codec_.simulcastStream[0].minBitrate;
+ if (new_bitrate_kbit > 0) {
+ // Make sure the bitrate fits the configured min bitrates. 0 is a special
+ // value that means paused, though, so leave it alone.
+ if (new_bitrate_kbit < codec_.minBitrate) {
+ new_bitrate_kbit = codec_.minBitrate;
+ }
+ if (codec_.numberOfSimulcastStreams > 0 &&
+ new_bitrate_kbit < codec_.simulcastStream[0].minBitrate) {
+ new_bitrate_kbit = codec_.simulcastStream[0].minBitrate;
+ }
}
codec_.maxFramerate = new_framerate;
« no previous file with comments | « no previous file | webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698