Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Side by Side Diff: webrtc/modules/audio_coding/main/test/TwoWayCommunication.cc

Issue 1308283003: Remove no-op and unused methods from AudioCodingModule (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 272
273 AudioFrame audioFrame; 273 AudioFrame audioFrame;
274 274
275 CodecInst codecInst_B; 275 CodecInst codecInst_B;
276 CodecInst dummy; 276 CodecInst dummy;
277 277
278 EXPECT_EQ(0, _acmB->SendCodec(&codecInst_B)); 278 EXPECT_EQ(0, _acmB->SendCodec(&codecInst_B));
279 279
280 // In the following loop we tests that the code can handle misuse of the APIs. 280 // In the following loop we tests that the code can handle misuse of the APIs.
281 // In the middle of a session with data flowing between two sides, called A 281 // In the middle of a session with data flowing between two sides, called A
282 // and B, APIs will be called, like ResetEncoder(), and the code should 282 // and B, APIs will be called, and the code should continue to run, and be
283 // continue to run, and be able to recover. 283 // able to recover.
284 while (!_inFileA.EndOfFile() && !_inFileB.EndOfFile()) { 284 while (!_inFileA.EndOfFile() && !_inFileB.EndOfFile()) {
285 msecPassed += 10; 285 msecPassed += 10;
286 EXPECT_GT(_inFileA.Read10MsData(audioFrame), 0); 286 EXPECT_GT(_inFileA.Read10MsData(audioFrame), 0);
287 EXPECT_GE(_acmA->Add10MsData(audioFrame), 0); 287 EXPECT_GE(_acmA->Add10MsData(audioFrame), 0);
288 EXPECT_GE(_acmRefA->Add10MsData(audioFrame), 0); 288 EXPECT_GE(_acmRefA->Add10MsData(audioFrame), 0);
289 289
290 EXPECT_GT(_inFileB.Read10MsData(audioFrame), 0); 290 EXPECT_GT(_inFileB.Read10MsData(audioFrame), 0);
291 291
292 EXPECT_GE(_acmB->Add10MsData(audioFrame), 0); 292 EXPECT_GE(_acmB->Add10MsData(audioFrame), 0);
293 EXPECT_GE(_acmRefB->Add10MsData(audioFrame), 0); 293 EXPECT_GE(_acmRefB->Add10MsData(audioFrame), 0);
294 EXPECT_EQ(0, _acmA->PlayoutData10Ms(outFreqHzA, &audioFrame)); 294 EXPECT_EQ(0, _acmA->PlayoutData10Ms(outFreqHzA, &audioFrame));
295 _outFileA.Write10MsData(audioFrame); 295 _outFileA.Write10MsData(audioFrame);
296 EXPECT_EQ(0, _acmRefA->PlayoutData10Ms(outFreqHzA, &audioFrame)); 296 EXPECT_EQ(0, _acmRefA->PlayoutData10Ms(outFreqHzA, &audioFrame));
297 _outFileRefA.Write10MsData(audioFrame); 297 _outFileRefA.Write10MsData(audioFrame);
298 EXPECT_EQ(0, _acmB->PlayoutData10Ms(outFreqHzB, &audioFrame)); 298 EXPECT_EQ(0, _acmB->PlayoutData10Ms(outFreqHzB, &audioFrame));
299 _outFileB.Write10MsData(audioFrame); 299 _outFileB.Write10MsData(audioFrame);
300 EXPECT_EQ(0, _acmRefB->PlayoutData10Ms(outFreqHzB, &audioFrame)); 300 EXPECT_EQ(0, _acmRefB->PlayoutData10Ms(outFreqHzB, &audioFrame));
301 _outFileRefB.Write10MsData(audioFrame); 301 _outFileRefB.Write10MsData(audioFrame);
302 302
303 // Update time counters each time a second of data has passed. 303 // Update time counters each time a second of data has passed.
304 if (msecPassed >= 1000) { 304 if (msecPassed >= 1000) {
305 msecPassed = 0; 305 msecPassed = 0;
306 secPassed++; 306 secPassed++;
307 } 307 }
308 // Call RestEncoder for ACM on side A, and InitializeSender for ACM on
309 // side B.
310 if (((secPassed % 5) == 4) && (msecPassed == 0)) {
311 EXPECT_EQ(0, _acmA->ResetEncoder());
312 }
313 // Re-register send codec on side B. 308 // Re-register send codec on side B.
314 if (((secPassed % 5) == 4) && (msecPassed >= 990)) { 309 if (((secPassed % 5) == 4) && (msecPassed >= 990)) {
315 EXPECT_EQ(0, _acmB->RegisterSendCodec(codecInst_B)); 310 EXPECT_EQ(0, _acmB->RegisterSendCodec(codecInst_B));
316 EXPECT_EQ(0, _acmB->SendCodec(&dummy)); 311 EXPECT_EQ(0, _acmB->SendCodec(&dummy));
317 } 312 }
318 // Reset decoder on side B, and initialize receiver on side A. 313 // Initialize receiver on side A.
319 if (((secPassed % 7) == 6) && (msecPassed == 0)) { 314 if (((secPassed % 7) == 6) && (msecPassed == 0))
320 EXPECT_EQ(0, _acmB->ResetDecoder());
321 EXPECT_EQ(0, _acmA->InitializeReceiver()); 315 EXPECT_EQ(0, _acmA->InitializeReceiver());
322 }
323 // Re-register codec on side A. 316 // Re-register codec on side A.
324 if (((secPassed % 7) == 6) && (msecPassed >= 990)) { 317 if (((secPassed % 7) == 6) && (msecPassed >= 990)) {
325 EXPECT_EQ(0, _acmA->RegisterReceiveCodec(codecInst_B)); 318 EXPECT_EQ(0, _acmA->RegisterReceiveCodec(codecInst_B));
326 } 319 }
327 } 320 }
328 } 321 }
329 322
330 } // namespace webrtc 323 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/main/test/TestVADDTX.cc ('k') | webrtc/modules/audio_coding/main/test/iSACTest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698