Removed the timeout for the delay estimate quality.
BUG=webrtc:8223, chromium:763761 Review-Url: https://codereview.webrtc.org/3011193002 Cr-Commit-Position: refs/heads/master@{#19773}
This commit is contained in:
@ -42,10 +42,10 @@ class RenderDelayControllerImpl final : public RenderDelayController {
|
||||
private:
|
||||
static int instance_count_;
|
||||
std::unique_ptr<ApmDataDumper> data_dumper_;
|
||||
size_t delay_ = 0;
|
||||
size_t delay_ = kMinEchoPathDelayBlocks;
|
||||
EchoPathDelayEstimator delay_estimator_;
|
||||
size_t blocks_since_last_delay_estimate_ = 300000;
|
||||
int echo_path_delay_samples_ = 0;
|
||||
int echo_path_delay_samples_ = kMinEchoPathDelayBlocks * kBlockSize;
|
||||
size_t align_call_counter_ = 0;
|
||||
rtc::Optional<size_t> headroom_samples_;
|
||||
RenderDelayControllerMetrics metrics_;
|
||||
@ -85,7 +85,7 @@ RenderDelayControllerImpl::~RenderDelayControllerImpl() = default;
|
||||
void RenderDelayControllerImpl::Reset() {
|
||||
delay_ = kMinEchoPathDelayBlocks;
|
||||
blocks_since_last_delay_estimate_ = 300000;
|
||||
echo_path_delay_samples_ = 0;
|
||||
echo_path_delay_samples_ = delay_ * kBlockSize;
|
||||
align_call_counter_ = 0;
|
||||
headroom_samples_ = rtc::Optional<size_t>();
|
||||
|
||||
@ -124,8 +124,6 @@ size_t RenderDelayControllerImpl::GetDelay(
|
||||
RTC_DCHECK_LE(0, headroom);
|
||||
headroom_samples_ = rtc::Optional<size_t>(headroom);
|
||||
}
|
||||
} else if (++blocks_since_last_delay_estimate_ > 20 * kNumBlocksPerSecond) {
|
||||
headroom_samples_ = rtc::Optional<size_t>();
|
||||
}
|
||||
|
||||
metrics_.Update(echo_path_delay_samples, delay_);
|
||||
|
||||
@ -53,8 +53,9 @@ TEST(RenderDelayController, NoRenderSignal) {
|
||||
RenderDelayController::Create(AudioProcessing::Config::EchoCanceller3(),
|
||||
rate));
|
||||
for (size_t k = 0; k < 100; ++k) {
|
||||
EXPECT_EQ(0u, delay_controller->GetDelay(
|
||||
delay_buffer->GetDownsampledRenderBuffer(), block));
|
||||
EXPECT_EQ(kMinEchoPathDelayBlocks,
|
||||
delay_controller->GetDelay(
|
||||
delay_buffer->GetDownsampledRenderBuffer(), block));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -78,7 +79,7 @@ TEST(RenderDelayController, BasicApiCalls) {
|
||||
render_delay_buffer->GetDownsampledRenderBuffer(), capture_block);
|
||||
}
|
||||
EXPECT_FALSE(delay_controller->AlignmentHeadroomSamples());
|
||||
EXPECT_EQ(0u, delay_blocks);
|
||||
EXPECT_EQ(kMinEchoPathDelayBlocks, delay_blocks);
|
||||
}
|
||||
}
|
||||
|
||||
@ -113,9 +114,6 @@ TEST(RenderDelayController, Alignment) {
|
||||
size_t expected_delay_blocks =
|
||||
std::max(0, static_cast<int>(delay_samples / kBlockSize) -
|
||||
kDelayHeadroomBlocks);
|
||||
if (expected_delay_blocks < 2) {
|
||||
expected_delay_blocks = 0;
|
||||
}
|
||||
|
||||
EXPECT_EQ(expected_delay_blocks, delay_blocks);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user