Adding flag to force Opus application and DTX while toggling.
Currently, we only allow Opus DTX in combination with Opus kVoip mode. When one of them is toggled, the other might need to change as well. This CL is to introduce a flag to force a co-config.
BUG=
R=henrik.lundin@webrtc.org, tina.legrand@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/40159004
Cr-Commit-Position: refs/heads/master@{#8698}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8698 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/audio_coding/main/test/TestVADDTX.cc b/webrtc/modules/audio_coding/main/test/TestVADDTX.cc
index 475e699..e544ae3 100644
--- a/webrtc/modules/audio_coding/main/test/TestVADDTX.cc
+++ b/webrtc/modules/audio_coding/main/test/TestVADDTX.cc
@@ -236,6 +236,13 @@
// Following is the implementation of TestOpusDtx.
void TestOpusDtx::Perform() {
+#ifdef WEBRTC_CODEC_ISAC
+ // If we set other codec than Opus, DTX cannot be toggled.
+ RegisterCodec(kIsacWb);
+ EXPECT_EQ(-1, acm_send_->EnableOpusDtx(false));
+ EXPECT_EQ(-1, acm_send_->DisableOpusDtx());
+#endif
+
#ifdef WEBRTC_CODEC_OPUS
int expects[] = {0, 1, 0, 0, 0};
@@ -248,7 +255,7 @@
Run(webrtc::test::ResourcePath("audio_coding/testfile32kHz", "pcm"),
32000, 1, out_filename, false, expects);
- EXPECT_EQ(0, acm_send_->EnableOpusDtx());
+ EXPECT_EQ(0, acm_send_->EnableOpusDtx(false));
expects[kFrameEmpty] = 1;
Run(webrtc::test::ResourcePath("audio_coding/testfile32kHz", "pcm"),
32000, 1, out_filename, true, expects);
@@ -261,9 +268,10 @@
Run(webrtc::test::ResourcePath("audio_coding/teststereo32kHz", "pcm"),
32000, 2, out_filename, false, expects);
- // Opus DTX should only work in Voip mode.
- EXPECT_EQ(0, acm_send_->SetOpusApplication(kVoip));
- EXPECT_EQ(0, acm_send_->EnableOpusDtx());
+ // Opus should be now in kAudio mode. Opus DTX should not be set without
+ // forcing kVoip mode.
+ EXPECT_EQ(-1, acm_send_->EnableOpusDtx(false));
+ EXPECT_EQ(0, acm_send_->EnableOpusDtx(true));
expects[kFrameEmpty] = 1;
Run(webrtc::test::ResourcePath("audio_coding/teststereo32kHz", "pcm"),