| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |