OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 if (overhead_bytes_per_packet) { | 94 if (overhead_bytes_per_packet) { |
95 Controller::NetworkMetrics network_metrics; | 95 Controller::NetworkMetrics network_metrics; |
96 network_metrics.overhead_bytes_per_packet = overhead_bytes_per_packet; | 96 network_metrics.overhead_bytes_per_packet = overhead_bytes_per_packet; |
97 controller->UpdateNetworkMetrics(network_metrics); | 97 controller->UpdateNetworkMetrics(network_metrics); |
98 } | 98 } |
99 } | 99 } |
100 | 100 |
101 void CheckDecision(FrameLengthController* controller, | 101 void CheckDecision(FrameLengthController* controller, |
102 const rtc::Optional<bool>& enable_fec, | 102 const rtc::Optional<bool>& enable_fec, |
103 int expected_frame_length_ms) { | 103 int expected_frame_length_ms) { |
104 AudioNetworkAdaptor::EncoderRuntimeConfig config; | 104 AudioEncoderRuntimeConfig config; |
105 config.enable_fec = enable_fec; | 105 config.enable_fec = enable_fec; |
106 controller->MakeDecision(&config); | 106 controller->MakeDecision(&config); |
107 EXPECT_EQ(rtc::Optional<int>(expected_frame_length_ms), | 107 EXPECT_EQ(rtc::Optional<int>(expected_frame_length_ms), |
108 config.frame_length_ms); | 108 config.frame_length_ms); |
109 } | 109 } |
110 | 110 |
111 } // namespace | 111 } // namespace |
112 | 112 |
113 TEST(FrameLengthControllerTest, DecreaseTo20MsOnHighUplinkBandwidth) { | 113 TEST(FrameLengthControllerTest, DecreaseTo20MsOnHighUplinkBandwidth) { |
114 auto controller = | 114 auto controller = |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 CheckDecision(controller.get(), rtc::Optional<bool>(), 60); | 404 CheckDecision(controller.get(), rtc::Optional<bool>(), 60); |
405 | 405 |
406 UpdateNetworkMetrics(controller.get(), | 406 UpdateNetworkMetrics(controller.get(), |
407 rtc::Optional<int>(kMediumBandwidthBps), | 407 rtc::Optional<int>(kMediumBandwidthBps), |
408 rtc::Optional<float>(kFlDecreasingPacketLossFraction), | 408 rtc::Optional<float>(kFlDecreasingPacketLossFraction), |
409 rtc::Optional<size_t>(kOverheadBytesPerPacket)); | 409 rtc::Optional<size_t>(kOverheadBytesPerPacket)); |
410 CheckDecision(controller.get(), rtc::Optional<bool>(), 20); | 410 CheckDecision(controller.get(), rtc::Optional<bool>(), 20); |
411 } | 411 } |
412 | 412 |
413 } // namespace webrtc | 413 } // namespace webrtc |
OLD | NEW |