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

Side by Side Diff: webrtc/video/end_to_end_tests.cc

Issue 2646073004: Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters. (Closed)
Patch Set: Created 3 years, 11 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) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 #include <algorithm> 10 #include <algorithm>
(...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 send_config->rtp.ulpfec.ulpfec_payload_type; 1078 send_config->rtp.ulpfec.ulpfec_payload_type;
1079 (*receive_configs)[0].rtp.ulpfec.red_payload_type = 1079 (*receive_configs)[0].rtp.ulpfec.red_payload_type =
1080 send_config->rtp.ulpfec.red_payload_type; 1080 send_config->rtp.ulpfec.red_payload_type;
1081 (*receive_configs)[0].rtp.ulpfec.red_rtx_payload_type = 1081 (*receive_configs)[0].rtp.ulpfec.red_rtx_payload_type =
1082 send_config->rtp.ulpfec.red_rtx_payload_type; 1082 send_config->rtp.ulpfec.red_rtx_payload_type;
1083 } 1083 }
1084 1084
1085 if (retransmission_ssrc_ == kSendRtxSsrcs[0]) { 1085 if (retransmission_ssrc_ == kSendRtxSsrcs[0]) {
1086 send_config->rtp.rtx.ssrcs.push_back(kSendRtxSsrcs[0]); 1086 send_config->rtp.rtx.ssrcs.push_back(kSendRtxSsrcs[0]);
1087 send_config->rtp.rtx.payload_type = kSendRtxPayloadType; 1087 send_config->rtp.rtx.payload_type = kSendRtxPayloadType;
1088 (*receive_configs)[0].rtp.rtx[payload_type_].ssrc = kSendRtxSsrcs[0]; 1088 (*receive_configs)[0].rtp.rtx_ssrc = kSendRtxSsrcs[0];
1089 (*receive_configs)[0].rtp.rtx[payload_type_].payload_type = 1089 (*receive_configs)[0].rtp.rtx_payload_types[payload_type_] =
1090 kSendRtxPayloadType; 1090 kSendRtxPayloadType;
1091 } 1091 }
1092 // Configure encoding and decoding with VP8, since generic packetization 1092 // Configure encoding and decoding with VP8, since generic packetization
1093 // doesn't support FEC with NACK. 1093 // doesn't support FEC with NACK.
1094 RTC_DCHECK_EQ(1, (*receive_configs)[0].decoders.size()); 1094 RTC_DCHECK_EQ(1, (*receive_configs)[0].decoders.size());
1095 send_config->encoder_settings.encoder = encoder_.get(); 1095 send_config->encoder_settings.encoder = encoder_.get();
1096 send_config->encoder_settings.payload_name = "VP8"; 1096 send_config->encoder_settings.payload_name = "VP8";
1097 (*receive_configs)[0].decoders[0].payload_name = "VP8"; 1097 (*receive_configs)[0].decoders[0].payload_name = "VP8";
1098 } 1098 }
1099 1099
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after
2321 send_config->encoder_settings.payload_name = "VP8"; 2321 send_config->encoder_settings.payload_name = "VP8";
2322 (*receive_configs)[0].decoders[0].payload_name = "VP8"; 2322 (*receive_configs)[0].decoders[0].payload_name = "VP8";
2323 (*receive_configs)[0].rtp.ulpfec.red_payload_type = kRedPayloadType; 2323 (*receive_configs)[0].rtp.ulpfec.red_payload_type = kRedPayloadType;
2324 (*receive_configs)[0].rtp.ulpfec.ulpfec_payload_type = 2324 (*receive_configs)[0].rtp.ulpfec.ulpfec_payload_type =
2325 kUlpfecPayloadType; 2325 kUlpfecPayloadType;
2326 } 2326 }
2327 // RTX 2327 // RTX
2328 if (use_rtx_) { 2328 if (use_rtx_) {
2329 send_config->rtp.rtx.ssrcs.push_back(kSendRtxSsrcs[0]); 2329 send_config->rtp.rtx.ssrcs.push_back(kSendRtxSsrcs[0]);
2330 send_config->rtp.rtx.payload_type = kSendRtxPayloadType; 2330 send_config->rtp.rtx.payload_type = kSendRtxPayloadType;
2331 (*receive_configs)[0].rtp.rtx[kFakeVideoSendPayloadType].ssrc = 2331 (*receive_configs)[0].rtp.rtx_ssrc = kSendRtxSsrcs[0];
2332 kSendRtxSsrcs[0]; 2332 (*receive_configs)[0].rtp.rtx_payload_types[kFakeVideoSendPayloadType] =
2333 (*receive_configs)[0].rtp.rtx[kFakeVideoSendPayloadType].payload_type =
2334 kSendRtxPayloadType; 2333 kSendRtxPayloadType;
2335 } 2334 }
2336 // RTT needed for RemoteNtpTimeEstimator for the receive stream. 2335 // RTT needed for RemoteNtpTimeEstimator for the receive stream.
2337 (*receive_configs)[0].rtp.rtcp_xr.receiver_reference_time_report = true; 2336 (*receive_configs)[0].rtp.rtcp_xr.receiver_reference_time_report = true;
2338 encoder_config->content_type = 2337 encoder_config->content_type =
2339 screenshare_ ? VideoEncoderConfig::ContentType::kScreen 2338 screenshare_ ? VideoEncoderConfig::ContentType::kScreen
2340 : VideoEncoderConfig::ContentType::kRealtimeVideo; 2339 : VideoEncoderConfig::ContentType::kRealtimeVideo;
2341 } 2340 }
2342 2341
2343 void OnCallsCreated(Call* sender_call, Call* receiver_call) override { 2342 void OnCallsCreated(Call* sender_call, Call* receiver_call) override {
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
2943 2942
2944 const std::vector<uint32_t>& ssrcs = send_config->rtp.ssrcs; 2943 const std::vector<uint32_t>& ssrcs = send_config->rtp.ssrcs;
2945 for (size_t i = 0; i < ssrcs.size(); ++i) { 2944 for (size_t i = 0; i < ssrcs.size(); ++i) {
2946 expected_send_ssrcs_.insert(ssrcs[i]); 2945 expected_send_ssrcs_.insert(ssrcs[i]);
2947 expected_receive_ssrcs_.push_back( 2946 expected_receive_ssrcs_.push_back(
2948 (*receive_configs)[i].rtp.remote_ssrc); 2947 (*receive_configs)[i].rtp.remote_ssrc);
2949 (*receive_configs)[i].render_delay_ms = kExpectedRenderDelayMs; 2948 (*receive_configs)[i].render_delay_ms = kExpectedRenderDelayMs;
2950 (*receive_configs)[i].renderer = &receive_stream_renderer_; 2949 (*receive_configs)[i].renderer = &receive_stream_renderer_;
2951 (*receive_configs)[i].rtp.nack.rtp_history_ms = kNackRtpHistoryMs; 2950 (*receive_configs)[i].rtp.nack.rtp_history_ms = kNackRtpHistoryMs;
2952 2951
2953 (*receive_configs)[i].rtp.rtx[kFakeVideoSendPayloadType].ssrc = 2952 (*receive_configs)[i].rtp.rtx_ssrc = kSendRtxSsrcs[i];
2954 kSendRtxSsrcs[i]; 2953 (*receive_configs)[i].rtp.rtx_payload_types[kFakeVideoSendPayloadType] =
2955 (*receive_configs)[i].rtp.rtx[kFakeVideoSendPayloadType].payload_type =
2956 kSendRtxPayloadType; 2954 kSendRtxPayloadType;
2957 } 2955 }
2958 2956
2959 for (size_t i = 0; i < kNumSsrcs; ++i) 2957 for (size_t i = 0; i < kNumSsrcs; ++i)
2960 send_config->rtp.rtx.ssrcs.push_back(kSendRtxSsrcs[i]); 2958 send_config->rtp.rtx.ssrcs.push_back(kSendRtxSsrcs[i]);
2961 2959
2962 // Use a delayed encoder to make sure we see CpuOveruseMetrics stats that 2960 // Use a delayed encoder to make sure we see CpuOveruseMetrics stats that
2963 // are non-zero. 2961 // are non-zero.
2964 send_config->encoder_settings.encoder = &encoder_; 2962 send_config->encoder_settings.encoder = &encoder_;
2965 } 2963 }
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after
3933 3931
3934 TEST_P(EndToEndTest, VerifyDefaultVideoReceiveConfigParameters) { 3932 TEST_P(EndToEndTest, VerifyDefaultVideoReceiveConfigParameters) {
3935 VideoReceiveStream::Config default_receive_config(nullptr); 3933 VideoReceiveStream::Config default_receive_config(nullptr);
3936 EXPECT_EQ(RtcpMode::kCompound, default_receive_config.rtp.rtcp_mode) 3934 EXPECT_EQ(RtcpMode::kCompound, default_receive_config.rtp.rtcp_mode)
3937 << "Reduced-size RTCP require rtcp-rsize to be negotiated."; 3935 << "Reduced-size RTCP require rtcp-rsize to be negotiated.";
3938 EXPECT_FALSE(default_receive_config.rtp.remb) 3936 EXPECT_FALSE(default_receive_config.rtp.remb)
3939 << "REMB require rtcp-fb: goog-remb to be negotiated."; 3937 << "REMB require rtcp-fb: goog-remb to be negotiated.";
3940 EXPECT_FALSE( 3938 EXPECT_FALSE(
3941 default_receive_config.rtp.rtcp_xr.receiver_reference_time_report) 3939 default_receive_config.rtp.rtcp_xr.receiver_reference_time_report)
3942 << "RTCP XR settings require rtcp-xr to be negotiated."; 3940 << "RTCP XR settings require rtcp-xr to be negotiated.";
3943 EXPECT_TRUE(default_receive_config.rtp.rtx.empty()) 3941 EXPECT_EQ(0U, default_receive_config.rtp.rtx_ssrc)
3942 << "Enabling RTX requires ssrc-group: FID negotiation";
3943 EXPECT_TRUE(default_receive_config.rtp.rtx_payload_types.empty())
3944 << "Enabling RTX requires rtpmap: rtx negotiation."; 3944 << "Enabling RTX requires rtpmap: rtx negotiation.";
3945 EXPECT_TRUE(default_receive_config.rtp.extensions.empty()) 3945 EXPECT_TRUE(default_receive_config.rtp.extensions.empty())
3946 << "Enabling RTP extensions require negotiation."; 3946 << "Enabling RTP extensions require negotiation.";
3947 3947
3948 VerifyEmptyNackConfig(default_receive_config.rtp.nack); 3948 VerifyEmptyNackConfig(default_receive_config.rtp.nack);
3949 VerifyEmptyUlpfecConfig(default_receive_config.rtp.ulpfec); 3949 VerifyEmptyUlpfecConfig(default_receive_config.rtp.ulpfec);
3950 } 3950 }
3951 3951
3952 TEST_P(EndToEndTest, VerifyDefaultFlexfecReceiveConfigParameters) { 3952 TEST_P(EndToEndTest, VerifyDefaultFlexfecReceiveConfigParameters) {
3953 test::NullTransport rtcp_send_transport; 3953 test::NullTransport rtcp_send_transport;
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
4127 std::unique_ptr<VideoEncoder> encoder_; 4127 std::unique_ptr<VideoEncoder> encoder_;
4128 std::unique_ptr<VideoDecoder> decoder_; 4128 std::unique_ptr<VideoDecoder> decoder_;
4129 rtc::CriticalSection crit_; 4129 rtc::CriticalSection crit_;
4130 int recorded_frames_ GUARDED_BY(crit_); 4130 int recorded_frames_ GUARDED_BY(crit_);
4131 } test(this); 4131 } test(this);
4132 4132
4133 RunBaseTest(&test); 4133 RunBaseTest(&test);
4134 } 4134 }
4135 4135
4136 } // namespace webrtc 4136 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698