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

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

Issue 1649493004: Support multiple rtx codecs. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase. Created 4 years, 10 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 | « talk/media/webrtc/webrtcvideoengine2.cc ('k') | webrtc/config.cc » ('j') | 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 * libjingle 2 * libjingle
3 * Copyright 2004 Google Inc. 3 * Copyright 2004 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 1102
1103 ASSERT_EQ(rtx_ssrcs.size(), send_stream->GetConfig().rtp.rtx.ssrcs.size()); 1103 ASSERT_EQ(rtx_ssrcs.size(), send_stream->GetConfig().rtp.rtx.ssrcs.size());
1104 for (size_t i = 0; i < rtx_ssrcs.size(); ++i) 1104 for (size_t i = 0; i < rtx_ssrcs.size(); ++i)
1105 EXPECT_EQ(rtx_ssrcs[i], send_stream->GetConfig().rtp.rtx.ssrcs[i]); 1105 EXPECT_EQ(rtx_ssrcs[i], send_stream->GetConfig().rtp.rtx.ssrcs[i]);
1106 1106
1107 // Receiver side. 1107 // Receiver side.
1108 FakeVideoReceiveStream* recv_stream = AddRecvStream( 1108 FakeVideoReceiveStream* recv_stream = AddRecvStream(
1109 cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs)); 1109 cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs));
1110 ASSERT_GT(recv_stream->GetConfig().rtp.rtx.size(), 0u) 1110 ASSERT_GT(recv_stream->GetConfig().rtp.rtx.size(), 0u)
1111 << "No SSRCs for RTX configured by AddRecvStream."; 1111 << "No SSRCs for RTX configured by AddRecvStream.";
1112 ASSERT_EQ(1u, recv_stream->GetConfig().rtp.rtx.size())
1113 << "This test only works with one receive codec. Please update the test.";
1114 EXPECT_EQ(rtx_ssrcs[0], 1112 EXPECT_EQ(rtx_ssrcs[0],
1115 recv_stream->GetConfig().rtp.rtx.begin()->second.ssrc); 1113 recv_stream->GetConfig().rtp.rtx.begin()->second.ssrc);
1116 // TODO(pbos): Make sure we set the RTX for correct payloads etc. 1114 // TODO(pbos): Make sure we set the RTX for correct payloads etc.
1117 } 1115 }
1118 1116
1119 TEST_F(WebRtcVideoChannel2Test, RecvStreamWithRtx) { 1117 TEST_F(WebRtcVideoChannel2Test, RecvStreamWithRtx) {
1120 // Setup one channel with an associated RTX stream. 1118 // Setup one channel with an associated RTX stream.
1121 cricket::StreamParams params = 1119 cricket::StreamParams params =
1122 cricket::StreamParams::CreateLegacy(kSsrcs1[0]); 1120 cricket::StreamParams::CreateLegacy(kSsrcs1[0]);
1123 params.AddFidSsrc(kSsrcs1[0], kRtxSsrcs1[0]); 1121 params.AddFidSsrc(kSsrcs1[0], kRtxSsrcs1[0]);
1124 FakeVideoReceiveStream* recv_stream = AddRecvStream(params); 1122 FakeVideoReceiveStream* recv_stream = AddRecvStream(params);
1125 ASSERT_EQ(1u, recv_stream->GetConfig().rtp.rtx.size());
1126 EXPECT_EQ(kRtxSsrcs1[0], 1123 EXPECT_EQ(kRtxSsrcs1[0],
1127 recv_stream->GetConfig().rtp.rtx.begin()->second.ssrc); 1124 recv_stream->GetConfig().rtp.rtx.begin()->second.ssrc);
1128 } 1125 }
1129 1126
1130 TEST_F(WebRtcVideoChannel2Test, RecvStreamNoRtx) { 1127 TEST_F(WebRtcVideoChannel2Test, RecvStreamNoRtx) {
1131 // Setup one channel without an associated RTX stream. 1128 // Setup one channel without an associated RTX stream.
1132 cricket::StreamParams params = 1129 cricket::StreamParams params =
1133 cricket::StreamParams::CreateLegacy(kSsrcs1[0]); 1130 cricket::StreamParams::CreateLegacy(kSsrcs1[0]);
1134 FakeVideoReceiveStream* recv_stream = AddRecvStream(params); 1131 FakeVideoReceiveStream* recv_stream = AddRecvStream(params);
1135 ASSERT_TRUE(recv_stream->GetConfig().rtp.rtx.empty()); 1132 ASSERT_TRUE(recv_stream->GetConfig().rtp.rtx.empty());
(...skipping 1593 matching lines...) Expand 10 before | Expand all | Expand 10 after
2729 << "No default receive stream created."; 2726 << "No default receive stream created.";
2730 FakeVideoReceiveStream* recv_stream = fake_call_->GetVideoReceiveStreams()[0]; 2727 FakeVideoReceiveStream* recv_stream = fake_call_->GetVideoReceiveStreams()[0];
2731 EXPECT_EQ(0u, recv_stream->GetConfig().rtp.rtx.size()) 2728 EXPECT_EQ(0u, recv_stream->GetConfig().rtp.rtx.size())
2732 << "Default receive stream should not have configured RTX"; 2729 << "Default receive stream should not have configured RTX";
2733 2730
2734 EXPECT_TRUE(channel_->AddRecvStream( 2731 EXPECT_TRUE(channel_->AddRecvStream(
2735 cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs))); 2732 cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs)));
2736 ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size()) 2733 ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size())
2737 << "AddRecvStream should've reconfigured, not added a new receiver."; 2734 << "AddRecvStream should've reconfigured, not added a new receiver.";
2738 recv_stream = fake_call_->GetVideoReceiveStreams()[0]; 2735 recv_stream = fake_call_->GetVideoReceiveStreams()[0];
2739 ASSERT_EQ(1u, recv_stream->GetConfig().rtp.rtx.size()); 2736 ASSERT_GE(2u, recv_stream->GetConfig().rtp.rtx.size());
2740 EXPECT_EQ(rtx_ssrcs[0], 2737 EXPECT_EQ(rtx_ssrcs[0],
2741 recv_stream->GetConfig().rtp.rtx.begin()->second.ssrc); 2738 recv_stream->GetConfig().rtp.rtx.begin()->second.ssrc);
2742 } 2739 }
2743 2740
2744 TEST_F(WebRtcVideoChannel2Test, RejectsAddingStreamsWithMissingSsrcsForRtx) { 2741 TEST_F(WebRtcVideoChannel2Test, RejectsAddingStreamsWithMissingSsrcsForRtx) {
2745 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); 2742 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
2746 2743
2747 const std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs1); 2744 const std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs1);
2748 const std::vector<uint32_t> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1); 2745 const std::vector<uint32_t> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1);
2749 2746
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
3097 // Test that we normalize send codec format size in simulcast. 3094 // Test that we normalize send codec format size in simulcast.
3098 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { 3095 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) {
3099 cricket::VideoCodec codec(kVp8Codec270p); 3096 cricket::VideoCodec codec(kVp8Codec270p);
3100 codec.width += 1; 3097 codec.width += 1;
3101 codec.height += 1; 3098 codec.height += 1;
3102 VerifySimulcastSettings(codec, 2, 2); 3099 VerifySimulcastSettings(codec, 2, 2);
3103 } 3100 }
3104 } // namespace cricket 3101 } // namespace cricket
3105 3102
3106 #endif // HAVE_WEBRTC_VIDEO 3103 #endif // HAVE_WEBRTC_VIDEO
OLDNEW
« no previous file with comments | « talk/media/webrtc/webrtcvideoengine2.cc ('k') | webrtc/config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698