| 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> |
| 18 |
| 17 #ifdef WIN32 | 19 #ifdef WIN32 |
| 18 #include <Windows.h> | 20 #include <Windows.h> |
| 19 #endif | 21 #endif |
| 20 | 22 |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
| 22 #include "webrtc/engine_configurations.h" | 24 #include "webrtc/engine_configurations.h" |
| 23 #include "webrtc/common_types.h" | 25 #include "webrtc/common_types.h" |
| 24 #include "webrtc/modules/audio_coding/test/PCMFile.h" | 26 #include "webrtc/modules/audio_coding/test/PCMFile.h" |
| 25 #include "webrtc/modules/audio_coding/test/utility.h" | 27 #include "webrtc/modules/audio_coding/test/utility.h" |
| 26 #include "webrtc/system_wrappers/include/trace.h" | 28 #include "webrtc/system_wrappers/include/trace.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 _inFileA.Close(); | 61 _inFileA.Close(); |
| 60 _inFileB.Close(); | 62 _inFileB.Close(); |
| 61 _outFileA.Close(); | 63 _outFileA.Close(); |
| 62 _outFileB.Close(); | 64 _outFileB.Close(); |
| 63 _outFileRefA.Close(); | 65 _outFileRefA.Close(); |
| 64 _outFileRefB.Close(); | 66 _outFileRefB.Close(); |
| 65 } | 67 } |
| 66 | 68 |
| 67 void TwoWayCommunication::ChooseCodec(uint8_t* codecID_A, | 69 void TwoWayCommunication::ChooseCodec(uint8_t* codecID_A, |
| 68 uint8_t* codecID_B) { | 70 uint8_t* codecID_B) { |
| 69 rtc::scoped_ptr<AudioCodingModule> tmpACM(AudioCodingModule::Create(0)); | 71 std::unique_ptr<AudioCodingModule> tmpACM(AudioCodingModule::Create(0)); |
| 70 uint8_t noCodec = tmpACM->NumberOfCodecs(); | 72 uint8_t noCodec = tmpACM->NumberOfCodecs(); |
| 71 CodecInst codecInst; | 73 CodecInst codecInst; |
| 72 printf("List of Supported Codecs\n"); | 74 printf("List of Supported Codecs\n"); |
| 73 printf("========================\n"); | 75 printf("========================\n"); |
| 74 for (uint8_t codecCntr = 0; codecCntr < noCodec; codecCntr++) { | 76 for (uint8_t codecCntr = 0; codecCntr < noCodec; codecCntr++) { |
| 75 EXPECT_EQ(tmpACM->Codec(codecCntr, &codecInst), 0); | 77 EXPECT_EQ(tmpACM->Codec(codecCntr, &codecInst), 0); |
| 76 printf("%d- %s\n", codecCntr, codecInst.plname); | 78 printf("%d- %s\n", codecCntr, codecInst.plname); |
| 77 } | 79 } |
| 78 printf("\nChoose a send codec for side A [0]: "); | 80 printf("\nChoose a send codec for side A [0]: "); |
| 79 char myStr[15] = ""; | 81 char myStr[15] = ""; |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 if (((secPassed % 7) == 6) && (msecPassed == 0)) | 292 if (((secPassed % 7) == 6) && (msecPassed == 0)) |
| 291 EXPECT_EQ(0, _acmA->InitializeReceiver()); | 293 EXPECT_EQ(0, _acmA->InitializeReceiver()); |
| 292 // Re-register codec on side A. | 294 // Re-register codec on side A. |
| 293 if (((secPassed % 7) == 6) && (msecPassed >= 990)) { | 295 if (((secPassed % 7) == 6) && (msecPassed >= 990)) { |
| 294 EXPECT_EQ(0, _acmA->RegisterReceiveCodec(*codecInst_B)); | 296 EXPECT_EQ(0, _acmA->RegisterReceiveCodec(*codecInst_B)); |
| 295 } | 297 } |
| 296 } | 298 } |
| 297 } | 299 } |
| 298 | 300 |
| 299 } // namespace webrtc | 301 } // namespace webrtc |
| OLD | NEW |