| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 return rand_gen_.Rand(max); | 76 return rand_gen_.Rand(max); |
| 77 } | 77 } |
| 78 | 78 |
| 79 float RandFloat() { | 79 float RandFloat() { |
| 80 rtc::CritScope cs(&crit_); | 80 rtc::CritScope cs(&crit_); |
| 81 return rand_gen_.Rand<float>(); | 81 return rand_gen_.Rand<float>(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 private: | 84 private: |
| 85 rtc::CriticalSection crit_; | 85 rtc::CriticalSection crit_; |
| 86 Random rand_gen_ GUARDED_BY(crit_); | 86 Random rand_gen_ RTC_GUARDED_BY(crit_); |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 // Variables related to the audio data and formats. | 89 // Variables related to the audio data and formats. |
| 90 struct AudioFrameData { | 90 struct AudioFrameData { |
| 91 explicit AudioFrameData(int max_frame_size) { | 91 explicit AudioFrameData(int max_frame_size) { |
| 92 // Set up the two-dimensional arrays needed for the APM API calls. | 92 // Set up the two-dimensional arrays needed for the APM API calls. |
| 93 input_framechannels.resize(2 * max_frame_size); | 93 input_framechannels.resize(2 * max_frame_size); |
| 94 input_frame.resize(2); | 94 input_frame.resize(2); |
| 95 input_frame[0] = &input_framechannels[0]; | 95 input_frame[0] = &input_framechannels[0]; |
| 96 input_frame[1] = &input_framechannels[max_frame_size]; | 96 input_frame[1] = &input_framechannels[max_frame_size]; |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 return -CaptureMinusRenderCounters(); | 293 return -CaptureMinusRenderCounters(); |
| 294 } | 294 } |
| 295 | 295 |
| 296 bool BothCountersExceedeThreshold(int threshold) { | 296 bool BothCountersExceedeThreshold(int threshold) { |
| 297 rtc::CritScope cs(&crit_); | 297 rtc::CritScope cs(&crit_); |
| 298 return (render_count > threshold && capture_count > threshold); | 298 return (render_count > threshold && capture_count > threshold); |
| 299 } | 299 } |
| 300 | 300 |
| 301 private: | 301 private: |
| 302 rtc::CriticalSection crit_; | 302 rtc::CriticalSection crit_; |
| 303 int render_count GUARDED_BY(crit_) = 0; | 303 int render_count RTC_GUARDED_BY(crit_) = 0; |
| 304 int capture_count GUARDED_BY(crit_) = 0; | 304 int capture_count RTC_GUARDED_BY(crit_) = 0; |
| 305 }; | 305 }; |
| 306 | 306 |
| 307 // Class for handling the capture side processing. | 307 // Class for handling the capture side processing. |
| 308 class CaptureProcessor { | 308 class CaptureProcessor { |
| 309 public: | 309 public: |
| 310 CaptureProcessor(int max_frame_size, | 310 CaptureProcessor(int max_frame_size, |
| 311 RandomGenerator* rand_gen, | 311 RandomGenerator* rand_gen, |
| 312 rtc::Event* render_call_event, | 312 rtc::Event* render_call_event, |
| 313 rtc::Event* capture_call_event, | 313 rtc::Event* capture_call_event, |
| 314 FrameCounters* shared_counters_state, | 314 FrameCounters* shared_counters_state, |
| (...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1126 DISABLED_AudioProcessingImplLockExtensive, | 1126 DISABLED_AudioProcessingImplLockExtensive, |
| 1127 AudioProcessingImplLockTest, | 1127 AudioProcessingImplLockTest, |
| 1128 ::testing::ValuesIn(TestConfig::GenerateExtensiveTestConfigs())); | 1128 ::testing::ValuesIn(TestConfig::GenerateExtensiveTestConfigs())); |
| 1129 | 1129 |
| 1130 INSTANTIATE_TEST_CASE_P( | 1130 INSTANTIATE_TEST_CASE_P( |
| 1131 AudioProcessingImplLockBrief, | 1131 AudioProcessingImplLockBrief, |
| 1132 AudioProcessingImplLockTest, | 1132 AudioProcessingImplLockTest, |
| 1133 ::testing::ValuesIn(TestConfig::GenerateBriefTestConfigs())); | 1133 ::testing::ValuesIn(TestConfig::GenerateBriefTestConfigs())); |
| 1134 | 1134 |
| 1135 } // namespace webrtc | 1135 } // namespace webrtc |
| OLD | NEW |