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

Side by Side Diff: webrtc/modules/audio_coding/main/test/iSACTest.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, 4 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
« no previous file with comments | « webrtc/modules/audio_coding/main/test/TwoWayCommunication.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } 68 }
69 69
70 if (isacConfig.maxRateBitPerSec > 0) { 70 if (isacConfig.maxRateBitPerSec > 0) {
71 // Set max rate. 71 // Set max rate.
72 EXPECT_EQ(0, acm->SetISACMaxRate(isacConfig.maxRateBitPerSec)); 72 EXPECT_EQ(0, acm->SetISACMaxRate(isacConfig.maxRateBitPerSec));
73 } 73 }
74 if (isacConfig.maxPayloadSizeByte > 0) { 74 if (isacConfig.maxPayloadSizeByte > 0) {
75 // Set max payload size. 75 // Set max payload size.
76 EXPECT_EQ(0, acm->SetISACMaxPayloadSize(isacConfig.maxPayloadSizeByte)); 76 EXPECT_EQ(0, acm->SetISACMaxPayloadSize(isacConfig.maxPayloadSizeByte));
77 } 77 }
78 if ((isacConfig.initFrameSizeInMsec != 0)
79 || (isacConfig.initRateBitPerSec != 0)) {
80 EXPECT_EQ(0, acm->ConfigISACBandwidthEstimator(
81 static_cast<uint8_t>(isacConfig.initFrameSizeInMsec),
82 static_cast<uint16_t>(isacConfig.initRateBitPerSec),
83 isacConfig.enforceFrameSize));
84 }
85 78
86 return 0; 79 return 0;
87 } 80 }
88 81
89 ISACTest::ISACTest(int testMode) 82 ISACTest::ISACTest(int testMode)
90 : _acmA(AudioCodingModule::Create(1)), 83 : _acmA(AudioCodingModule::Create(1)),
91 _acmB(AudioCodingModule::Create(2)), 84 _acmB(AudioCodingModule::Create(2)),
92 _testMode(testMode) {} 85 _testMode(testMode) {}
93 86
94 ISACTest::~ISACTest() {} 87 ISACTest::~ISACTest() {}
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 printf("Enter the max payload-size for side A: "); 201 printf("Enter the max payload-size for side A: ");
209 CHECK_ERROR(scanf("%d", &user_input)); 202 CHECK_ERROR(scanf("%d", &user_input));
210 swbISACConfig.maxPayloadSizeByte = (uint16_t) user_input; 203 swbISACConfig.maxPayloadSizeByte = (uint16_t) user_input;
211 printf("Enter the max payload-size for side B: "); 204 printf("Enter the max payload-size for side B: ");
212 CHECK_ERROR(scanf("%d", &user_input)); 205 CHECK_ERROR(scanf("%d", &user_input));
213 wbISACConfig.maxPayloadSizeByte = (uint16_t) user_input; 206 wbISACConfig.maxPayloadSizeByte = (uint16_t) user_input;
214 } 207 }
215 testNr++; 208 testNr++;
216 EncodeDecode(testNr, wbISACConfig, swbISACConfig); 209 EncodeDecode(testNr, wbISACConfig, swbISACConfig);
217 210
218 _acmA->ResetEncoder();
219 _acmB->ResetEncoder();
220 SetISACConfigDefault(wbISACConfig); 211 SetISACConfigDefault(wbISACConfig);
221 SetISACConfigDefault(swbISACConfig); 212 SetISACConfigDefault(swbISACConfig);
222 213
223 if ((_testMode == 0) || (_testMode == 1)) { 214 if ((_testMode == 0) || (_testMode == 1)) {
224 swbISACConfig.maxRateBitPerSec = static_cast<uint32_t>(48000); 215 swbISACConfig.maxRateBitPerSec = static_cast<uint32_t>(48000);
225 wbISACConfig.maxRateBitPerSec = static_cast<uint32_t>(48000); 216 wbISACConfig.maxRateBitPerSec = static_cast<uint32_t>(48000);
226 } else { 217 } else {
227 printf("Enter the max rate for side A: "); 218 printf("Enter the max rate for side A: ");
228 CHECK_ERROR(scanf("%d", &user_input)); 219 CHECK_ERROR(scanf("%d", &user_input));
229 swbISACConfig.maxRateBitPerSec = (uint32_t) user_input; 220 swbISACConfig.maxRateBitPerSec = (uint32_t) user_input;
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 numSendCodecChanged++; 375 numSendCodecChanged++;
385 } 376 }
386 } 377 }
387 _outFileA.Close(); 378 _outFileA.Close();
388 _outFileB.Close(); 379 _outFileB.Close();
389 _inFileA.Close(); 380 _inFileA.Close();
390 _inFileB.Close(); 381 _inFileB.Close();
391 } 382 }
392 383
393 } // namespace webrtc 384 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/main/test/TwoWayCommunication.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698