| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 EXPECT_EQ(kMaxBitrateBps, target_bitrate); | 80 EXPECT_EQ(kMaxBitrateBps, target_bitrate); |
| 81 | 81 |
| 82 // Using as much for codec bitrate as nack rate, new target rate should share | 82 // Using as much for codec bitrate as nack rate, new target rate should share |
| 83 // both equally, but only be half of max (since that ceiling should be hit). | 83 // both equally, but only be half of max (since that ceiling should be hit). |
| 84 protection_callback_.nack_rate_bps_ = kMaxBitrateBps; | 84 protection_callback_.nack_rate_bps_ = kMaxBitrateBps; |
| 85 target_bitrate = media_opt_.SetTargetRates(kMaxBitrateBps, 30, 128, 100); | 85 target_bitrate = media_opt_.SetTargetRates(kMaxBitrateBps, 30, 128, 100); |
| 86 EXPECT_EQ(kMaxBitrateBps / 2, target_bitrate); | 86 EXPECT_EQ(kMaxBitrateBps / 2, target_bitrate); |
| 87 } | 87 } |
| 88 | 88 |
| 89 TEST_F(ProtectionBitrateCalculatorTest, NoProtection) { |
| 90 static const uint32_t kMaxBitrateBps = 130000; |
| 91 |
| 92 media_opt_.SetProtectionMethod(false /*enable_fec*/, false /* enable_nack */); |
| 93 media_opt_.SetEncodingData(kCodecBitrateBps, 640, 480, 30, 1, 1000); |
| 94 |
| 95 uint32_t target_bitrate = |
| 96 media_opt_.SetTargetRates(kMaxBitrateBps, 30, 128, 100); |
| 97 EXPECT_EQ(kMaxBitrateBps, target_bitrate); |
| 98 } |
| 99 |
| 89 } // namespace webrtc | 100 } // namespace webrtc |
| OLD | NEW |