| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 config.bitrate_bps = rtc::Optional<int>(12500); | 439 config.bitrate_bps = rtc::Optional<int>(12500); |
| 440 EXPECT_EQ(rtc::Optional<int>(), config.GetNewComplexity()); | 440 EXPECT_EQ(rtc::Optional<int>(), config.GetNewComplexity()); |
| 441 | 441 |
| 442 // Bitrate above hysteresis window. Expect lower complexity. | 442 // Bitrate above hysteresis window. Expect lower complexity. |
| 443 config.bitrate_bps = rtc::Optional<int>(14001); | 443 config.bitrate_bps = rtc::Optional<int>(14001); |
| 444 EXPECT_EQ(rtc::Optional<int>(6), config.GetNewComplexity()); | 444 EXPECT_EQ(rtc::Optional<int>(6), config.GetNewComplexity()); |
| 445 } | 445 } |
| 446 | 446 |
| 447 TEST(AudioEncoderOpusTest, EmptyConfigDoesNotAffectEncoderSettings) { | 447 TEST(AudioEncoderOpusTest, EmptyConfigDoesNotAffectEncoderSettings) { |
| 448 auto states = CreateCodec(2); | 448 auto states = CreateCodec(2); |
| 449 states.encoder->EnableAudioNetworkAdaptor("", nullptr); | 449 states.encoder->EnableAudioNetworkAdaptor("", nullptr, nullptr); |
| 450 | 450 |
| 451 auto config = CreateEncoderRuntimeConfig(); | 451 auto config = CreateEncoderRuntimeConfig(); |
| 452 AudioNetworkAdaptor::EncoderRuntimeConfig empty_config; | 452 AudioNetworkAdaptor::EncoderRuntimeConfig empty_config; |
| 453 | 453 |
| 454 EXPECT_CALL(**states.mock_audio_network_adaptor, GetEncoderRuntimeConfig()) | 454 EXPECT_CALL(**states.mock_audio_network_adaptor, GetEncoderRuntimeConfig()) |
| 455 .WillOnce(Return(config)) | 455 .WillOnce(Return(config)) |
| 456 .WillOnce(Return(empty_config)); | 456 .WillOnce(Return(empty_config)); |
| 457 | 457 |
| 458 constexpr size_t kOverhead = 64; | 458 constexpr size_t kOverhead = 64; |
| 459 EXPECT_CALL(**states.mock_audio_network_adaptor, SetOverhead(kOverhead)) | 459 EXPECT_CALL(**states.mock_audio_network_adaptor, SetOverhead(kOverhead)) |
| 460 .Times(2); | 460 .Times(2); |
| 461 states.encoder->OnReceivedOverhead(kOverhead); | 461 states.encoder->OnReceivedOverhead(kOverhead); |
| 462 states.encoder->OnReceivedOverhead(kOverhead); | 462 states.encoder->OnReceivedOverhead(kOverhead); |
| 463 | 463 |
| 464 CheckEncoderRuntimeConfig(states.encoder.get(), config); | 464 CheckEncoderRuntimeConfig(states.encoder.get(), config); |
| 465 } | 465 } |
| 466 | 466 |
| 467 } // namespace webrtc | 467 } // namespace webrtc |
| OLD | NEW |