| Index: webrtc/media/engine/webrtcvoiceengine.cc
|
| diff --git a/webrtc/media/engine/webrtcvoiceengine.cc b/webrtc/media/engine/webrtcvoiceengine.cc
|
| index ae2518b73af9d74feed8a847d51c4f2f9b60ab9e..cfa4cc0656875f96c54f689c60c4e60eca79162b 100644
|
| --- a/webrtc/media/engine/webrtcvoiceengine.cc
|
| +++ b/webrtc/media/engine/webrtcvoiceengine.cc
|
| @@ -1422,7 +1422,7 @@ bool WebRtcVoiceMediaChannel::SetSendParameters(
|
| }
|
| }
|
|
|
| - if (!SetMaxSendBandwidth(params.max_bandwidth_bps)) {
|
| + if (!SetMaxSendBitrate(params.max_bitrate_bps)) {
|
| return false;
|
| }
|
| return SetOptions(params.options);
|
| @@ -1746,7 +1746,7 @@ bool WebRtcVoiceMediaChannel::SetSendCodecs(int channel) {
|
| }
|
| }
|
|
|
| - if (send_bitrate_setting_) {
|
| + if (send_bitrate_bps_) {
|
| SetSendBitrateInternal(send_bitrate_bps_);
|
| }
|
|
|
| @@ -2368,17 +2368,14 @@ bool WebRtcVoiceMediaChannel::MuteStream(uint32_t ssrc, bool muted) {
|
| return true;
|
| }
|
|
|
| -// TODO(minyue): SetMaxSendBandwidth() is subject to be renamed to
|
| -// SetMaxSendBitrate() in future.
|
| -bool WebRtcVoiceMediaChannel::SetMaxSendBandwidth(int bps) {
|
| +bool WebRtcVoiceMediaChannel::SetMaxSendBitrate(rtc::Optional<int> bps) {
|
| LOG(LS_INFO) << "WebRtcVoiceMediaChannel::SetMaxSendBandwidth.";
|
| return SetSendBitrateInternal(bps);
|
| }
|
|
|
| -bool WebRtcVoiceMediaChannel::SetSendBitrateInternal(int bps) {
|
| +bool WebRtcVoiceMediaChannel::SetSendBitrateInternal(rtc::Optional<int> bps) {
|
| LOG(LS_INFO) << "WebRtcVoiceMediaChannel::SetSendBitrateInternal.";
|
|
|
| - send_bitrate_setting_ = true;
|
| send_bitrate_bps_ = bps;
|
|
|
| if (!HasSendCodec()) {
|
| @@ -2390,7 +2387,7 @@ bool WebRtcVoiceMediaChannel::SetSendBitrateInternal(int bps) {
|
| // Bitrate is auto by default.
|
| // TODO(bemasc): Fix this so that if SetMaxSendBandwidth(50) is followed by
|
| // SetMaxSendBandwith(0), the second call removes the previous limit.
|
| - if (bps <= 0)
|
| + if (!bps)
|
| return true;
|
|
|
| webrtc::CodecInst codec = send_codec_spec_.codec_inst;
|
| @@ -2398,7 +2395,7 @@ bool WebRtcVoiceMediaChannel::SetSendBitrateInternal(int bps) {
|
|
|
| if (is_multi_rate) {
|
| // If codec is multi-rate then just set the bitrate.
|
| - codec.rate = bps;
|
| + codec.rate = *bps;
|
| for (const auto& ch : send_streams_) {
|
| if (!SetSendCodec(ch.second->channel(), codec)) {
|
| LOG(LS_INFO) << "Failed to set codec " << codec.plname
|
| @@ -2411,7 +2408,7 @@ bool WebRtcVoiceMediaChannel::SetSendBitrateInternal(int bps) {
|
| // If codec is not multi-rate and |bps| is less than the fixed bitrate
|
| // then fail. If codec is not multi-rate and |bps| exceeds or equal the
|
| // fixed bitrate then ignore.
|
| - if (bps < codec.rate) {
|
| + if (*bps < codec.rate) {
|
| LOG(LS_INFO) << "Failed to set codec " << codec.plname
|
| << " to bitrate " << bps << " bps"
|
| << ", requires at least " << codec.rate << " bps.";
|
|
|