diff --git a/talk/media/base/mediachannel.h b/talk/media/base/mediachannel.h index ac62d5e2d2..ab5bdb4d7c 100644 --- a/talk/media/base/mediachannel.h +++ b/talk/media/base/mediachannel.h @@ -329,7 +329,6 @@ struct VideoOptions { system_high_adaptation_threshhold.SetFrom( change.system_high_adaptation_threshhold); buffered_mode_latency.SetFrom(change.buffered_mode_latency); - lower_min_bitrate.SetFrom(change.lower_min_bitrate); dscp.SetFrom(change.dscp); suspend_below_min_bitrate.SetFrom(change.suspend_below_min_bitrate); unsignalled_recv_stream_limit.SetFrom(change.unsignalled_recv_stream_limit); @@ -368,7 +367,6 @@ struct VideoOptions { system_high_adaptation_threshhold == o.system_high_adaptation_threshhold && buffered_mode_latency == o.buffered_mode_latency && - lower_min_bitrate == o.lower_min_bitrate && dscp == o.dscp && suspend_below_min_bitrate == o.suspend_below_min_bitrate && unsignalled_recv_stream_limit == o.unsignalled_recv_stream_limit && @@ -409,7 +407,6 @@ struct VideoOptions { ost << ToStringIfSet("low", system_low_adaptation_threshhold); ost << ToStringIfSet("high", system_high_adaptation_threshhold); ost << ToStringIfSet("buffered mode latency", buffered_mode_latency); - ost << ToStringIfSet("lower min bitrate", lower_min_bitrate); ost << ToStringIfSet("dscp", dscp); ost << ToStringIfSet("suspend below min bitrate", suspend_below_min_bitrate); @@ -480,8 +477,6 @@ struct VideoOptions { SettablePercent system_high_adaptation_threshhold; // Specify buffered mode latency in milliseconds. Settable buffered_mode_latency; - // Make minimum configured send bitrate even lower than usual, at 30kbit. - Settable lower_min_bitrate; // Set DSCP value for packet sent from video channel. Settable dscp; // Enable WebRTC suspension of video. No video frames will be sent when the diff --git a/talk/media/webrtc/webrtcvideoengine.cc b/talk/media/webrtc/webrtcvideoengine.cc index db0d26fdb0..0161de8b45 100644 --- a/talk/media/webrtc/webrtcvideoengine.cc +++ b/talk/media/webrtc/webrtcvideoengine.cc @@ -75,7 +75,7 @@ const int kVideoRtpBufferSize = 65536; const char kVp8CodecName[] = "VP8"; const int kDefaultFramerate = 30; -const int kMinVideoBitrate = 50; +const int kMinVideoBitrate = 30; const int kStartVideoBitrate = 300; const int kMaxVideoBitrate = 2000; @@ -84,9 +84,6 @@ const int kCpuMonitorPeriodMs = 2000; // 2 seconds. static const int kDefaultLogSeverity = talk_base::LS_WARNING; -// Controlled by exp, try a super low minimum bitrate for poor connections. -static const int kLowerMinBitrate = 30; - static const int kDefaultNumberOfTemporalLayers = 1; // 1:1 static const int kExternalVideoPayloadTypeBase = 120; @@ -2958,13 +2955,6 @@ bool WebRtcVideoMediaChannel::SetOptions(const VideoOptions &options) { bool reset_send_codec_needed = denoiser_changed; webrtc::VideoCodec new_codec = *send_codec_; - // TODO(pthatcher): Remove this. We don't need 4 ways to set bitrates. - bool lower_min_bitrate; - if (options.lower_min_bitrate.Get(&lower_min_bitrate)) { - new_codec.minBitrate = kLowerMinBitrate; - reset_send_codec_needed = true; - } - if (conference_mode_turned_off) { // This is a special case for turning conference mode off. // Max bitrate should go back to the default maximum value instead diff --git a/talk/media/webrtc/webrtcvideoengine_unittest.cc b/talk/media/webrtc/webrtcvideoengine_unittest.cc index 68bbfe6b22..f4d45820c1 100644 --- a/talk/media/webrtc/webrtcvideoengine_unittest.cc +++ b/talk/media/webrtc/webrtcvideoengine_unittest.cc @@ -68,7 +68,7 @@ static const cricket::VideoCodec* const kVideoCodecs[] = { }; static const unsigned int kStartBandwidthKbps = 300; -static const unsigned int kMinBandwidthKbps = 50; +static const unsigned int kMinBandwidthKbps = 30; static const unsigned int kMaxBandwidthKbps = 2000; static const uint32 kSsrcs1[] = {1}; @@ -430,8 +430,13 @@ TEST_F(WebRtcVideoEngineTestFake, SetSendCodecsWithStartBitrate) { codecs[0].params[cricket::kCodecParamStartBitrate] = "450"; EXPECT_TRUE(channel_->SetSendCodecs(codecs)); - VerifyVP8SendCodec( - channel_num, kVP8Codec.width, kVP8Codec.height, 0, 2000, 50, 450); + VerifyVP8SendCodec(channel_num, + kVP8Codec.width, + kVP8Codec.height, + 0, + kMaxBandwidthKbps, + kMinBandwidthKbps, + 450); cricket::VideoCodec codec; EXPECT_TRUE(channel_->GetSendCodec(&codec)); @@ -470,11 +475,11 @@ TEST_F(WebRtcVideoEngineTestFake, SetSendCodecsWithLargeMinMaxBitrate) { int channel_num = vie_.GetLastChannel(); std::vector codecs(engine_.codecs()); codecs[0].params[cricket::kCodecParamMinBitrate] = "1000"; - codecs[0].params[cricket::kCodecParamMaxBitrate] = "2000"; + codecs[0].params[cricket::kCodecParamMaxBitrate] = "3000"; EXPECT_TRUE(channel_->SetSendCodecs(codecs)); VerifyVP8SendCodec( - channel_num, kVP8Codec.width, kVP8Codec.height, 0, 2000, 1000, + channel_num, kVP8Codec.width, kVP8Codec.height, 0, 3000, 1000, 1000); } @@ -485,9 +490,15 @@ TEST_F(WebRtcVideoEngineTestFake, SetSendCodecsWithMaxQuantization) { codecs[0].params[cricket::kCodecParamMaxQuantization] = "21"; EXPECT_TRUE(channel_->SetSendCodecs(codecs)); - VerifyVP8SendCodec( - channel_num, kVP8Codec.width, kVP8Codec.height, 0, 2000, 50, 300, - 30, 21); + VerifyVP8SendCodec(channel_num, + kVP8Codec.width, + kVP8Codec.height, + 0, + kMaxBandwidthKbps, + kMinBandwidthKbps, + 300, + 30, + 21); cricket::VideoCodec codec; EXPECT_TRUE(channel_->GetSendCodec(&codec)); @@ -519,25 +530,6 @@ TEST_F(WebRtcVideoEngineTestFake, SetOptionsWithMaxBitrate) { channel_num, kVP8Codec.width, kVP8Codec.height, 0, 20, 10, 20); } -TEST_F(WebRtcVideoEngineTestFake, SetOptionsWithLoweredBitrate) { - EXPECT_TRUE(SetupEngine()); - int channel_num = vie_.GetLastChannel(); - std::vector codecs(engine_.codecs()); - codecs[0].params[cricket::kCodecParamMinBitrate] = "50"; - codecs[0].params[cricket::kCodecParamMaxBitrate] = "100"; - EXPECT_TRUE(channel_->SetSendCodecs(codecs)); - - VerifyVP8SendCodec( - channel_num, kVP8Codec.width, kVP8Codec.height, 0, 100, 50, 100); - - // Verify that min bitrate changes after SetOptions(). - cricket::VideoOptions options; - options.lower_min_bitrate.Set(true); - EXPECT_TRUE(channel_->SetOptions(options)); - VerifyVP8SendCodec( - channel_num, kVP8Codec.width, kVP8Codec.height, 0, 100, 30, 100); -} - TEST_F(WebRtcVideoEngineTestFake, MaxBitrateResetWithConferenceMode) { EXPECT_TRUE(SetupEngine()); int channel_num = vie_.GetLastChannel(); @@ -570,36 +562,33 @@ TEST_F(WebRtcVideoEngineTestFake, StartSendBitrate) { std::vector codec_list; codec_list.push_back(codec); EXPECT_TRUE(channel_->SetSendCodecs(codec_list)); - const unsigned int kVideoMaxSendBitrateKbps = 2000; - const unsigned int kVideoMinSendBitrateKbps = 50; - const unsigned int kVideoDefaultStartSendBitrateKbps = 300; VerifyVP8SendCodec(send_channel, kVP8Codec.width, kVP8Codec.height, 0, - kVideoMaxSendBitrateKbps, kVideoMinSendBitrateKbps, - kVideoDefaultStartSendBitrateKbps); + kMaxBandwidthKbps, kMinBandwidthKbps, + kStartBandwidthKbps); EXPECT_EQ(0, vie_.StartSend(send_channel)); // Increase the send bitrate and verify it is used as start bitrate. - const unsigned int kVideoSendBitrateBps = 768000; - vie_.SetSendBitrates(send_channel, kVideoSendBitrateBps, 0, 0); + const unsigned int kIncreasedSendBitrateBps = 768000; + vie_.SetSendBitrates(send_channel, kIncreasedSendBitrateBps, 0, 0); EXPECT_TRUE(channel_->SetSendCodecs(codec_list)); VerifyVP8SendCodec(send_channel, kVP8Codec.width, kVP8Codec.height, 0, - kVideoMaxSendBitrateKbps, kVideoMinSendBitrateKbps, - kVideoSendBitrateBps / 1000); + kMaxBandwidthKbps, kMinBandwidthKbps, + kIncreasedSendBitrateBps / 1000); // Never set a start bitrate higher than the max bitrate. - vie_.SetSendBitrates(send_channel, kVideoMaxSendBitrateKbps + 500, 0, 0); + vie_.SetSendBitrates(send_channel, kMaxBandwidthKbps + 500, 0, 0); EXPECT_TRUE(channel_->SetSendCodecs(codec_list)); VerifyVP8SendCodec(send_channel, kVP8Codec.width, kVP8Codec.height, 0, - kVideoMaxSendBitrateKbps, kVideoMinSendBitrateKbps, - kVideoDefaultStartSendBitrateKbps); + kMaxBandwidthKbps, kMinBandwidthKbps, + kStartBandwidthKbps); // Use the default start bitrate if the send bitrate is lower. - vie_.SetSendBitrates(send_channel, kVideoDefaultStartSendBitrateKbps - 50, 0, + vie_.SetSendBitrates(send_channel, kStartBandwidthKbps - 50, 0, 0); EXPECT_TRUE(channel_->SetSendCodecs(codec_list)); VerifyVP8SendCodec(send_channel, kVP8Codec.width, kVP8Codec.height, 0, - kVideoMaxSendBitrateKbps, kVideoMinSendBitrateKbps, - kVideoDefaultStartSendBitrateKbps); + kMaxBandwidthKbps, kMinBandwidthKbps, + kStartBandwidthKbps); }