Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Unified Diff: webrtc/modules/audio_processing/aec3/echo_canceller3_unittest.cc

Issue 2611223003: Adding second layer of the echo canceller 3 functionality. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/aec3/echo_canceller3_unittest.cc
diff --git a/webrtc/modules/audio_processing/aec3/echo_canceller3_unittest.cc b/webrtc/modules/audio_processing/aec3/echo_canceller3_unittest.cc
index 8baa45606f5474c598ada890a2a4fb2a276e0540..a42a873ef431a45a57c42fd1f7eab17931c0d8e7 100644
--- a/webrtc/modules/audio_processing/aec3/echo_canceller3_unittest.cc
+++ b/webrtc/modules/audio_processing/aec3/echo_canceller3_unittest.cc
@@ -82,7 +82,7 @@ class CaptureTransportVerificationProcessor : public BlockProcessor {
explicit CaptureTransportVerificationProcessor(size_t num_bands) {}
~CaptureTransportVerificationProcessor() override = default;
- void ProcessCapture(bool known_echo_path_change,
+ void ProcessCapture(bool level_change,
bool saturated_microphone_signal,
std::vector<std::vector<float>>* capture_block) override {
}
@@ -91,7 +91,7 @@ class CaptureTransportVerificationProcessor : public BlockProcessor {
return false;
}
- void ReportEchoLeakage(bool leakage_detected) override {}
+ void UpdateEchoLeakageStatus(bool leakage_detected) override {}
private:
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(CaptureTransportVerificationProcessor);
@@ -104,7 +104,7 @@ class RenderTransportVerificationProcessor : public BlockProcessor {
explicit RenderTransportVerificationProcessor(size_t num_bands) {}
~RenderTransportVerificationProcessor() override = default;
- void ProcessCapture(bool known_echo_path_change,
+ void ProcessCapture(bool level_change,
bool saturated_microphone_signal,
std::vector<std::vector<float>>* capture_block) override {
std::vector<std::vector<float>> render_block =
@@ -118,7 +118,7 @@ class RenderTransportVerificationProcessor : public BlockProcessor {
return false;
}
- void ReportEchoLeakage(bool leakage_detected) override {}
+ void UpdateEchoLeakageStatus(bool leakage_detected) override {}
private:
std::deque<std::vector<std::vector<float>>> received_render_blocks_;
@@ -218,7 +218,7 @@ class EchoCanceller3Tester {
new StrictMock<webrtc::test::MockBlockProcessor>());
EXPECT_CALL(*block_processor_mock, BufferRender(_))
.Times(expected_num_block_to_process);
- EXPECT_CALL(*block_processor_mock, ReportEchoLeakage(_)).Times(0);
+ EXPECT_CALL(*block_processor_mock, UpdateEchoLeakageStatus(_)).Times(0);
switch (echo_path_change_test_variant) {
case EchoPathChangeTestVariant::kNone:
@@ -300,18 +300,21 @@ class EchoCanceller3Tester {
switch (leakage_report_variant) {
case EchoLeakageTestVariant::kNone:
- EXPECT_CALL(*block_processor_mock, ReportEchoLeakage(_)).Times(0);
+ EXPECT_CALL(*block_processor_mock, UpdateEchoLeakageStatus(_)).Times(0);
break;
case EchoLeakageTestVariant::kFalseSticky:
- EXPECT_CALL(*block_processor_mock, ReportEchoLeakage(false)).Times(1);
+ EXPECT_CALL(*block_processor_mock, UpdateEchoLeakageStatus(false))
+ .Times(1);
break;
case EchoLeakageTestVariant::kTrueSticky:
- EXPECT_CALL(*block_processor_mock, ReportEchoLeakage(true)).Times(1);
+ EXPECT_CALL(*block_processor_mock, UpdateEchoLeakageStatus(true))
+ .Times(1);
break;
case EchoLeakageTestVariant::kTrueNonSticky: {
testing::InSequence s;
- EXPECT_CALL(*block_processor_mock, ReportEchoLeakage(true)).Times(1);
- EXPECT_CALL(*block_processor_mock, ReportEchoLeakage(false))
+ EXPECT_CALL(*block_processor_mock, UpdateEchoLeakageStatus(true))
+ .Times(1);
+ EXPECT_CALL(*block_processor_mock, UpdateEchoLeakageStatus(false))
.Times(kNumFramesToProcess - 1);
} break;
}
@@ -326,19 +329,19 @@ class EchoCanceller3Tester {
break;
case EchoLeakageTestVariant::kFalseSticky:
if (frame_index == 0) {
- aec3.ReportEchoLeakage(false);
+ aec3.UpdateEchoLeakageStatus(false);
}
break;
case EchoLeakageTestVariant::kTrueSticky:
if (frame_index == 0) {
- aec3.ReportEchoLeakage(true);
+ aec3.UpdateEchoLeakageStatus(true);
}
break;
case EchoLeakageTestVariant::kTrueNonSticky:
if (frame_index == 0) {
- aec3.ReportEchoLeakage(true);
+ aec3.UpdateEchoLeakageStatus(true);
} else {
- aec3.ReportEchoLeakage(false);
+ aec3.UpdateEchoLeakageStatus(false);
}
break;
}
@@ -382,7 +385,7 @@ class EchoCanceller3Tester {
new StrictMock<webrtc::test::MockBlockProcessor>());
EXPECT_CALL(*block_processor_mock, BufferRender(_))
.Times(expected_num_block_to_process);
- EXPECT_CALL(*block_processor_mock, ReportEchoLeakage(_)).Times(0);
+ EXPECT_CALL(*block_processor_mock, UpdateEchoLeakageStatus(_)).Times(0);
switch (saturation_variant) {
case SaturationTestVariant::kNone:

Powered by Google App Engine
This is Rietveld 408576698