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

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

Issue 1613643004: Remove mutable from rtc::CriticalSection members. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 11 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 rtc::CritScope lock(&crit_sect_); 140 rtc::CritScope lock(&crit_sect_);
141 last_payload_vec_.swap(*payload); 141 last_payload_vec_.swap(*payload);
142 } 142 }
143 143
144 private: 144 private:
145 int num_calls_ GUARDED_BY(crit_sect_); 145 int num_calls_ GUARDED_BY(crit_sect_);
146 FrameType last_frame_type_ GUARDED_BY(crit_sect_); 146 FrameType last_frame_type_ GUARDED_BY(crit_sect_);
147 int last_payload_type_ GUARDED_BY(crit_sect_); 147 int last_payload_type_ GUARDED_BY(crit_sect_);
148 uint32_t last_timestamp_ GUARDED_BY(crit_sect_); 148 uint32_t last_timestamp_ GUARDED_BY(crit_sect_);
149 std::vector<uint8_t> last_payload_vec_ GUARDED_BY(crit_sect_); 149 std::vector<uint8_t> last_payload_vec_ GUARDED_BY(crit_sect_);
150 mutable rtc::CriticalSection crit_sect_; 150 rtc::CriticalSection crit_sect_;
151 }; 151 };
152 152
153 class AudioCodingModuleTestOldApi : public ::testing::Test { 153 class AudioCodingModuleTestOldApi : public ::testing::Test {
154 protected: 154 protected:
155 AudioCodingModuleTestOldApi() 155 AudioCodingModuleTestOldApi()
156 : id_(1), 156 : id_(1),
157 rtp_utility_(new RtpUtility(kFrameSizeSamples, kPayloadType)), 157 rtp_utility_(new RtpUtility(kFrameSizeSamples, kPayloadType)),
158 clock_(Clock::GetRealTimeClock()) {} 158 clock_(Clock::GetRealTimeClock()) {}
159 159
160 ~AudioCodingModuleTestOldApi() {} 160 ~AudioCodingModuleTestOldApi() {}
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 return true; 572 return true;
573 } 573 }
574 574
575 rtc::PlatformThread send_thread_; 575 rtc::PlatformThread send_thread_;
576 rtc::PlatformThread insert_packet_thread_; 576 rtc::PlatformThread insert_packet_thread_;
577 rtc::PlatformThread pull_audio_thread_; 577 rtc::PlatformThread pull_audio_thread_;
578 const rtc::scoped_ptr<EventWrapper> test_complete_; 578 const rtc::scoped_ptr<EventWrapper> test_complete_;
579 int send_count_; 579 int send_count_;
580 int insert_packet_count_; 580 int insert_packet_count_;
581 int pull_audio_count_ GUARDED_BY(crit_sect_); 581 int pull_audio_count_ GUARDED_BY(crit_sect_);
582 mutable rtc::CriticalSection crit_sect_; 582 rtc::CriticalSection crit_sect_;
583 int64_t next_insert_packet_time_ms_ GUARDED_BY(crit_sect_); 583 int64_t next_insert_packet_time_ms_ GUARDED_BY(crit_sect_);
584 rtc::scoped_ptr<SimulatedClock> fake_clock_; 584 rtc::scoped_ptr<SimulatedClock> fake_clock_;
585 }; 585 };
586 586
587 #if defined(WEBRTC_IOS) 587 #if defined(WEBRTC_IOS)
588 #define MAYBE_DoTest DISABLED_DoTest 588 #define MAYBE_DoTest DISABLED_DoTest
589 #else 589 #else
590 #define MAYBE_DoTest DoTest 590 #define MAYBE_DoTest DoTest
591 #endif 591 #endif
592 TEST_F(AudioCodingModuleMtTestOldApi, MAYBE_DoTest) { 592 TEST_F(AudioCodingModuleMtTestOldApi, MAYBE_DoTest) {
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 } 835 }
836 if (codec_registered_ && receive_packet_count_ > kNumPackets) { 836 if (codec_registered_ && receive_packet_count_ > kNumPackets) {
837 test_complete_->Set(); 837 test_complete_->Set();
838 } 838 }
839 return true; 839 return true;
840 } 840 }
841 841
842 rtc::PlatformThread receive_thread_; 842 rtc::PlatformThread receive_thread_;
843 rtc::PlatformThread codec_registration_thread_; 843 rtc::PlatformThread codec_registration_thread_;
844 const rtc::scoped_ptr<EventWrapper> test_complete_; 844 const rtc::scoped_ptr<EventWrapper> test_complete_;
845 mutable rtc::CriticalSection crit_sect_; 845 rtc::CriticalSection crit_sect_;
846 bool codec_registered_ GUARDED_BY(crit_sect_); 846 bool codec_registered_ GUARDED_BY(crit_sect_);
847 int receive_packet_count_ GUARDED_BY(crit_sect_); 847 int receive_packet_count_ GUARDED_BY(crit_sect_);
848 int64_t next_insert_packet_time_ms_ GUARDED_BY(crit_sect_); 848 int64_t next_insert_packet_time_ms_ GUARDED_BY(crit_sect_);
849 rtc::scoped_ptr<AudioEncoderIsac> isac_encoder_; 849 rtc::scoped_ptr<AudioEncoderIsac> isac_encoder_;
850 rtc::scoped_ptr<SimulatedClock> fake_clock_; 850 rtc::scoped_ptr<SimulatedClock> fake_clock_;
851 test::AudioLoop audio_loop_; 851 test::AudioLoop audio_loop_;
852 }; 852 };
853 853
854 #if defined(WEBRTC_IOS) 854 #if defined(WEBRTC_IOS)
855 #define MAYBE_DoTest DISABLED_DoTest 855 #define MAYBE_DoTest DISABLED_DoTest
(...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after
1777 Run(16000, 8000, 1000); 1777 Run(16000, 8000, 1000);
1778 } 1778 }
1779 1779
1780 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) { 1780 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) {
1781 Run(8000, 16000, 1000); 1781 Run(8000, 16000, 1000);
1782 } 1782 }
1783 1783
1784 #endif 1784 #endif
1785 1785
1786 } // namespace webrtc 1786 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698