Fix issue with conflicting behavior if setting a max BW with b=AS on both audio and video.
This reverts to previous behavior where b=AS only affects the codec bitrate for audio streams, and not the max bandwidth estimate. BUG=chromium:703903 Review-Url: https://codereview.webrtc.org/2774123002 Cr-Commit-Position: refs/heads/master@{#17386}
This commit is contained in:
@ -1638,14 +1638,6 @@ bool WebRtcVoiceMediaChannel::SetSendParameters(
|
||||
return false;
|
||||
}
|
||||
|
||||
if (params.max_bandwidth_bps >= 0) {
|
||||
// Note that max_bandwidth_bps intentionally takes priority over the
|
||||
// bitrate config for the codec.
|
||||
bitrate_config_.max_bitrate_bps =
|
||||
params.max_bandwidth_bps == 0 ? -1 : params.max_bandwidth_bps;
|
||||
}
|
||||
call_->SetBitrateConfig(bitrate_config_);
|
||||
|
||||
if (!ValidateRtpExtensions(params.extensions)) {
|
||||
return false;
|
||||
}
|
||||
@ -1917,6 +1909,7 @@ bool WebRtcVoiceMediaChannel::SetSendCodecs(
|
||||
// parameters.
|
||||
// TODO(solenberg): Refactor this logic once we create AudioEncoders here.
|
||||
webrtc::AudioSendStream::Config::SendCodecSpec send_codec_spec;
|
||||
webrtc::Call::Config::BitrateConfig bitrate_config;
|
||||
{
|
||||
send_codec_spec.nack_enabled = send_codec_spec_.nack_enabled;
|
||||
|
||||
@ -1930,7 +1923,7 @@ bool WebRtcVoiceMediaChannel::SetSendCodecs(
|
||||
|
||||
send_codec_spec.transport_cc_enabled = HasTransportCc(*codec);
|
||||
send_codec_spec.nack_enabled = HasNack(*codec);
|
||||
bitrate_config_ = GetBitrateConfigForCodec(*codec);
|
||||
bitrate_config = GetBitrateConfigForCodec(*codec);
|
||||
|
||||
// For Opus as the send codec, we are to determine inband FEC, maximum
|
||||
// playback rate, and opus internal dtx.
|
||||
@ -2007,8 +2000,9 @@ bool WebRtcVoiceMediaChannel::SetSendCodecs(
|
||||
} else {
|
||||
// If the codec isn't changing, set the start bitrate to -1 which means
|
||||
// "unchanged" so that BWE isn't affected.
|
||||
bitrate_config_.start_bitrate_bps = -1;
|
||||
bitrate_config.start_bitrate_bps = -1;
|
||||
}
|
||||
call_->SetBitrateConfig(bitrate_config);
|
||||
|
||||
// Check if the transport cc feedback or NACK status has changed on the
|
||||
// preferred send codec, and in that case reconfigure all receive streams.
|
||||
|
||||
@ -262,7 +262,6 @@ class WebRtcVoiceMediaChannel final : public VoiceMediaChannel,
|
||||
bool playout_ = false;
|
||||
bool send_ = false;
|
||||
webrtc::Call* const call_ = nullptr;
|
||||
webrtc::Call::Config::BitrateConfig bitrate_config_;
|
||||
|
||||
// Queue of unsignaled SSRCs; oldest at the beginning.
|
||||
std::vector<uint32_t> unsignaled_recv_ssrcs_;
|
||||
|
||||
@ -1533,16 +1533,16 @@ TEST_F(WebRtcVoiceEngineTestFake, SetSendCodecsCapsMinAndStartBitrate) {
|
||||
}
|
||||
|
||||
TEST_F(WebRtcVoiceEngineTestFake,
|
||||
SetMaxSendBandwidthShouldPreserveOtherBitrates) {
|
||||
SetMaxSendBandwidthForAudioDoesntAffectBwe) {
|
||||
SetSendCodecsShouldWorkForBitrates("100", 100000, "150", 150000, "200",
|
||||
200000);
|
||||
send_parameters_.max_bandwidth_bps = 300000;
|
||||
send_parameters_.max_bandwidth_bps = 100000;
|
||||
SetSendParameters(send_parameters_);
|
||||
EXPECT_EQ(100000, call_.GetConfig().bitrate_config.min_bitrate_bps)
|
||||
<< "Setting max bitrate should keep previous min bitrate.";
|
||||
EXPECT_EQ(-1, call_.GetConfig().bitrate_config.start_bitrate_bps)
|
||||
<< "Setting max bitrate should not reset start bitrate.";
|
||||
EXPECT_EQ(300000, call_.GetConfig().bitrate_config.max_bitrate_bps);
|
||||
EXPECT_EQ(200000, call_.GetConfig().bitrate_config.max_bitrate_bps);
|
||||
}
|
||||
|
||||
// Test that we can enable NACK with opus as caller.
|
||||
|
||||
Reference in New Issue
Block a user