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

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

Issue 1452733002: rtcp::VoipMetric block moved into own file and got Parse function (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years 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 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 583
584 TEST_F(RtcpReceiverTest, InjectXrVoipPacket) { 584 TEST_F(RtcpReceiverTest, InjectXrVoipPacket) {
585 const uint32_t kSourceSsrc = 0x123456; 585 const uint32_t kSourceSsrc = 0x123456;
586 std::set<uint32_t> ssrcs; 586 std::set<uint32_t> ssrcs;
587 ssrcs.insert(kSourceSsrc); 587 ssrcs.insert(kSourceSsrc);
588 rtcp_receiver_->SetSsrcs(kSourceSsrc, ssrcs); 588 rtcp_receiver_->SetSsrcs(kSourceSsrc, ssrcs);
589 589
590 const uint8_t kLossRate = 123; 590 const uint8_t kLossRate = 123;
591 rtcp::VoipMetric voip_metric; 591 rtcp::VoipMetric voip_metric;
592 voip_metric.To(kSourceSsrc); 592 voip_metric.To(kSourceSsrc);
593 voip_metric.LossRate(kLossRate); 593 RTCPVoIPMetric metric;
594 metric.lossRate = kLossRate;
595 voip_metric.WithVoipMetric(metric);
594 rtcp::Xr xr; 596 rtcp::Xr xr;
595 xr.From(0x2345); 597 xr.From(0x2345);
596 xr.WithVoipMetric(&voip_metric); 598 xr.WithVoipMetric(&voip_metric);
597 rtc::scoped_ptr<rtcp::RawPacket> packet(xr.Build()); 599 rtc::scoped_ptr<rtcp::RawPacket> packet(xr.Build());
598 EXPECT_EQ(0, InjectRtcpPacket(packet->Buffer(), packet->Length())); 600 EXPECT_EQ(0, InjectRtcpPacket(packet->Buffer(), packet->Length()));
599 ASSERT_TRUE(rtcp_packet_info_.VoIPMetric != nullptr); 601 ASSERT_TRUE(rtcp_packet_info_.VoIPMetric != nullptr);
600 EXPECT_EQ(kLossRate, rtcp_packet_info_.VoIPMetric->lossRate); 602 EXPECT_EQ(kLossRate, rtcp_packet_info_.VoIPMetric->lossRate);
601 EXPECT_EQ(kRtcpXrVoipMetric, rtcp_packet_info_.rtcpPacketTypeFlags); 603 EXPECT_EQ(kRtcpXrVoipMetric, rtcp_packet_info_.rtcpPacketTypeFlags);
602 } 604 }
603 605
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 1092
1091 // Transport feedback should be ignored, but next packet should work. 1093 // Transport feedback should be ignored, but next packet should work.
1092 EXPECT_EQ(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpTransportFeedback); 1094 EXPECT_EQ(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpTransportFeedback);
1093 EXPECT_NE(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpRemb); 1095 EXPECT_NE(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpRemb);
1094 EXPECT_EQ(kBitrateBps, rtcp_packet_info_.receiverEstimatedMaxBitrate); 1096 EXPECT_EQ(kBitrateBps, rtcp_packet_info_.receiverEstimatedMaxBitrate);
1095 } 1097 }
1096 1098
1097 } // Anonymous namespace 1099 } // Anonymous namespace
1098 1100
1099 } // namespace webrtc 1101 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_packet_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