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 "TwoWayCommunication.h" | 11 #include "TwoWayCommunication.h" |
12 | 12 |
13 #include <ctype.h> | 13 #include <ctype.h> |
14 #include <stdio.h> | 14 #include <stdio.h> |
15 #include <string.h> | 15 #include <string.h> |
16 | 16 |
17 #include <memory> | 17 #include <memory> |
18 | 18 |
19 #ifdef WIN32 | 19 #ifdef WIN32 |
20 #include <Windows.h> | 20 #include <Windows.h> |
21 #endif | 21 #endif |
22 | 22 |
23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
24 #include "webrtc/engine_configurations.h" | 24 #include "webrtc/engine_configurations.h" |
25 #include "webrtc/common_types.h" | 25 #include "webrtc/common_types.h" |
| 26 #include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h" |
26 #include "webrtc/modules/audio_coding/test/PCMFile.h" | 27 #include "webrtc/modules/audio_coding/test/PCMFile.h" |
27 #include "webrtc/modules/audio_coding/test/utility.h" | 28 #include "webrtc/modules/audio_coding/test/utility.h" |
28 #include "webrtc/system_wrappers/include/trace.h" | 29 #include "webrtc/system_wrappers/include/trace.h" |
29 #include "webrtc/test/testsupport/fileutils.h" | 30 #include "webrtc/test/testsupport/fileutils.h" |
30 | 31 |
31 namespace webrtc { | 32 namespace webrtc { |
32 | 33 |
33 #define MAX_FILE_NAME_LENGTH_BYTE 500 | 34 #define MAX_FILE_NAME_LENGTH_BYTE 500 |
34 | 35 |
35 TwoWayCommunication::TwoWayCommunication(int testMode) | 36 TwoWayCommunication::TwoWayCommunication(int testMode) |
36 : _acmA(AudioCodingModule::Create(1)), | 37 : _acmA(AudioCodingModule::Create(1)), |
37 _acmRefA(AudioCodingModule::Create(3)), | 38 _acmRefA(AudioCodingModule::Create(3)), |
38 _testMode(testMode) { | 39 _testMode(testMode) { |
39 AudioCodingModule::Config config; | 40 AudioCodingModule::Config config; |
40 // The clicks will be more obvious in FAX mode. TODO(henrik.lundin) Really? | 41 // The clicks will be more obvious in FAX mode. TODO(henrik.lundin) Really? |
41 config.neteq_config.playout_mode = kPlayoutFax; | 42 config.neteq_config.playout_mode = kPlayoutFax; |
42 config.id = 2; | 43 config.id = 2; |
| 44 config.decoder_factory = CreateBuiltinAudioDecoderFactory(); |
43 _acmB.reset(AudioCodingModule::Create(config)); | 45 _acmB.reset(AudioCodingModule::Create(config)); |
44 config.id = 4; | 46 config.id = 4; |
45 _acmRefB.reset(AudioCodingModule::Create(config)); | 47 _acmRefB.reset(AudioCodingModule::Create(config)); |
46 } | 48 } |
47 | 49 |
48 TwoWayCommunication::~TwoWayCommunication() { | 50 TwoWayCommunication::~TwoWayCommunication() { |
49 delete _channel_A2B; | 51 delete _channel_A2B; |
50 delete _channel_B2A; | 52 delete _channel_B2A; |
51 delete _channelRef_A2B; | 53 delete _channelRef_A2B; |
52 delete _channelRef_B2A; | 54 delete _channelRef_B2A; |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 if (((secPassed % 7) == 6) && (msecPassed == 0)) | 291 if (((secPassed % 7) == 6) && (msecPassed == 0)) |
290 EXPECT_EQ(0, _acmA->InitializeReceiver()); | 292 EXPECT_EQ(0, _acmA->InitializeReceiver()); |
291 // Re-register codec on side A. | 293 // Re-register codec on side A. |
292 if (((secPassed % 7) == 6) && (msecPassed >= 990)) { | 294 if (((secPassed % 7) == 6) && (msecPassed >= 990)) { |
293 EXPECT_EQ(0, _acmA->RegisterReceiveCodec(*codecInst_B)); | 295 EXPECT_EQ(0, _acmA->RegisterReceiveCodec(*codecInst_B)); |
294 } | 296 } |
295 } | 297 } |
296 } | 298 } |
297 | 299 |
298 } // namespace webrtc | 300 } // namespace webrtc |
OLD | NEW |