| 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> // max | 10 #include <algorithm> // max |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 observation_complete_.Set(); | 233 observation_complete_.Set(); |
| 234 | 234 |
| 235 return SEND_PACKET; | 235 return SEND_PACKET; |
| 236 } | 236 } |
| 237 | 237 |
| 238 void ModifyVideoConfigs( | 238 void ModifyVideoConfigs( |
| 239 VideoSendStream::Config* send_config, | 239 VideoSendStream::Config* send_config, |
| 240 std::vector<VideoReceiveStream::Config>* receive_configs, | 240 std::vector<VideoReceiveStream::Config>* receive_configs, |
| 241 VideoEncoderConfig* encoder_config) override { | 241 VideoEncoderConfig* encoder_config) override { |
| 242 send_config->encoder_settings.encoder = &encoder_; | 242 send_config->encoder_settings.encoder = &encoder_; |
| 243 send_config->rtp.extensions.clear(); | |
| 244 send_config->rtp.extensions.push_back(RtpExtension( | |
| 245 RtpExtension::kTransportSequenceNumberUri, kExtensionId)); | |
| 246 } | 243 } |
| 247 | 244 |
| 248 void PerformTest() override { | 245 void PerformTest() override { |
| 249 EXPECT_TRUE(Wait()) << "Timed out while waiting for a single RTP packet."; | 246 EXPECT_TRUE(Wait()) << "Timed out while waiting for a single RTP packet."; |
| 250 } | 247 } |
| 251 | 248 |
| 252 test::FakeEncoder encoder_; | 249 test::FakeEncoder encoder_; |
| 253 } test; | 250 } test; |
| 254 | 251 |
| 255 RunBaseTest(&test); | 252 RunBaseTest(&test); |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 send_config->rtp.nack.rtp_history_ms = | 450 send_config->rtp.nack.rtp_history_ms = |
| 454 (*receive_configs)[0].rtp.nack.rtp_history_ms = | 451 (*receive_configs)[0].rtp.nack.rtp_history_ms = |
| 455 VideoSendStreamTest::kNackRtpHistoryMs; | 452 VideoSendStreamTest::kNackRtpHistoryMs; |
| 456 } | 453 } |
| 457 send_config->encoder_settings.encoder = encoder_; | 454 send_config->encoder_settings.encoder = encoder_; |
| 458 send_config->encoder_settings.payload_name = payload_name_; | 455 send_config->encoder_settings.payload_name = payload_name_; |
| 459 send_config->rtp.ulpfec.red_payload_type = | 456 send_config->rtp.ulpfec.red_payload_type = |
| 460 VideoSendStreamTest::kRedPayloadType; | 457 VideoSendStreamTest::kRedPayloadType; |
| 461 send_config->rtp.ulpfec.ulpfec_payload_type = | 458 send_config->rtp.ulpfec.ulpfec_payload_type = |
| 462 VideoSendStreamTest::kUlpfecPayloadType; | 459 VideoSendStreamTest::kUlpfecPayloadType; |
| 463 if (header_extensions_enabled_) { | 460 EXPECT_FALSE(send_config->rtp.extensions.empty()); |
| 461 if (!header_extensions_enabled_) { |
| 462 send_config->rtp.extensions.clear(); |
| 463 } else { |
| 464 send_config->rtp.extensions.push_back(RtpExtension( | 464 send_config->rtp.extensions.push_back(RtpExtension( |
| 465 RtpExtension::kAbsSendTimeUri, test::kAbsSendTimeExtensionId)); | 465 RtpExtension::kAbsSendTimeUri, test::kAbsSendTimeExtensionId)); |
| 466 send_config->rtp.extensions.push_back( | |
| 467 RtpExtension(RtpExtension::kTransportSequenceNumberUri, | |
| 468 test::kTransportSequenceNumberExtensionId)); | |
| 469 } | 466 } |
| 470 (*receive_configs)[0].rtp.ulpfec.red_payload_type = | 467 (*receive_configs)[0].rtp.ulpfec.red_payload_type = |
| 471 send_config->rtp.ulpfec.red_payload_type; | 468 send_config->rtp.ulpfec.red_payload_type; |
| 472 (*receive_configs)[0].rtp.ulpfec.ulpfec_payload_type = | 469 (*receive_configs)[0].rtp.ulpfec.ulpfec_payload_type = |
| 473 send_config->rtp.ulpfec.ulpfec_payload_type; | 470 send_config->rtp.ulpfec.ulpfec_payload_type; |
| 474 } | 471 } |
| 475 | 472 |
| 476 void PerformTest() override { | 473 void PerformTest() override { |
| 477 EXPECT_EQ(expect_ulpfec_, Wait()) | 474 EXPECT_EQ(expect_ulpfec_, Wait()) |
| 478 << "Timed out waiting for ULPFEC and/or media packets."; | 475 << "Timed out waiting for ULPFEC and/or media packets."; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 (*receive_configs)[0].rtp.nack.rtp_history_ms = | 604 (*receive_configs)[0].rtp.nack.rtp_history_ms = |
| 608 VideoSendStreamTest::kNackRtpHistoryMs; | 605 VideoSendStreamTest::kNackRtpHistoryMs; |
| 609 } | 606 } |
| 610 send_config->encoder_settings.encoder = encoder_; | 607 send_config->encoder_settings.encoder = encoder_; |
| 611 send_config->encoder_settings.payload_name = payload_name_; | 608 send_config->encoder_settings.payload_name = payload_name_; |
| 612 if (header_extensions_enabled_) { | 609 if (header_extensions_enabled_) { |
| 613 send_config->rtp.extensions.push_back(RtpExtension( | 610 send_config->rtp.extensions.push_back(RtpExtension( |
| 614 RtpExtension::kAbsSendTimeUri, test::kAbsSendTimeExtensionId)); | 611 RtpExtension::kAbsSendTimeUri, test::kAbsSendTimeExtensionId)); |
| 615 send_config->rtp.extensions.push_back(RtpExtension( | 612 send_config->rtp.extensions.push_back(RtpExtension( |
| 616 RtpExtension::kTimestampOffsetUri, test::kTOffsetExtensionId)); | 613 RtpExtension::kTimestampOffsetUri, test::kTOffsetExtensionId)); |
| 617 send_config->rtp.extensions.push_back( | 614 } else { |
| 618 RtpExtension(RtpExtension::kTransportSequenceNumberUri, | 615 send_config->rtp.extensions.clear(); |
| 619 test::kTransportSequenceNumberExtensionId)); | |
| 620 } | 616 } |
| 621 } | 617 } |
| 622 | 618 |
| 623 void PerformTest() override { | 619 void PerformTest() override { |
| 624 EXPECT_TRUE(Wait()) | 620 EXPECT_TRUE(Wait()) |
| 625 << "Timed out waiting for FlexFEC and/or media packets."; | 621 << "Timed out waiting for FlexFEC and/or media packets."; |
| 626 } | 622 } |
| 627 | 623 |
| 628 VideoEncoder* const encoder_; | 624 VideoEncoder* const encoder_; |
| 629 std::string payload_name_; | 625 std::string payload_name_; |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1265 config.link_capacity_kbps = kCapacityKbps; | 1261 config.link_capacity_kbps = kCapacityKbps; |
| 1266 config.queue_delay_ms = kNetworkDelayMs; | 1262 config.queue_delay_ms = kNetworkDelayMs; |
| 1267 return new test::PacketTransport(sender_call, this, | 1263 return new test::PacketTransport(sender_call, this, |
| 1268 test::PacketTransport::kSender, config); | 1264 test::PacketTransport::kSender, config); |
| 1269 } | 1265 } |
| 1270 | 1266 |
| 1271 void ModifyVideoConfigs( | 1267 void ModifyVideoConfigs( |
| 1272 VideoSendStream::Config* send_config, | 1268 VideoSendStream::Config* send_config, |
| 1273 std::vector<VideoReceiveStream::Config>* receive_configs, | 1269 std::vector<VideoReceiveStream::Config>* receive_configs, |
| 1274 VideoEncoderConfig* encoder_config) override { | 1270 VideoEncoderConfig* encoder_config) override { |
| 1275 send_config->rtp.extensions.clear(); | |
| 1276 send_config->rtp.extensions.push_back( | |
| 1277 RtpExtension(RtpExtension::kTransportSequenceNumberUri, | |
| 1278 test::kTransportSequenceNumberExtensionId)); | |
| 1279 // Turn on RTX. | 1271 // Turn on RTX. |
| 1280 send_config->rtp.rtx.payload_type = kFakeVideoSendPayloadType; | 1272 send_config->rtp.rtx.payload_type = kFakeVideoSendPayloadType; |
| 1281 send_config->rtp.rtx.ssrcs.push_back(kVideoSendSsrcs[0]); | 1273 send_config->rtp.rtx.ssrcs.push_back(kVideoSendSsrcs[0]); |
| 1282 | |
| 1283 (*receive_configs)[0].rtp.extensions.clear(); | |
| 1284 (*receive_configs)[0].rtp.extensions.push_back( | |
| 1285 RtpExtension(RtpExtension::kTransportSequenceNumberUri, | |
| 1286 test::kTransportSequenceNumberExtensionId)); | |
| 1287 (*receive_configs)[0].rtp.transport_cc = true; | |
| 1288 } | 1274 } |
| 1289 | 1275 |
| 1290 void PerformTest() override { | 1276 void PerformTest() override { |
| 1291 // TODO(isheriff): Some platforms do not ramp up as expected to full | 1277 // TODO(isheriff): Some platforms do not ramp up as expected to full |
| 1292 // capacity due to packet scheduling delays. Fix that before getting | 1278 // capacity due to packet scheduling delays. Fix that before getting |
| 1293 // rid of this. | 1279 // rid of this. |
| 1294 SleepMs(5000); | 1280 SleepMs(5000); |
| 1295 { | 1281 { |
| 1296 rtc::CritScope lock(&crit_); | 1282 rtc::CritScope lock(&crit_); |
| 1297 // Expect padding to be a small percentage of total bytes sent. | 1283 // Expect padding to be a small percentage of total bytes sent. |
| (...skipping 1953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3251 rtc::CriticalSection crit_; | 3237 rtc::CriticalSection crit_; |
| 3252 uint32_t max_bitrate_bps_ GUARDED_BY(&crit_); | 3238 uint32_t max_bitrate_bps_ GUARDED_BY(&crit_); |
| 3253 bool first_packet_sent_ GUARDED_BY(&crit_); | 3239 bool first_packet_sent_ GUARDED_BY(&crit_); |
| 3254 rtc::Event bitrate_changed_event_; | 3240 rtc::Event bitrate_changed_event_; |
| 3255 } test; | 3241 } test; |
| 3256 | 3242 |
| 3257 RunBaseTest(&test); | 3243 RunBaseTest(&test); |
| 3258 } | 3244 } |
| 3259 | 3245 |
| 3260 } // namespace webrtc | 3246 } // namespace webrtc |
| OLD | NEW |