| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 EXPECT_TRUE(delay_controller->AnalyzeRender(render_block)); | 98 EXPECT_TRUE(delay_controller->AnalyzeRender(render_block)); |
| 99 delay_blocks = delay_controller->GetDelay(capture_block); | 99 delay_blocks = delay_controller->GetDelay(capture_block); |
| 100 } | 100 } |
| 101 EXPECT_FALSE(delay_controller->AlignmentHeadroomSamples()); | 101 EXPECT_FALSE(delay_controller->AlignmentHeadroomSamples()); |
| 102 EXPECT_EQ(0u, delay_blocks); | 102 EXPECT_EQ(0u, delay_blocks); |
| 103 } | 103 } |
| 104 } | 104 } |
| 105 | 105 |
| 106 // Verifies that the RenderDelayController is able to align the signals for | 106 // Verifies that the RenderDelayController is able to align the signals for |
| 107 // simple timeshifts between the signals. | 107 // simple timeshifts between the signals. |
| 108 // TODO(peah): Activate the unittest once the required code has been landed. | 108 TEST(RenderDelayController, Alignment) { |
| 109 TEST(RenderDelayController, DISABLED_Alignment) { | |
| 110 Random random_generator(42U); | 109 Random random_generator(42U); |
| 111 std::vector<float> render_block(kBlockSize, 0.f); | 110 std::vector<float> render_block(kBlockSize, 0.f); |
| 112 std::vector<float> capture_block(kBlockSize, 0.f); | 111 std::vector<float> capture_block(kBlockSize, 0.f); |
| 113 size_t delay_blocks = 0; | 112 size_t delay_blocks = 0; |
| 114 for (auto rate : {8000, 16000, 32000, 48000}) { | 113 for (auto rate : {8000, 16000, 32000, 48000}) { |
| 115 for (size_t delay_samples : {0, 50, 150, 200, 800, 4000}) { | 114 for (size_t delay_samples : {0, 50, 150, 200, 800, 4000}) { |
| 116 SCOPED_TRACE(ProduceDebugText(rate, delay_samples)); | 115 SCOPED_TRACE(ProduceDebugText(rate, delay_samples)); |
| 117 std::unique_ptr<RenderDelayBuffer> render_delay_buffer( | 116 std::unique_ptr<RenderDelayBuffer> render_delay_buffer( |
| 118 RenderDelayBuffer::Create(250, NumBandsForRate(rate), | 117 RenderDelayBuffer::Create(250, NumBandsForRate(rate), |
| 119 kMaxApiCallJitter)); | 118 kMaxApiCallJitter)); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 141 delay_controller->AlignmentHeadroomSamples(); | 140 delay_controller->AlignmentHeadroomSamples(); |
| 142 ASSERT_TRUE(headroom_samples); | 141 ASSERT_TRUE(headroom_samples); |
| 143 EXPECT_NEAR(delay_samples - delay_blocks * kBlockSize, *headroom_samples, | 142 EXPECT_NEAR(delay_samples - delay_blocks * kBlockSize, *headroom_samples, |
| 144 4); | 143 4); |
| 145 } | 144 } |
| 146 } | 145 } |
| 147 } | 146 } |
| 148 | 147 |
| 149 // Verifies that the RenderDelayController is able to align the signals for | 148 // Verifies that the RenderDelayController is able to align the signals for |
| 150 // simple timeshifts between the signals when there is jitter in the API calls. | 149 // simple timeshifts between the signals when there is jitter in the API calls. |
| 151 // TODO(peah): Activate the unittest once the required code has been landed. | 150 TEST(RenderDelayController, AlignmentWithJitter) { |
| 152 TEST(RenderDelayController, DISABLED_AlignmentWithJitter) { | |
| 153 Random random_generator(42U); | 151 Random random_generator(42U); |
| 154 std::vector<float> render_block(kBlockSize, 0.f); | 152 std::vector<float> render_block(kBlockSize, 0.f); |
| 155 std::vector<float> capture_block(kBlockSize, 0.f); | 153 std::vector<float> capture_block(kBlockSize, 0.f); |
| 156 for (auto rate : {8000, 16000, 32000, 48000}) { | 154 for (auto rate : {8000, 16000, 32000, 48000}) { |
| 157 for (size_t delay_samples : {0, 50, 800}) { | 155 for (size_t delay_samples : {0, 50, 800}) { |
| 158 for (size_t max_jitter : {1, 9, 20}) { | 156 for (size_t max_jitter : {1, 9, 20}) { |
| 159 size_t delay_blocks = 0; | 157 size_t delay_blocks = 0; |
| 160 SCOPED_TRACE(ProduceDebugText(rate, delay_samples, max_jitter)); | 158 SCOPED_TRACE(ProduceDebugText(rate, delay_samples, max_jitter)); |
| 161 std::unique_ptr<RenderDelayBuffer> render_delay_buffer( | 159 std::unique_ptr<RenderDelayBuffer> render_delay_buffer( |
| 162 RenderDelayBuffer::Create(250, NumBandsForRate(rate), max_jitter)); | 160 RenderDelayBuffer::Create(250, NumBandsForRate(rate), max_jitter)); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 kMaxApiCallJitter)); | 253 kMaxApiCallJitter)); |
| 256 EXPECT_DEATH(std::unique_ptr<RenderDelayController>( | 254 EXPECT_DEATH(std::unique_ptr<RenderDelayController>( |
| 257 RenderDelayController::Create(rate, *render_delay_buffer)), | 255 RenderDelayController::Create(rate, *render_delay_buffer)), |
| 258 ""); | 256 ""); |
| 259 } | 257 } |
| 260 } | 258 } |
| 261 | 259 |
| 262 #endif | 260 #endif |
| 263 | 261 |
| 264 } // namespace webrtc | 262 } // namespace webrtc |
| OLD | NEW |