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

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

Issue 1544403002: [rtp_rtcp] rtcp::Fir cleaned and got Parse function. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: 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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 EXPECT_EQ(0U, rtcp_packet_info_.rtcpPacketTypeFlags); 545 EXPECT_EQ(0U, rtcp_packet_info_.rtcpPacketTypeFlags);
546 } 546 }
547 547
548 TEST_F(RtcpReceiverTest, InjectFirPacket) { 548 TEST_F(RtcpReceiverTest, InjectFirPacket) {
549 const uint32_t kSourceSsrc = 0x123456; 549 const uint32_t kSourceSsrc = 0x123456;
550 std::set<uint32_t> ssrcs; 550 std::set<uint32_t> ssrcs;
551 ssrcs.insert(kSourceSsrc); 551 ssrcs.insert(kSourceSsrc);
552 rtcp_receiver_->SetSsrcs(kSourceSsrc, ssrcs); 552 rtcp_receiver_->SetSsrcs(kSourceSsrc, ssrcs);
553 553
554 rtcp::Fir fir; 554 rtcp::Fir fir;
555 fir.To(kSourceSsrc); 555 fir.WithRequestTo(kSourceSsrc, 13);
556 rtc::scoped_ptr<rtcp::RawPacket> packet(fir.Build()); 556 rtc::scoped_ptr<rtcp::RawPacket> packet(fir.Build());
557 EXPECT_EQ(0, InjectRtcpPacket(packet->Buffer(), packet->Length())); 557 EXPECT_EQ(0, InjectRtcpPacket(packet->Buffer(), packet->Length()));
558 EXPECT_EQ(kRtcpFir, rtcp_packet_info_.rtcpPacketTypeFlags); 558 EXPECT_EQ(kRtcpFir, rtcp_packet_info_.rtcpPacketTypeFlags);
559 } 559 }
560 560
561 TEST_F(RtcpReceiverTest, FirPacketNotToUsIgnored) { 561 TEST_F(RtcpReceiverTest, FirPacketNotToUsIgnored) {
562 const uint32_t kSourceSsrc = 0x123456; 562 const uint32_t kSourceSsrc = 0x123456;
563 std::set<uint32_t> ssrcs; 563 std::set<uint32_t> ssrcs;
564 ssrcs.insert(kSourceSsrc); 564 ssrcs.insert(kSourceSsrc);
565 rtcp_receiver_->SetSsrcs(kSourceSsrc, ssrcs); 565 rtcp_receiver_->SetSsrcs(kSourceSsrc, ssrcs);
566 566
567 rtcp::Fir fir; 567 rtcp::Fir fir;
568 fir.To(kSourceSsrc + 1); 568 fir.WithRequestTo(kSourceSsrc + 1, 13);
569 rtc::scoped_ptr<rtcp::RawPacket> packet(fir.Build()); 569 rtc::scoped_ptr<rtcp::RawPacket> packet(fir.Build());
570 EXPECT_EQ(0, InjectRtcpPacket(packet->Buffer(), packet->Length())); 570 EXPECT_EQ(0, InjectRtcpPacket(packet->Buffer(), packet->Length()));
571 EXPECT_EQ(0U, rtcp_packet_info_.rtcpPacketTypeFlags); 571 EXPECT_EQ(0U, rtcp_packet_info_.rtcpPacketTypeFlags);
572 } 572 }
573 573
574 TEST_F(RtcpReceiverTest, InjectSliPacket) { 574 TEST_F(RtcpReceiverTest, InjectSliPacket) {
575 rtcp::Sli sli; 575 rtcp::Sli sli;
576 sli.WithPictureId(40); 576 sli.WithPictureId(40);
577 rtc::scoped_ptr<rtcp::RawPacket> packet(sli.Build()); 577 rtc::scoped_ptr<rtcp::RawPacket> packet(sli.Build());
578 EXPECT_EQ(0, InjectRtcpPacket(packet->Buffer(), packet->Length())); 578 EXPECT_EQ(0, InjectRtcpPacket(packet->Buffer(), packet->Length()));
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 1099
1100 // Transport feedback should be ignored, but next packet should work. 1100 // Transport feedback should be ignored, but next packet should work.
1101 EXPECT_EQ(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpTransportFeedback); 1101 EXPECT_EQ(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpTransportFeedback);
1102 EXPECT_NE(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpRemb); 1102 EXPECT_NE(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpRemb);
1103 EXPECT_EQ(kBitrateBps, rtcp_packet_info_.receiverEstimatedMaxBitrate); 1103 EXPECT_EQ(kBitrateBps, rtcp_packet_info_.receiverEstimatedMaxBitrate);
1104 } 1104 }
1105 1105
1106 } // Anonymous namespace 1106 } // Anonymous namespace
1107 1107
1108 } // namespace webrtc 1108 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_packet/fir_unittest.cc ('k') | webrtc/modules/rtp_rtcp/source/rtcp_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698