| 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 EXPECT_TRUE(vad_enabled_); // WebRTC DTX cannot run without WebRTC VAD. | 227 EXPECT_TRUE(vad_enabled_); // WebRTC DTX cannot run without WebRTC VAD. |
| 228 } else { | 228 } else { |
| 229 // Using no DTX should not affect setting of VAD. | 229 // Using no DTX should not affect setting of VAD. |
| 230 EXPECT_EQ(enable_vad, vad_enabled_); | 230 EXPECT_EQ(enable_vad, vad_enabled_); |
| 231 } | 231 } |
| 232 } | 232 } |
| 233 | 233 |
| 234 // Following is the implementation of TestOpusDtx. | 234 // Following is the implementation of TestOpusDtx. |
| 235 void TestOpusDtx::Perform() { | 235 void TestOpusDtx::Perform() { |
| 236 #ifdef WEBRTC_CODEC_ISAC | 236 #ifdef WEBRTC_CODEC_ISAC |
| 237 // If we set other codec than Opus, DTX cannot be toggled. | 237 // If we set other codec than Opus, DTX cannot be switched on. |
| 238 RegisterCodec(kIsacWb); | 238 RegisterCodec(kIsacWb); |
| 239 EXPECT_EQ(-1, acm_send_->EnableOpusDtx()); | 239 EXPECT_EQ(-1, acm_send_->EnableOpusDtx()); |
| 240 EXPECT_EQ(-1, acm_send_->DisableOpusDtx()); | 240 EXPECT_EQ(0, acm_send_->DisableOpusDtx()); |
| 241 #endif | 241 #endif |
| 242 | 242 |
| 243 #ifdef WEBRTC_CODEC_OPUS | 243 #ifdef WEBRTC_CODEC_OPUS |
| 244 int expects[] = {0, 1, 0, 0, 0}; | 244 int expects[] = {0, 1, 0, 0, 0}; |
| 245 | 245 |
| 246 // Register Opus as send codec | 246 // Register Opus as send codec |
| 247 std::string out_filename = webrtc::test::OutputPath() + | 247 std::string out_filename = webrtc::test::OutputPath() + |
| 248 "testOpusDtx_outFile_mono.pcm"; | 248 "testOpusDtx_outFile_mono.pcm"; |
| 249 RegisterCodec(kOpus); | 249 RegisterCodec(kOpus); |
| 250 EXPECT_EQ(0, acm_send_->DisableOpusDtx()); | 250 EXPECT_EQ(0, acm_send_->DisableOpusDtx()); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 267 | 267 |
| 268 EXPECT_EQ(0, acm_send_->EnableOpusDtx()); | 268 EXPECT_EQ(0, acm_send_->EnableOpusDtx()); |
| 269 | 269 |
| 270 expects[kEmptyFrame] = 1; | 270 expects[kEmptyFrame] = 1; |
| 271 Run(webrtc::test::ResourcePath("audio_coding/teststereo32kHz", "pcm"), | 271 Run(webrtc::test::ResourcePath("audio_coding/teststereo32kHz", "pcm"), |
| 272 32000, 2, out_filename, true, expects); | 272 32000, 2, out_filename, true, expects); |
| 273 #endif | 273 #endif |
| 274 } | 274 } |
| 275 | 275 |
| 276 } // namespace webrtc | 276 } // namespace webrtc |
| OLD | NEW |