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

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

Issue 2640793003: Clear the FrameBuffer in case of backward jumps in the picture id. (Closed)
Patch Set: Created 3 years, 11 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/video_coding/frame_buffer2.cc ('k') | no next file » | 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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 EXPECT_EQ(pid, InsertFrame(pid, 0, ts, false)); 412 EXPECT_EQ(pid, InsertFrame(pid, 0, ts, false));
413 EXPECT_EQ(pid, InsertFrame(pid, 1, ts, true)); 413 EXPECT_EQ(pid, InsertFrame(pid, 1, ts, true));
414 EXPECT_EQ(pid, InsertFrame(pid + 1, 1, ts, true, pid)); 414 EXPECT_EQ(pid, InsertFrame(pid + 1, 1, ts, true, pid));
415 EXPECT_EQ(pid, InsertFrame(pid + 2, 0, ts, false, pid + 1)); 415 EXPECT_EQ(pid, InsertFrame(pid + 2, 0, ts, false, pid + 1));
416 EXPECT_EQ(pid, InsertFrame(pid + 2, 1, ts, true, pid + 1)); 416 EXPECT_EQ(pid, InsertFrame(pid + 2, 1, ts, true, pid + 1));
417 EXPECT_EQ(pid, InsertFrame(pid + 3, 0, ts, false, pid + 2)); 417 EXPECT_EQ(pid, InsertFrame(pid + 3, 0, ts, false, pid + 2));
418 EXPECT_EQ(pid + 3, InsertFrame(pid + 1, 0, ts, false, pid)); 418 EXPECT_EQ(pid + 3, InsertFrame(pid + 1, 0, ts, false, pid));
419 EXPECT_EQ(pid + 3, InsertFrame(pid + 3, 1, ts, true, pid + 2)); 419 EXPECT_EQ(pid + 3, InsertFrame(pid + 3, 1, ts, true, pid + 2));
420 } 420 }
421 421
422 TEST_F(TestFrameBuffer2, PictureIdJumpBack) {
423 uint16_t pid = Rand();
424 uint32_t ts = Rand();
425
426 EXPECT_EQ(pid, InsertFrame(pid, 0, ts, false));
427 EXPECT_EQ(pid + 1, InsertFrame(pid + 1, 0, ts + 1, false, pid));
428 ExtractFrame();
429 CheckFrame(0, pid, 0);
430
431 // Jump back in pid but increase ts.
432 EXPECT_EQ(pid - 1, InsertFrame(pid - 1, 0, ts + 2, false));
433 ExtractFrame();
434 ExtractFrame();
435 CheckFrame(1, pid - 1, 0);
436 CheckNoFrame(2);
437 }
438
422 } // namespace video_coding 439 } // namespace video_coding
423 } // namespace webrtc 440 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/frame_buffer2.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698