Index: webrtc/media/engine/webrtcvideoengine2.cc |
diff --git a/webrtc/media/engine/webrtcvideoengine2.cc b/webrtc/media/engine/webrtcvideoengine2.cc |
index 6723b1b89fd466fa4b5332eabfd5c3f20215612a..89ea5ced54eefc270dd2d1ef304a52dfecce7200 100644 |
--- a/webrtc/media/engine/webrtcvideoengine2.cc |
+++ b/webrtc/media/engine/webrtcvideoengine2.cc |
@@ -715,8 +715,10 @@ bool WebRtcVideoChannel2::GetChangedSendParameters( |
// Handle max bitrate. |
if (params.max_bandwidth_bps != send_params_.max_bandwidth_bps && |
- params.max_bandwidth_bps >= 0) { |
- // 0 uncaps max bitrate (-1). |
+ params.max_bandwidth_bps >= -1) { |
+ // 0 or -1 uncaps max bitrate. |
+ // TODO(pbos): Reconsider whether 0 should be invalid or not. -1 is the |
+ // auto-bitrate value. |
Taylor Brandstetter
2017/03/09 23:48:38
The "correct" behavior for b=AS:0 may be "set bitr
pbos-webrtc
2017/03/10 18:52:09
TODO text updated.
|
changed_params->max_bandwidth_bps = rtc::Optional<int>( |
params.max_bandwidth_bps == 0 ? -1 : params.max_bandwidth_bps); |
} |
@@ -762,7 +764,7 @@ bool WebRtcVideoChannel2::SetSendParameters(const VideoSendParameters& params) { |
if (changed_params.codec || changed_params.max_bandwidth_bps) { |
if (send_codec_) { |
// TODO(holmer): Changing the codec parameters shouldn't necessarily mean |
- // that we change the min/max of bandwidth estimation. Reevaluate this. |
+ // that we change the min of bandwidth estimation. Reevaluate this. |
bitrate_config_ = GetBitrateConfigForCodec(send_codec_->codec); |
if (!changed_params.codec) { |
// If the codec isn't changing, set the start bitrate to -1 which means |
@@ -770,7 +772,7 @@ bool WebRtcVideoChannel2::SetSendParameters(const VideoSendParameters& params) { |
bitrate_config_.start_bitrate_bps = -1; |
} |
} |
- if (params.max_bandwidth_bps >= 0) { |
+ if (params.max_bandwidth_bps >= -1) { |
// Note that max_bandwidth_bps intentionally takes priority over the |
// bitrate config for the codec. This allows FEC to be applied above the |
// codec target bitrate. |
@@ -778,6 +780,9 @@ bool WebRtcVideoChannel2::SetSendParameters(const VideoSendParameters& params) { |
// WebRtcVideoChannel2 (in which case we're good), or per sender (SSRC), |
// in which case this should not set a Call::BitrateConfig but rather |
// reconfigure all senders. |
+ |
+ // TODO(pbos): Consider whether 0 should be invalid or not. |
+ // 0 or -1 uncaps max bitrate. |
bitrate_config_.max_bitrate_bps = |
params.max_bandwidth_bps == 0 ? -1 : params.max_bandwidth_bps; |
} |