Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1981)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtcp_sender_unittest.cc

Issue 1571283002: Fixes a bug which incorrectly logs incoming RTCP as outgoing. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 RtcpSenderTest() 226 RtcpSenderTest()
227 : clock_(1335900000), 227 : clock_(1335900000),
228 receive_statistics_(ReceiveStatistics::Create(&clock_)) { 228 receive_statistics_(ReceiveStatistics::Create(&clock_)) {
229 RtpRtcp::Configuration configuration; 229 RtpRtcp::Configuration configuration;
230 configuration.audio = false; 230 configuration.audio = false;
231 configuration.clock = &clock_; 231 configuration.clock = &clock_;
232 configuration.outgoing_transport = &test_transport_; 232 configuration.outgoing_transport = &test_transport_;
233 233
234 rtp_rtcp_impl_.reset(new ModuleRtpRtcpImpl(configuration)); 234 rtp_rtcp_impl_.reset(new ModuleRtpRtcpImpl(configuration));
235 rtcp_sender_.reset(new RTCPSender(false, &clock_, receive_statistics_.get(), 235 rtcp_sender_.reset(new RTCPSender(false, &clock_, receive_statistics_.get(),
236 nullptr, &test_transport_)); 236 nullptr, nullptr, &test_transport_));
237 rtcp_sender_->SetSSRC(kSenderSsrc); 237 rtcp_sender_->SetSSRC(kSenderSsrc);
238 rtcp_sender_->SetRemoteSSRC(kRemoteSsrc); 238 rtcp_sender_->SetRemoteSSRC(kRemoteSsrc);
239 } 239 }
240 240
241 void InsertIncomingPacket(uint32_t remote_ssrc, uint16_t seq_num) { 241 void InsertIncomingPacket(uint32_t remote_ssrc, uint16_t seq_num) {
242 RTPHeader header; 242 RTPHeader header;
243 header.ssrc = remote_ssrc; 243 header.ssrc = remote_ssrc;
244 header.sequenceNumber = seq_num; 244 header.sequenceNumber = seq_num;
245 header.timestamp = 12345; 245 header.timestamp = 12345;
246 header.headerLength = 12; 246 header.headerLength = 12;
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 EXPECT_EQ(clock_.CurrentNtpInMilliseconds(), time_ms); 662 EXPECT_EQ(clock_.CurrentNtpInMilliseconds(), time_ms);
663 clock_.AdvanceTimeMilliseconds(1000); 663 clock_.AdvanceTimeMilliseconds(1000);
664 } 664 }
665 // The first report should no longer be stored. 665 // The first report should no longer be stored.
666 EXPECT_FALSE(rtcp_sender_->SendTimeOfXrRrReport(initial_mid_ntp, &time_ms)); 666 EXPECT_FALSE(rtcp_sender_->SendTimeOfXrRrReport(initial_mid_ntp, &time_ms));
667 } 667 }
668 668
669 TEST_F(RtcpSenderTest, TestRegisterRtcpPacketTypeObserver) { 669 TEST_F(RtcpSenderTest, TestRegisterRtcpPacketTypeObserver) {
670 RtcpPacketTypeCounterObserverImpl observer; 670 RtcpPacketTypeCounterObserverImpl observer;
671 rtcp_sender_.reset(new RTCPSender(false, &clock_, receive_statistics_.get(), 671 rtcp_sender_.reset(new RTCPSender(false, &clock_, receive_statistics_.get(),
672 &observer, &test_transport_)); 672 &observer, nullptr, &test_transport_));
673 rtcp_sender_->SetRemoteSSRC(kRemoteSsrc); 673 rtcp_sender_->SetRemoteSSRC(kRemoteSsrc);
674 rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize); 674 rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize);
675 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpPli)); 675 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpPli));
676 EXPECT_EQ(1, parser()->pli()->num_packets()); 676 EXPECT_EQ(1, parser()->pli()->num_packets());
677 EXPECT_EQ(kRemoteSsrc, observer.ssrc_); 677 EXPECT_EQ(kRemoteSsrc, observer.ssrc_);
678 EXPECT_EQ(1U, observer.counter_.pli_packets); 678 EXPECT_EQ(1U, observer.counter_.pli_packets);
679 EXPECT_EQ(clock_.TimeInMilliseconds(), 679 EXPECT_EQ(clock_.TimeInMilliseconds(),
680 observer.counter_.first_packet_time_ms); 680 observer.counter_.first_packet_time_ms);
681 } 681 }
682 682
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 rtcp_sender_->SetREMBData(kBitrate, ssrcs); 755 rtcp_sender_->SetREMBData(kBitrate, ssrcs);
756 std::set<RTCPPacketType> packet_types; 756 std::set<RTCPPacketType> packet_types;
757 packet_types.insert(kRtcpRemb); 757 packet_types.insert(kRtcpRemb);
758 packet_types.insert(kRtcpPli); 758 packet_types.insert(kRtcpPli);
759 EXPECT_EQ(0, rtcp_sender_->SendCompoundRTCP(feedback_state(), packet_types)); 759 EXPECT_EQ(0, rtcp_sender_->SendCompoundRTCP(feedback_state(), packet_types));
760 EXPECT_EQ(1, parser()->remb_item()->num_packets()); 760 EXPECT_EQ(1, parser()->remb_item()->num_packets());
761 EXPECT_EQ(1, parser()->pli()->num_packets()); 761 EXPECT_EQ(1, parser()->pli()->num_packets());
762 } 762 }
763 763
764 } // namespace webrtc 764 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_sender.cc ('k') | webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698