| 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 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 | 764 |
| 765 parser.Parse(data, length); | 765 parser.Parse(data, length); |
| 766 if (parser.sender_ssrc() == kFlexfecLocalSsrc) { | 766 if (parser.sender_ssrc() == kFlexfecLocalSsrc) { |
| 767 EXPECT_EQ(1, parser.receiver_report()->num_packets()); | 767 EXPECT_EQ(1, parser.receiver_report()->num_packets()); |
| 768 const std::vector<rtcp::ReportBlock>& report_blocks = | 768 const std::vector<rtcp::ReportBlock>& report_blocks = |
| 769 parser.receiver_report()->report_blocks(); | 769 parser.receiver_report()->report_blocks(); |
| 770 if (!report_blocks.empty()) { | 770 if (!report_blocks.empty()) { |
| 771 EXPECT_EQ(1U, report_blocks.size()); | 771 EXPECT_EQ(1U, report_blocks.size()); |
| 772 EXPECT_EQ(test::CallTest::kFlexfecSendSsrc, | 772 EXPECT_EQ(test::CallTest::kFlexfecSendSsrc, |
| 773 report_blocks[0].source_ssrc()); | 773 report_blocks[0].source_ssrc()); |
| 774 rtc::CritScope lock(&crit_); |
| 774 received_flexfec_rtcp_ = true; | 775 received_flexfec_rtcp_ = true; |
| 775 } | 776 } |
| 776 } | 777 } |
| 777 | 778 |
| 778 return SEND_PACKET; | 779 return SEND_PACKET; |
| 779 } | 780 } |
| 780 | 781 |
| 781 void OnFrame(const VideoFrame& video_frame) override { | 782 void OnFrame(const VideoFrame& video_frame) override { |
| 782 rtc::CritScope lock(&crit_); | 783 rtc::CritScope lock(&crit_); |
| 783 // Rendering frame with timestamp of packet that was dropped -> FEC | 784 // Rendering frame with timestamp of packet that was dropped -> FEC |
| (...skipping 22 matching lines...) Expand all Loading... |
| 806 void PerformTest() override { | 807 void PerformTest() override { |
| 807 EXPECT_TRUE(Wait()) | 808 EXPECT_TRUE(Wait()) |
| 808 << "Timed out waiting for dropped frames to be rendered."; | 809 << "Timed out waiting for dropped frames to be rendered."; |
| 809 } | 810 } |
| 810 | 811 |
| 811 rtc::CriticalSection crit_; | 812 rtc::CriticalSection crit_; |
| 812 std::set<uint32_t> dropped_sequence_numbers_ GUARDED_BY(crit_); | 813 std::set<uint32_t> dropped_sequence_numbers_ GUARDED_BY(crit_); |
| 813 // Since several packets can have the same timestamp a multiset is used | 814 // Since several packets can have the same timestamp a multiset is used |
| 814 // instead of a set. | 815 // instead of a set. |
| 815 std::multiset<uint32_t> dropped_timestamps_ GUARDED_BY(crit_); | 816 std::multiset<uint32_t> dropped_timestamps_ GUARDED_BY(crit_); |
| 816 bool expect_flexfec_rtcp_; | 817 const bool expect_flexfec_rtcp_; |
| 817 bool received_flexfec_rtcp_; | 818 bool received_flexfec_rtcp_ GUARDED_BY(crit_); |
| 818 Random random_; | 819 Random random_; |
| 819 }; | 820 }; |
| 820 | 821 |
| 821 TEST_P(EndToEndTest, ReceivesFlexfec) { | 822 TEST_P(EndToEndTest, ReceivesFlexfec) { |
| 822 FlexfecRenderObserver test(false); | 823 FlexfecRenderObserver test(false); |
| 823 RunBaseTest(&test); | 824 RunBaseTest(&test); |
| 824 } | 825 } |
| 825 | 826 |
| 826 TEST_P(EndToEndTest, ReceivesFlexfecAndSendsCorrespondingRtcp) { | 827 TEST_P(EndToEndTest, ReceivesFlexfecAndSendsCorrespondingRtcp) { |
| 827 FlexfecRenderObserver test(true); | 828 FlexfecRenderObserver test(true); |
| (...skipping 3298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4126 std::unique_ptr<VideoEncoder> encoder_; | 4127 std::unique_ptr<VideoEncoder> encoder_; |
| 4127 std::unique_ptr<VideoDecoder> decoder_; | 4128 std::unique_ptr<VideoDecoder> decoder_; |
| 4128 rtc::CriticalSection crit_; | 4129 rtc::CriticalSection crit_; |
| 4129 int recorded_frames_ GUARDED_BY(crit_); | 4130 int recorded_frames_ GUARDED_BY(crit_); |
| 4130 } test(this); | 4131 } test(this); |
| 4131 | 4132 |
| 4132 RunBaseTest(&test); | 4133 RunBaseTest(&test); |
| 4133 } | 4134 } |
| 4134 | 4135 |
| 4135 } // namespace webrtc | 4136 } // namespace webrtc |
| OLD | NEW |