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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 ModuleRtpRtcpImpl* receiver_; | 90 ModuleRtpRtcpImpl* receiver_; |
91 SimulatedClock* clock_; | 91 SimulatedClock* clock_; |
92 int64_t delay_ms_; | 92 int64_t delay_ms_; |
93 int rtp_packets_sent_; | 93 int rtp_packets_sent_; |
94 RTPHeader last_rtp_header_; | 94 RTPHeader last_rtp_header_; |
95 std::vector<uint16_t> last_nack_list_; | 95 std::vector<uint16_t> last_nack_list_; |
96 }; | 96 }; |
97 | 97 |
98 class RtpRtcpModule : public RtcpPacketTypeCounterObserver { | 98 class RtpRtcpModule : public RtcpPacketTypeCounterObserver { |
99 public: | 99 public: |
100 RtpRtcpModule(SimulatedClock* clock) | 100 explicit RtpRtcpModule(SimulatedClock* clock) |
101 : receive_statistics_(ReceiveStatistics::Create(clock)) { | 101 : receive_statistics_(ReceiveStatistics::Create(clock)) { |
102 RtpRtcp::Configuration config; | 102 RtpRtcp::Configuration config; |
103 config.audio = false; | 103 config.audio = false; |
104 config.clock = clock; | 104 config.clock = clock; |
105 config.outgoing_transport = &transport_; | 105 config.outgoing_transport = &transport_; |
106 config.receive_statistics = receive_statistics_.get(); | 106 config.receive_statistics = receive_statistics_.get(); |
107 config.rtcp_packet_type_counter_observer = this; | 107 config.rtcp_packet_type_counter_observer = this; |
108 config.rtt_stats = &rtt_stats_; | 108 config.rtt_stats = &rtt_stats_; |
109 | 109 |
110 impl_.reset(new ModuleRtpRtcpImpl(config)); | 110 impl_.reset(new ModuleRtpRtcpImpl(config)); |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 EXPECT_EQ(6U, receiver_.RtcpSent().unique_nack_requests); | 540 EXPECT_EQ(6U, receiver_.RtcpSent().unique_nack_requests); |
541 EXPECT_THAT(receiver_.LastNackListSent(), ElementsAre(11, 18, 20, 21)); | 541 EXPECT_THAT(receiver_.LastNackListSent(), ElementsAre(11, 18, 20, 21)); |
542 | 542 |
543 // Send module receives the request. | 543 // Send module receives the request. |
544 EXPECT_EQ(2U, sender_.RtcpReceived().nack_packets); | 544 EXPECT_EQ(2U, sender_.RtcpReceived().nack_packets); |
545 EXPECT_EQ(8U, sender_.RtcpReceived().nack_requests); | 545 EXPECT_EQ(8U, sender_.RtcpReceived().nack_requests); |
546 EXPECT_EQ(6U, sender_.RtcpReceived().unique_nack_requests); | 546 EXPECT_EQ(6U, sender_.RtcpReceived().unique_nack_requests); |
547 EXPECT_EQ(75, sender_.RtcpReceived().UniqueNackRequestsInPercent()); | 547 EXPECT_EQ(75, sender_.RtcpReceived().UniqueNackRequestsInPercent()); |
548 } | 548 } |
549 } // namespace webrtc | 549 } // namespace webrtc |
OLD | NEW |