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

Side by Side Diff: webrtc/modules/video_coding/nack_module_unittest.cc

Issue 2574943003: Rename RTPVideoHeader.isFirstPacket to .is_first_packet_in_frame. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « webrtc/modules/video_coding/nack_module.cc ('k') | webrtc/modules/video_coding/packet.h » ('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) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 packet.seqNum = 0xfffe; 65 packet.seqNum = 0xfffe;
66 nack_module_.OnReceivedPacket(packet); 66 nack_module_.OnReceivedPacket(packet);
67 packet.seqNum = 1; 67 packet.seqNum = 1;
68 nack_module_.OnReceivedPacket(packet); 68 nack_module_.OnReceivedPacket(packet);
69 EXPECT_EQ(2u, sent_nacks_.size()); 69 EXPECT_EQ(2u, sent_nacks_.size());
70 EXPECT_EQ(0xffff, sent_nacks_[0]); 70 EXPECT_EQ(0xffff, sent_nacks_[0]);
71 EXPECT_EQ(0, sent_nacks_[1]); 71 EXPECT_EQ(0, sent_nacks_[1]);
72 72
73 sent_nacks_.clear(); 73 sent_nacks_.clear();
74 packet.frameType = kVideoFrameKey; 74 packet.frameType = kVideoFrameKey;
75 packet.isFirstPacket = true; 75 packet.is_first_packet_in_frame = true;
76 packet.seqNum = 2; 76 packet.seqNum = 2;
77 nack_module_.OnReceivedPacket(packet); 77 nack_module_.OnReceivedPacket(packet);
78 EXPECT_EQ(0u, sent_nacks_.size()); 78 EXPECT_EQ(0u, sent_nacks_.size());
79 79
80 packet.seqNum = 501; 80 packet.seqNum = 501;
81 nack_module_.OnReceivedPacket(packet); 81 nack_module_.OnReceivedPacket(packet);
82 EXPECT_EQ(498u, sent_nacks_.size()); 82 EXPECT_EQ(498u, sent_nacks_.size());
83 for (int seq_num = 3; seq_num < 501; ++seq_num) 83 for (int seq_num = 3; seq_num < 501; ++seq_num)
84 EXPECT_EQ(seq_num, sent_nacks_[seq_num - 3]); 84 EXPECT_EQ(seq_num, sent_nacks_[seq_num - 3]);
85 85
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 nack_module_.OnReceivedPacket(packet); 232 nack_module_.OnReceivedPacket(packet);
233 EXPECT_EQ(1000u, sent_nacks_.size()); 233 EXPECT_EQ(1000u, sent_nacks_.size());
234 EXPECT_EQ(1, keyframes_requested_); 234 EXPECT_EQ(1, keyframes_requested_);
235 } 235 }
236 236
237 TEST_F(TestNackModule, TooLargeNackListWithKeyFrame) { 237 TEST_F(TestNackModule, TooLargeNackListWithKeyFrame) {
238 VCMPacket packet; 238 VCMPacket packet;
239 packet.seqNum = 0; 239 packet.seqNum = 0;
240 nack_module_.OnReceivedPacket(packet); 240 nack_module_.OnReceivedPacket(packet);
241 packet.seqNum = 1; 241 packet.seqNum = 1;
242 packet.isFirstPacket = true; 242 packet.is_first_packet_in_frame = true;
243 packet.frameType = kVideoFrameKey; 243 packet.frameType = kVideoFrameKey;
244 nack_module_.OnReceivedPacket(packet); 244 nack_module_.OnReceivedPacket(packet);
245 packet.seqNum = 1001; 245 packet.seqNum = 1001;
246 packet.isFirstPacket = false; 246 packet.is_first_packet_in_frame = false;
247 packet.frameType = kVideoFrameKey; 247 packet.frameType = kVideoFrameKey;
248 nack_module_.OnReceivedPacket(packet); 248 nack_module_.OnReceivedPacket(packet);
249 EXPECT_EQ(999u, sent_nacks_.size()); 249 EXPECT_EQ(999u, sent_nacks_.size());
250 EXPECT_EQ(0, keyframes_requested_); 250 EXPECT_EQ(0, keyframes_requested_);
251 packet.seqNum = 1003; 251 packet.seqNum = 1003;
252 nack_module_.OnReceivedPacket(packet); 252 nack_module_.OnReceivedPacket(packet);
253 EXPECT_EQ(1000u, sent_nacks_.size()); 253 EXPECT_EQ(1000u, sent_nacks_.size());
254 EXPECT_EQ(0, keyframes_requested_); 254 EXPECT_EQ(0, keyframes_requested_);
255 packet.seqNum = 1005; 255 packet.seqNum = 1005;
256 nack_module_.OnReceivedPacket(packet); 256 nack_module_.OnReceivedPacket(packet);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 clock_->AdvanceTimeMilliseconds(100); 308 clock_->AdvanceTimeMilliseconds(100);
309 nack_module_.Process(); 309 nack_module_.Process();
310 packet.seqNum = 3; 310 packet.seqNum = 3;
311 EXPECT_EQ(3, nack_module_.OnReceivedPacket(packet)); 311 EXPECT_EQ(3, nack_module_.OnReceivedPacket(packet));
312 packet.seqNum = 4; 312 packet.seqNum = 4;
313 EXPECT_EQ(3, nack_module_.OnReceivedPacket(packet)); 313 EXPECT_EQ(3, nack_module_.OnReceivedPacket(packet));
314 EXPECT_EQ(0, nack_module_.OnReceivedPacket(packet)); 314 EXPECT_EQ(0, nack_module_.OnReceivedPacket(packet));
315 } 315 }
316 316
317 } // namespace webrtc 317 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/nack_module.cc ('k') | webrtc/modules/video_coding/packet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698