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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
436 EXPECT_EQ(rtc::Optional<int>(8), config.GetNewComplexity()); | 436 EXPECT_EQ(rtc::Optional<int>(8), config.GetNewComplexity()); |
437 | 437 |
438 // Bitrate within hysteresis window. Expect empty output. | 438 // Bitrate within hysteresis window. Expect empty output. |
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 | |
447 TEST(AudioEncoderOpusTest, EmptyConfigDontAffectEncoderSettings) { | |
ivoc
2016/12/27 13:56:56
nit: Please rename to EmptyConfigDoesntAffectEncod
| |
448 auto states = CreateCodec(2); | |
449 states.encoder->EnableAudioNetworkAdaptor("", nullptr); | |
450 | |
451 auto config = CreateEncoderRuntimeConfig(); | |
452 AudioNetworkAdaptor::EncoderRuntimeConfig empty_config; | |
453 | |
454 EXPECT_CALL(**states.mock_audio_network_adaptor, GetEncoderRuntimeConfig()) | |
455 .WillOnce(Return(config)) | |
456 .WillOnce(Return(empty_config)); | |
457 | |
458 constexpr size_t kOverhead = 64; | |
459 EXPECT_CALL(**states.mock_audio_network_adaptor, SetOverhead(kOverhead)) | |
460 .Times(2); | |
461 states.encoder->OnReceivedOverhead(kOverhead); | |
462 states.encoder->OnReceivedOverhead(kOverhead); | |
463 | |
464 CheckEncoderRuntimeConfig(states.encoder.get(), config); | |
465 } | |
466 | |
446 } // namespace webrtc | 467 } // namespace webrtc |
OLD | NEW |