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

Side by Side Diff: webrtc/media/engine/webrtcvideoengine2_unittest.cc

Issue 1870283002: Don't reconfigure the encoder if the video options aren't changing. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@50
Patch Set: Created 4 years, 8 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
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2004 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 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after
1638 stream = SetDenoisingOption(parameters, true); 1638 stream = SetDenoisingOption(parameters, true);
1639 1639
1640 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; 1640 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set.";
1641 EXPECT_FALSE(vp8_settings.denoisingOn); 1641 EXPECT_FALSE(vp8_settings.denoisingOn);
1642 EXPECT_FALSE(vp8_settings.automaticResizeOn); 1642 EXPECT_FALSE(vp8_settings.automaticResizeOn);
1643 EXPECT_FALSE(vp8_settings.frameDroppingOn); 1643 EXPECT_FALSE(vp8_settings.frameDroppingOn);
1644 1644
1645 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); 1645 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL));
1646 } 1646 }
1647 1647
1648 // Test that setting the same options doesn't result in the encoder being
1649 // reconfigured.
1650 TEST_F(WebRtcVideoChannel2Test, SetIdenticalOptionsDoesntReconfigureEncoder) {
1651 VideoOptions options;
1652 cricket::FakeVideoCapturer capturer;
1653
1654 FakeVideoSendStream* send_stream = AddSendStream();
1655 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer));
1656 EXPECT_EQ(cricket::CS_RUNNING,
1657 capturer.Start(capturer.GetSupportedFormats()->front()));
1658 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, &options));
1659 EXPECT_TRUE(capturer.CaptureFrame());
1660 // Expect 2 reconfigurations at this point, from the initial configuration
1661 // and from the dimensions of the first frame.
1662 EXPECT_EQ(2, send_stream->num_encoder_reconfigurations());
1663
1664 // Set the options one more time and expect no additional reconfigurations.
1665 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, &options));
1666 EXPECT_TRUE(capturer.CaptureFrame());
1667 EXPECT_EQ(2, send_stream->num_encoder_reconfigurations());
1668
1669 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, nullptr));
1670 }
1671
1648 class Vp9SettingsTest : public WebRtcVideoChannel2Test { 1672 class Vp9SettingsTest : public WebRtcVideoChannel2Test {
1649 public: 1673 public:
1650 Vp9SettingsTest() : WebRtcVideoChannel2Test() { 1674 Vp9SettingsTest() : WebRtcVideoChannel2Test() {
1651 encoder_factory_.AddSupportedVideoCodecType(webrtc::kVideoCodecVP9, "VP9"); 1675 encoder_factory_.AddSupportedVideoCodecType(webrtc::kVideoCodecVP9, "VP9");
1652 } 1676 }
1653 virtual ~Vp9SettingsTest() {} 1677 virtual ~Vp9SettingsTest() {}
1654 1678
1655 protected: 1679 protected:
1656 void SetUp() override { 1680 void SetUp() override {
1657 engine_.SetExternalEncoderFactory(&encoder_factory_); 1681 engine_.SetExternalEncoderFactory(&encoder_factory_);
(...skipping 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after
3078 // Test that we normalize send codec format size in simulcast. 3102 // Test that we normalize send codec format size in simulcast.
3079 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { 3103 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) {
3080 cricket::VideoCodec codec(kVp8Codec270p); 3104 cricket::VideoCodec codec(kVp8Codec270p);
3081 codec.width += 1; 3105 codec.width += 1;
3082 codec.height += 1; 3106 codec.height += 1;
3083 VerifySimulcastSettings(codec, 2, 2); 3107 VerifySimulcastSettings(codec, 2, 2);
3084 } 3108 }
3085 } // namespace cricket 3109 } // namespace cricket
3086 3110
3087 #endif // HAVE_WEBRTC_VIDEO 3111 #endif // HAVE_WEBRTC_VIDEO
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698