blob: 35c34d5947b8eb850d0cddff5cc96feb534e2d91 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
andrew@webrtc.org9dc45da2012-05-23 15:39:01 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000011#include "webrtc/modules/audio_coding/main/test/iSACTest.h"
12
pbos@webrtc.org12dc1a32013-08-05 16:22:53 +000013#include <ctype.h>
niklase@google.com470e71d2011-07-07 08:21:25 +000014#include <stdio.h>
15#include <string.h>
16
17#if _WIN32
18#include <windows.h>
19#elif WEBRTC_LINUX
pbos@webrtc.org12dc1a32013-08-05 16:22:53 +000020#include <time.h>
niklase@google.com470e71d2011-07-07 08:21:25 +000021#else
22#include <sys/time.h>
23#include <time.h>
andrew@webrtc.org89df0922013-09-12 01:27:43 +000024#endif
niklase@google.com470e71d2011-07-07 08:21:25 +000025
turaj@webrtc.org532f3dc2013-09-19 00:12:23 +000026#include "webrtc/modules/audio_coding/main/acm2/acm_common_defs.h"
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000027#include "webrtc/modules/audio_coding/main/test/utility.h"
Henrik Kjellander98f53512015-10-28 18:17:40 +010028#include "webrtc/system_wrappers/include/event_wrapper.h"
29#include "webrtc/system_wrappers/include/tick_util.h"
30#include "webrtc/system_wrappers/include/trace.h"
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000031#include "webrtc/test/testsupport/fileutils.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000032
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000033namespace webrtc {
niklase@google.com470e71d2011-07-07 08:21:25 +000034
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000035void SetISACConfigDefault(ACMTestISACConfig& isacConfig) {
36 isacConfig.currentRateBitPerSec = 0;
37 isacConfig.currentFrameSizeMsec = 0;
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000038 isacConfig.encodingMode = -1;
39 isacConfig.initRateBitPerSec = 0;
40 isacConfig.initFrameSizeInMsec = 0;
41 isacConfig.enforceFrameSize = false;
42 return;
niklase@google.com470e71d2011-07-07 08:21:25 +000043}
44
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000045int16_t SetISAConfig(ACMTestISACConfig& isacConfig, AudioCodingModule* acm,
46 int testMode) {
niklase@google.com470e71d2011-07-07 08:21:25 +000047
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000048 if ((isacConfig.currentRateBitPerSec != 0)
49 || (isacConfig.currentFrameSizeMsec != 0)) {
50 CodecInst sendCodec;
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000051 EXPECT_EQ(0, acm->SendCodec(&sendCodec));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000052 if (isacConfig.currentRateBitPerSec < 0) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000053 // Register iSAC in adaptive (channel-dependent) mode.
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000054 sendCodec.rate = -1;
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000055 EXPECT_EQ(0, acm->RegisterSendCodec(sendCodec));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000056 } else {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000057 if (isacConfig.currentRateBitPerSec != 0) {
58 sendCodec.rate = isacConfig.currentRateBitPerSec;
59 }
60 if (isacConfig.currentFrameSizeMsec != 0) {
61 sendCodec.pacsize = isacConfig.currentFrameSizeMsec
62 * (sendCodec.plfreq / 1000);
63 }
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000064 EXPECT_EQ(0, acm->RegisterSendCodec(sendCodec));
niklase@google.com470e71d2011-07-07 08:21:25 +000065 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000066 }
niklase@google.com470e71d2011-07-07 08:21:25 +000067
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000068 return 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000069}
70
henrik.lundin@webrtc.orgadaf8092014-04-17 08:29:10 +000071ISACTest::ISACTest(int testMode)
72 : _acmA(AudioCodingModule::Create(1)),
73 _acmB(AudioCodingModule::Create(2)),
74 _testMode(testMode) {}
niklase@google.com470e71d2011-07-07 08:21:25 +000075
turaj@webrtc.org55e17232013-10-29 04:40:09 +000076ISACTest::~ISACTest() {}
niklase@google.com470e71d2011-07-07 08:21:25 +000077
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000078void ISACTest::Setup() {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000079 int codecCntr;
80 CodecInst codecParam;
niklase@google.com470e71d2011-07-07 08:21:25 +000081
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000082 for (codecCntr = 0; codecCntr < AudioCodingModule::NumberOfCodecs();
83 codecCntr++) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000084 EXPECT_EQ(0, AudioCodingModule::Codec(codecCntr, &codecParam));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000085 if (!STR_CASE_CMP(codecParam.plname, "ISAC")
86 && codecParam.plfreq == 16000) {
87 memcpy(&_paramISAC16kHz, &codecParam, sizeof(CodecInst));
88 _idISAC16kHz = codecCntr;
niklase@google.com470e71d2011-07-07 08:21:25 +000089 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000090 if (!STR_CASE_CMP(codecParam.plname, "ISAC")
91 && codecParam.plfreq == 32000) {
92 memcpy(&_paramISAC32kHz, &codecParam, sizeof(CodecInst));
93 _idISAC32kHz = codecCntr;
niklase@google.com470e71d2011-07-07 08:21:25 +000094 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000095 }
niklase@google.com470e71d2011-07-07 08:21:25 +000096
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000097 // Register both iSAC-wb & iSAC-swb in both sides as receiver codecs.
98 EXPECT_EQ(0, _acmA->RegisterReceiveCodec(_paramISAC16kHz));
99 EXPECT_EQ(0, _acmA->RegisterReceiveCodec(_paramISAC32kHz));
100 EXPECT_EQ(0, _acmB->RegisterReceiveCodec(_paramISAC16kHz));
101 EXPECT_EQ(0, _acmB->RegisterReceiveCodec(_paramISAC32kHz));
niklase@google.com470e71d2011-07-07 08:21:25 +0000102
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000103 //--- Set A-to-B channel
turaj@webrtc.org55e17232013-10-29 04:40:09 +0000104 _channel_A2B.reset(new Channel);
105 EXPECT_EQ(0, _acmA->RegisterTransportCallback(_channel_A2B.get()));
106 _channel_A2B->RegisterReceiverACM(_acmB.get());
niklase@google.com470e71d2011-07-07 08:21:25 +0000107
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000108 //--- Set B-to-A channel
turaj@webrtc.org55e17232013-10-29 04:40:09 +0000109 _channel_B2A.reset(new Channel);
110 EXPECT_EQ(0, _acmB->RegisterTransportCallback(_channel_B2A.get()));
111 _channel_B2A->RegisterReceiverACM(_acmA.get());
niklase@google.com470e71d2011-07-07 08:21:25 +0000112
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000113 file_name_swb_ = webrtc::test::ResourcePath("audio_coding/testfile32kHz",
114 "pcm");
niklase@google.com470e71d2011-07-07 08:21:25 +0000115
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000116 EXPECT_EQ(0, _acmB->RegisterSendCodec(_paramISAC16kHz));
117 EXPECT_EQ(0, _acmA->RegisterSendCodec(_paramISAC32kHz));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000118
119 _inFileA.Open(file_name_swb_, 32000, "rb");
120 std::string fileNameA = webrtc::test::OutputPath() + "testisac_a.pcm";
121 std::string fileNameB = webrtc::test::OutputPath() + "testisac_b.pcm";
122 _outFileA.Open(fileNameA, 32000, "wb");
123 _outFileB.Open(fileNameB, 32000, "wb");
124
125 while (!_inFileA.EndOfFile()) {
126 Run10ms();
127 }
128 CodecInst receiveCodec;
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000129 EXPECT_EQ(0, _acmA->ReceiveCodec(&receiveCodec));
130 EXPECT_EQ(0, _acmB->ReceiveCodec(&receiveCodec));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000131
132 _inFileA.Close();
133 _outFileA.Close();
134 _outFileB.Close();
niklase@google.com470e71d2011-07-07 08:21:25 +0000135}
136
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000137void ISACTest::Perform() {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000138 Setup();
niklase@google.com470e71d2011-07-07 08:21:25 +0000139
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000140 int16_t testNr = 0;
141 ACMTestISACConfig wbISACConfig;
142 ACMTestISACConfig swbISACConfig;
niklase@google.com470e71d2011-07-07 08:21:25 +0000143
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000144 SetISACConfigDefault(wbISACConfig);
145 SetISACConfigDefault(swbISACConfig);
niklase@google.com470e71d2011-07-07 08:21:25 +0000146
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000147 wbISACConfig.currentRateBitPerSec = -1;
148 swbISACConfig.currentRateBitPerSec = -1;
149 testNr++;
150 EncodeDecode(testNr, wbISACConfig, swbISACConfig);
151
152 if (_testMode != 0) {
niklase@google.com470e71d2011-07-07 08:21:25 +0000153 SetISACConfigDefault(wbISACConfig);
154 SetISACConfigDefault(swbISACConfig);
155
156 wbISACConfig.currentRateBitPerSec = -1;
157 swbISACConfig.currentRateBitPerSec = -1;
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000158 wbISACConfig.initRateBitPerSec = 13000;
159 wbISACConfig.initFrameSizeInMsec = 60;
160 swbISACConfig.initRateBitPerSec = 20000;
161 swbISACConfig.initFrameSizeInMsec = 30;
niklase@google.com470e71d2011-07-07 08:21:25 +0000162 testNr++;
163 EncodeDecode(testNr, wbISACConfig, swbISACConfig);
164
niklase@google.com470e71d2011-07-07 08:21:25 +0000165 SetISACConfigDefault(wbISACConfig);
166 SetISACConfigDefault(swbISACConfig);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000167
168 wbISACConfig.currentRateBitPerSec = 20000;
169 swbISACConfig.currentRateBitPerSec = 48000;
niklase@google.com470e71d2011-07-07 08:21:25 +0000170 testNr++;
171 EncodeDecode(testNr, wbISACConfig, swbISACConfig);
pbos@webrtc.org0946a562013-04-09 00:28:06 +0000172
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000173 wbISACConfig.currentRateBitPerSec = 16000;
174 swbISACConfig.currentRateBitPerSec = 30000;
175 wbISACConfig.currentFrameSizeMsec = 60;
niklase@google.com470e71d2011-07-07 08:21:25 +0000176 testNr++;
177 EncodeDecode(testNr, wbISACConfig, swbISACConfig);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000178 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000179
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000180 SetISACConfigDefault(wbISACConfig);
181 SetISACConfigDefault(swbISACConfig);
182 testNr++;
183 EncodeDecode(testNr, wbISACConfig, swbISACConfig);
niklase@google.com470e71d2011-07-07 08:21:25 +0000184
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000185 testNr++;
186 if (_testMode == 0) {
187 SwitchingSamplingRate(testNr, 4);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000188 } else {
189 SwitchingSamplingRate(testNr, 80);
190 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000191}
192
andresp@webrtc.orgd0b436a2014-01-13 13:15:59 +0000193void ISACTest::Run10ms() {
194 AudioFrame audioFrame;
195 EXPECT_GT(_inFileA.Read10MsData(audioFrame), 0);
henrik.lundin@webrtc.orgf56c1622015-03-02 12:29:30 +0000196 EXPECT_GE(_acmA->Add10MsData(audioFrame), 0);
197 EXPECT_GE(_acmB->Add10MsData(audioFrame), 0);
andresp@webrtc.orgd0b436a2014-01-13 13:15:59 +0000198 EXPECT_EQ(0, _acmA->PlayoutData10Ms(32000, &audioFrame));
199 _outFileA.Write10MsData(audioFrame);
200 EXPECT_EQ(0, _acmB->PlayoutData10Ms(32000, &audioFrame));
201 _outFileB.Write10MsData(audioFrame);
202}
203
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000204void ISACTest::EncodeDecode(int testNr, ACMTestISACConfig& wbISACConfig,
205 ACMTestISACConfig& swbISACConfig) {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000206 // Files in Side A and B
207 _inFileA.Open(file_name_swb_, 32000, "rb", true);
208 _inFileB.Open(file_name_swb_, 32000, "rb", true);
209
210 std::string file_name_out;
211 std::stringstream file_stream_a;
212 std::stringstream file_stream_b;
213 file_stream_a << webrtc::test::OutputPath();
214 file_stream_b << webrtc::test::OutputPath();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000215 file_stream_a << "out_iSACTest_A_" << testNr << ".pcm";
216 file_stream_b << "out_iSACTest_B_" << testNr << ".pcm";
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000217 file_name_out = file_stream_a.str();
218 _outFileA.Open(file_name_out, 32000, "wb");
219 file_name_out = file_stream_b.str();
220 _outFileB.Open(file_name_out, 32000, "wb");
221
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000222 EXPECT_EQ(0, _acmA->RegisterSendCodec(_paramISAC16kHz));
223 EXPECT_EQ(0, _acmA->RegisterSendCodec(_paramISAC32kHz));
224 EXPECT_EQ(0, _acmB->RegisterSendCodec(_paramISAC32kHz));
225 EXPECT_EQ(0, _acmB->RegisterSendCodec(_paramISAC16kHz));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000226
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000227 // Side A is sending super-wideband, and side B is sending wideband.
turaj@webrtc.org55e17232013-10-29 04:40:09 +0000228 SetISAConfig(swbISACConfig, _acmA.get(), _testMode);
229 SetISAConfig(wbISACConfig, _acmB.get(), _testMode);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000230
231 bool adaptiveMode = false;
232 if ((swbISACConfig.currentRateBitPerSec == -1)
233 || (wbISACConfig.currentRateBitPerSec == -1)) {
234 adaptiveMode = true;
235 }
236 _myTimer.Reset();
237 _channel_A2B->ResetStats();
238 _channel_B2A->ResetStats();
239
240 char currentTime[500];
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000241 CodecInst sendCodec;
Peter Boström64c03662015-04-08 11:24:19 +0200242 EventTimerWrapper* myEvent = EventTimerWrapper::Create();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000243 EXPECT_TRUE(myEvent->StartTimer(true, 10));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000244 while (!(_inFileA.EndOfFile() || _inFileA.Rewinded())) {
245 Run10ms();
246 _myTimer.Tick10ms();
247 _myTimer.CurrentTimeHMS(currentTime);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000248
249 if ((adaptiveMode) && (_testMode != 0)) {
250 myEvent->Wait(5000);
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000251 EXPECT_EQ(0, _acmA->SendCodec(&sendCodec));
252 EXPECT_EQ(0, _acmB->SendCodec(&sendCodec));
niklase@google.com470e71d2011-07-07 08:21:25 +0000253 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000254 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000255
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000256 if (_testMode != 0) {
257 printf("\n\nSide A statistics\n\n");
258 _channel_A2B->PrintStats(_paramISAC32kHz);
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +0000259
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000260 printf("\n\nSide B statistics\n\n");
261 _channel_B2A->PrintStats(_paramISAC16kHz);
262 }
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +0000263
andresp@webrtc.orgd0b436a2014-01-13 13:15:59 +0000264 _channel_A2B->ResetStats();
265 _channel_B2A->ResetStats();
266
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000267 _outFileA.Close();
268 _outFileB.Close();
269 _inFileA.Close();
270 _inFileB.Close();
niklase@google.com470e71d2011-07-07 08:21:25 +0000271}
272
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000273void ISACTest::SwitchingSamplingRate(int testNr, int maxSampRateChange) {
274 // Files in Side A
275 _inFileA.Open(file_name_swb_, 32000, "rb");
276 _inFileB.Open(file_name_swb_, 32000, "rb");
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +0000277
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000278 std::string file_name_out;
279 std::stringstream file_stream_a;
280 std::stringstream file_stream_b;
281 file_stream_a << webrtc::test::OutputPath();
282 file_stream_b << webrtc::test::OutputPath();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000283 file_stream_a << "out_iSACTest_A_" << testNr << ".pcm";
284 file_stream_b << "out_iSACTest_B_" << testNr << ".pcm";
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000285 file_name_out = file_stream_a.str();
286 _outFileA.Open(file_name_out, 32000, "wb");
287 file_name_out = file_stream_b.str();
288 _outFileB.Open(file_name_out, 32000, "wb");
niklase@google.com470e71d2011-07-07 08:21:25 +0000289
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000290 // Start with side A sending super-wideband and side B seding wideband.
291 // Toggle sending wideband/super-wideband in this test.
292 EXPECT_EQ(0, _acmA->RegisterSendCodec(_paramISAC32kHz));
293 EXPECT_EQ(0, _acmB->RegisterSendCodec(_paramISAC16kHz));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000294
295 int numSendCodecChanged = 0;
296 _myTimer.Reset();
297 char currentTime[50];
298 while (numSendCodecChanged < (maxSampRateChange << 1)) {
299 Run10ms();
300 _myTimer.Tick10ms();
301 _myTimer.CurrentTimeHMS(currentTime);
302 if (_testMode == 2)
303 printf("\r%s", currentTime);
304 if (_inFileA.EndOfFile()) {
305 if (_inFileA.SamplingFrequency() == 16000) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000306 // Switch side A to send super-wideband.
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000307 _inFileA.Close();
308 _inFileA.Open(file_name_swb_, 32000, "rb");
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000309 EXPECT_EQ(0, _acmA->RegisterSendCodec(_paramISAC32kHz));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000310 } else {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000311 // Switch side A to send wideband.
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000312 _inFileA.Close();
313 _inFileA.Open(file_name_swb_, 32000, "rb");
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000314 EXPECT_EQ(0, _acmA->RegisterSendCodec(_paramISAC16kHz));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000315 }
316 numSendCodecChanged++;
niklase@google.com470e71d2011-07-07 08:21:25 +0000317 }
318
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000319 if (_inFileB.EndOfFile()) {
320 if (_inFileB.SamplingFrequency() == 16000) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000321 // Switch side B to send super-wideband.
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000322 _inFileB.Close();
323 _inFileB.Open(file_name_swb_, 32000, "rb");
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000324 EXPECT_EQ(0, _acmB->RegisterSendCodec(_paramISAC32kHz));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000325 } else {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000326 // Switch side B to send wideband.
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000327 _inFileB.Close();
328 _inFileB.Open(file_name_swb_, 32000, "rb");
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000329 EXPECT_EQ(0, _acmB->RegisterSendCodec(_paramISAC16kHz));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000330 }
331 numSendCodecChanged++;
niklase@google.com470e71d2011-07-07 08:21:25 +0000332 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000333 }
334 _outFileA.Close();
335 _outFileB.Close();
336 _inFileA.Close();
337 _inFileB.Close();
niklase@google.com470e71d2011-07-07 08:21:25 +0000338}
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000339
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000340} // namespace webrtc