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

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

Issue 2542413002: Generalize FlexfecReceiveStream::Config. (CL1) (Closed)
Patch Set: Rebase. Created 4 years 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') | webrtc/test/call_test.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 * 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 2845 matching lines...) Expand 10 before | Expand all | Expand 10 after
2856 send_parameters.codecs.push_back(GetEngineCodec("flexfec-03")); 2856 send_parameters.codecs.push_back(GetEngineCodec("flexfec-03"));
2857 ASSERT_TRUE(channel_->SetSendParameters(send_parameters)); 2857 ASSERT_TRUE(channel_->SetSendParameters(send_parameters));
2858 2858
2859 AddRecvStream( 2859 AddRecvStream(
2860 CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc)); 2860 CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc));
2861 const std::list<FakeFlexfecReceiveStream>& streams = 2861 const std::list<FakeFlexfecReceiveStream>& streams =
2862 fake_call_->GetFlexfecReceiveStreams(); 2862 fake_call_->GetFlexfecReceiveStreams();
2863 2863
2864 ASSERT_EQ(1U, streams.size()); 2864 ASSERT_EQ(1U, streams.size());
2865 const FakeFlexfecReceiveStream& stream = streams.front(); 2865 const FakeFlexfecReceiveStream& stream = streams.front();
2866 EXPECT_EQ(GetEngineCodec("flexfec-03").id, 2866 EXPECT_EQ(GetEngineCodec("flexfec-03").id, stream.GetConfig().payload_type);
2867 stream.GetConfig().flexfec_payload_type); 2867 EXPECT_EQ(kFlexfecSsrc, stream.GetConfig().remote_ssrc);
2868 EXPECT_EQ(kFlexfecSsrc, stream.GetConfig().flexfec_ssrc);
2869 ASSERT_EQ(1U, stream.GetConfig().protected_media_ssrcs.size()); 2868 ASSERT_EQ(1U, stream.GetConfig().protected_media_ssrcs.size());
2870 EXPECT_EQ(kSsrcs1[0], stream.GetConfig().protected_media_ssrcs[0]); 2869 EXPECT_EQ(kSsrcs1[0], stream.GetConfig().protected_media_ssrcs[0]);
2871 2870
2872 cricket::VideoRecvParameters recv_parameters; 2871 cricket::VideoRecvParameters recv_parameters;
2873 recv_parameters.codecs.push_back(GetEngineCodec("VP8")); 2872 recv_parameters.codecs.push_back(GetEngineCodec("VP8"));
2874 ASSERT_TRUE(channel_->SetRecvParameters(recv_parameters)); 2873 ASSERT_TRUE(channel_->SetRecvParameters(recv_parameters));
2875 EXPECT_TRUE(streams.empty()) 2874 EXPECT_TRUE(streams.empty())
2876 << "SetSendCodec without FlexFEC should disable current FlexFEC."; 2875 << "SetSendCodec without FlexFEC should disable current FlexFEC.";
2877 } 2876 }
2878 2877
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
2911 const std::list<FakeFlexfecReceiveStream>& streams = 2910 const std::list<FakeFlexfecReceiveStream>& streams =
2912 fake_call_->GetFlexfecReceiveStreams(); 2911 fake_call_->GetFlexfecReceiveStreams();
2913 2912
2914 cricket::VideoRecvParameters recv_parameters; 2913 cricket::VideoRecvParameters recv_parameters;
2915 recv_parameters.codecs.push_back(GetEngineCodec("VP8")); 2914 recv_parameters.codecs.push_back(GetEngineCodec("VP8"));
2916 recv_parameters.codecs.push_back(GetEngineCodec("flexfec-03")); 2915 recv_parameters.codecs.push_back(GetEngineCodec("flexfec-03"));
2917 ASSERT_TRUE(channel_->SetRecvParameters(recv_parameters)); 2916 ASSERT_TRUE(channel_->SetRecvParameters(recv_parameters));
2918 ASSERT_EQ(1U, streams.size()); 2917 ASSERT_EQ(1U, streams.size());
2919 const FakeFlexfecReceiveStream& stream_with_recv_params = streams.front(); 2918 const FakeFlexfecReceiveStream& stream_with_recv_params = streams.front();
2920 EXPECT_EQ(GetEngineCodec("flexfec-03").id, 2919 EXPECT_EQ(GetEngineCodec("flexfec-03").id,
2921 stream_with_recv_params.GetConfig().flexfec_payload_type); 2920 stream_with_recv_params.GetConfig().payload_type);
2922 EXPECT_EQ(kFlexfecSsrc, stream_with_recv_params.GetConfig().flexfec_ssrc); 2921 EXPECT_EQ(kFlexfecSsrc, stream_with_recv_params.GetConfig().remote_ssrc);
2923 EXPECT_EQ(1U, 2922 EXPECT_EQ(1U,
2924 stream_with_recv_params.GetConfig().protected_media_ssrcs.size()); 2923 stream_with_recv_params.GetConfig().protected_media_ssrcs.size());
2925 EXPECT_EQ(kSsrcs1[0], 2924 EXPECT_EQ(kSsrcs1[0],
2926 stream_with_recv_params.GetConfig().protected_media_ssrcs[0]); 2925 stream_with_recv_params.GetConfig().protected_media_ssrcs[0]);
2927 2926
2928 cricket::VideoSendParameters send_parameters; 2927 cricket::VideoSendParameters send_parameters;
2929 send_parameters.codecs.push_back(GetEngineCodec("VP8")); 2928 send_parameters.codecs.push_back(GetEngineCodec("VP8"));
2930 send_parameters.codecs.push_back(GetEngineCodec("flexfec-03")); 2929 send_parameters.codecs.push_back(GetEngineCodec("flexfec-03"));
2931 ASSERT_TRUE(channel_->SetSendParameters(send_parameters)); 2930 ASSERT_TRUE(channel_->SetSendParameters(send_parameters));
2932 ASSERT_EQ(1U, streams.size()); 2931 ASSERT_EQ(1U, streams.size());
2933 const FakeFlexfecReceiveStream& stream_with_send_params = streams.front(); 2932 const FakeFlexfecReceiveStream& stream_with_send_params = streams.front();
2934 EXPECT_EQ(GetEngineCodec("flexfec-03").id, 2933 EXPECT_EQ(GetEngineCodec("flexfec-03").id,
2935 stream_with_send_params.GetConfig().flexfec_payload_type); 2934 stream_with_send_params.GetConfig().payload_type);
2936 EXPECT_EQ(kFlexfecSsrc, stream_with_send_params.GetConfig().flexfec_ssrc); 2935 EXPECT_EQ(kFlexfecSsrc, stream_with_send_params.GetConfig().remote_ssrc);
2937 EXPECT_EQ(1U, 2936 EXPECT_EQ(1U,
2938 stream_with_send_params.GetConfig().protected_media_ssrcs.size()); 2937 stream_with_send_params.GetConfig().protected_media_ssrcs.size());
2939 EXPECT_EQ(kSsrcs1[0], 2938 EXPECT_EQ(kSsrcs1[0],
2940 stream_with_send_params.GetConfig().protected_media_ssrcs[0]); 2939 stream_with_send_params.GetConfig().protected_media_ssrcs[0]);
2941 } 2940 }
2942 2941
2943 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsRejectDuplicateFecPayloads) { 2942 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsRejectDuplicateFecPayloads) {
2944 cricket::VideoRecvParameters parameters; 2943 cricket::VideoRecvParameters parameters;
2945 parameters.codecs.push_back(GetEngineCodec("VP8")); 2944 parameters.codecs.push_back(GetEngineCodec("VP8"));
2946 parameters.codecs.push_back(GetEngineCodec("red")); 2945 parameters.codecs.push_back(GetEngineCodec("red"));
(...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after
4042 4041
4043 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWith3SimulcastStreams) { 4042 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWith3SimulcastStreams) {
4044 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 3); 4043 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 3);
4045 } 4044 }
4046 4045
4047 // Test that we normalize send codec format size in simulcast. 4046 // Test that we normalize send codec format size in simulcast.
4048 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { 4047 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) {
4049 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 541, 271, 2, 2); 4048 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 541, 271, 2, 2);
4050 } 4049 }
4051 } // namespace cricket 4050 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2.cc ('k') | webrtc/test/call_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698