OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 ss << "wave frequency: " << wave_frequency << " ,"; | 46 ss << "wave frequency: " << wave_frequency << " ,"; |
47 return ss.str(); | 47 return ss.str(); |
48 } | 48 } |
49 | 49 |
50 AudioFrame frame1; | 50 AudioFrame frame1; |
51 AudioFrame frame2; | 51 AudioFrame frame2; |
52 AudioFrame audio_frame_for_mixing; | 52 AudioFrame audio_frame_for_mixing; |
53 | 53 |
54 void SetUpFrames(int sample_rate_hz, int number_of_channels) { | 54 void SetUpFrames(int sample_rate_hz, int number_of_channels) { |
55 for (auto* frame : {&frame1, &frame2}) { | 55 for (auto* frame : {&frame1, &frame2}) { |
56 frame->UpdateFrame(-1, 0, nullptr, | 56 frame->UpdateFrame(0, nullptr, rtc::CheckedDivExact(sample_rate_hz, 100), |
57 rtc::CheckedDivExact(sample_rate_hz, 100), | |
58 sample_rate_hz, AudioFrame::kNormalSpeech, | 57 sample_rate_hz, AudioFrame::kNormalSpeech, |
59 AudioFrame::kVadActive, number_of_channels); | 58 AudioFrame::kVadActive, number_of_channels); |
60 } | 59 } |
61 } | 60 } |
62 } // namespace | 61 } // namespace |
63 | 62 |
64 TEST(FrameCombiner, BasicApiCallsLimiter) { | 63 TEST(FrameCombiner, BasicApiCallsLimiter) { |
65 FrameCombiner combiner(true); | 64 FrameCombiner combiner(true); |
66 for (const int rate : {8000, 16000, 32000, 48000}) { | 65 for (const int rate : {8000, 16000, 32000, 48000}) { |
67 for (const int number_of_channels : {1, 2}) { | 66 for (const int number_of_channels : {1, 2}) { |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 rtc::ArrayView<const int16_t>(frame1.data(), number_of_samples), | 196 rtc::ArrayView<const int16_t>(frame1.data(), number_of_samples), |
198 rtc::ArrayView<const int16_t>(audio_frame_for_mixing.data(), | 197 rtc::ArrayView<const int16_t>(audio_frame_for_mixing.data(), |
199 number_of_samples)); | 198 number_of_samples)); |
200 } | 199 } |
201 RTC_DCHECK_LT(cumulative_change, 10); | 200 RTC_DCHECK_LT(cumulative_change, 10); |
202 } | 201 } |
203 } | 202 } |
204 } | 203 } |
205 } | 204 } |
206 } // namespace webrtc | 205 } // namespace webrtc |
OLD | NEW |