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

Unified Diff: webrtc/media/engine/webrtcvideoengine2_unittest.cc

Issue 2042603002: Movable support for VideoReceiveStream::Config and avoid copies (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: git cl format Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/media/engine/webrtcvideoengine2_unittest.cc
diff --git a/webrtc/media/engine/webrtcvideoengine2_unittest.cc b/webrtc/media/engine/webrtcvideoengine2_unittest.cc
index 177ab9f22368fd705601cc29d59300b516d6662d..5561b209fc3fa97e0ca21a53b80070e9a831479d 100644
--- a/webrtc/media/engine/webrtcvideoengine2_unittest.cc
+++ b/webrtc/media/engine/webrtcvideoengine2_unittest.cc
@@ -2633,7 +2633,7 @@ TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsAcceptDefaultCodecs) {
EXPECT_TRUE(channel_->SetRecvParameters(parameters));
FakeVideoReceiveStream* stream = AddRecvStream();
- webrtc::VideoReceiveStream::Config config = stream->GetConfig();
+ const webrtc::VideoReceiveStream::Config& config = stream->GetConfig();
EXPECT_EQ(engine_.codecs()[0].name, config.decoders[0].payload_name);
EXPECT_EQ(engine_.codecs()[0].id, config.decoders[0].payload_type);
}
@@ -2671,7 +2671,7 @@ TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsWithoutFecDisablesFec) {
ASSERT_TRUE(channel_->SetSendParameters(send_parameters));
FakeVideoReceiveStream* stream = AddRecvStream();
- webrtc::VideoReceiveStream::Config config = stream->GetConfig();
+ const webrtc::VideoReceiveStream::Config& config = stream->GetConfig();
EXPECT_EQ(kUlpfecCodec.id, config.rtp.fec.ulpfec_payload_type);
pbos-webrtc 2016/06/06 16:15:34 Replace config.rtp.. with GetConfig().rtp in this
tommi 2016/06/08 09:49:39 Done.
@@ -2680,16 +2680,13 @@ TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsWithoutFecDisablesFec) {
ASSERT_TRUE(channel_->SetRecvParameters(recv_parameters));
stream = fake_call_->GetVideoReceiveStreams()[0];
ASSERT_TRUE(stream != NULL);
- config = stream->GetConfig();
- EXPECT_EQ(-1, config.rtp.fec.ulpfec_payload_type)
+ EXPECT_EQ(-1, stream->GetConfig().rtp.fec.ulpfec_payload_type)
<< "SetSendCodec without FEC should disable current FEC.";
}
TEST_F(WebRtcVideoChannel2Test, SetSendParamsWithoutFecDisablesReceivingFec) {
FakeVideoReceiveStream* stream = AddRecvStream();
- webrtc::VideoReceiveStream::Config config = stream->GetConfig();
-
- EXPECT_EQ(kUlpfecCodec.id, config.rtp.fec.ulpfec_payload_type);
+ EXPECT_EQ(kUlpfecCodec.id, stream->GetConfig().rtp.fec.ulpfec_payload_type);
cricket::VideoRecvParameters recv_parameters;
recv_parameters.codecs.push_back(kVp8Codec);
@@ -2698,16 +2695,14 @@ TEST_F(WebRtcVideoChannel2Test, SetSendParamsWithoutFecDisablesReceivingFec) {
ASSERT_TRUE(channel_->SetRecvParameters(recv_parameters));
stream = fake_call_->GetVideoReceiveStreams()[0];
ASSERT_TRUE(stream != NULL);
- config = stream->GetConfig();
- EXPECT_EQ(kUlpfecCodec.id, config.rtp.fec.ulpfec_payload_type)
+ EXPECT_EQ(kUlpfecCodec.id, stream->GetConfig().rtp.fec.ulpfec_payload_type)
<< "FEC should be enabled on the recieve stream.";
cricket::VideoSendParameters send_parameters;
send_parameters.codecs.push_back(kVp8Codec);
ASSERT_TRUE(channel_->SetSendParameters(send_parameters));
stream = fake_call_->GetVideoReceiveStreams()[0];
- config = stream->GetConfig();
- EXPECT_EQ(-1, config.rtp.fec.ulpfec_payload_type)
+ EXPECT_EQ(-1, stream->GetConfig().rtp.fec.ulpfec_payload_type)
<< "FEC should have been disabled when we know the other side won't do "
"FEC.";
@@ -2715,8 +2710,7 @@ TEST_F(WebRtcVideoChannel2Test, SetSendParamsWithoutFecDisablesReceivingFec) {
send_parameters.codecs.push_back(kUlpfecCodec);
ASSERT_TRUE(channel_->SetSendParameters(send_parameters));
stream = fake_call_->GetVideoReceiveStreams()[0];
- config = stream->GetConfig();
- EXPECT_EQ(kUlpfecCodec.id, config.rtp.fec.ulpfec_payload_type)
+ EXPECT_EQ(kUlpfecCodec.id, stream->GetConfig().rtp.fec.ulpfec_payload_type)
<< "FEC should be enabled on the recieve stream.";
}

Powered by Google App Engine
This is Rietveld 408576698