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

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

Issue 1840043005: Don't reconfigure the encoder if the video options aren't changing. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: removing whitespace 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 1793 matching lines...) Expand 10 before | Expand all | Expand 10 after
1804 stream = SetDenoisingOption(last_ssrc_, &capturer, true); 1804 stream = SetDenoisingOption(last_ssrc_, &capturer, true);
1805 1805
1806 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; 1806 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set.";
1807 EXPECT_FALSE(vp8_settings.denoisingOn); 1807 EXPECT_FALSE(vp8_settings.denoisingOn);
1808 EXPECT_FALSE(vp8_settings.automaticResizeOn); 1808 EXPECT_FALSE(vp8_settings.automaticResizeOn);
1809 EXPECT_FALSE(vp8_settings.frameDroppingOn); 1809 EXPECT_FALSE(vp8_settings.frameDroppingOn);
1810 1810
1811 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); 1811 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL));
1812 } 1812 }
1813 1813
1814 // Test that setting the same options doesn't result in the encoder being
1815 // reconfigured.
1816 TEST_F(WebRtcVideoChannel2Test, SetIdenticalOptionsDoesntReconfigureEncoder) {
1817 VideoOptions options;
1818 cricket::FakeVideoCapturer capturer;
1819
1820 FakeVideoSendStream* send_stream = AddSendStream();
1821 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer));
1822 EXPECT_EQ(cricket::CS_RUNNING,
1823 capturer.Start(capturer.GetSupportedFormats()->front()));
1824 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, &options));
1825 EXPECT_TRUE(capturer.CaptureFrame());
1826 // Expect 2 reconfigurations at this point, from the initial configuration
1827 // and from the dimensions of the first frame.
1828 EXPECT_EQ(2, send_stream->num_encoder_reconfigurations());
1829
1830 // Set the options one more time and expect no additional reconfigurations.
1831 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, &options));
1832 EXPECT_TRUE(capturer.CaptureFrame());
1833 EXPECT_EQ(2, send_stream->num_encoder_reconfigurations());
1834
1835 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, nullptr));
1836 }
1837
1814 class Vp9SettingsTest : public WebRtcVideoChannel2Test { 1838 class Vp9SettingsTest : public WebRtcVideoChannel2Test {
1815 public: 1839 public:
1816 Vp9SettingsTest() : Vp9SettingsTest("") {} 1840 Vp9SettingsTest() : Vp9SettingsTest("") {}
1817 explicit Vp9SettingsTest(const char* field_trials) 1841 explicit Vp9SettingsTest(const char* field_trials)
1818 : WebRtcVideoChannel2Test(field_trials) { 1842 : WebRtcVideoChannel2Test(field_trials) {
1819 encoder_factory_.AddSupportedVideoCodecType(webrtc::kVideoCodecVP9, "VP9"); 1843 encoder_factory_.AddSupportedVideoCodecType(webrtc::kVideoCodecVP9, "VP9");
1820 } 1844 }
1821 virtual ~Vp9SettingsTest() {} 1845 virtual ~Vp9SettingsTest() {}
1822 1846
1823 protected: 1847 protected:
(...skipping 1666 matching lines...) Expand 10 before | Expand all | Expand 10 after
3490 } 3514 }
3491 3515
3492 // Test that we normalize send codec format size in simulcast. 3516 // Test that we normalize send codec format size in simulcast.
3493 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { 3517 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) {
3494 cricket::VideoCodec codec(kVp8Codec270p); 3518 cricket::VideoCodec codec(kVp8Codec270p);
3495 codec.width += 1; 3519 codec.width += 1;
3496 codec.height += 1; 3520 codec.height += 1;
3497 VerifySimulcastSettings(codec, 2, 2); 3521 VerifySimulcastSettings(codec, 2, 2);
3498 } 3522 }
3499 } // namespace cricket 3523 } // namespace cricket
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