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

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: Remove some more code. 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
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 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1127 1127
1128 ASSERT_EQ(rtx_ssrcs.size(), send_stream->GetConfig().rtp.rtx.ssrcs.size()); 1128 ASSERT_EQ(rtx_ssrcs.size(), send_stream->GetConfig().rtp.rtx.ssrcs.size());
1129 for (size_t i = 0; i < rtx_ssrcs.size(); ++i) 1129 for (size_t i = 0; i < rtx_ssrcs.size(); ++i)
1130 EXPECT_EQ(rtx_ssrcs[i], send_stream->GetConfig().rtp.rtx.ssrcs[i]); 1130 EXPECT_EQ(rtx_ssrcs[i], send_stream->GetConfig().rtp.rtx.ssrcs[i]);
1131 1131
1132 // Receiver side. 1132 // Receiver side.
1133 FakeVideoReceiveStream* recv_stream = AddRecvStream( 1133 FakeVideoReceiveStream* recv_stream = AddRecvStream(
1134 cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs)); 1134 cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs));
1135 ASSERT_GT(recv_stream->GetConfig().rtp.rtx.size(), 0u) 1135 ASSERT_GT(recv_stream->GetConfig().rtp.rtx.size(), 0u)
1136 << "No SSRCs for RTX configured by AddRecvStream."; 1136 << "No SSRCs for RTX configured by AddRecvStream.";
1137 ASSERT_EQ(1u, recv_stream->GetConfig().rtp.rtx.size())
1138 << "This test only works with one receive codec. Please update the test.";
1139 EXPECT_EQ(rtx_ssrcs[0], 1137 EXPECT_EQ(rtx_ssrcs[0],
1140 recv_stream->GetConfig().rtp.rtx.begin()->second.ssrc); 1138 recv_stream->GetConfig().rtp.rtx.begin()->second.ssrc);
1141 // TODO(pbos): Make sure we set the RTX for correct payloads etc. 1139 // TODO(pbos): Make sure we set the RTX for correct payloads etc.
1142 } 1140 }
1143 1141
1144 TEST_F(WebRtcVideoChannel2Test, RecvStreamWithRtx) { 1142 TEST_F(WebRtcVideoChannel2Test, RecvStreamWithRtx) {
1145 // Setup one channel with an associated RTX stream. 1143 // Setup one channel with an associated RTX stream.
1146 cricket::StreamParams params = 1144 cricket::StreamParams params =
1147 cricket::StreamParams::CreateLegacy(kSsrcs1[0]); 1145 cricket::StreamParams::CreateLegacy(kSsrcs1[0]);
1148 params.AddFidSsrc(kSsrcs1[0], kRtxSsrcs1[0]); 1146 params.AddFidSsrc(kSsrcs1[0], kRtxSsrcs1[0]);
1149 FakeVideoReceiveStream* recv_stream = AddRecvStream(params); 1147 FakeVideoReceiveStream* recv_stream = AddRecvStream(params);
1150 ASSERT_EQ(1u, recv_stream->GetConfig().rtp.rtx.size());
1151 EXPECT_EQ(kRtxSsrcs1[0], 1148 EXPECT_EQ(kRtxSsrcs1[0],
1152 recv_stream->GetConfig().rtp.rtx.begin()->second.ssrc); 1149 recv_stream->GetConfig().rtp.rtx.begin()->second.ssrc);
1153 } 1150 }
1154 1151
1155 TEST_F(WebRtcVideoChannel2Test, RecvStreamNoRtx) { 1152 TEST_F(WebRtcVideoChannel2Test, RecvStreamNoRtx) {
1156 // Setup one channel without an associated RTX stream. 1153 // Setup one channel without an associated RTX stream.
1157 cricket::StreamParams params = 1154 cricket::StreamParams params =
1158 cricket::StreamParams::CreateLegacy(kSsrcs1[0]); 1155 cricket::StreamParams::CreateLegacy(kSsrcs1[0]);
1159 FakeVideoReceiveStream* recv_stream = AddRecvStream(params); 1156 FakeVideoReceiveStream* recv_stream = AddRecvStream(params);
1160 ASSERT_TRUE(recv_stream->GetConfig().rtp.rtx.empty()); 1157 ASSERT_TRUE(recv_stream->GetConfig().rtp.rtx.empty());
(...skipping 1654 matching lines...) Expand 10 before | Expand all | Expand 10 after
2815 << "No default receive stream created."; 2812 << "No default receive stream created.";
2816 FakeVideoReceiveStream* recv_stream = fake_call_->GetVideoReceiveStreams()[0]; 2813 FakeVideoReceiveStream* recv_stream = fake_call_->GetVideoReceiveStreams()[0];
2817 EXPECT_EQ(0u, recv_stream->GetConfig().rtp.rtx.size()) 2814 EXPECT_EQ(0u, recv_stream->GetConfig().rtp.rtx.size())
2818 << "Default receive stream should not have configured RTX"; 2815 << "Default receive stream should not have configured RTX";
2819 2816
2820 EXPECT_TRUE(channel_->AddRecvStream( 2817 EXPECT_TRUE(channel_->AddRecvStream(
2821 cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs))); 2818 cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs)));
2822 ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size()) 2819 ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size())
2823 << "AddRecvStream should've reconfigured, not added a new receiver."; 2820 << "AddRecvStream should've reconfigured, not added a new receiver.";
2824 recv_stream = fake_call_->GetVideoReceiveStreams()[0]; 2821 recv_stream = fake_call_->GetVideoReceiveStreams()[0];
2825 ASSERT_EQ(1u, recv_stream->GetConfig().rtp.rtx.size()); 2822 ASSERT_GE(2u, recv_stream->GetConfig().rtp.rtx.size());
2826 EXPECT_EQ(rtx_ssrcs[0], 2823 EXPECT_EQ(rtx_ssrcs[0],
2827 recv_stream->GetConfig().rtp.rtx.begin()->second.ssrc); 2824 recv_stream->GetConfig().rtp.rtx.begin()->second.ssrc);
2828 } 2825 }
2829 2826
2830 TEST_F(WebRtcVideoChannel2Test, RejectsAddingStreamsWithMissingSsrcsForRtx) { 2827 TEST_F(WebRtcVideoChannel2Test, RejectsAddingStreamsWithMissingSsrcsForRtx) {
2831 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); 2828 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
2832 2829
2833 const std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs1); 2830 const std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs1);
2834 const std::vector<uint32_t> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1); 2831 const std::vector<uint32_t> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1);
2835 2832
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
3412 // reapplied when disabling screencasting. 3409 // reapplied when disabling screencasting.
3413 TEST_F(WebRtcVideoChannel2SimulcastTest, 3410 TEST_F(WebRtcVideoChannel2SimulcastTest,
3414 DISABLED_TwoTemporalLayerScreencastSettings) { 3411 DISABLED_TwoTemporalLayerScreencastSettings) {
3415 // TODO(pbos): Implement. 3412 // TODO(pbos): Implement.
3416 FAIL() << "Not implemented."; 3413 FAIL() << "Not implemented.";
3417 } 3414 }
3418 3415
3419 } // namespace cricket 3416 } // namespace cricket
3420 3417
3421 #endif // HAVE_WEBRTC_VIDEO 3418 #endif // HAVE_WEBRTC_VIDEO
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698