OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 RtcpSenderTest() | 231 RtcpSenderTest() |
232 : clock_(1335900000), | 232 : clock_(1335900000), |
233 receive_statistics_(ReceiveStatistics::Create(&clock_)) { | 233 receive_statistics_(ReceiveStatistics::Create(&clock_)) { |
234 RtpRtcp::Configuration configuration; | 234 RtpRtcp::Configuration configuration; |
235 configuration.audio = false; | 235 configuration.audio = false; |
236 configuration.clock = &clock_; | 236 configuration.clock = &clock_; |
237 configuration.outgoing_transport = &test_transport_; | 237 configuration.outgoing_transport = &test_transport_; |
238 | 238 |
239 rtp_rtcp_impl_.reset(new ModuleRtpRtcpImpl(configuration)); | 239 rtp_rtcp_impl_.reset(new ModuleRtpRtcpImpl(configuration)); |
240 rtcp_sender_.reset(new RTCPSender(false, &clock_, receive_statistics_.get(), | 240 rtcp_sender_.reset(new RTCPSender(false, &clock_, receive_statistics_.get(), |
241 nullptr, nullptr, &test_transport_)); | 241 nullptr, &test_transport_)); |
242 rtcp_sender_->SetSSRC(kSenderSsrc); | 242 rtcp_sender_->SetSSRC(kSenderSsrc); |
243 rtcp_sender_->SetRemoteSSRC(kRemoteSsrc); | 243 rtcp_sender_->SetRemoteSSRC(kRemoteSsrc); |
244 } | 244 } |
245 | 245 |
246 void InsertIncomingPacket(uint32_t remote_ssrc, uint16_t seq_num) { | 246 void InsertIncomingPacket(uint32_t remote_ssrc, uint16_t seq_num) { |
247 RTPHeader header; | 247 RTPHeader header; |
248 header.ssrc = remote_ssrc; | 248 header.ssrc = remote_ssrc; |
249 header.sequenceNumber = seq_num; | 249 header.sequenceNumber = seq_num; |
250 header.timestamp = 12345; | 250 header.timestamp = 12345; |
251 header.headerLength = 12; | 251 header.headerLength = 12; |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 EXPECT_EQ(0, rtcp_sender_->SetSendingStatus(feedback_state(), false)); | 639 EXPECT_EQ(0, rtcp_sender_->SetSendingStatus(feedback_state(), false)); |
640 rtcp_sender_->SendRtcpXrReceiverReferenceTime(false); | 640 rtcp_sender_->SendRtcpXrReceiverReferenceTime(false); |
641 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpReport)); | 641 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpReport)); |
642 EXPECT_EQ(0, parser()->xr_header()->num_packets()); | 642 EXPECT_EQ(0, parser()->xr_header()->num_packets()); |
643 EXPECT_EQ(0, parser()->rrtr()->num_packets()); | 643 EXPECT_EQ(0, parser()->rrtr()->num_packets()); |
644 } | 644 } |
645 | 645 |
646 TEST_F(RtcpSenderTest, TestRegisterRtcpPacketTypeObserver) { | 646 TEST_F(RtcpSenderTest, TestRegisterRtcpPacketTypeObserver) { |
647 RtcpPacketTypeCounterObserverImpl observer; | 647 RtcpPacketTypeCounterObserverImpl observer; |
648 rtcp_sender_.reset(new RTCPSender(false, &clock_, receive_statistics_.get(), | 648 rtcp_sender_.reset(new RTCPSender(false, &clock_, receive_statistics_.get(), |
649 &observer, nullptr, &test_transport_)); | 649 &observer, &test_transport_)); |
650 rtcp_sender_->SetRemoteSSRC(kRemoteSsrc); | 650 rtcp_sender_->SetRemoteSSRC(kRemoteSsrc); |
651 rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize); | 651 rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize); |
652 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpPli)); | 652 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpPli)); |
653 EXPECT_EQ(1, parser()->pli()->num_packets()); | 653 EXPECT_EQ(1, parser()->pli()->num_packets()); |
654 EXPECT_EQ(kRemoteSsrc, observer.ssrc_); | 654 EXPECT_EQ(kRemoteSsrc, observer.ssrc_); |
655 EXPECT_EQ(1U, observer.counter_.pli_packets); | 655 EXPECT_EQ(1U, observer.counter_.pli_packets); |
656 EXPECT_EQ(clock_.TimeInMilliseconds(), | 656 EXPECT_EQ(clock_.TimeInMilliseconds(), |
657 observer.counter_.first_packet_time_ms); | 657 observer.counter_.first_packet_time_ms); |
658 } | 658 } |
659 | 659 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 EXPECT_TRUE(is_last_packet) << | 759 EXPECT_TRUE(is_last_packet) << |
760 "Bye packet should be last in a compound RTCP packet."; | 760 "Bye packet should be last in a compound RTCP packet."; |
761 } | 761 } |
762 } | 762 } |
763 | 763 |
764 return true; | 764 return true; |
765 })); | 765 })); |
766 | 766 |
767 // Re-configure rtcp_sender_ with mock_transport_ | 767 // Re-configure rtcp_sender_ with mock_transport_ |
768 rtcp_sender_.reset(new RTCPSender(false, &clock_, receive_statistics_.get(), | 768 rtcp_sender_.reset(new RTCPSender(false, &clock_, receive_statistics_.get(), |
769 nullptr, nullptr, &mock_transport)); | 769 nullptr, &mock_transport)); |
770 rtcp_sender_->SetSSRC(kSenderSsrc); | 770 rtcp_sender_->SetSSRC(kSenderSsrc); |
771 rtcp_sender_->SetRemoteSSRC(kRemoteSsrc); | 771 rtcp_sender_->SetRemoteSSRC(kRemoteSsrc); |
772 | 772 |
773 // Set up XR VoIP metric to be included with BYE | 773 // Set up XR VoIP metric to be included with BYE |
774 rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound); | 774 rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound); |
775 RTCPVoIPMetric metric; | 775 RTCPVoIPMetric metric; |
776 EXPECT_EQ(0, rtcp_sender_->SetRTCPVoIPMetrics(&metric)); | 776 EXPECT_EQ(0, rtcp_sender_->SetRTCPVoIPMetrics(&metric)); |
777 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpBye)); | 777 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpBye)); |
778 } | 778 } |
779 | 779 |
780 } // namespace webrtc | 780 } // namespace webrtc |
OLD | NEW |