| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 <stdio.h> | 11 #include <stdio.h> |
| 12 #include <string.h> | 12 #include <string.h> |
| 13 #include <memory> | 13 #include <memory> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "webrtc/base/criticalsection.h" | 16 #include "webrtc/base/criticalsection.h" |
| 17 #include "webrtc/base/md5digest.h" | 17 #include "webrtc/base/md5digest.h" |
| 18 #include "webrtc/base/platform_thread.h" | 18 #include "webrtc/base/platform_thread.h" |
| 19 #include "webrtc/base/thread_annotations.h" | 19 #include "webrtc/base/thread_annotations.h" |
| 20 #include "webrtc/modules/audio_coding/acm2/acm_receive_test.h" | 20 #include "webrtc/modules/audio_coding/acm2/acm_receive_test.h" |
| 21 #include "webrtc/modules/audio_coding/acm2/acm_send_test.h" | 21 #include "webrtc/modules/audio_coding/acm2/acm_send_test.h" |
| 22 #include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h" | 22 #include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h" |
| 23 #include "webrtc/modules/audio_coding/codecs/audio_encoder.h" | 23 #include "webrtc/modules/audio_coding/codecs/audio_encoder.h" |
| 24 #include "webrtc/modules/audio_coding/codecs/audio_format_conversion.h" |
| 24 #include "webrtc/modules/audio_coding/codecs/g711/audio_decoder_pcm.h" | 25 #include "webrtc/modules/audio_coding/codecs/g711/audio_decoder_pcm.h" |
| 25 #include "webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.h" | 26 #include "webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.h" |
| 26 #include "webrtc/modules/audio_coding/codecs/isac/main/include/audio_encoder_isa
c.h" | 27 #include "webrtc/modules/audio_coding/codecs/isac/main/include/audio_encoder_isa
c.h" |
| 27 #include "webrtc/modules/audio_coding/codecs/mock/mock_audio_encoder.h" | 28 #include "webrtc/modules/audio_coding/codecs/mock/mock_audio_encoder.h" |
| 28 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" | 29 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" |
| 29 #include "webrtc/modules/audio_coding/include/audio_coding_module_typedefs.h" | 30 #include "webrtc/modules/audio_coding/include/audio_coding_module_typedefs.h" |
| 30 #include "webrtc/modules/audio_coding/neteq/audio_decoder_impl.h" | 31 #include "webrtc/modules/audio_coding/neteq/audio_decoder_impl.h" |
| 31 #include "webrtc/modules/audio_coding/neteq/mock/mock_audio_decoder.h" | 32 #include "webrtc/modules/audio_coding/neteq/mock/mock_audio_decoder.h" |
| 32 #include "webrtc/modules/audio_coding/neteq/tools/audio_checksum.h" | 33 #include "webrtc/modules/audio_coding/neteq/tools/audio_checksum.h" |
| 33 #include "webrtc/modules/audio_coding/neteq/tools/audio_loop.h" | 34 #include "webrtc/modules/audio_coding/neteq/tools/audio_loop.h" |
| (...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 } | 771 } |
| 771 | 772 |
| 772 void RegisterCodec() override { | 773 void RegisterCodec() override { |
| 773 static_assert(kSampleRateHz == 16000, "test designed for iSAC 16 kHz"); | 774 static_assert(kSampleRateHz == 16000, "test designed for iSAC 16 kHz"); |
| 774 AudioCodingModule::Codec("ISAC", &codec_, kSampleRateHz, 1); | 775 AudioCodingModule::Codec("ISAC", &codec_, kSampleRateHz, 1); |
| 775 codec_.pltype = kPayloadType; | 776 codec_.pltype = kPayloadType; |
| 776 | 777 |
| 777 // Register iSAC codec in ACM, effectively unregistering the PCM16B codec | 778 // Register iSAC codec in ACM, effectively unregistering the PCM16B codec |
| 778 // registered in AudioCodingModuleTestOldApi::SetUp(); | 779 // registered in AudioCodingModuleTestOldApi::SetUp(); |
| 779 // Only register the decoder for now. The encoder is registered later. | 780 // Only register the decoder for now. The encoder is registered later. |
| 780 ASSERT_EQ(0, acm_->RegisterReceiveCodec(codec_)); | 781 ASSERT_EQ(true, acm_->RegisterReceiveCodec(codec_.pltype, |
| 782 CodecInstToSdp(codec_))); |
| 781 } | 783 } |
| 782 | 784 |
| 783 void StartThreads() { | 785 void StartThreads() { |
| 784 receive_thread_.Start(); | 786 receive_thread_.Start(); |
| 785 receive_thread_.SetPriority(rtc::kRealtimePriority); | 787 receive_thread_.SetPriority(rtc::kRealtimePriority); |
| 786 codec_registration_thread_.Start(); | 788 codec_registration_thread_.Start(); |
| 787 codec_registration_thread_.SetPriority(rtc::kRealtimePriority); | 789 codec_registration_thread_.SetPriority(rtc::kRealtimePriority); |
| 788 } | 790 } |
| 789 | 791 |
| 790 void TearDown() override { | 792 void TearDown() override { |
| (...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1833 Run(16000, 8000, 1000); | 1835 Run(16000, 8000, 1000); |
| 1834 } | 1836 } |
| 1835 | 1837 |
| 1836 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) { | 1838 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) { |
| 1837 Run(8000, 16000, 1000); | 1839 Run(8000, 16000, 1000); |
| 1838 } | 1840 } |
| 1839 | 1841 |
| 1840 #endif | 1842 #endif |
| 1841 | 1843 |
| 1842 } // namespace webrtc | 1844 } // namespace webrtc |
| OLD | NEW |