| 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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 PRINT("] "); | 343 PRINT("] "); |
| 344 for (auto it = latencies_.begin(); it != latencies_.end(); ++it) { | 344 for (auto it = latencies_.begin(); it != latencies_.end(); ++it) { |
| 345 PRINT("%d ", *it); | 345 PRINT("%d ", *it); |
| 346 } | 346 } |
| 347 PRINT("\n"); | 347 PRINT("\n"); |
| 348 PRINT("%s[min, max, avg]=[%d, %d, %d] ms\n", kTag, | 348 PRINT("%s[min, max, avg]=[%d, %d, %d] ms\n", kTag, |
| 349 min_latency(), max_latency(), average_latency()); | 349 min_latency(), max_latency(), average_latency()); |
| 350 } | 350 } |
| 351 | 351 |
| 352 int IndexToMilliseconds(double index) const { | 352 int IndexToMilliseconds(double index) const { |
| 353 return 10.0 * (index / frames_per_buffer_) + 0.5; | 353 return static_cast<int>(10.0 * (index / frames_per_buffer_) + 0.5); |
| 354 } | 354 } |
| 355 | 355 |
| 356 private: | 356 private: |
| 357 Clock* clock_; | 357 Clock* clock_; |
| 358 const int frames_per_buffer_; | 358 const int frames_per_buffer_; |
| 359 const int bytes_per_buffer_; | 359 const int bytes_per_buffer_; |
| 360 int play_count_; | 360 int play_count_; |
| 361 int rec_count_; | 361 int rec_count_; |
| 362 int64_t pulse_time_; | 362 int64_t pulse_time_; |
| 363 std::vector<int> latencies_; | 363 std::vector<int> latencies_; |
| (...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 992 1000 * kMeasureLatencyTimeInSec)); | 992 1000 * kMeasureLatencyTimeInSec)); |
| 993 StopPlayout(); | 993 StopPlayout(); |
| 994 StopRecording(); | 994 StopRecording(); |
| 995 // Verify that the correct number of transmitted impulses are detected. | 995 // Verify that the correct number of transmitted impulses are detected. |
| 996 EXPECT_EQ(latency_audio_stream->num_latency_values(), | 996 EXPECT_EQ(latency_audio_stream->num_latency_values(), |
| 997 kImpulseFrequencyInHz * kMeasureLatencyTimeInSec - 1); | 997 kImpulseFrequencyInHz * kMeasureLatencyTimeInSec - 1); |
| 998 latency_audio_stream->PrintResults(); | 998 latency_audio_stream->PrintResults(); |
| 999 } | 999 } |
| 1000 | 1000 |
| 1001 } // namespace webrtc | 1001 } // namespace webrtc |
| OLD | NEW |