| 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 |
| 11 #include "webrtc/modules/audio_coding/test/APITest.h" | 11 #include "webrtc/modules/audio_coding/test/APITest.h" |
| 12 | 12 |
| 13 #include <ctype.h> | 13 #include <ctype.h> |
| 14 #include <stdio.h> | 14 #include <stdio.h> |
| 15 #include <stdlib.h> | 15 #include <stdlib.h> |
| 16 #include <string.h> | 16 #include <string.h> |
| 17 | 17 |
| 18 #include <iostream> | 18 #include <iostream> |
| 19 #include <ostream> | 19 #include <ostream> |
| 20 #include <string> | 20 #include <string> |
| 21 | 21 |
| 22 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
| 23 #include "webrtc/base/platform_thread.h" | 23 #include "webrtc/base/platform_thread.h" |
| 24 #include "webrtc/base/timeutils.h" | 24 #include "webrtc/base/timeutils.h" |
| 25 #include "webrtc/common.h" | |
| 26 #include "webrtc/common_types.h" | 25 #include "webrtc/common_types.h" |
| 27 #include "webrtc/engine_configurations.h" | 26 #include "webrtc/engine_configurations.h" |
| 28 #include "webrtc/modules/audio_coding/acm2/acm_common_defs.h" | 27 #include "webrtc/modules/audio_coding/acm2/acm_common_defs.h" |
| 29 #include "webrtc/modules/audio_coding/test/utility.h" | 28 #include "webrtc/modules/audio_coding/test/utility.h" |
| 30 #include "webrtc/system_wrappers/include/event_wrapper.h" | 29 #include "webrtc/system_wrappers/include/event_wrapper.h" |
| 31 #include "webrtc/system_wrappers/include/trace.h" | 30 #include "webrtc/system_wrappers/include/trace.h" |
| 32 #include "webrtc/test/testsupport/fileutils.h" | 31 #include "webrtc/test/testsupport/fileutils.h" |
| 33 | 32 |
| 34 namespace webrtc { | 33 namespace webrtc { |
| 35 | 34 |
| 36 #define TEST_DURATION_SEC 600 | 35 #define TEST_DURATION_SEC 600 |
| 37 #define NUMBER_OF_SENDER_TESTS 6 | 36 #define NUMBER_OF_SENDER_TESTS 6 |
| 38 #define MAX_FILE_NAME_LENGTH_BYTE 500 | 37 #define MAX_FILE_NAME_LENGTH_BYTE 500 |
| 39 | 38 |
| 40 void APITest::Wait(uint32_t waitLengthMs) { | 39 void APITest::Wait(uint32_t waitLengthMs) { |
| 41 if (_randomTest) { | 40 if (_randomTest) { |
| 42 return; | 41 return; |
| 43 } else { | 42 } else { |
| 44 EventWrapper* myEvent = EventWrapper::Create(); | 43 EventWrapper* myEvent = EventWrapper::Create(); |
| 45 myEvent->Wait(waitLengthMs); | 44 myEvent->Wait(waitLengthMs); |
| 46 delete myEvent; | 45 delete myEvent; |
| 47 return; | 46 return; |
| 48 } | 47 } |
| 49 } | 48 } |
| 50 | 49 |
| 51 APITest::APITest(const Config& config) | 50 APITest::APITest() |
| 52 : _acmA(AudioCodingModule::Create(1)), | 51 : _acmA(AudioCodingModule::Create(1)), |
| 53 _acmB(AudioCodingModule::Create(2)), | 52 _acmB(AudioCodingModule::Create(2)), |
| 54 _channel_A2B(NULL), | 53 _channel_A2B(NULL), |
| 55 _channel_B2A(NULL), | 54 _channel_B2A(NULL), |
| 56 _writeToFile(true), | 55 _writeToFile(true), |
| 57 _pullEventA(NULL), | 56 _pullEventA(NULL), |
| 58 _pushEventA(NULL), | 57 _pushEventA(NULL), |
| 59 _processEventA(NULL), | 58 _processEventA(NULL), |
| 60 _apiEventA(NULL), | 59 _apiEventA(NULL), |
| 61 _pullEventB(NULL), | 60 _pullEventB(NULL), |
| (...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1098 CHECK_ERROR_MT(myACM->RegisterSendCodec(myCodec)); | 1097 CHECK_ERROR_MT(myACM->RegisterSendCodec(myCodec)); |
| 1099 myChannel->ResetStats(); | 1098 myChannel->ResetStats(); |
| 1100 { | 1099 { |
| 1101 WriteLockScoped wl(_apiTestRWLock); | 1100 WriteLockScoped wl(_apiTestRWLock); |
| 1102 *thereIsEncoder = true; | 1101 *thereIsEncoder = true; |
| 1103 } | 1102 } |
| 1104 Wait(500); | 1103 Wait(500); |
| 1105 } | 1104 } |
| 1106 | 1105 |
| 1107 } // namespace webrtc | 1106 } // namespace webrtc |
| OLD | NEW |