Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Side by Side Diff: webrtc/modules/audio_coding/main/acm2/audio_coding_module_unittest_oldapi.cc

Issue 1208993010: iSAC: Make separate AudioEncoder and AudioDecoder objects (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: review fixes Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 codec_registration_thread_( 714 codec_registration_thread_(
715 ThreadWrapper::CreateThread(CbCodecRegistrationThread, 715 ThreadWrapper::CreateThread(CbCodecRegistrationThread,
716 this, 716 this,
717 "codec_registration")), 717 "codec_registration")),
718 test_complete_(EventWrapper::Create()), 718 test_complete_(EventWrapper::Create()),
719 crit_sect_(CriticalSectionWrapper::CreateCriticalSection()), 719 crit_sect_(CriticalSectionWrapper::CreateCriticalSection()),
720 codec_registered_(false), 720 codec_registered_(false),
721 receive_packet_count_(0), 721 receive_packet_count_(0),
722 next_insert_packet_time_ms_(0), 722 next_insert_packet_time_ms_(0),
723 fake_clock_(new SimulatedClock(0)) { 723 fake_clock_(new SimulatedClock(0)) {
724 AudioEncoderDecoderIsac::Config config; 724 AudioEncoderIsac::Config config;
725 config.payload_type = kPayloadType; 725 config.payload_type = kPayloadType;
726 isac_encoder_.reset(new AudioEncoderDecoderIsac(config)); 726 isac_encoder_.reset(new AudioEncoderIsac(config));
727 clock_ = fake_clock_.get(); 727 clock_ = fake_clock_.get();
728 } 728 }
729 729
730 void SetUp() { 730 void SetUp() {
731 AudioCodingModuleTestOldApi::SetUp(); 731 AudioCodingModuleTestOldApi::SetUp();
732 // Set up input audio source to read from specified file, loop after 5 732 // Set up input audio source to read from specified file, loop after 5
733 // seconds, and deliver blocks of 10 ms. 733 // seconds, and deliver blocks of 10 ms.
734 const std::string input_file_name = 734 const std::string input_file_name =
735 webrtc::test::ResourcePath("audio_coding/speech_mono_16kHz", "pcm"); 735 webrtc::test::ResourcePath("audio_coding/speech_mono_16kHz", "pcm");
736 audio_loop_.Init(input_file_name, 5 * kSampleRateHz, kNumSamples10ms); 736 audio_loop_.Init(input_file_name, 5 * kSampleRateHz, kNumSamples10ms);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 return true; 838 return true;
839 } 839 }
840 840
841 rtc::scoped_ptr<ThreadWrapper> receive_thread_; 841 rtc::scoped_ptr<ThreadWrapper> receive_thread_;
842 rtc::scoped_ptr<ThreadWrapper> codec_registration_thread_; 842 rtc::scoped_ptr<ThreadWrapper> codec_registration_thread_;
843 const rtc::scoped_ptr<EventWrapper> test_complete_; 843 const rtc::scoped_ptr<EventWrapper> test_complete_;
844 const rtc::scoped_ptr<CriticalSectionWrapper> crit_sect_; 844 const rtc::scoped_ptr<CriticalSectionWrapper> crit_sect_;
845 bool codec_registered_ GUARDED_BY(crit_sect_); 845 bool codec_registered_ GUARDED_BY(crit_sect_);
846 int receive_packet_count_ GUARDED_BY(crit_sect_); 846 int receive_packet_count_ GUARDED_BY(crit_sect_);
847 int64_t next_insert_packet_time_ms_ GUARDED_BY(crit_sect_); 847 int64_t next_insert_packet_time_ms_ GUARDED_BY(crit_sect_);
848 rtc::scoped_ptr<AudioEncoderDecoderIsac> isac_encoder_; 848 rtc::scoped_ptr<AudioEncoderIsac> isac_encoder_;
849 rtc::scoped_ptr<SimulatedClock> fake_clock_; 849 rtc::scoped_ptr<SimulatedClock> fake_clock_;
850 test::AudioLoop audio_loop_; 850 test::AudioLoop audio_loop_;
851 }; 851 };
852 852
853 TEST_F(AcmReRegisterIsacMtTestOldApi, DISABLED_ON_IOS(DoTest)) { 853 TEST_F(AcmReRegisterIsacMtTestOldApi, DISABLED_ON_IOS(DoTest)) {
854 EXPECT_EQ(kEventSignaled, RunTest()); 854 EXPECT_EQ(kEventSignaled, RunTest());
855 } 855 }
856 856
857 // Disabling all of these tests on iOS until file support has been added. 857 // Disabling all of these tests on iOS until file support has been added.
858 // See https://code.google.com/p/webrtc/issues/detail?id=4752 for details. 858 // See https://code.google.com/p/webrtc/issues/detail?id=4752 for details.
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
1684 Run(16000, 8000, 1000); 1684 Run(16000, 8000, 1000);
1685 } 1685 }
1686 1686
1687 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) { 1687 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) {
1688 Run(8000, 16000, 1000); 1688 Run(8000, 16000, 1000);
1689 } 1689 }
1690 1690
1691 #endif 1691 #endif
1692 1692
1693 } // namespace webrtc 1693 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698