From f7d636644faf81d84374e540d254ec64cedf111b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Wed, 9 Jan 2019 15:49:29 +0100 Subject: [PATCH] Delete method NetEqImpl::CurrentDelayMs, used only by tests Bug: None Change-Id: If94695f60ed804f6b43be828dd93f02826269140 Reviewed-on: https://webrtc-review.googlesource.com/c/116687 Reviewed-by: Ivo Creusen Commit-Queue: Niels Moller Cr-Commit-Position: refs/heads/master@{#26193} --- modules/audio_coding/neteq/include/neteq.h | 3 --- modules/audio_coding/neteq/neteq_impl.cc | 15 --------------- modules/audio_coding/neteq/neteq_impl.h | 2 -- .../neteq/neteq_network_stats_unittest.cc | 3 --- modules/audio_coding/neteq/neteq_unittest.cc | 4 ---- 5 files changed, 27 deletions(-) diff --git a/modules/audio_coding/neteq/include/neteq.h b/modules/audio_coding/neteq/include/neteq.h index 70bedfbd0c..eddcbb267d 100644 --- a/modules/audio_coding/neteq/include/neteq.h +++ b/modules/audio_coding/neteq/include/neteq.h @@ -204,9 +204,6 @@ class NetEq { // requested through SetMinimumDelay. virtual int TargetDelayMs() const = 0; - // Returns the current total delay (packet buffer and sync buffer) in ms. - virtual int CurrentDelayMs() const = 0; - // Returns the current total delay (packet buffer and sync buffer) in ms, // with smoothing applied to even out short-time fluctuations due to jitter. // The packet buffer part of the delay is not updated during DTX/CNG periods. diff --git a/modules/audio_coding/neteq/neteq_impl.cc b/modules/audio_coding/neteq/neteq_impl.cc index 00c9172a71..fd6a544703 100644 --- a/modules/audio_coding/neteq/neteq_impl.cc +++ b/modules/audio_coding/neteq/neteq_impl.cc @@ -303,21 +303,6 @@ int NetEqImpl::TargetDelayMs() const { rtc::CheckedDivExact(fs_hz_, 1000); } -int NetEqImpl::CurrentDelayMs() const { - rtc::CritScope lock(&crit_sect_); - if (fs_hz_ == 0) - return 0; - // Sum up the samples in the packet buffer with the future length of the sync - // buffer, and divide the sum by the sample rate. - const size_t delay_samples = - packet_buffer_->NumSamplesInBuffer(decoder_frame_length_) + - sync_buffer_->FutureLength(); - // The division below will truncate. - const int delay_ms = - static_cast(delay_samples) / rtc::CheckedDivExact(fs_hz_, 1000); - return delay_ms; -} - int NetEqImpl::FilteredCurrentDelayMs() const { rtc::CritScope lock(&crit_sect_); // Calculate the filtered packet buffer level in samples. The value from diff --git a/modules/audio_coding/neteq/neteq_impl.h b/modules/audio_coding/neteq/neteq_impl.h index e695c6ffbd..b1af537800 100644 --- a/modules/audio_coding/neteq/neteq_impl.h +++ b/modules/audio_coding/neteq/neteq_impl.h @@ -156,8 +156,6 @@ class NetEqImpl : public webrtc::NetEq { int TargetDelayMs() const override; - int CurrentDelayMs() const override; - int FilteredCurrentDelayMs() const override; // Writes the current network statistics to |stats|. The statistics are reset diff --git a/modules/audio_coding/neteq/neteq_network_stats_unittest.cc b/modules/audio_coding/neteq/neteq_network_stats_unittest.cc index d052168469..72a75d1b5c 100644 --- a/modules/audio_coding/neteq/neteq_network_stats_unittest.cc +++ b/modules/audio_coding/neteq/neteq_network_stats_unittest.cc @@ -220,9 +220,6 @@ class NetEqNetworkStatsTest { CHECK_NETEQ_NETWORK_STATS(added_zero_samples); #undef CHECK_NETEQ_NETWORK_STATS - - // Compare with CurrentDelay, which should be identical. - EXPECT_EQ(stats.current_buffer_size_ms, neteq_->CurrentDelayMs()); } void RunTest(int num_loops, NetEqNetworkStatsCheck expects) { diff --git a/modules/audio_coding/neteq/neteq_unittest.cc b/modules/audio_coding/neteq/neteq_unittest.cc index d45877a192..2757b024b8 100644 --- a/modules/audio_coding/neteq/neteq_unittest.cc +++ b/modules/audio_coding/neteq/neteq_unittest.cc @@ -404,10 +404,6 @@ void NetEqDecodingTest::DecodeAndCompare( ASSERT_EQ(0, neteq_->NetworkStatistics(¤t_network_stats)); ASSERT_NO_FATAL_FAILURE(network_stats.AddResult(current_network_stats)); - // Compare with CurrentDelay, which should be identical. - EXPECT_EQ(current_network_stats.current_buffer_size_ms, - neteq_->CurrentDelayMs()); - // Verify that liftime stats and network stats report similar loss // concealment rates. auto lifetime_stats = neteq_->GetLifetimeStatistics();