From 5abd3e1f986c627a852bf823d15feaa5f619a559 Mon Sep 17 00:00:00 2001 From: Henrik Lundin Date: Wed, 3 Jun 2015 12:58:46 +0200 Subject: [PATCH] Revert r9359 "Implement NetEq's CurrentDelay function" This reverts commit d8a03facf6986a011c8f889c63d87f9216a1e912, since it broke the Chrome build. Will have to swap to using base/logging.h in neteq_impl.cc before re-landing this change. TBR=kwiberg@webrtc.org Review URL: https://webrtc-codereview.appspot.com/50219004 Cr-Commit-Position: refs/heads/master@{#9360} --- .../modules/audio_coding/neteq/interface/neteq.h | 4 ++-- webrtc/modules/audio_coding/neteq/neteq_impl.cc | 16 ++-------------- webrtc/modules/audio_coding/neteq/neteq_impl.h | 2 +- .../neteq/neteq_network_stats_unittest.cc | 3 --- .../modules/audio_coding/neteq/neteq_unittest.cc | 2 -- 5 files changed, 5 insertions(+), 22 deletions(-) diff --git a/webrtc/modules/audio_coding/neteq/interface/neteq.h b/webrtc/modules/audio_coding/neteq/interface/neteq.h index 93e8172ab4..88bf2087ff 100644 --- a/webrtc/modules/audio_coding/neteq/interface/neteq.h +++ b/webrtc/modules/audio_coding/neteq/interface/neteq.h @@ -210,8 +210,8 @@ class NetEq { // Not implemented. virtual int TargetDelay() = 0; - // Returns the current total delay (packet buffer and sync buffer) in ms. - virtual int CurrentDelayMs() const = 0; + // Not implemented. + virtual int CurrentDelay() = 0; // Sets the playout mode to |mode|. // Deprecated. Set the mode in the Config struct passed to the constructor. diff --git a/webrtc/modules/audio_coding/neteq/neteq_impl.cc b/webrtc/modules/audio_coding/neteq/neteq_impl.cc index 636594e729..1351e66634 100644 --- a/webrtc/modules/audio_coding/neteq/neteq_impl.cc +++ b/webrtc/modules/audio_coding/neteq/neteq_impl.cc @@ -15,7 +15,6 @@ #include -#include "webrtc/base/checks.h" #include "webrtc/common_audio/signal_processing/include/signal_processing_library.h" #include "webrtc/modules/audio_coding/codecs/audio_decoder.h" #include "webrtc/modules/audio_coding/neteq/accelerate.h" @@ -292,19 +291,8 @@ int NetEqImpl::TargetDelay() { return kNotImplemented; } -int NetEqImpl::CurrentDelayMs() const { - CriticalSectionScoped lock(crit_sect_.get()); - 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 int delay_samples = - packet_buffer_->NumSamplesInBuffer(decoder_database_.get(), - decoder_frame_length_) + - static_cast(sync_buffer_->FutureLength()); - // The division below will truncate. - const int delay_ms = delay_samples / rtc::CheckedDivExact(fs_hz_, 1000); - return delay_ms; +int NetEqImpl::CurrentDelay() { + return kNotImplemented; } // Deprecated. diff --git a/webrtc/modules/audio_coding/neteq/neteq_impl.h b/webrtc/modules/audio_coding/neteq/neteq_impl.h index 4c4660a678..55ba067221 100644 --- a/webrtc/modules/audio_coding/neteq/neteq_impl.h +++ b/webrtc/modules/audio_coding/neteq/neteq_impl.h @@ -138,7 +138,7 @@ class NetEqImpl : public webrtc::NetEq { int TargetDelay() override; - int CurrentDelayMs() const override; + int CurrentDelay() override; // Sets the playout mode to |mode|. // Deprecated. diff --git a/webrtc/modules/audio_coding/neteq/neteq_network_stats_unittest.cc b/webrtc/modules/audio_coding/neteq/neteq_network_stats_unittest.cc index 95f6489a99..e1a0f69dfa 100644 --- a/webrtc/modules/audio_coding/neteq/neteq_network_stats_unittest.cc +++ b/webrtc/modules/audio_coding/neteq/neteq_network_stats_unittest.cc @@ -170,9 +170,6 @@ struct NetEqNetworkStatsCheck { 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/webrtc/modules/audio_coding/neteq/neteq_unittest.cc b/webrtc/modules/audio_coding/neteq/neteq_unittest.cc index 678e3a0743..b3d6f25f89 100644 --- a/webrtc/modules/audio_coding/neteq/neteq_unittest.cc +++ b/webrtc/modules/audio_coding/neteq/neteq_unittest.cc @@ -404,8 +404,6 @@ void NetEqDecodingTest::DecodeAndCompare(const std::string& rtp_file, ASSERT_EQ(0, neteq_->NetworkStatistics(&network_stats)); ASSERT_NO_FATAL_FAILURE( network_stat_files.ProcessReference(network_stats)); - // Compare with CurrentDelay, which should be identical. - EXPECT_EQ(network_stats.current_buffer_size_ms, neteq_->CurrentDelayMs()); // Process RTCPstat. RtcpStatistics rtcp_stats;