blob: 6b058fd8d04239cf2fa4f30b951294f4ccc8213c [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
leozwang@webrtc.org91b359e2012-02-28 17:26:14 +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
kjellander@webrtc.org543c3ea2011-11-23 12:20:35 +000011#include "TwoWayCommunication.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#ifdef WIN32
18#include <Windows.h>
19#endif
20
niklase@google.com470e71d2011-07-07 08:21:25 +000021#include "common_types.h"
kjellander@webrtc.org543c3ea2011-11-23 12:20:35 +000022#include "engine_configurations.h"
23#include "gtest/gtest.h"
24#include "PCMFile.h"
25#include "trace.h"
26#include "utility.h"
pbos@webrtc.org2ab209e2013-08-09 08:49:48 +000027#include "webrtc/test/testsupport/fileutils.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000028
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000029namespace webrtc {
niklase@google.com470e71d2011-07-07 08:21:25 +000030
31#define MAX_FILE_NAME_LENGTH_BYTE 500
32
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000033TwoWayCommunication::TwoWayCommunication(int testMode) {
34 _testMode = testMode;
niklase@google.com470e71d2011-07-07 08:21:25 +000035}
36
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000037TwoWayCommunication::~TwoWayCommunication() {
38 AudioCodingModule::Destroy(_acmA);
39 AudioCodingModule::Destroy(_acmB);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000040 AudioCodingModule::Destroy(_acmRefA);
41 AudioCodingModule::Destroy(_acmRefB);
niklase@google.com470e71d2011-07-07 08:21:25 +000042
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000043 delete _channel_A2B;
44 delete _channel_B2A;
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000045 delete _channelRef_A2B;
46 delete _channelRef_B2A;
niklase@google.com470e71d2011-07-07 08:21:25 +000047#ifdef WEBRTC_DTMF_DETECTION
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000048 if (_dtmfDetectorA != NULL) {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000049 delete _dtmfDetectorA;
50 }
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000051 if (_dtmfDetectorB != NULL) {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000052 delete _dtmfDetectorB;
53 }
niklase@google.com470e71d2011-07-07 08:21:25 +000054#endif
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000055 _inFileA.Close();
56 _inFileB.Close();
57 _outFileA.Close();
58 _outFileB.Close();
59 _outFileRefA.Close();
60 _outFileRefB.Close();
niklase@google.com470e71d2011-07-07 08:21:25 +000061}
62
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000063void TwoWayCommunication::ChooseCodec(uint8_t* codecID_A,
64 uint8_t* codecID_B) {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000065 AudioCodingModule* tmpACM = AudioCodingModule::Create(0);
66 uint8_t noCodec = tmpACM->NumberOfCodecs();
67 CodecInst codecInst;
68 printf("List of Supported Codecs\n");
69 printf("========================\n");
70 for (uint8_t codecCntr = 0; codecCntr < noCodec; codecCntr++) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000071 EXPECT_EQ(tmpACM->Codec(codecCntr, &codecInst), 0);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000072 printf("%d- %s\n", codecCntr, codecInst.plname);
73 }
74 printf("\nChoose a send codec for side A [0]: ");
75 char myStr[15] = "";
76 EXPECT_TRUE(fgets(myStr, 10, stdin) != NULL);
77 *codecID_A = (uint8_t) atoi(myStr);
niklase@google.com470e71d2011-07-07 08:21:25 +000078
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000079 printf("\nChoose a send codec for side B [0]: ");
80 EXPECT_TRUE(fgets(myStr, 10, stdin) != NULL);
81 *codecID_B = (uint8_t) atoi(myStr);
niklase@google.com470e71d2011-07-07 08:21:25 +000082
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000083 AudioCodingModule::Destroy(tmpACM);
84 printf("\n");
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000085}
niklase@google.com470e71d2011-07-07 08:21:25 +000086
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000087void TwoWayCommunication::SetUp() {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000088 _acmA = AudioCodingModule::Create(1);
89 _acmB = AudioCodingModule::Create(2);
90
91 _acmRefA = AudioCodingModule::Create(3);
92 _acmRefB = AudioCodingModule::Create(4);
93
94 uint8_t codecID_A;
95 uint8_t codecID_B;
96
97 ChooseCodec(&codecID_A, &codecID_B);
98 CodecInst codecInst_A;
99 CodecInst codecInst_B;
100 CodecInst dummyCodec;
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000101 EXPECT_EQ(0, _acmA->Codec(codecID_A, &codecInst_A));
102 EXPECT_EQ(0, _acmB->Codec(codecID_B, &codecInst_B));
103 EXPECT_EQ(0, _acmA->Codec(6, &dummyCodec));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000104
105 //--- Set A codecs
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000106 EXPECT_EQ(0, _acmA->RegisterSendCodec(codecInst_A));
107 EXPECT_EQ(0, _acmA->RegisterReceiveCodec(codecInst_B));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000108#ifdef WEBRTC_DTMF_DETECTION
109 _dtmfDetectorA = new(DTMFDetector);
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000110 EXPECT_GT(_acmA->RegisterIncomingMessagesCallback(_dtmfDetectorA, ACMUSA),
111 -1);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000112#endif
113 //--- Set ref-A codecs
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000114 EXPECT_EQ(0, _acmRefA->RegisterSendCodec(codecInst_A));
115 EXPECT_EQ(0, _acmRefA->RegisterReceiveCodec(codecInst_B));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000116
117 //--- Set B codecs
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000118 EXPECT_EQ(0, _acmB->RegisterSendCodec(codecInst_B));
119 EXPECT_EQ(0, _acmB->RegisterReceiveCodec(codecInst_A));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000120#ifdef WEBRTC_DTMF_DETECTION
121 _dtmfDetectorB = new(DTMFDetector);
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000122 EXPECT_GT(_acmB->RegisterIncomingMessagesCallback(_dtmfDetectorB, ACMUSA),
123 -1);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000124#endif
125
126 //--- Set ref-B codecs
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000127 EXPECT_EQ(0, _acmRefB->RegisterSendCodec(codecInst_B));
128 EXPECT_EQ(0, _acmRefB->RegisterReceiveCodec(codecInst_A));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000129
130 uint16_t frequencyHz;
131
132 //--- Input A
133 std::string in_file_name = webrtc::test::ResourcePath(
134 "audio_coding/testfile32kHz", "pcm");
135 frequencyHz = 32000;
136 printf("Enter input file at side A [%s]: ", in_file_name.c_str());
137 PCMFile::ChooseFile(&in_file_name, 499, &frequencyHz);
138 _inFileA.Open(in_file_name, frequencyHz, "rb");
139
140 //--- Output A
141 std::string out_file_a = webrtc::test::OutputPath() + "outA.pcm";
142 printf("Output file at side A: %s\n", out_file_a.c_str());
143 printf("Sampling frequency (in Hz) of the above file: %u\n", frequencyHz);
144 _outFileA.Open(out_file_a, frequencyHz, "wb");
145 std::string ref_file_name = webrtc::test::OutputPath() + "ref_outA.pcm";
146 _outFileRefA.Open(ref_file_name, frequencyHz, "wb");
147
148 //--- Input B
149 in_file_name = webrtc::test::ResourcePath("audio_coding/testfile32kHz",
150 "pcm");
151 frequencyHz = 32000;
152 printf("\n\nEnter input file at side B [%s]: ", in_file_name.c_str());
153 PCMFile::ChooseFile(&in_file_name, 499, &frequencyHz);
154 _inFileB.Open(in_file_name, frequencyHz, "rb");
155
156 //--- Output B
157 std::string out_file_b = webrtc::test::OutputPath() + "outB.pcm";
158 printf("Output file at side B: %s\n", out_file_b.c_str());
159 printf("Sampling frequency (in Hz) of the above file: %u\n", frequencyHz);
160 _outFileB.Open(out_file_b, frequencyHz, "wb");
161 ref_file_name = webrtc::test::OutputPath() + "ref_outB.pcm";
162 _outFileRefB.Open(ref_file_name, frequencyHz, "wb");
163
164 //--- Set A-to-B channel
165 _channel_A2B = new Channel;
166 _acmA->RegisterTransportCallback(_channel_A2B);
167 _channel_A2B->RegisterReceiverACM(_acmB);
168 //--- Do the same for the reference
169 _channelRef_A2B = new Channel;
170 _acmRefA->RegisterTransportCallback(_channelRef_A2B);
171 _channelRef_A2B->RegisterReceiverACM(_acmRefB);
172
173 //--- Set B-to-A channel
174 _channel_B2A = new Channel;
175 _acmB->RegisterTransportCallback(_channel_B2A);
176 _channel_B2A->RegisterReceiverACM(_acmA);
177 //--- Do the same for reference
178 _channelRef_B2A = new Channel;
179 _acmRefB->RegisterTransportCallback(_channelRef_B2A);
180 _channelRef_B2A->RegisterReceiverACM(_acmRefA);
181
182 // The clicks will be more obvious when we
183 // are in FAX mode.
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000184 EXPECT_EQ(_acmB->SetPlayoutMode(fax), 0);
185 EXPECT_EQ(_acmRefB->SetPlayoutMode(fax), 0);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000186}
187
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000188void TwoWayCommunication::SetUpAutotest() {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000189 _acmA = AudioCodingModule::Create(1);
190 _acmB = AudioCodingModule::Create(2);
191
192 _acmRefA = AudioCodingModule::Create(3);
193 _acmRefB = AudioCodingModule::Create(4);
194
195 CodecInst codecInst_A;
196 CodecInst codecInst_B;
197 CodecInst dummyCodec;
198
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000199 EXPECT_EQ(0, _acmA->Codec("ISAC", &codecInst_A, 16000, 1));
200 EXPECT_EQ(0, _acmB->Codec("L16", &codecInst_B, 8000, 1));
201 EXPECT_EQ(0, _acmA->Codec(6, &dummyCodec));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000202
203 //--- Set A codecs
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000204 EXPECT_EQ(0, _acmA->RegisterSendCodec(codecInst_A));
205 EXPECT_EQ(0, _acmA->RegisterReceiveCodec(codecInst_B));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000206#ifdef WEBRTC_DTMF_DETECTION
207 _dtmfDetectorA = new(DTMFDetector);
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000208 EXPECT_EQ(0, _acmA->RegisterIncomingMessagesCallback(_dtmfDetectorA, ACMUSA));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000209#endif
210
211 //--- Set ref-A codecs
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000212 EXPECT_GT(_acmRefA->RegisterSendCodec(codecInst_A), -1);
213 EXPECT_GT(_acmRefA->RegisterReceiveCodec(codecInst_B), -1);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000214
215 //--- Set B codecs
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000216 EXPECT_GT(_acmB->RegisterSendCodec(codecInst_B), -1);
217 EXPECT_GT(_acmB->RegisterReceiveCodec(codecInst_A), -1);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000218#ifdef WEBRTC_DTMF_DETECTION
219 _dtmfDetectorB = new(DTMFDetector);
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000220 EXPECT_EQ(0, _acmB->RegisterIncomingMessagesCallback(_dtmfDetectorB, ACMUSA));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000221#endif
222
223 //--- Set ref-B codecs
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000224 EXPECT_EQ(0, _acmRefB->RegisterSendCodec(codecInst_B));
225 EXPECT_EQ(0, _acmRefB->RegisterReceiveCodec(codecInst_A));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000226
227 uint16_t frequencyHz;
228
229 //--- Input A and B
230 std::string in_file_name = webrtc::test::ResourcePath(
231 "audio_coding/testfile32kHz", "pcm");
232 frequencyHz = 16000;
233 _inFileA.Open(in_file_name, frequencyHz, "rb");
234 _inFileB.Open(in_file_name, frequencyHz, "rb");
235
236 //--- Output A
237 std::string output_file_a = webrtc::test::OutputPath() + "outAutotestA.pcm";
238 frequencyHz = 16000;
239 _outFileA.Open(output_file_a, frequencyHz, "wb");
240 std::string output_ref_file_a = webrtc::test::OutputPath()
241 + "ref_outAutotestA.pcm";
242 _outFileRefA.Open(output_ref_file_a, frequencyHz, "wb");
243
244 //--- Output B
245 std::string output_file_b = webrtc::test::OutputPath() + "outAutotestB.pcm";
246 frequencyHz = 16000;
247 _outFileB.Open(output_file_b, frequencyHz, "wb");
248 std::string output_ref_file_b = webrtc::test::OutputPath()
249 + "ref_outAutotestB.pcm";
250 _outFileRefB.Open(output_ref_file_b, frequencyHz, "wb");
251
252 //--- Set A-to-B channel
253 _channel_A2B = new Channel;
254 _acmA->RegisterTransportCallback(_channel_A2B);
255 _channel_A2B->RegisterReceiverACM(_acmB);
256 //--- Do the same for the reference
257 _channelRef_A2B = new Channel;
258 _acmRefA->RegisterTransportCallback(_channelRef_A2B);
259 _channelRef_A2B->RegisterReceiverACM(_acmRefB);
260
261 //--- Set B-to-A channel
262 _channel_B2A = new Channel;
263 _acmB->RegisterTransportCallback(_channel_B2A);
264 _channel_B2A->RegisterReceiverACM(_acmA);
265 //--- Do the same for reference
266 _channelRef_B2A = new Channel;
267 _acmRefB->RegisterTransportCallback(_channelRef_B2A);
268 _channelRef_B2A->RegisterReceiverACM(_acmRefA);
269
270 // The clicks will be more obvious when we
271 // are in FAX mode.
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000272 EXPECT_EQ(0, _acmB->SetPlayoutMode(fax));
273 EXPECT_EQ(0, _acmRefB->SetPlayoutMode(fax));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000274}
275
276void TwoWayCommunication::Perform() {
277 if (_testMode == 0) {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000278 SetUpAutotest();
279 } else {
280 SetUp();
281 }
282 unsigned int msecPassed = 0;
283 unsigned int secPassed = 0;
284
285 int32_t outFreqHzA = _outFileA.SamplingFrequency();
286 int32_t outFreqHzB = _outFileB.SamplingFrequency();
287
288 AudioFrame audioFrame;
289
290 CodecInst codecInst_B;
291 CodecInst dummy;
292
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000293 EXPECT_EQ(0, _acmB->SendCodec(&codecInst_B));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000294
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000295 // In the following loop we tests that the code can handle misuse of the APIs.
296 // In the middle of a session with data flowing between two sides, called A
297 // and B, APIs will be called, like ResetEncoder(), and the code should
298 // continue to run, and be able to recover.
299 bool expect_error_add = false;
300 bool expect_error_process = false;
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000301 while (!_inFileA.EndOfFile() && !_inFileB.EndOfFile()) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000302 msecPassed += 10;
303 EXPECT_GT(_inFileA.Read10MsData(audioFrame), 0);
304 EXPECT_EQ(0, _acmA->Add10MsData(audioFrame));
305 EXPECT_EQ(0, _acmRefA->Add10MsData(audioFrame));
niklase@google.com470e71d2011-07-07 08:21:25 +0000306
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000307 EXPECT_GT(_inFileB.Read10MsData(audioFrame), 0);
niklase@google.com470e71d2011-07-07 08:21:25 +0000308
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000309 // Expect call to pass except for the time when no send codec is registered.
310 if (!expect_error_add) {
311 EXPECT_EQ(0, _acmB->Add10MsData(audioFrame));
312 } else {
313 EXPECT_EQ(-1, _acmB->Add10MsData(audioFrame));
314 }
315 // Expect to pass except for the time when there either is no send codec
316 // registered, or no receive codec.
317 if (!expect_error_process) {
318 EXPECT_GT(_acmB->Process(), -1);
319 } else {
320 EXPECT_EQ(_acmB->Process(), -1);
321 }
322 EXPECT_EQ(0, _acmRefB->Add10MsData(audioFrame));
323 EXPECT_GT(_acmA->Process(), -1);
324 EXPECT_GT(_acmRefA->Process(), -1);
325 EXPECT_GT(_acmRefB->Process(), -1);
326 EXPECT_EQ(0, _acmA->PlayoutData10Ms(outFreqHzA, &audioFrame));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000327 _outFileA.Write10MsData(audioFrame);
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000328 EXPECT_EQ(0, _acmRefA->PlayoutData10Ms(outFreqHzA, &audioFrame));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000329 _outFileRefA.Write10MsData(audioFrame);
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000330 EXPECT_EQ(0, _acmB->PlayoutData10Ms(outFreqHzB, &audioFrame));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000331 _outFileB.Write10MsData(audioFrame);
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000332 EXPECT_EQ(0, _acmRefB->PlayoutData10Ms(outFreqHzB, &audioFrame));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000333 _outFileRefB.Write10MsData(audioFrame);
niklase@google.com470e71d2011-07-07 08:21:25 +0000334
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000335 // Update time counters each time a second of data has passed.
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000336 if (msecPassed >= 1000) {
337 msecPassed = 0;
338 secPassed++;
339 }
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000340 // Call RestEncoder for ACM on side A, and InitializeSender for ACM on
341 // side B.
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000342 if (((secPassed % 5) == 4) && (msecPassed == 0)) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000343 EXPECT_EQ(0, _acmA->ResetEncoder());
344 EXPECT_EQ(0, _acmB->InitializeSender());
345 expect_error_add = true;
346 expect_error_process = true;
niklase@google.com470e71d2011-07-07 08:21:25 +0000347 }
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000348 // Re-register send codec on side B.
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000349 if (((secPassed % 5) == 4) && (msecPassed >= 990)) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000350 EXPECT_EQ(0, _acmB->RegisterSendCodec(codecInst_B));
351 EXPECT_EQ(0, _acmB->SendCodec(&dummy));
352 expect_error_add = false;
353 expect_error_process = false;
niklase@google.com470e71d2011-07-07 08:21:25 +0000354 }
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000355 // Reset decoder on side B, and initialize receiver on side A.
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000356 if (((secPassed % 7) == 6) && (msecPassed == 0)) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000357 EXPECT_EQ(0, _acmB->ResetDecoder());
358 EXPECT_EQ(0, _acmA->InitializeReceiver());
niklase@google.com470e71d2011-07-07 08:21:25 +0000359 }
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000360 // Re-register codec on side A.
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000361 if (((secPassed % 7) == 6) && (msecPassed >= 990)) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000362 EXPECT_EQ(0, _acmA->RegisterReceiveCodec(codecInst_B));
niklase@google.com470e71d2011-07-07 08:21:25 +0000363 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000364 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000365}
366
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000367} // namespace webrtc