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