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 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 _sendVADModeA(VADNormal), | 79 _sendVADModeA(VADNormal), |
80 _sendVADB(false), | 80 _sendVADB(false), |
81 _sendDTXB(false), | 81 _sendDTXB(false), |
82 _sendVADModeB(VADNormal), | 82 _sendVADModeB(VADNormal), |
83 _minDelayA(0), | 83 _minDelayA(0), |
84 _minDelayB(0), | 84 _minDelayB(0), |
85 _dotPositionA(0), | 85 _dotPositionA(0), |
86 _dotMoveDirectionA(1), | 86 _dotMoveDirectionA(1), |
87 _dotPositionB(39), | 87 _dotPositionB(39), |
88 _dotMoveDirectionB(-1), | 88 _dotMoveDirectionB(-1), |
89 _dtmfCallback(NULL), | |
90 _vadCallbackA(NULL), | 89 _vadCallbackA(NULL), |
91 _vadCallbackB(NULL), | 90 _vadCallbackB(NULL), |
92 _apiTestRWLock(*RWLockWrapper::CreateRWLock()), | 91 _apiTestRWLock(*RWLockWrapper::CreateRWLock()), |
93 _randomTest(false), | 92 _randomTest(false), |
94 _testNumA(0), | 93 _testNumA(0), |
95 _testNumB(1) { | 94 _testNumB(1) { |
96 int n; | 95 int n; |
97 for (n = 0; n < 32; n++) { | 96 for (n = 0; n < 32; n++) { |
98 _payloadUsed[n] = false; | 97 _payloadUsed[n] = false; |
99 } | 98 } |
(...skipping 18 matching lines...) Expand all Loading... |
118 DELETE_POINTER(_pullEventB); | 117 DELETE_POINTER(_pullEventB); |
119 DELETE_POINTER(_processEventB); | 118 DELETE_POINTER(_processEventB); |
120 DELETE_POINTER(_apiEventB); | 119 DELETE_POINTER(_apiEventB); |
121 | 120 |
122 _inFileA.Close(); | 121 _inFileA.Close(); |
123 _outFileA.Close(); | 122 _outFileA.Close(); |
124 | 123 |
125 _inFileB.Close(); | 124 _inFileB.Close(); |
126 _outFileB.Close(); | 125 _outFileB.Close(); |
127 | 126 |
128 DELETE_POINTER(_dtmfCallback); | |
129 DELETE_POINTER(_vadCallbackA); | 127 DELETE_POINTER(_vadCallbackA); |
130 DELETE_POINTER(_vadCallbackB); | 128 DELETE_POINTER(_vadCallbackB); |
131 | 129 |
132 delete &_apiTestRWLock; | 130 delete &_apiTestRWLock; |
133 } | 131 } |
134 | 132 |
135 int16_t APITest::SetUp() { | 133 int16_t APITest::SetUp() { |
136 CodecInst dummyCodec; | 134 CodecInst dummyCodec; |
137 int lastPayloadType = 0; | 135 int lastPayloadType = 0; |
138 | 136 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 _randomTest = false; | 281 _randomTest = false; |
284 printf("\nPrint Tests (y/n)? "); | 282 printf("\nPrint Tests (y/n)? "); |
285 EXPECT_TRUE(fgets(print, 10, stdin) != NULL); | 283 EXPECT_TRUE(fgets(print, 10, stdin) != NULL); |
286 print[10] = '\0'; | 284 print[10] = '\0'; |
287 if (strstr(print, "y") == NULL) { | 285 if (strstr(print, "y") == NULL) { |
288 EXPECT_TRUE(freopen("APITest_log.txt", "w", stdout) != 0); | 286 EXPECT_TRUE(freopen("APITest_log.txt", "w", stdout) != 0); |
289 _verbose = false; | 287 _verbose = false; |
290 } | 288 } |
291 } | 289 } |
292 | 290 |
293 #ifdef WEBRTC_DTMF_DETECTION | |
294 _dtmfCallback = new DTMFDetector; | |
295 #endif | |
296 _vadCallbackA = new VADCallback; | 291 _vadCallbackA = new VADCallback; |
297 _vadCallbackB = new VADCallback; | 292 _vadCallbackB = new VADCallback; |
298 | 293 |
299 return 0; | 294 return 0; |
300 } | 295 } |
301 | 296 |
302 bool APITest::PushAudioThreadA(void* obj) { | 297 bool APITest::PushAudioThreadA(void* obj) { |
303 return static_cast<APITest*>(obj)->PushAudioRunA(); | 298 return static_cast<APITest*>(obj)->PushAudioRunA(); |
304 } | 299 } |
305 | 300 |
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1178 CHECK_ERROR_MT(myACM->RegisterSendCodec(myCodec)); | 1173 CHECK_ERROR_MT(myACM->RegisterSendCodec(myCodec)); |
1179 myChannel->ResetStats(); | 1174 myChannel->ResetStats(); |
1180 { | 1175 { |
1181 WriteLockScoped wl(_apiTestRWLock); | 1176 WriteLockScoped wl(_apiTestRWLock); |
1182 *thereIsEncoder = true; | 1177 *thereIsEncoder = true; |
1183 } | 1178 } |
1184 Wait(500); | 1179 Wait(500); |
1185 } | 1180 } |
1186 | 1181 |
1187 } // namespace webrtc | 1182 } // namespace webrtc |
OLD | NEW |