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

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: 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 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 580
581 TEST_F(RtcpReceiverTest, InjectXrVoipPacket) { 581 TEST_F(RtcpReceiverTest, InjectXrVoipPacket) {
582 const uint32_t kSourceSsrc = 0x123456; 582 const uint32_t kSourceSsrc = 0x123456;
583 std::set<uint32_t> ssrcs; 583 std::set<uint32_t> ssrcs;
584 ssrcs.insert(kSourceSsrc); 584 ssrcs.insert(kSourceSsrc);
585 rtcp_receiver_->SetSsrcs(kSourceSsrc, ssrcs); 585 rtcp_receiver_->SetSsrcs(kSourceSsrc, ssrcs);
586 586
587 const uint8_t kLossRate = 123; 587 const uint8_t kLossRate = 123;
588 rtcp::VoipMetric voip_metric; 588 rtcp::VoipMetric voip_metric;
589 voip_metric.To(kSourceSsrc); 589 voip_metric.To(kSourceSsrc);
590 voip_metric.LossRate(kLossRate); 590 RTCPVoIPMetric metric;
591 metric.lossRate = kLossRate;
592 voip_metric.WithVoipMetric(metric);
591 rtcp::Xr xr; 593 rtcp::Xr xr;
592 xr.From(0x2345); 594 xr.From(0x2345);
593 xr.WithVoipMetric(&voip_metric); 595 xr.WithVoipMetric(&voip_metric);
594 rtc::scoped_ptr<rtcp::RawPacket> packet(xr.Build()); 596 rtc::scoped_ptr<rtcp::RawPacket> packet(xr.Build());
595 EXPECT_EQ(0, InjectRtcpPacket(packet->Buffer(), packet->Length())); 597 EXPECT_EQ(0, InjectRtcpPacket(packet->Buffer(), packet->Length()));
596 ASSERT_TRUE(rtcp_packet_info_.VoIPMetric != nullptr); 598 ASSERT_TRUE(rtcp_packet_info_.VoIPMetric != nullptr);
597 EXPECT_EQ(kLossRate, rtcp_packet_info_.VoIPMetric->lossRate); 599 EXPECT_EQ(kLossRate, rtcp_packet_info_.VoIPMetric->lossRate);
598 EXPECT_EQ(kRtcpXrVoipMetric, rtcp_packet_info_.rtcpPacketTypeFlags); 600 EXPECT_EQ(kRtcpXrVoipMetric, rtcp_packet_info_.rtcpPacketTypeFlags);
599 } 601 }
600 602
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 1091
1090 // Transport feedback should be ignored, but next packet should work. 1092 // Transport feedback should be ignored, but next packet should work.
1091 EXPECT_EQ(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpTransportFeedback); 1093 EXPECT_EQ(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpTransportFeedback);
1092 EXPECT_NE(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpRemb); 1094 EXPECT_NE(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpRemb);
1093 EXPECT_EQ(kBitrateBps, rtcp_packet_info_.receiverEstimatedMaxBitrate); 1095 EXPECT_EQ(kBitrateBps, rtcp_packet_info_.receiverEstimatedMaxBitrate);
1094 } 1096 }
1095 1097
1096 } // Anonymous namespace 1098 } // Anonymous namespace
1097 1099
1098 } // namespace webrtc 1100 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698