| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #ifdef WEBRTC_CODEC_G722 | 44 #ifdef WEBRTC_CODEC_G722 |
| 45 const char kNameISAC[] = "ISAC"; | 45 const char kNameISAC[] = "ISAC"; |
| 46 const char kNameG722[] = "G722"; | 46 const char kNameG722[] = "G722"; |
| 47 const char kNameOPUS[] = "opus"; | 47 const char kNameOPUS[] = "opus"; |
| 48 #endif | 48 #endif |
| 49 } | 49 } |
| 50 | 50 |
| 51 TestRedFec::TestRedFec() | 51 TestRedFec::TestRedFec() |
| 52 : _acmA(AudioCodingModule::Create(0)), | 52 : _acmA(AudioCodingModule::Create(0)), |
| 53 _acmB(AudioCodingModule::Create(1)), | 53 _acmB(AudioCodingModule::Create(1)), |
| 54 _channelA2B(NULL), | 54 _channelA2B(nullptr), |
| 55 _testCntr(0) { | 55 _testCntr(0) {} |
| 56 } | |
| 57 | 56 |
| 58 TestRedFec::~TestRedFec() { | 57 TestRedFec::~TestRedFec() { |
| 59 if (_channelA2B != NULL) { | 58 if (_channelA2B != nullptr) { |
| 60 delete _channelA2B; | 59 delete _channelA2B; |
| 61 _channelA2B = NULL; | 60 _channelA2B = nullptr; |
| 62 } | 61 } |
| 63 } | 62 } |
| 64 | 63 |
| 65 void TestRedFec::Perform() { | 64 void TestRedFec::Perform() { |
| 66 const std::string file_name = webrtc::test::ResourcePath( | 65 const std::string file_name = webrtc::test::ResourcePath( |
| 67 "audio_coding/testfile32kHz", "pcm"); | 66 "audio_coding/testfile32kHz", "pcm"); |
| 68 _inFileA.Open(file_name, 32000, "rb"); | 67 _inFileA.Open(file_name, 32000, "rb"); |
| 69 | 68 |
| 70 ASSERT_EQ(0, _acmA->InitializeReceiver()); | 69 ASSERT_EQ(0, _acmA->InitializeReceiver()); |
| 71 ASSERT_EQ(0, _acmB->InitializeReceiver()); | 70 ASSERT_EQ(0, _acmB->InitializeReceiver()); |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 break; | 430 break; |
| 432 } | 431 } |
| 433 case 'B': { | 432 case 'B': { |
| 434 myACM = _acmB.get(); | 433 myACM = _acmB.get(); |
| 435 break; | 434 break; |
| 436 } | 435 } |
| 437 default: | 436 default: |
| 438 return -1; | 437 return -1; |
| 439 } | 438 } |
| 440 | 439 |
| 441 if (myACM == NULL) { | 440 if (myACM == nullptr) { |
| 442 assert(false); | 441 assert(false); |
| 443 return -1; | 442 return -1; |
| 444 } | 443 } |
| 445 CodecInst myCodecParam; | 444 CodecInst myCodecParam; |
| 446 EXPECT_GT(AudioCodingModule::Codec(codecName, &myCodecParam, | 445 EXPECT_GT(AudioCodingModule::Codec(codecName, &myCodecParam, |
| 447 samplingFreqHz, 1), -1); | 446 samplingFreqHz, 1), -1); |
| 448 EXPECT_GT(myACM->RegisterSendCodec(myCodecParam), -1); | 447 EXPECT_GT(myACM->RegisterSendCodec(myCodecParam), -1); |
| 449 | 448 |
| 450 // Initialization was successful. | 449 // Initialization was successful. |
| 451 return 0; | 450 return 0; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 474 std::string file_name; | 473 std::string file_name; |
| 475 std::stringstream file_stream; | 474 std::stringstream file_stream; |
| 476 file_stream << webrtc::test::OutputPath(); | 475 file_stream << webrtc::test::OutputPath(); |
| 477 file_stream << "TestRedFec_outFile_"; | 476 file_stream << "TestRedFec_outFile_"; |
| 478 file_stream << test_number << ".pcm"; | 477 file_stream << test_number << ".pcm"; |
| 479 file_name = file_stream.str(); | 478 file_name = file_stream.str(); |
| 480 _outFileB.Open(file_name, 16000, "wb"); | 479 _outFileB.Open(file_name, 16000, "wb"); |
| 481 } | 480 } |
| 482 | 481 |
| 483 } // namespace webrtc | 482 } // namespace webrtc |
| OLD | NEW |