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

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

Issue 2258523005: Style cleanup in UpdateTmmbr: (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: . Created 4 years, 4 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 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 731
732 TEST_F(RtcpSenderTest, SendTmmbn) { 732 TEST_F(RtcpSenderTest, SendTmmbn) {
733 rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound); 733 rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound);
734 rtcp_sender_->SetSendingStatus(feedback_state(), true); 734 rtcp_sender_->SetSendingStatus(feedback_state(), true);
735 std::vector<rtcp::TmmbItem> bounding_set; 735 std::vector<rtcp::TmmbItem> bounding_set;
736 const uint32_t kBitrateKbps = 32768; 736 const uint32_t kBitrateKbps = 32768;
737 const uint32_t kPacketOh = 40; 737 const uint32_t kPacketOh = 40;
738 const uint32_t kSourceSsrc = 12345; 738 const uint32_t kSourceSsrc = 12345;
739 const rtcp::TmmbItem tmmbn(kSourceSsrc, kBitrateKbps * 1000, kPacketOh); 739 const rtcp::TmmbItem tmmbn(kSourceSsrc, kBitrateKbps * 1000, kPacketOh);
740 bounding_set.push_back(tmmbn); 740 bounding_set.push_back(tmmbn);
741 rtcp_sender_->SetTMMBN(&bounding_set); 741 rtcp_sender_->SetTmmbn(bounding_set);
742 742
743 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpSr)); 743 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpSr));
744 EXPECT_EQ(1, parser()->sender_report()->num_packets()); 744 EXPECT_EQ(1, parser()->sender_report()->num_packets());
745 EXPECT_EQ(1, parser()->tmmbn()->num_packets()); 745 EXPECT_EQ(1, parser()->tmmbn()->num_packets());
746 EXPECT_EQ(kSenderSsrc, parser()->tmmbn()->Ssrc()); 746 EXPECT_EQ(kSenderSsrc, parser()->tmmbn()->Ssrc());
747 EXPECT_EQ(1, parser()->tmmbn_items()->num_packets()); 747 EXPECT_EQ(1, parser()->tmmbn_items()->num_packets());
748 EXPECT_EQ(kBitrateKbps, parser()->tmmbn_items()->BitrateKbps(0)); 748 EXPECT_EQ(kBitrateKbps, parser()->tmmbn_items()->BitrateKbps(0));
749 EXPECT_EQ(kPacketOh, parser()->tmmbn_items()->Overhead(0)); 749 EXPECT_EQ(kPacketOh, parser()->tmmbn_items()->Overhead(0));
750 EXPECT_EQ(kSourceSsrc, parser()->tmmbn_items()->Ssrc(0)); 750 EXPECT_EQ(kSourceSsrc, parser()->tmmbn_items()->Ssrc(0));
751 } 751 }
752 752
753 // This test is written to verify actual behaviour. It does not seem 753 // This test is written to verify actual behaviour. It does not seem
754 // to make much sense to send an empty TMMBN, since there is no place 754 // to make much sense to send an empty TMMBN, since there is no place
755 // to put an actual limit here. It's just information that no limit 755 // to put an actual limit here. It's just information that no limit
756 // is set, which is kind of the starting assumption. 756 // is set, which is kind of the starting assumption.
757 // See http://code.google.com/p/webrtc/issues/detail?id=468 for one 757 // See http://code.google.com/p/webrtc/issues/detail?id=468 for one
758 // situation where this caused confusion. 758 // situation where this caused confusion.
759 TEST_F(RtcpSenderTest, SendsTmmbnIfSetAndEmpty) { 759 TEST_F(RtcpSenderTest, SendsTmmbnIfSetAndEmpty) {
760 rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound); 760 rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound);
761 rtcp_sender_->SetSendingStatus(feedback_state(), true); 761 rtcp_sender_->SetSendingStatus(feedback_state(), true);
762 std::vector<rtcp::TmmbItem> bounding_set; 762 std::vector<rtcp::TmmbItem> bounding_set;
763 rtcp_sender_->SetTMMBN(&bounding_set); 763 rtcp_sender_->SetTmmbn(bounding_set);
764 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpSr)); 764 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpSr));
765 EXPECT_EQ(1, parser()->sender_report()->num_packets()); 765 EXPECT_EQ(1, parser()->sender_report()->num_packets());
766 EXPECT_EQ(1, parser()->tmmbn()->num_packets()); 766 EXPECT_EQ(1, parser()->tmmbn()->num_packets());
767 EXPECT_EQ(kSenderSsrc, parser()->tmmbn()->Ssrc()); 767 EXPECT_EQ(kSenderSsrc, parser()->tmmbn()->Ssrc());
768 EXPECT_EQ(0, parser()->tmmbn_items()->num_packets()); 768 EXPECT_EQ(0, parser()->tmmbn_items()->num_packets());
769 } 769 }
770 770
771 TEST_F(RtcpSenderTest, SendCompoundPliRemb) { 771 TEST_F(RtcpSenderTest, SendCompoundPliRemb) {
772 const int kBitrate = 261011; 772 const int kBitrate = 261011;
773 std::vector<uint32_t> ssrcs; 773 std::vector<uint32_t> ssrcs;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 rtcp_sender_->SetLastRtpTime(kRtpTimestamp, clock_.TimeInMilliseconds()); 817 rtcp_sender_->SetLastRtpTime(kRtpTimestamp, clock_.TimeInMilliseconds());
818 818
819 // Set up XR VoIP metric to be included with BYE 819 // Set up XR VoIP metric to be included with BYE
820 rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound); 820 rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound);
821 RTCPVoIPMetric metric; 821 RTCPVoIPMetric metric;
822 EXPECT_EQ(0, rtcp_sender_->SetRTCPVoIPMetrics(&metric)); 822 EXPECT_EQ(0, rtcp_sender_->SetRTCPVoIPMetrics(&metric));
823 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpBye)); 823 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpBye));
824 } 824 }
825 825
826 } // namespace webrtc 826 } // 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.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698