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 16 matching lines...) Expand all Loading... |
27 #include "modules/audio_coding/test/utility.h" | 27 #include "modules/audio_coding/test/utility.h" |
28 #include "test/gtest.h" | 28 #include "test/gtest.h" |
29 #include "test/testsupport/fileutils.h" | 29 #include "test/testsupport/fileutils.h" |
30 #include "typedefs.h" // NOLINT(build/include) | 30 #include "typedefs.h" // NOLINT(build/include) |
31 | 31 |
32 namespace webrtc { | 32 namespace webrtc { |
33 | 33 |
34 #define MAX_FILE_NAME_LENGTH_BYTE 500 | 34 #define MAX_FILE_NAME_LENGTH_BYTE 500 |
35 | 35 |
36 TwoWayCommunication::TwoWayCommunication(int testMode) | 36 TwoWayCommunication::TwoWayCommunication(int testMode) |
37 : _acmA(AudioCodingModule::Create(1)), | 37 : _acmA(AudioCodingModule::Create()), |
38 _acmRefA(AudioCodingModule::Create(3)), | 38 _acmRefA(AudioCodingModule::Create()), |
39 _testMode(testMode) { | 39 _testMode(testMode) { |
40 AudioCodingModule::Config config; | 40 AudioCodingModule::Config config; |
41 // 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? |
42 config.neteq_config.playout_mode = kPlayoutFax; | 42 config.neteq_config.playout_mode = kPlayoutFax; |
43 config.id = 2; | |
44 config.decoder_factory = CreateBuiltinAudioDecoderFactory(); | 43 config.decoder_factory = CreateBuiltinAudioDecoderFactory(); |
45 _acmB.reset(AudioCodingModule::Create(config)); | 44 _acmB.reset(AudioCodingModule::Create(config)); |
46 config.id = 4; | |
47 _acmRefB.reset(AudioCodingModule::Create(config)); | 45 _acmRefB.reset(AudioCodingModule::Create(config)); |
48 } | 46 } |
49 | 47 |
50 TwoWayCommunication::~TwoWayCommunication() { | 48 TwoWayCommunication::~TwoWayCommunication() { |
51 delete _channel_A2B; | 49 delete _channel_A2B; |
52 delete _channel_B2A; | 50 delete _channel_B2A; |
53 delete _channelRef_A2B; | 51 delete _channelRef_A2B; |
54 delete _channelRef_B2A; | 52 delete _channelRef_B2A; |
55 _inFileA.Close(); | 53 _inFileA.Close(); |
56 _inFileB.Close(); | 54 _inFileB.Close(); |
57 _outFileA.Close(); | 55 _outFileA.Close(); |
58 _outFileB.Close(); | 56 _outFileB.Close(); |
59 _outFileRefA.Close(); | 57 _outFileRefA.Close(); |
60 _outFileRefB.Close(); | 58 _outFileRefB.Close(); |
61 } | 59 } |
62 | 60 |
63 void TwoWayCommunication::ChooseCodec(uint8_t* codecID_A, | 61 void TwoWayCommunication::ChooseCodec(uint8_t* codecID_A, |
64 uint8_t* codecID_B) { | 62 uint8_t* codecID_B) { |
65 std::unique_ptr<AudioCodingModule> tmpACM(AudioCodingModule::Create(0)); | 63 std::unique_ptr<AudioCodingModule> tmpACM(AudioCodingModule::Create()); |
66 uint8_t noCodec = tmpACM->NumberOfCodecs(); | 64 uint8_t noCodec = tmpACM->NumberOfCodecs(); |
67 CodecInst codecInst; | 65 CodecInst codecInst; |
68 printf("List of Supported Codecs\n"); | 66 printf("List of Supported Codecs\n"); |
69 printf("========================\n"); | 67 printf("========================\n"); |
70 for (uint8_t codecCntr = 0; codecCntr < noCodec; codecCntr++) { | 68 for (uint8_t codecCntr = 0; codecCntr < noCodec; codecCntr++) { |
71 EXPECT_EQ(tmpACM->Codec(codecCntr, &codecInst), 0); | 69 EXPECT_EQ(tmpACM->Codec(codecCntr, &codecInst), 0); |
72 printf("%d- %s\n", codecCntr, codecInst.plname); | 70 printf("%d- %s\n", codecCntr, codecInst.plname); |
73 } | 71 } |
74 printf("\nChoose a send codec for side A [0]: "); | 72 printf("\nChoose a send codec for side A [0]: "); |
75 char myStr[15] = ""; | 73 char myStr[15] = ""; |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 EXPECT_EQ(0, _acmA->InitializeReceiver()); | 298 EXPECT_EQ(0, _acmA->InitializeReceiver()); |
301 // Re-register codec on side A. | 299 // Re-register codec on side A. |
302 if (((secPassed % 7) == 6) && (msecPassed >= 990)) { | 300 if (((secPassed % 7) == 6) && (msecPassed >= 990)) { |
303 EXPECT_EQ(true, _acmA->RegisterReceiveCodec( | 301 EXPECT_EQ(true, _acmA->RegisterReceiveCodec( |
304 codecInst_B->pltype, CodecInstToSdp(*codecInst_B))); | 302 codecInst_B->pltype, CodecInstToSdp(*codecInst_B))); |
305 } | 303 } |
306 } | 304 } |
307 } | 305 } |
308 | 306 |
309 } // namespace webrtc | 307 } // namespace webrtc |
OLD | NEW |