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 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 | 31 |
32 void CheckDecision(DtxController* controller, | 32 void CheckDecision(DtxController* controller, |
33 const rtc::Optional<int>& uplink_bandwidth_bps, | 33 const rtc::Optional<int>& uplink_bandwidth_bps, |
34 bool expected_dtx_enabled) { | 34 bool expected_dtx_enabled) { |
35 if (uplink_bandwidth_bps) { | 35 if (uplink_bandwidth_bps) { |
36 Controller::NetworkMetrics network_metrics; | 36 Controller::NetworkMetrics network_metrics; |
37 network_metrics.uplink_bandwidth_bps = uplink_bandwidth_bps; | 37 network_metrics.uplink_bandwidth_bps = uplink_bandwidth_bps; |
38 controller->UpdateNetworkMetrics(network_metrics); | 38 controller->UpdateNetworkMetrics(network_metrics); |
39 } | 39 } |
40 AudioNetworkAdaptor::EncoderRuntimeConfig config; | 40 AudioEncoderRuntimeConfig config; |
41 controller->MakeDecision(&config); | 41 controller->MakeDecision(&config); |
42 EXPECT_EQ(rtc::Optional<bool>(expected_dtx_enabled), config.enable_dtx); | 42 EXPECT_EQ(rtc::Optional<bool>(expected_dtx_enabled), config.enable_dtx); |
43 } | 43 } |
44 | 44 |
45 } // namespace | 45 } // namespace |
46 | 46 |
47 TEST(DtxControllerTest, OutputInitValueWhenUplinkBandwidthUnknown) { | 47 TEST(DtxControllerTest, OutputInitValueWhenUplinkBandwidthUnknown) { |
48 constexpr bool kInitialDtxEnabled = true; | 48 constexpr bool kInitialDtxEnabled = true; |
49 auto controller = CreateController(kInitialDtxEnabled); | 49 auto controller = CreateController(kInitialDtxEnabled); |
50 CheckDecision(controller.get(), rtc::Optional<int>(), kInitialDtxEnabled); | 50 CheckDecision(controller.get(), rtc::Optional<int>(), kInitialDtxEnabled); |
(...skipping 29 matching lines...) Expand all Loading... |
80 false); | 80 false); |
81 CheckDecision(controller.get(), rtc::Optional<int>(kDtxEnablingBandwidthBps), | 81 CheckDecision(controller.get(), rtc::Optional<int>(kDtxEnablingBandwidthBps), |
82 true); | 82 true); |
83 CheckDecision(controller.get(), rtc::Optional<int>(kMediumBandwidthBps), | 83 CheckDecision(controller.get(), rtc::Optional<int>(kMediumBandwidthBps), |
84 true); | 84 true); |
85 CheckDecision(controller.get(), rtc::Optional<int>(kDtxDisablingBandwidthBps), | 85 CheckDecision(controller.get(), rtc::Optional<int>(kDtxDisablingBandwidthBps), |
86 false); | 86 false); |
87 } | 87 } |
88 | 88 |
89 } // namespace webrtc | 89 } // namespace webrtc |
OLD | NEW |