@@ -165,7 +165,10 @@ GoogCcNetworkController::GoogCcNetworkController(NetworkControllerConfig config,
165
165
DataRate::Zero ())),
166
166
max_padding_rate_(config.stream_based_config.max_padding_rate.value_or(
167
167
DataRate::Zero ())),
168
- max_total_allocated_bitrate_(DataRate::Zero()) {
168
+ max_total_allocated_bitrate_(DataRate::Zero()),
169
+ external_start_bitrate_kbps_(" start" , 0 ),
170
+ external_min_bitrate_kbps_(" min" , 0 ),
171
+ external_max_bitrate_kbps_(" max" , 0 ) {
169
172
RTC_DCHECK (config.constraints .at_time .IsFinite ());
170
173
ParseFieldTrial (
171
174
{&safe_reset_on_route_change_, &safe_reset_acknowledged_rate_},
@@ -175,21 +178,26 @@ GoogCcNetworkController::GoogCcNetworkController(NetworkControllerConfig config,
175
178
if (delay_based_bwe_gcc_)
176
179
delay_based_bwe_gcc_->SetMinBitrate (congestion_controller::GetMinBitrate ());
177
180
if (AllowExternalBwe ()) {
178
- if (GetExternalBweRateLimits (&external_start_bitrate_kbps_,
179
- &external_min_bitrate_kbps_,
180
- &external_max_bitrate_kbps_)) {
181
- if (external_start_bitrate_kbps_ > 0 )
182
- delay_based_bwe_->SetStartBitrate (
183
- webrtc::DataRate::BitsPerSec (external_start_bitrate_kbps_ * 1024 ));
184
- if (external_min_bitrate_kbps_ > 0 )
185
- delay_based_bwe_->SetMinBitrate (
186
- webrtc::DataRate::BitsPerSec (external_min_bitrate_kbps_ * 1024 ));
181
+ ParseFieldTrial ({&external_start_bitrate_kbps_, &external_min_bitrate_kbps_,
182
+ &external_max_bitrate_kbps_},
183
+ field_trial::FindFullName (" OWT-Bwe-RateLimits" ));
184
+ RTC_CHECK_GE (external_start_bitrate_kbps_.Get (), 0 )
185
+ << " start_bitrate_kbps must not be smaller than 0." ;
186
+ RTC_CHECK_GE (external_min_bitrate_kbps_.Get (), 0 )
187
+ << " min_bitrate_kbps must not be smaller than 0." ;
188
+ RTC_CHECK_GE (external_max_bitrate_kbps_.Get (), 0 )
189
+ << " max_bitrate_kbps must not be smaller than 0" ;
190
+ if (external_start_bitrate_kbps_.Get () > 0 )
191
+ delay_based_bwe_->SetStartBitrate (
192
+ webrtc::DataRate::BitsPerSec (external_start_bitrate_kbps_ * 1024 ));
193
+ if (external_min_bitrate_kbps_.Get () > 0 )
194
+ delay_based_bwe_->SetMinBitrate (
195
+ webrtc::DataRate::BitsPerSec (external_min_bitrate_kbps_ * 1024 ));
187
196
#ifdef INTEL_GPRA
188
- // Only intel_gpra module allows setting maxbitrate.
189
- if (external_max_bitrate_kbps_ > 0 )
190
- delay_based_bwe_->SetMaxBitrate (external_max_bitrate_kbps_ * 1024 );
197
+ // Only intel_gpra module allows setting maxbitrate.
198
+ if (external_max_bitrate_kbps_. Get () > 0 )
199
+ delay_based_bwe_->SetMaxBitrate (external_max_bitrate_kbps_ * 1024 );
191
200
#endif
192
- }
193
201
}
194
202
}
195
203
0 commit comments