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

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

Issue 1745003002: Move suspend_below_min_bitrate from VideoOptions to MediaConfig. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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) 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 1536 matching lines...) Expand 10 before | Expand all | Expand 10 after
1547 encoder_config.streams[0].temporal_layer_thresholds_bps[0]); 1547 encoder_config.streams[0].temporal_layer_thresholds_bps[0]);
1548 1548
1549 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); 1549 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL));
1550 } 1550 }
1551 1551
1552 TEST_F(WebRtcVideoChannel2Test, SuspendBelowMinBitrateDisabledByDefault) { 1552 TEST_F(WebRtcVideoChannel2Test, SuspendBelowMinBitrateDisabledByDefault) {
1553 FakeVideoSendStream* stream = AddSendStream(); 1553 FakeVideoSendStream* stream = AddSendStream();
1554 EXPECT_FALSE(stream->GetConfig().suspend_below_min_bitrate); 1554 EXPECT_FALSE(stream->GetConfig().suspend_below_min_bitrate);
1555 } 1555 }
1556 1556
1557 TEST_F(WebRtcVideoChannel2Test, SetOptionsWithSuspendBelowMinBitrate) { 1557 TEST_F(WebRtcVideoChannel2Test, SetOptionsWithSuspendBelowMinBitrate) {
pbos-webrtc 2016/02/29 13:20:31 Rename test to ConfigureSuspendBelowMinBitrate, ma
nisse-webrtc 2016/02/29 15:01:07 Renamed to SetMediaConfigSuspendBelowMinBitrate.
1558 send_parameters_.options.suspend_below_min_bitrate = 1558 MediaConfig media_config = MediaConfig();
1559 rtc::Optional<bool>(true); 1559 media_config.video.suspend_below_min_bitrate = true;
1560
1561 channel_.reset(
1562 engine_.CreateChannel(fake_call_.get(), media_config, VideoOptions()));
1563
1560 channel_->SetSendParameters(send_parameters_); 1564 channel_->SetSendParameters(send_parameters_);
1561 1565
1562 FakeVideoSendStream* stream = AddSendStream(); 1566 FakeVideoSendStream* stream = AddSendStream();
1563 EXPECT_TRUE(stream->GetConfig().suspend_below_min_bitrate); 1567 EXPECT_TRUE(stream->GetConfig().suspend_below_min_bitrate);
1564 1568
1565 send_parameters_.options.suspend_below_min_bitrate = 1569 media_config.video.suspend_below_min_bitrate = false;
1566 rtc::Optional<bool>(false); 1570 channel_.reset(
1571 engine_.CreateChannel(fake_call_.get(), media_config, VideoOptions()));
1572
1567 channel_->SetSendParameters(send_parameters_); 1573 channel_->SetSendParameters(send_parameters_);
1568 1574
1569 stream = fake_call_->GetVideoSendStreams()[0]; 1575 stream = fake_call_->GetVideoSendStreams()[0];
1570 EXPECT_FALSE(stream->GetConfig().suspend_below_min_bitrate); 1576 EXPECT_FALSE(stream->GetConfig().suspend_below_min_bitrate);
1571 } 1577 }
1572 1578
1573 TEST_F(WebRtcVideoChannel2Test, Vp8DenoisingEnabledByDefault) { 1579 TEST_F(WebRtcVideoChannel2Test, Vp8DenoisingEnabledByDefault) {
1574 FakeVideoSendStream* stream = AddSendStream(); 1580 FakeVideoSendStream* stream = AddSendStream();
1575 webrtc::VideoCodecVP8 vp8_settings; 1581 webrtc::VideoCodecVP8 vp8_settings;
1576 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; 1582 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set.";
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
1810 } 1816 }
1811 1817
1812 void WebRtcVideoChannel2Test::TestCpuAdaptation(bool enable_overuse, 1818 void WebRtcVideoChannel2Test::TestCpuAdaptation(bool enable_overuse,
1813 bool is_screenshare) { 1819 bool is_screenshare) {
1814 cricket::VideoCodec codec = kVp8Codec720p; 1820 cricket::VideoCodec codec = kVp8Codec720p;
1815 cricket::VideoSendParameters parameters; 1821 cricket::VideoSendParameters parameters;
1816 parameters.codecs.push_back(codec); 1822 parameters.codecs.push_back(codec);
1817 1823
1818 MediaConfig media_config = MediaConfig(); 1824 MediaConfig media_config = MediaConfig();
1819 if (!enable_overuse) { 1825 if (!enable_overuse) {
1820 media_config.enable_cpu_overuse_detection = false; 1826 media_config.video.enable_cpu_overuse_detection = false;
1821 } 1827 }
1822 channel_.reset( 1828 channel_.reset(
1823 engine_.CreateChannel(fake_call_.get(), media_config, VideoOptions())); 1829 engine_.CreateChannel(fake_call_.get(), media_config, VideoOptions()));
1824 1830
1825 EXPECT_TRUE(channel_->SetSendParameters(parameters)); 1831 EXPECT_TRUE(channel_->SetSendParameters(parameters));
1826 1832
1827 AddSendStream(); 1833 AddSendStream();
1828 1834
1829 cricket::FakeVideoCapturer capturer; 1835 cricket::FakeVideoCapturer capturer;
1830 capturer.SetScreencast(is_screenshare); 1836 capturer.SetScreencast(is_screenshare);
(...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after
3170 // Test that we normalize send codec format size in simulcast. 3176 // Test that we normalize send codec format size in simulcast.
3171 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { 3177 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) {
3172 cricket::VideoCodec codec(kVp8Codec270p); 3178 cricket::VideoCodec codec(kVp8Codec270p);
3173 codec.width += 1; 3179 codec.width += 1;
3174 codec.height += 1; 3180 codec.height += 1;
3175 VerifySimulcastSettings(codec, 2, 2); 3181 VerifySimulcastSettings(codec, 2, 2);
3176 } 3182 }
3177 } // namespace cricket 3183 } // namespace cricket
3178 3184
3179 #endif // HAVE_WEBRTC_VIDEO 3185 #endif // HAVE_WEBRTC_VIDEO
OLDNEW
« webrtc/media/engine/webrtcvideoengine2.cc ('K') | « webrtc/media/engine/webrtcvideoengine2.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698