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 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 } | 783 } |
784 | 784 |
785 if (header.timestamp == retransmitted_timestamp_) { | 785 if (header.timestamp == retransmitted_timestamp_) { |
786 EXPECT_EQ(retransmission_ssrc_, header.ssrc); | 786 EXPECT_EQ(retransmission_ssrc_, header.ssrc); |
787 EXPECT_EQ(retransmission_payload_type_, header.payloadType); | 787 EXPECT_EQ(retransmission_payload_type_, header.payloadType); |
788 frame_retransmitted_ = true; | 788 frame_retransmitted_ = true; |
789 return SEND_PACKET; | 789 return SEND_PACKET; |
790 } | 790 } |
791 | 791 |
792 EXPECT_EQ(kVideoSendSsrcs[0], header.ssrc) | 792 EXPECT_EQ(kVideoSendSsrcs[0], header.ssrc) |
793 << "Payload type " << static_cast<int>(header.payloadType) | 793 << "Unexpected packet length " << length |
794 << " not expected."; | 794 << ", header_length " << header.headerLength |
| 795 << ", padding_length " << header.paddingLength |
| 796 << ", timestamp " << header.timestamp |
| 797 << ", expected timestamp " << retransmitted_timestamp_ |
| 798 << ", payload type " << static_cast<int>(header.payloadType); |
795 EXPECT_EQ(payload_type_, header.payloadType); | 799 EXPECT_EQ(payload_type_, header.payloadType); |
796 | 800 |
797 // Found the final packet of the frame to inflict loss to, drop this and | 801 // Found the final packet of the frame to inflict loss to, drop this and |
798 // expect a retransmission. | 802 // expect a retransmission. |
799 if (header.markerBit && ++marker_bits_observed_ == kDroppedFrameNumber) { | 803 if (header.markerBit && ++marker_bits_observed_ == kDroppedFrameNumber) { |
| 804 // This should be the only dropped packet. |
| 805 EXPECT_EQ(0u, retransmitted_timestamp_); |
800 retransmitted_timestamp_ = header.timestamp; | 806 retransmitted_timestamp_ = header.timestamp; |
801 return DROP_PACKET; | 807 return DROP_PACKET; |
802 } | 808 } |
803 | 809 |
804 return SEND_PACKET; | 810 return SEND_PACKET; |
805 } | 811 } |
806 | 812 |
807 void FrameCallback(VideoFrame* frame) override { | 813 void FrameCallback(VideoFrame* frame) override { |
808 rtc::CritScope lock(&crit_); | 814 rtc::CritScope lock(&crit_); |
809 if (frame->timestamp() == retransmitted_timestamp_) { | 815 if (frame->timestamp() == retransmitted_timestamp_) { |
(...skipping 2747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3557 private: | 3563 private: |
3558 bool video_observed_; | 3564 bool video_observed_; |
3559 bool audio_observed_; | 3565 bool audio_observed_; |
3560 SequenceNumberUnwrapper unwrapper_; | 3566 SequenceNumberUnwrapper unwrapper_; |
3561 std::set<int64_t> received_packet_ids_; | 3567 std::set<int64_t> received_packet_ids_; |
3562 } test; | 3568 } test; |
3563 | 3569 |
3564 RunBaseTest(&test); | 3570 RunBaseTest(&test); |
3565 } | 3571 } |
3566 } // namespace webrtc | 3572 } // namespace webrtc |
OLD | NEW |