| 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 "webrtc/modules/audio_coding/test/TestRedFec.h" | 11 #include "webrtc/modules/audio_coding/test/TestRedFec.h" |
| 12 | 12 |
| 13 #include <assert.h> | 13 #include <assert.h> |
| 14 | 14 |
| 15 #include "webrtc/common_types.h" | 15 #include "webrtc/common_types.h" |
| 16 #include "webrtc/modules/audio_coding/codecs/audio_format_conversion.h" |
| 16 #include "webrtc/modules/audio_coding/include/audio_coding_module_typedefs.h" | 17 #include "webrtc/modules/audio_coding/include/audio_coding_module_typedefs.h" |
| 17 #include "webrtc/modules/audio_coding/test/utility.h" | 18 #include "webrtc/modules/audio_coding/test/utility.h" |
| 18 #include "webrtc/system_wrappers/include/trace.h" | 19 #include "webrtc/system_wrappers/include/trace.h" |
| 19 #include "webrtc/test/testsupport/fileutils.h" | 20 #include "webrtc/test/testsupport/fileutils.h" |
| 20 #include "webrtc/voice_engine_configurations.h" | 21 #include "webrtc/voice_engine_configurations.h" |
| 21 | 22 |
| 22 #ifdef SUPPORT_RED_WB | 23 #ifdef SUPPORT_RED_WB |
| 23 #undef SUPPORT_RED_WB | 24 #undef SUPPORT_RED_WB |
| 24 #endif | 25 #endif |
| 25 | 26 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 ASSERT_EQ(0, _acmB->InitializeReceiver()); | 71 ASSERT_EQ(0, _acmB->InitializeReceiver()); |
| 71 | 72 |
| 72 uint8_t numEncoders = _acmA->NumberOfCodecs(); | 73 uint8_t numEncoders = _acmA->NumberOfCodecs(); |
| 73 CodecInst myCodecParam; | 74 CodecInst myCodecParam; |
| 74 for (uint8_t n = 0; n < numEncoders; n++) { | 75 for (uint8_t n = 0; n < numEncoders; n++) { |
| 75 EXPECT_EQ(0, _acmB->Codec(n, &myCodecParam)); | 76 EXPECT_EQ(0, _acmB->Codec(n, &myCodecParam)); |
| 76 // Default number of channels is 2 for opus, so we change to 1 in this test. | 77 // Default number of channels is 2 for opus, so we change to 1 in this test. |
| 77 if (!strcmp(myCodecParam.plname, "opus")) { | 78 if (!strcmp(myCodecParam.plname, "opus")) { |
| 78 myCodecParam.channels = 1; | 79 myCodecParam.channels = 1; |
| 79 } | 80 } |
| 80 EXPECT_EQ(0, _acmB->RegisterReceiveCodec(myCodecParam)); | 81 EXPECT_EQ(true, _acmB->RegisterReceiveCodec(myCodecParam.pltype, |
| 82 CodecInstToSdp(myCodecParam))); |
| 81 } | 83 } |
| 82 | 84 |
| 83 // Create and connect the channel | 85 // Create and connect the channel |
| 84 _channelA2B = new Channel; | 86 _channelA2B = new Channel; |
| 85 _acmA->RegisterTransportCallback(_channelA2B); | 87 _acmA->RegisterTransportCallback(_channelA2B); |
| 86 _channelA2B->RegisterReceiverACM(_acmB.get()); | 88 _channelA2B->RegisterReceiverACM(_acmB.get()); |
| 87 | 89 |
| 88 EXPECT_EQ(0, RegisterSendCodec('A', kNameL16, 8000)); | 90 EXPECT_EQ(0, RegisterSendCodec('A', kNameL16, 8000)); |
| 89 EXPECT_EQ(0, RegisterSendCodec('A', kNameCN, 8000)); | 91 EXPECT_EQ(0, RegisterSendCodec('A', kNameCN, 8000)); |
| 90 EXPECT_EQ(0, RegisterSendCodec('A', kNameRED)); | 92 EXPECT_EQ(0, RegisterSendCodec('A', kNameRED)); |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 std::string file_name; | 474 std::string file_name; |
| 473 std::stringstream file_stream; | 475 std::stringstream file_stream; |
| 474 file_stream << webrtc::test::OutputPath(); | 476 file_stream << webrtc::test::OutputPath(); |
| 475 file_stream << "TestRedFec_outFile_"; | 477 file_stream << "TestRedFec_outFile_"; |
| 476 file_stream << test_number << ".pcm"; | 478 file_stream << test_number << ".pcm"; |
| 477 file_name = file_stream.str(); | 479 file_name = file_stream.str(); |
| 478 _outFileB.Open(file_name, 16000, "wb"); | 480 _outFileB.Open(file_name, 16000, "wb"); |
| 479 } | 481 } |
| 480 | 482 |
| 481 } // namespace webrtc | 483 } // namespace webrtc |
| OLD | NEW |