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 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 const PacketOptions& options) override { | 72 const PacketOptions& options) override { |
73 RTPHeader header; | 73 RTPHeader header; |
74 std::unique_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create()); | 74 std::unique_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create()); |
75 EXPECT_TRUE(parser->Parse(static_cast<const uint8_t*>(data), len, &header)); | 75 EXPECT_TRUE(parser->Parse(static_cast<const uint8_t*>(data), len, &header)); |
76 ++rtp_packets_sent_; | 76 ++rtp_packets_sent_; |
77 last_rtp_header_ = header; | 77 last_rtp_header_ = header; |
78 return true; | 78 return true; |
79 } | 79 } |
80 bool SendRtcp(const uint8_t* data, size_t len) override { | 80 bool SendRtcp(const uint8_t* data, size_t len) override { |
81 test::RtcpPacketParser parser; | 81 test::RtcpPacketParser parser; |
82 parser.Parse(static_cast<const uint8_t*>(data), len); | 82 parser.Parse(data, len); |
83 last_nack_list_ = parser.nack_item()->last_nack_list(); | 83 last_nack_list_ = parser.nack()->packet_ids(); |
84 | 84 |
85 if (clock_) { | 85 if (clock_) { |
86 clock_->AdvanceTimeMilliseconds(delay_ms_); | 86 clock_->AdvanceTimeMilliseconds(delay_ms_); |
87 } | 87 } |
88 EXPECT_TRUE(receiver_ != NULL); | 88 EXPECT_TRUE(receiver_); |
89 EXPECT_EQ(0, receiver_->IncomingRtcpPacket( | 89 EXPECT_EQ(0, receiver_->IncomingRtcpPacket(data, len)); |
90 static_cast<const uint8_t*>(data), len)); | |
91 return true; | 90 return true; |
92 } | 91 } |
93 ModuleRtpRtcpImpl* receiver_; | 92 ModuleRtpRtcpImpl* receiver_; |
94 SimulatedClock* clock_; | 93 SimulatedClock* clock_; |
95 int64_t delay_ms_; | 94 int64_t delay_ms_; |
96 int rtp_packets_sent_; | 95 int rtp_packets_sent_; |
97 RTPHeader last_rtp_header_; | 96 RTPHeader last_rtp_header_; |
98 std::vector<uint16_t> last_nack_list_; | 97 std::vector<uint16_t> last_nack_list_; |
99 }; | 98 }; |
100 | 99 |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 EXPECT_EQ(6U, receiver_.RtcpSent().unique_nack_requests); | 549 EXPECT_EQ(6U, receiver_.RtcpSent().unique_nack_requests); |
551 EXPECT_THAT(receiver_.LastNackListSent(), ElementsAre(11, 18, 20, 21)); | 550 EXPECT_THAT(receiver_.LastNackListSent(), ElementsAre(11, 18, 20, 21)); |
552 | 551 |
553 // Send module receives the request. | 552 // Send module receives the request. |
554 EXPECT_EQ(2U, sender_.RtcpReceived().nack_packets); | 553 EXPECT_EQ(2U, sender_.RtcpReceived().nack_packets); |
555 EXPECT_EQ(8U, sender_.RtcpReceived().nack_requests); | 554 EXPECT_EQ(8U, sender_.RtcpReceived().nack_requests); |
556 EXPECT_EQ(6U, sender_.RtcpReceived().unique_nack_requests); | 555 EXPECT_EQ(6U, sender_.RtcpReceived().unique_nack_requests); |
557 EXPECT_EQ(75, sender_.RtcpReceived().UniqueNackRequestsInPercent()); | 556 EXPECT_EQ(75, sender_.RtcpReceived().UniqueNackRequestsInPercent()); |
558 } | 557 } |
559 } // namespace webrtc | 558 } // namespace webrtc |
OLD | NEW |