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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 .WillOnce(Return(rtc::Optional<float>(*uplink_packet_loss))); | 90 .WillOnce(Return(rtc::Optional<float>(*uplink_packet_loss))); |
91 } | 91 } |
92 } | 92 } |
93 | 93 |
94 // Checks that the FEC decision and |uplink_packet_loss_fraction| given by | 94 // Checks that the FEC decision and |uplink_packet_loss_fraction| given by |
95 // |states->controller->MakeDecision| matches |expected_enable_fec| and | 95 // |states->controller->MakeDecision| matches |expected_enable_fec| and |
96 // |expected_uplink_packet_loss_fraction|, respectively. | 96 // |expected_uplink_packet_loss_fraction|, respectively. |
97 void CheckDecision(FecControllerPlrBasedTestStates* states, | 97 void CheckDecision(FecControllerPlrBasedTestStates* states, |
98 bool expected_enable_fec, | 98 bool expected_enable_fec, |
99 float expected_uplink_packet_loss_fraction) { | 99 float expected_uplink_packet_loss_fraction) { |
100 AudioNetworkAdaptor::EncoderRuntimeConfig config; | 100 AudioEncoderRuntimeConfig config; |
101 states->controller->MakeDecision(&config); | 101 states->controller->MakeDecision(&config); |
102 EXPECT_EQ(rtc::Optional<bool>(expected_enable_fec), config.enable_fec); | 102 EXPECT_EQ(rtc::Optional<bool>(expected_enable_fec), config.enable_fec); |
103 EXPECT_EQ(rtc::Optional<float>(expected_uplink_packet_loss_fraction), | 103 EXPECT_EQ(rtc::Optional<float>(expected_uplink_packet_loss_fraction), |
104 config.uplink_packet_loss_fraction); | 104 config.uplink_packet_loss_fraction); |
105 } | 105 } |
106 | 106 |
107 } // namespace | 107 } // namespace |
108 | 108 |
109 TEST(FecControllerPlrBasedTest, OutputInitValueWhenUplinkBandwidthUnknown) { | 109 TEST(FecControllerPlrBasedTest, OutputInitValueWhenUplinkBandwidthUnknown) { |
110 constexpr bool kInitialFecEnabled = true; | 110 constexpr bool kInitialFecEnabled = true; |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 kEnablingBandwidthHigh, kEnablingPacketLossAtHighBw), | 362 kEnablingBandwidthHigh, kEnablingPacketLossAtHighBw), |
363 Threshold(kDisablingBandwidthLow, kDisablingPacketLossAtLowBw, | 363 Threshold(kDisablingBandwidthLow, kDisablingPacketLossAtLowBw, |
364 kDisablingBandwidthHigh, kDisablingPacketLossAtHighBw), | 364 kDisablingBandwidthHigh, kDisablingPacketLossAtHighBw), |
365 0, nullptr), | 365 0, nullptr), |
366 std::move(mock_smoothing_filter))), | 366 std::move(mock_smoothing_filter))), |
367 "Check failed"); | 367 "Check failed"); |
368 } | 368 } |
369 #endif | 369 #endif |
370 | 370 |
371 } // namespace webrtc | 371 } // namespace webrtc |
OLD | NEW |