| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 Run(webrtc::test::ResourcePath("audio_coding/testfile32kHz", "pcm"), | 202 Run(webrtc::test::ResourcePath("audio_coding/testfile32kHz", "pcm"), |
| 203 32000, 1, out_filename.str(), !new_outfile, expects); | 203 32000, 1, out_filename.str(), !new_outfile, expects); |
| 204 } | 204 } |
| 205 | 205 |
| 206 void TestWebRtcVadDtx::SetVAD(bool enable_dtx, bool enable_vad, | 206 void TestWebRtcVadDtx::SetVAD(bool enable_dtx, bool enable_vad, |
| 207 ACMVADMode vad_mode) { | 207 ACMVADMode vad_mode) { |
| 208 ACMVADMode mode; | 208 ACMVADMode mode; |
| 209 EXPECT_EQ(0, acm_send_->SetVAD(enable_dtx, enable_vad, vad_mode)); | 209 EXPECT_EQ(0, acm_send_->SetVAD(enable_dtx, enable_vad, vad_mode)); |
| 210 EXPECT_EQ(0, acm_send_->VAD(&dtx_enabled_, &vad_enabled_, &mode)); | 210 EXPECT_EQ(0, acm_send_->VAD(&dtx_enabled_, &vad_enabled_, &mode)); |
| 211 | 211 |
| 212 CodecInst codec_param; | 212 auto codec_param = acm_send_->SendCodec(); |
| 213 acm_send_->SendCodec(&codec_param); | 213 ASSERT_TRUE(codec_param); |
| 214 if (STR_CASE_CMP(codec_param.plname, "opus") == 0) { | 214 if (STR_CASE_CMP(codec_param->plname, "opus") == 0) { |
| 215 // If send codec is Opus, WebRTC VAD/DTX cannot be used. | 215 // If send codec is Opus, WebRTC VAD/DTX cannot be used. |
| 216 enable_dtx = enable_vad = false; | 216 enable_dtx = enable_vad = false; |
| 217 } | 217 } |
| 218 | 218 |
| 219 EXPECT_EQ(dtx_enabled_ , enable_dtx); // DTX should be set as expected. | 219 EXPECT_EQ(dtx_enabled_ , enable_dtx); // DTX should be set as expected. |
| 220 | 220 |
| 221 if (dtx_enabled_) { | 221 if (dtx_enabled_) { |
| 222 EXPECT_TRUE(vad_enabled_); // WebRTC DTX cannot run without WebRTC VAD. | 222 EXPECT_TRUE(vad_enabled_); // WebRTC DTX cannot run without WebRTC VAD. |
| 223 } else { | 223 } else { |
| 224 // Using no DTX should not affect setting of VAD. | 224 // Using no DTX should not affect setting of VAD. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 | 262 |
| 263 EXPECT_EQ(0, acm_send_->EnableOpusDtx()); | 263 EXPECT_EQ(0, acm_send_->EnableOpusDtx()); |
| 264 | 264 |
| 265 expects[kEmptyFrame] = 1; | 265 expects[kEmptyFrame] = 1; |
| 266 Run(webrtc::test::ResourcePath("audio_coding/teststereo32kHz", "pcm"), | 266 Run(webrtc::test::ResourcePath("audio_coding/teststereo32kHz", "pcm"), |
| 267 32000, 2, out_filename, true, expects); | 267 32000, 2, out_filename, true, expects); |
| 268 #endif | 268 #endif |
| 269 } | 269 } |
| 270 | 270 |
| 271 } // namespace webrtc | 271 } // namespace webrtc |
| OLD | NEW |