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(0, nullptr, rtc::CheckedDivExact(sample_rate_hz, 100), | 56 frame->UpdateFrame(-1, 0, nullptr, |
| 57 rtc::CheckedDivExact(sample_rate_hz, 100), |
57 sample_rate_hz, AudioFrame::kNormalSpeech, | 58 sample_rate_hz, AudioFrame::kNormalSpeech, |
58 AudioFrame::kVadActive, number_of_channels); | 59 AudioFrame::kVadActive, number_of_channels); |
59 } | 60 } |
60 } | 61 } |
61 } // namespace | 62 } // namespace |
62 | 63 |
63 TEST(FrameCombiner, BasicApiCallsLimiter) { | 64 TEST(FrameCombiner, BasicApiCallsLimiter) { |
64 FrameCombiner combiner(true); | 65 FrameCombiner combiner(true); |
65 for (const int rate : {8000, 16000, 32000, 48000}) { | 66 for (const int rate : {8000, 16000, 32000, 48000}) { |
66 for (const int number_of_channels : {1, 2}) { | 67 for (const int number_of_channels : {1, 2}) { |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 rtc::ArrayView<const int16_t>(frame1.data(), number_of_samples), | 197 rtc::ArrayView<const int16_t>(frame1.data(), number_of_samples), |
197 rtc::ArrayView<const int16_t>(audio_frame_for_mixing.data(), | 198 rtc::ArrayView<const int16_t>(audio_frame_for_mixing.data(), |
198 number_of_samples)); | 199 number_of_samples)); |
199 } | 200 } |
200 RTC_DCHECK_LT(cumulative_change, 10); | 201 RTC_DCHECK_LT(cumulative_change, 10); |
201 } | 202 } |
202 } | 203 } |
203 } | 204 } |
204 } | 205 } |
205 } // namespace webrtc | 206 } // namespace webrtc |
OLD | NEW |