Remove extra delay field trial.

Bug: webrtc:10817
Change-Id: I704a8ea0dc774f242f8d5d88b140f850cf23d518
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/164539
Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30182}
This commit is contained in:
Jakob Ivarsson 2020-01-08 14:29:04 +01:00 committed by Commit Bot
parent a406ee1ca2
commit 2ee15eb4fa
3 changed files with 2 additions and 50 deletions

View File

@ -78,23 +78,6 @@ DelayHistogramConfig GetDelayHistogramConfig() {
return config;
}
absl::optional<int> GetExtraDelayMs() {
constexpr char kExtraDelayFieldTrial[] = "WebRTC-Audio-NetEqExtraDelay";
if (!webrtc::field_trial::IsEnabled(kExtraDelayFieldTrial)) {
return absl::nullopt;
}
const auto field_trial_string =
webrtc::field_trial::FindFullName(kExtraDelayFieldTrial);
int extra_delay_ms = -1;
sscanf(field_trial_string.c_str(), "Enabled-%d", &extra_delay_ms);
if (extra_delay_ms >= 0) {
RTC_LOG(LS_INFO) << "NetEq extra delay in milliseconds: " << extra_delay_ms;
return extra_delay_ms;
}
return absl::nullopt;
}
} // namespace
namespace webrtc {
@ -120,8 +103,7 @@ DelayManager::DelayManager(size_t max_packets_in_buffer,
minimum_delay_ms_(0),
maximum_delay_ms_(0),
last_pack_cng_or_dtmf_(1),
enable_rtx_handling_(enable_rtx_handling),
extra_delay_ms_(GetExtraDelayMs()) {
enable_rtx_handling_(enable_rtx_handling) {
RTC_CHECK(histogram_);
RTC_DCHECK_GE(base_minimum_delay_ms_, 0);
@ -299,10 +281,6 @@ int DelayManager::CalculateTargetLevel() {
target_level = std::max(target_level, 1);
// Scale to Q8 and assign to member variable.
target_level_ = target_level << 8;
if (extra_delay_ms_ && packet_len_ms_ > 0) {
int extra_delay = (extra_delay_ms_.value() << 8) / packet_len_ms_;
target_level_ += extra_delay;
}
return target_level_;
}

View File

@ -131,8 +131,7 @@ class DelayManager {
void UpdateEffectiveMinimumDelay();
// Makes sure that |target_level_| is not too large, taking
// |max_packets_in_buffer_| and |extra_delay_ms_| into account. This method is
// called by Update().
// |max_packets_in_buffer_| into account. This method is called by Update().
void LimitTargetLevel();
// Makes sure that |delay_ms| is less than maximum delay, if any maximum
@ -175,8 +174,6 @@ class DelayManager {
};
std::deque<PacketDelay> delay_history_;
const absl::optional<int> extra_delay_ms_;
RTC_DISALLOW_COPY_AND_ASSIGN(DelayManager);
};

View File

@ -594,27 +594,4 @@ TEST_F(DelayManagerTest, DecelerationTargetLevelOffset) {
}
}
TEST_F(DelayManagerTest, ExtraDelay) {
{
// Default behavior. Insert two packets so that a new target level is
// calculated.
SetPacketAudioLength(kFrameSizeMs);
InsertNextPacket();
IncreaseTime(kFrameSizeMs);
InsertNextPacket();
EXPECT_EQ(dm_->TargetLevel(), 1 << 8);
}
{
// Add 80 ms extra delay and calculate a new target level.
test::ScopedFieldTrials field_trial(
"WebRTC-Audio-NetEqExtraDelay/Enabled-80/");
RecreateDelayManager();
SetPacketAudioLength(kFrameSizeMs);
InsertNextPacket();
IncreaseTime(kFrameSizeMs);
InsertNextPacket();
EXPECT_EQ(dm_->TargetLevel(), 5 << 8);
}
}
} // namespace webrtc