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

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

Issue 2372713005: Revert of Unify rtcp packet setters (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_sender.cc ('k') | webrtc/video/end_to_end_tests.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 kVideoFrameKey, codec_.plType, 0, 0, payload, 209 kVideoFrameKey, codec_.plType, 0, 0, payload,
210 sizeof(payload), nullptr, &rtp_video_header, nullptr)); 210 sizeof(payload), nullptr, &rtp_video_header, nullptr));
211 } 211 }
212 212
213 void IncomingRtcpNack(const RtpRtcpModule* module, uint16_t sequence_number) { 213 void IncomingRtcpNack(const RtpRtcpModule* module, uint16_t sequence_number) {
214 bool sender = module->impl_->SSRC() == kSenderSsrc; 214 bool sender = module->impl_->SSRC() == kSenderSsrc;
215 rtcp::Nack nack; 215 rtcp::Nack nack;
216 uint16_t list[1]; 216 uint16_t list[1];
217 list[0] = sequence_number; 217 list[0] = sequence_number;
218 const uint16_t kListLength = sizeof(list) / sizeof(list[0]); 218 const uint16_t kListLength = sizeof(list) / sizeof(list[0]);
219 nack.SetSenderSsrc(sender ? kReceiverSsrc : kSenderSsrc); 219 nack.From(sender ? kReceiverSsrc : kSenderSsrc);
220 nack.SetMediaSsrc(sender ? kSenderSsrc : kReceiverSsrc); 220 nack.To(sender ? kSenderSsrc : kReceiverSsrc);
221 nack.SetPacketIds(list, kListLength); 221 nack.WithList(list, kListLength);
222 rtc::Buffer packet = nack.Build(); 222 rtc::Buffer packet = nack.Build();
223 EXPECT_EQ(0, module->impl_->IncomingRtcpPacket(packet.data(), 223 EXPECT_EQ(0, module->impl_->IncomingRtcpPacket(packet.data(),
224 packet.size())); 224 packet.size()));
225 } 225 }
226 }; 226 };
227 227
228 TEST_F(RtpRtcpImplTest, SetSelectiveRetransmissions_BaseLayer) { 228 TEST_F(RtpRtcpImplTest, SetSelectiveRetransmissions_BaseLayer) {
229 sender_.impl_->SetSelectiveRetransmissions(kRetransmitBaseLayer); 229 sender_.impl_->SetSelectiveRetransmissions(kRetransmitBaseLayer);
230 EXPECT_EQ(kRetransmitBaseLayer, sender_.impl_->SelectiveRetransmissions()); 230 EXPECT_EQ(kRetransmitBaseLayer, sender_.impl_->SelectiveRetransmissions());
231 231
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 EXPECT_EQ(6U, receiver_.RtcpSent().unique_nack_requests); 549 EXPECT_EQ(6U, receiver_.RtcpSent().unique_nack_requests);
550 EXPECT_THAT(receiver_.LastNackListSent(), ElementsAre(11, 18, 20, 21)); 550 EXPECT_THAT(receiver_.LastNackListSent(), ElementsAre(11, 18, 20, 21));
551 551
552 // Send module receives the request. 552 // Send module receives the request.
553 EXPECT_EQ(2U, sender_.RtcpReceived().nack_packets); 553 EXPECT_EQ(2U, sender_.RtcpReceived().nack_packets);
554 EXPECT_EQ(8U, sender_.RtcpReceived().nack_requests); 554 EXPECT_EQ(8U, sender_.RtcpReceived().nack_requests);
555 EXPECT_EQ(6U, sender_.RtcpReceived().unique_nack_requests); 555 EXPECT_EQ(6U, sender_.RtcpReceived().unique_nack_requests);
556 EXPECT_EQ(75, sender_.RtcpReceived().UniqueNackRequestsInPercent()); 556 EXPECT_EQ(75, sender_.RtcpReceived().UniqueNackRequestsInPercent());
557 } 557 }
558 } // namespace webrtc 558 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_sender.cc ('k') | webrtc/video/end_to_end_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698