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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 return SEND_PACKET; | 431 return SEND_PACKET; |
432 } | 432 } |
433 | 433 |
434 test::PacketTransport* CreateSendTransport(Call* sender_call) override { | 434 test::PacketTransport* CreateSendTransport(Call* sender_call) override { |
435 // At low RTT (< kLowRttNackMs) -> NACK only, no FEC. | 435 // At low RTT (< kLowRttNackMs) -> NACK only, no FEC. |
436 // Configure some network delay. | 436 // Configure some network delay. |
437 const int kNetworkDelayMs = 100; | 437 const int kNetworkDelayMs = 100; |
438 FakeNetworkPipe::Config config; | 438 FakeNetworkPipe::Config config; |
439 config.loss_percent = 5; | 439 config.loss_percent = 5; |
440 config.queue_delay_ms = kNetworkDelayMs; | 440 config.queue_delay_ms = kNetworkDelayMs; |
441 return new test::PacketTransport(sender_call, this, | 441 return new test::PacketTransport( |
442 test::PacketTransport::kSender, | 442 sender_call, this, test::PacketTransport::kSender, |
443 MediaType::VIDEO, config); | 443 VideoSendStreamTest::payload_type_map_, config); |
444 } | 444 } |
445 | 445 |
446 void ModifyVideoConfigs( | 446 void ModifyVideoConfigs( |
447 VideoSendStream::Config* send_config, | 447 VideoSendStream::Config* send_config, |
448 std::vector<VideoReceiveStream::Config>* receive_configs, | 448 std::vector<VideoReceiveStream::Config>* receive_configs, |
449 VideoEncoderConfig* encoder_config) override { | 449 VideoEncoderConfig* encoder_config) override { |
450 if (use_nack_) { | 450 if (use_nack_) { |
451 send_config->rtp.nack.rtp_history_ms = | 451 send_config->rtp.nack.rtp_history_ms = |
452 (*receive_configs)[0].rtp.nack.rtp_history_ms = | 452 (*receive_configs)[0].rtp.nack.rtp_history_ms = |
453 VideoSendStreamTest::kNackRtpHistoryMs; | 453 VideoSendStreamTest::kNackRtpHistoryMs; |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 return SEND_PACKET; | 587 return SEND_PACKET; |
588 } | 588 } |
589 | 589 |
590 test::PacketTransport* CreateSendTransport(Call* sender_call) override { | 590 test::PacketTransport* CreateSendTransport(Call* sender_call) override { |
591 // At low RTT (< kLowRttNackMs) -> NACK only, no FEC. | 591 // At low RTT (< kLowRttNackMs) -> NACK only, no FEC. |
592 // Therefore we need some network delay. | 592 // Therefore we need some network delay. |
593 const int kNetworkDelayMs = 100; | 593 const int kNetworkDelayMs = 100; |
594 FakeNetworkPipe::Config config; | 594 FakeNetworkPipe::Config config; |
595 config.loss_percent = 5; | 595 config.loss_percent = 5; |
596 config.queue_delay_ms = kNetworkDelayMs; | 596 config.queue_delay_ms = kNetworkDelayMs; |
597 return new test::PacketTransport(sender_call, this, | 597 return new test::PacketTransport( |
598 test::PacketTransport::kSender, | 598 sender_call, this, test::PacketTransport::kSender, |
599 MediaType::VIDEO, config); | 599 VideoSendStreamTest::payload_type_map_, config); |
600 } | 600 } |
601 | 601 |
602 void ModifyVideoConfigs( | 602 void ModifyVideoConfigs( |
603 VideoSendStream::Config* send_config, | 603 VideoSendStream::Config* send_config, |
604 std::vector<VideoReceiveStream::Config>* receive_configs, | 604 std::vector<VideoReceiveStream::Config>* receive_configs, |
605 VideoEncoderConfig* encoder_config) override { | 605 VideoEncoderConfig* encoder_config) override { |
606 if (use_nack_) { | 606 if (use_nack_) { |
607 send_config->rtp.nack.rtp_history_ms = | 607 send_config->rtp.nack.rtp_history_ms = |
608 (*receive_configs)[0].rtp.nack.rtp_history_ms = | 608 (*receive_configs)[0].rtp.nack.rtp_history_ms = |
609 VideoSendStreamTest::kNackRtpHistoryMs; | 609 VideoSendStreamTest::kNackRtpHistoryMs; |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1259 } | 1259 } |
1260 | 1260 |
1261 test::PacketTransport* CreateSendTransport(Call* sender_call) override { | 1261 test::PacketTransport* CreateSendTransport(Call* sender_call) override { |
1262 const int kNetworkDelayMs = 50; | 1262 const int kNetworkDelayMs = 50; |
1263 FakeNetworkPipe::Config config; | 1263 FakeNetworkPipe::Config config; |
1264 config.loss_percent = 10; | 1264 config.loss_percent = 10; |
1265 config.link_capacity_kbps = kCapacityKbps; | 1265 config.link_capacity_kbps = kCapacityKbps; |
1266 config.queue_delay_ms = kNetworkDelayMs; | 1266 config.queue_delay_ms = kNetworkDelayMs; |
1267 return new test::PacketTransport(sender_call, this, | 1267 return new test::PacketTransport(sender_call, this, |
1268 test::PacketTransport::kSender, | 1268 test::PacketTransport::kSender, |
1269 MediaType::VIDEO, config); | 1269 payload_type_map_, config); |
1270 } | 1270 } |
1271 | 1271 |
1272 void ModifyVideoConfigs( | 1272 void ModifyVideoConfigs( |
1273 VideoSendStream::Config* send_config, | 1273 VideoSendStream::Config* send_config, |
1274 std::vector<VideoReceiveStream::Config>* receive_configs, | 1274 std::vector<VideoReceiveStream::Config>* receive_configs, |
1275 VideoEncoderConfig* encoder_config) override { | 1275 VideoEncoderConfig* encoder_config) override { |
1276 // Turn on RTX. | 1276 // Turn on RTX. |
1277 send_config->rtp.rtx.payload_type = kFakeVideoSendPayloadType; | 1277 send_config->rtp.rtx.payload_type = kFakeVideoSendPayloadType; |
1278 send_config->rtp.rtx.ssrcs.push_back(kVideoSendSsrcs[0]); | 1278 send_config->rtp.rtx.ssrcs.push_back(kVideoSendSsrcs[0]); |
1279 } | 1279 } |
(...skipping 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2742 expected_height_(0) {} | 2742 expected_height_(0) {} |
2743 | 2743 |
2744 virtual void ModifyVideoConfigsHook( | 2744 virtual void ModifyVideoConfigsHook( |
2745 VideoSendStream::Config* send_config, | 2745 VideoSendStream::Config* send_config, |
2746 std::vector<VideoReceiveStream::Config>* receive_configs, | 2746 std::vector<VideoReceiveStream::Config>* receive_configs, |
2747 VideoEncoderConfig* encoder_config) {} | 2747 VideoEncoderConfig* encoder_config) {} |
2748 | 2748 |
2749 virtual void InspectHeader(const RTPVideoHeaderVP9& vp9) = 0; | 2749 virtual void InspectHeader(const RTPVideoHeaderVP9& vp9) = 0; |
2750 | 2750 |
2751 private: | 2751 private: |
2752 const int kVp9PayloadType = 105; | 2752 const int kVp9PayloadType = test::CallTest::kVideoSendPayloadType; |
2753 | 2753 |
2754 class VideoStreamFactory | 2754 class VideoStreamFactory |
2755 : public VideoEncoderConfig::VideoStreamFactoryInterface { | 2755 : public VideoEncoderConfig::VideoStreamFactoryInterface { |
2756 public: | 2756 public: |
2757 explicit VideoStreamFactory(size_t number_of_temporal_layers) | 2757 explicit VideoStreamFactory(size_t number_of_temporal_layers) |
2758 : number_of_temporal_layers_(number_of_temporal_layers) {} | 2758 : number_of_temporal_layers_(number_of_temporal_layers) {} |
2759 | 2759 |
2760 private: | 2760 private: |
2761 std::vector<VideoStream> CreateEncoderStreams( | 2761 std::vector<VideoStream> CreateEncoderStreams( |
2762 int width, | 2762 int width, |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3293 rtc::CriticalSection crit_; | 3293 rtc::CriticalSection crit_; |
3294 uint32_t max_bitrate_bps_ GUARDED_BY(&crit_); | 3294 uint32_t max_bitrate_bps_ GUARDED_BY(&crit_); |
3295 bool first_packet_sent_ GUARDED_BY(&crit_); | 3295 bool first_packet_sent_ GUARDED_BY(&crit_); |
3296 rtc::Event bitrate_changed_event_; | 3296 rtc::Event bitrate_changed_event_; |
3297 } test; | 3297 } test; |
3298 | 3298 |
3299 RunBaseTest(&test); | 3299 RunBaseTest(&test); |
3300 } | 3300 } |
3301 | 3301 |
3302 } // namespace webrtc | 3302 } // namespace webrtc |
OLD | NEW |