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 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
731 length == header.headerLength + header.paddingLength); | 731 length == header.headerLength + header.paddingLength); |
732 return SEND_PACKET; | 732 return SEND_PACKET; |
733 } | 733 } |
734 if (header.timestamp == retransmitted_timestamp_) { | 734 if (header.timestamp == retransmitted_timestamp_) { |
735 EXPECT_EQ(retransmission_ssrc_, header.ssrc); | 735 EXPECT_EQ(retransmission_ssrc_, header.ssrc); |
736 EXPECT_EQ(retransmission_payload_type_, header.payloadType); | 736 EXPECT_EQ(retransmission_payload_type_, header.payloadType); |
737 frame_retransmitted_ = true; | 737 frame_retransmitted_ = true; |
738 return SEND_PACKET; | 738 return SEND_PACKET; |
739 } | 739 } |
740 | 740 |
741 EXPECT_EQ(kVideoSendSsrcs[0], header.ssrc); | 741 EXPECT_EQ(kVideoSendSsrcs[0], header.ssrc) |
| 742 << "Payload type " << static_cast<int>(header.payloadType) |
| 743 << " not expected."; |
742 EXPECT_EQ(payload_type_, header.payloadType); | 744 EXPECT_EQ(payload_type_, header.payloadType); |
743 | 745 |
744 // Found the final packet of the frame to inflict loss to, drop this and | 746 // Found the final packet of the frame to inflict loss to, drop this and |
745 // expect a retransmission. | 747 // expect a retransmission. |
746 if (header.markerBit && ++marker_bits_observed_ == kDroppedFrameNumber) { | 748 if (header.markerBit && ++marker_bits_observed_ == kDroppedFrameNumber) { |
747 retransmitted_timestamp_ = header.timestamp; | 749 retransmitted_timestamp_ = header.timestamp; |
748 return DROP_PACKET; | 750 return DROP_PACKET; |
749 } | 751 } |
750 | 752 |
751 return SEND_PACKET; | 753 return SEND_PACKET; |
(...skipping 11 matching lines...) Expand all Loading... |
763 VideoSendStream::Config* send_config, | 765 VideoSendStream::Config* send_config, |
764 std::vector<VideoReceiveStream::Config>* receive_configs, | 766 std::vector<VideoReceiveStream::Config>* receive_configs, |
765 VideoEncoderConfig* encoder_config) override { | 767 VideoEncoderConfig* encoder_config) override { |
766 send_config->rtp.nack.rtp_history_ms = kNackRtpHistoryMs; | 768 send_config->rtp.nack.rtp_history_ms = kNackRtpHistoryMs; |
767 (*receive_configs)[0].pre_render_callback = this; | 769 (*receive_configs)[0].pre_render_callback = this; |
768 (*receive_configs)[0].rtp.nack.rtp_history_ms = kNackRtpHistoryMs; | 770 (*receive_configs)[0].rtp.nack.rtp_history_ms = kNackRtpHistoryMs; |
769 | 771 |
770 if (payload_type_ == kRedPayloadType) { | 772 if (payload_type_ == kRedPayloadType) { |
771 send_config->rtp.fec.ulpfec_payload_type = kUlpfecPayloadType; | 773 send_config->rtp.fec.ulpfec_payload_type = kUlpfecPayloadType; |
772 send_config->rtp.fec.red_payload_type = kRedPayloadType; | 774 send_config->rtp.fec.red_payload_type = kRedPayloadType; |
773 (*receive_configs)[0].rtp.fec.red_payload_type = kRedPayloadType; | 775 if (retransmission_ssrc_ == kSendRtxSsrcs[0]) |
774 (*receive_configs)[0].rtp.fec.ulpfec_payload_type = kUlpfecPayloadType; | 776 send_config->rtp.fec.red_rtx_payload_type = kRtxRedPayloadType; |
| 777 (*receive_configs)[0].rtp.fec.ulpfec_payload_type = |
| 778 send_config->rtp.fec.ulpfec_payload_type; |
| 779 (*receive_configs)[0].rtp.fec.red_payload_type = |
| 780 send_config->rtp.fec.red_payload_type; |
| 781 (*receive_configs)[0].rtp.fec.red_rtx_payload_type = |
| 782 send_config->rtp.fec.red_rtx_payload_type; |
775 } | 783 } |
776 | 784 |
777 if (retransmission_ssrc_ == kSendRtxSsrcs[0]) { | 785 if (retransmission_ssrc_ == kSendRtxSsrcs[0]) { |
778 send_config->rtp.rtx.ssrcs.push_back(kSendRtxSsrcs[0]); | 786 send_config->rtp.rtx.ssrcs.push_back(kSendRtxSsrcs[0]); |
779 send_config->rtp.rtx.payload_type = kSendRtxPayloadType; | 787 send_config->rtp.rtx.payload_type = kSendRtxPayloadType; |
780 (*receive_configs)[0].rtp.rtx[kFakeVideoSendPayloadType].ssrc = | 788 (*receive_configs)[0].rtp.rtx[payload_type_].ssrc = kSendRtxSsrcs[0]; |
781 kSendRtxSsrcs[0]; | 789 (*receive_configs)[0].rtp.rtx[payload_type_].payload_type = |
782 (*receive_configs)[0].rtp.rtx[kFakeVideoSendPayloadType].payload_type = | |
783 kSendRtxPayloadType; | 790 kSendRtxPayloadType; |
784 } | 791 } |
785 } | 792 } |
786 | 793 |
787 void PerformTest() override { | 794 void PerformTest() override { |
788 EXPECT_TRUE(Wait()) | 795 EXPECT_TRUE(Wait()) |
789 << "Timed out while waiting for retransmission to render."; | 796 << "Timed out while waiting for retransmission to render."; |
790 } | 797 } |
791 | 798 |
792 int GetPayloadType(bool use_rtx, bool use_red) { | 799 int GetPayloadType(bool use_rtx, bool use_red) { |
793 return use_rtx ? kSendRtxPayloadType | 800 if (use_red) { |
794 : (use_red ? kRedPayloadType : kFakeVideoSendPayloadType); | 801 if (use_rtx) |
| 802 return kRtxRedPayloadType; |
| 803 return kRedPayloadType; |
| 804 } |
| 805 if (use_rtx) |
| 806 return kSendRtxPayloadType; |
| 807 return kFakeVideoSendPayloadType; |
795 } | 808 } |
796 | 809 |
797 rtc::CriticalSection crit_; | 810 rtc::CriticalSection crit_; |
798 const int payload_type_; | 811 const int payload_type_; |
799 const uint32_t retransmission_ssrc_; | 812 const uint32_t retransmission_ssrc_; |
800 const int retransmission_payload_type_; | 813 const int retransmission_payload_type_; |
801 int marker_bits_observed_; | 814 int marker_bits_observed_; |
802 int num_packets_observed_; | 815 int num_packets_observed_; |
803 uint32_t retransmitted_timestamp_ GUARDED_BY(&crit_); | 816 uint32_t retransmitted_timestamp_ GUARDED_BY(&crit_); |
804 bool frame_retransmitted_; | 817 bool frame_retransmitted_; |
(...skipping 2715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3520 private: | 3533 private: |
3521 bool video_observed_; | 3534 bool video_observed_; |
3522 bool audio_observed_; | 3535 bool audio_observed_; |
3523 SequenceNumberUnwrapper unwrapper_; | 3536 SequenceNumberUnwrapper unwrapper_; |
3524 std::set<int64_t> received_packet_ids_; | 3537 std::set<int64_t> received_packet_ids_; |
3525 } test; | 3538 } test; |
3526 | 3539 |
3527 RunBaseTest(&test); | 3540 RunBaseTest(&test); |
3528 } | 3541 } |
3529 } // namespace webrtc | 3542 } // namespace webrtc |
OLD | NEW |