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 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 fifo_audio_stream.get(), | 1013 fifo_audio_stream.get(), |
1014 kFullDuplexTimeInSec * kNumCallbacksPerSecond); | 1014 kFullDuplexTimeInSec * kNumCallbacksPerSecond); |
1015 SetMaxPlayoutVolume(); | 1015 SetMaxPlayoutVolume(); |
1016 EXPECT_EQ(0, audio_device()->RegisterAudioCallback(&mock)); | 1016 EXPECT_EQ(0, audio_device()->RegisterAudioCallback(&mock)); |
1017 StartRecording(); | 1017 StartRecording(); |
1018 StartPlayout(); | 1018 StartPlayout(); |
1019 test_is_done_->Wait(std::max(kTestTimeOutInMilliseconds, | 1019 test_is_done_->Wait(std::max(kTestTimeOutInMilliseconds, |
1020 1000 * kFullDuplexTimeInSec)); | 1020 1000 * kFullDuplexTimeInSec)); |
1021 StopPlayout(); | 1021 StopPlayout(); |
1022 StopRecording(); | 1022 StopRecording(); |
1023 EXPECT_LE(fifo_audio_stream->average_size(), 10u); | 1023 |
1024 EXPECT_LE(fifo_audio_stream->largest_size(), 20u); | 1024 // These thresholds are set rather high to accomodate differences in hardware |
| 1025 // in several devices, so this test can be used in swarming. |
| 1026 // See http://bugs.webrtc.org/6464 |
| 1027 EXPECT_LE(fifo_audio_stream->average_size(), 30u); |
| 1028 EXPECT_LE(fifo_audio_stream->largest_size(), 40u); |
1025 } | 1029 } |
1026 | 1030 |
1027 // Measures loopback latency and reports the min, max and average values for | 1031 // Measures loopback latency and reports the min, max and average values for |
1028 // a full duplex audio session. | 1032 // a full duplex audio session. |
1029 // The latency is measured like so: | 1033 // The latency is measured like so: |
1030 // - Insert impulses periodically on the output side. | 1034 // - Insert impulses periodically on the output side. |
1031 // - Detect the impulses on the input side. | 1035 // - Detect the impulses on the input side. |
1032 // - Measure the time difference between the transmit time and receive time. | 1036 // - Measure the time difference between the transmit time and receive time. |
1033 // - Store time differences in a vector and calculate min, max and average. | 1037 // - Store time differences in a vector and calculate min, max and average. |
1034 // This test requires a special hardware called Audio Loopback Dongle. | 1038 // This test requires a special hardware called Audio Loopback Dongle. |
(...skipping 17 matching lines...) Expand all Loading... |
1052 StopPlayout(); | 1056 StopPlayout(); |
1053 StopRecording(); | 1057 StopRecording(); |
1054 // Verify that the correct number of transmitted impulses are detected. | 1058 // Verify that the correct number of transmitted impulses are detected. |
1055 EXPECT_EQ(latency_audio_stream->num_latency_values(), | 1059 EXPECT_EQ(latency_audio_stream->num_latency_values(), |
1056 static_cast<size_t>( | 1060 static_cast<size_t>( |
1057 kImpulseFrequencyInHz * kMeasureLatencyTimeInSec - 1)); | 1061 kImpulseFrequencyInHz * kMeasureLatencyTimeInSec - 1)); |
1058 latency_audio_stream->PrintResults(); | 1062 latency_audio_stream->PrintResults(); |
1059 } | 1063 } |
1060 | 1064 |
1061 } // namespace webrtc | 1065 } // namespace webrtc |
OLD | NEW |