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()), | 37 : _acmA(AudioCodingModule::Create(1)), |
38 _acmRefA(AudioCodingModule::Create()), | 38 _acmRefA(AudioCodingModule::Create(3)), |
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; |
43 config.decoder_factory = CreateBuiltinAudioDecoderFactory(); | 44 config.decoder_factory = CreateBuiltinAudioDecoderFactory(); |
44 _acmB.reset(AudioCodingModule::Create(config)); | 45 _acmB.reset(AudioCodingModule::Create(config)); |
| 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; |
53 _inFileA.Close(); | 55 _inFileA.Close(); |
54 _inFileB.Close(); | 56 _inFileB.Close(); |
55 _outFileA.Close(); | 57 _outFileA.Close(); |
56 _outFileB.Close(); | 58 _outFileB.Close(); |
57 _outFileRefA.Close(); | 59 _outFileRefA.Close(); |
58 _outFileRefB.Close(); | 60 _outFileRefB.Close(); |
59 } | 61 } |
60 | 62 |
61 void TwoWayCommunication::ChooseCodec(uint8_t* codecID_A, | 63 void TwoWayCommunication::ChooseCodec(uint8_t* codecID_A, |
62 uint8_t* codecID_B) { | 64 uint8_t* codecID_B) { |
63 std::unique_ptr<AudioCodingModule> tmpACM(AudioCodingModule::Create()); | 65 std::unique_ptr<AudioCodingModule> tmpACM(AudioCodingModule::Create(0)); |
64 uint8_t noCodec = tmpACM->NumberOfCodecs(); | 66 uint8_t noCodec = tmpACM->NumberOfCodecs(); |
65 CodecInst codecInst; | 67 CodecInst codecInst; |
66 printf("List of Supported Codecs\n"); | 68 printf("List of Supported Codecs\n"); |
67 printf("========================\n"); | 69 printf("========================\n"); |
68 for (uint8_t codecCntr = 0; codecCntr < noCodec; codecCntr++) { | 70 for (uint8_t codecCntr = 0; codecCntr < noCodec; codecCntr++) { |
69 EXPECT_EQ(tmpACM->Codec(codecCntr, &codecInst), 0); | 71 EXPECT_EQ(tmpACM->Codec(codecCntr, &codecInst), 0); |
70 printf("%d- %s\n", codecCntr, codecInst.plname); | 72 printf("%d- %s\n", codecCntr, codecInst.plname); |
71 } | 73 } |
72 printf("\nChoose a send codec for side A [0]: "); | 74 printf("\nChoose a send codec for side A [0]: "); |
73 char myStr[15] = ""; | 75 char myStr[15] = ""; |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 EXPECT_EQ(0, _acmA->InitializeReceiver()); | 300 EXPECT_EQ(0, _acmA->InitializeReceiver()); |
299 // Re-register codec on side A. | 301 // Re-register codec on side A. |
300 if (((secPassed % 7) == 6) && (msecPassed >= 990)) { | 302 if (((secPassed % 7) == 6) && (msecPassed >= 990)) { |
301 EXPECT_EQ(true, _acmA->RegisterReceiveCodec( | 303 EXPECT_EQ(true, _acmA->RegisterReceiveCodec( |
302 codecInst_B->pltype, CodecInstToSdp(*codecInst_B))); | 304 codecInst_B->pltype, CodecInstToSdp(*codecInst_B))); |
303 } | 305 } |
304 } | 306 } |
305 } | 307 } |
306 | 308 |
307 } // namespace webrtc | 309 } // namespace webrtc |
OLD | NEW |