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 |
11 #include "webrtc/modules/audio_coding/test/TestVADDTX.h" | 11 #include "webrtc/modules/audio_coding/test/TestVADDTX.h" |
12 | 12 |
13 #include <string> | 13 #include <string> |
14 | 14 |
| 15 #include "webrtc/modules/audio_coding/codecs/audio_format_conversion.h" |
15 #include "webrtc/modules/audio_coding/test/PCMFile.h" | 16 #include "webrtc/modules/audio_coding/test/PCMFile.h" |
16 #include "webrtc/modules/audio_coding/test/utility.h" | 17 #include "webrtc/modules/audio_coding/test/utility.h" |
17 #include "webrtc/test/testsupport/fileutils.h" | 18 #include "webrtc/test/testsupport/fileutils.h" |
18 #include "webrtc/voice_engine_configurations.h" | 19 #include "webrtc/voice_engine_configurations.h" |
19 | 20 |
20 namespace webrtc { | 21 namespace webrtc { |
21 | 22 |
22 #ifdef WEBRTC_CODEC_ISAC | 23 #ifdef WEBRTC_CODEC_ISAC |
23 const CodecInst kIsacWb = {103, "ISAC", 16000, 480, 1, 32000}; | 24 const CodecInst kIsacWb = {103, "ISAC", 16000, 480, 1, 32000}; |
24 const CodecInst kIsacSwb = {104, "ISAC", 32000, 960, 1, 56000}; | 25 const CodecInst kIsacSwb = {104, "ISAC", 32000, 960, 1, 56000}; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 channel_(new Channel), | 67 channel_(new Channel), |
67 monitor_(new ActivityMonitor) { | 68 monitor_(new ActivityMonitor) { |
68 EXPECT_EQ(0, acm_send_->RegisterTransportCallback(channel_.get())); | 69 EXPECT_EQ(0, acm_send_->RegisterTransportCallback(channel_.get())); |
69 channel_->RegisterReceiverACM(acm_receive_.get()); | 70 channel_->RegisterReceiverACM(acm_receive_.get()); |
70 EXPECT_EQ(0, acm_send_->RegisterVADCallback(monitor_.get())); | 71 EXPECT_EQ(0, acm_send_->RegisterVADCallback(monitor_.get())); |
71 } | 72 } |
72 | 73 |
73 void TestVadDtx::RegisterCodec(CodecInst codec_param) { | 74 void TestVadDtx::RegisterCodec(CodecInst codec_param) { |
74 // Set the codec for sending and receiving. | 75 // Set the codec for sending and receiving. |
75 EXPECT_EQ(0, acm_send_->RegisterSendCodec(codec_param)); | 76 EXPECT_EQ(0, acm_send_->RegisterSendCodec(codec_param)); |
76 EXPECT_EQ(0, acm_receive_->RegisterReceiveCodec(codec_param)); | 77 EXPECT_EQ(true, acm_receive_->RegisterReceiveCodec( |
| 78 codec_param.pltype, CodecInstToSdp(codec_param))); |
77 channel_->SetIsStereo(codec_param.channels > 1); | 79 channel_->SetIsStereo(codec_param.channels > 1); |
78 } | 80 } |
79 | 81 |
80 // Encoding a file and see if the numbers that various packets occur follow | 82 // Encoding a file and see if the numbers that various packets occur follow |
81 // the expectation. | 83 // the expectation. |
82 void TestVadDtx::Run(std::string in_filename, int frequency, int channels, | 84 void TestVadDtx::Run(std::string in_filename, int frequency, int channels, |
83 std::string out_filename, bool append, | 85 std::string out_filename, bool append, |
84 const int* expects) { | 86 const int* expects) { |
85 monitor_->ResetStatistics(); | 87 monitor_->ResetStatistics(); |
86 | 88 |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 | 270 |
269 EXPECT_EQ(0, acm_send_->EnableOpusDtx()); | 271 EXPECT_EQ(0, acm_send_->EnableOpusDtx()); |
270 | 272 |
271 expects[kEmptyFrame] = 1; | 273 expects[kEmptyFrame] = 1; |
272 Run(webrtc::test::ResourcePath("audio_coding/teststereo32kHz", "pcm"), | 274 Run(webrtc::test::ResourcePath("audio_coding/teststereo32kHz", "pcm"), |
273 32000, 2, out_filename, true, expects); | 275 32000, 2, out_filename, true, expects); |
274 #endif | 276 #endif |
275 } | 277 } |
276 | 278 |
277 } // namespace webrtc | 279 } // namespace webrtc |
OLD | NEW |