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 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 mock.HandleCallbacks(test_is_done_.get(), fifo_audio_stream.get(), | 746 mock.HandleCallbacks(test_is_done_.get(), fifo_audio_stream.get(), |
747 kFullDuplexTimeInSec * kNumCallbacksPerSecond); | 747 kFullDuplexTimeInSec * kNumCallbacksPerSecond); |
748 // SetMaxPlayoutVolume(); | 748 // SetMaxPlayoutVolume(); |
749 EXPECT_EQ(0, audio_device()->RegisterAudioCallback(&mock)); | 749 EXPECT_EQ(0, audio_device()->RegisterAudioCallback(&mock)); |
750 StartRecording(); | 750 StartRecording(); |
751 StartPlayout(); | 751 StartPlayout(); |
752 test_is_done_->Wait( | 752 test_is_done_->Wait( |
753 std::max(kTestTimeOutInMilliseconds, 1000 * kFullDuplexTimeInSec)); | 753 std::max(kTestTimeOutInMilliseconds, 1000 * kFullDuplexTimeInSec)); |
754 StopPlayout(); | 754 StopPlayout(); |
755 StopRecording(); | 755 StopRecording(); |
756 EXPECT_LE(fifo_audio_stream->average_size(), 10); | 756 EXPECT_LE(fifo_audio_stream->average_size(), 10u); |
757 EXPECT_LE(fifo_audio_stream->largest_size(), 20); | 757 EXPECT_LE(fifo_audio_stream->largest_size(), 20u); |
758 } | 758 } |
759 | 759 |
760 // Measures loopback latency and reports the min, max and average values for | 760 // Measures loopback latency and reports the min, max and average values for |
761 // a full duplex audio session. | 761 // a full duplex audio session. |
762 // The latency is measured like so: | 762 // The latency is measured like so: |
763 // - Insert impulses periodically on the output side. | 763 // - Insert impulses periodically on the output side. |
764 // - Detect the impulses on the input side. | 764 // - Detect the impulses on the input side. |
765 // - Measure the time difference between the transmit time and receive time. | 765 // - Measure the time difference between the transmit time and receive time. |
766 // - Store time differences in a vector and calculate min, max and average. | 766 // - Store time differences in a vector and calculate min, max and average. |
767 // This test requires a special hardware called Audio Loopback Dongle. | 767 // This test requires a special hardware called Audio Loopback Dongle. |
(...skipping 10 matching lines...) Expand all Loading... |
778 // SetMaxPlayoutVolume(); | 778 // SetMaxPlayoutVolume(); |
779 // DisableBuiltInAECIfAvailable(); | 779 // DisableBuiltInAECIfAvailable(); |
780 StartRecording(); | 780 StartRecording(); |
781 StartPlayout(); | 781 StartPlayout(); |
782 test_is_done_->Wait( | 782 test_is_done_->Wait( |
783 std::max(kTestTimeOutInMilliseconds, 1000 * kMeasureLatencyTimeInSec)); | 783 std::max(kTestTimeOutInMilliseconds, 1000 * kMeasureLatencyTimeInSec)); |
784 StopPlayout(); | 784 StopPlayout(); |
785 StopRecording(); | 785 StopRecording(); |
786 // Verify that the correct number of transmitted impulses are detected. | 786 // Verify that the correct number of transmitted impulses are detected. |
787 EXPECT_EQ(latency_audio_stream->num_latency_values(), | 787 EXPECT_EQ(latency_audio_stream->num_latency_values(), |
788 kImpulseFrequencyInHz * kMeasureLatencyTimeInSec - 1); | 788 static_cast<size_t>( |
| 789 kImpulseFrequencyInHz * kMeasureLatencyTimeInSec - 1)); |
789 latency_audio_stream->PrintResults(); | 790 latency_audio_stream->PrintResults(); |
790 } | 791 } |
791 | 792 |
792 } // namespace webrtc | 793 } // namespace webrtc |
OLD | NEW |