Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus_unittest.cc

Issue 2609583002: Log audio network adapter decisions in event log (cont'd)
Patch Set: adding comments to proto Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698