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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/video_coding/frame_buffer2.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/frame_buffer2_unittest.cc
diff --git a/webrtc/modules/video_coding/frame_buffer2_unittest.cc b/webrtc/modules/video_coding/frame_buffer2_unittest.cc
index 6079bb95dd09cdad0033bce7d72b85faa70d7c9a..96be01f83de075fe21ddcb750843a3c1ce9c2734 100644
--- a/webrtc/modules/video_coding/frame_buffer2_unittest.cc
+++ b/webrtc/modules/video_coding/frame_buffer2_unittest.cc
@@ -419,5 +419,22 @@ TEST_F(TestFrameBuffer2, LastContinuousFrameTwoLayers) {
EXPECT_EQ(pid + 3, InsertFrame(pid + 3, 1, ts, true, pid + 2));
}
+TEST_F(TestFrameBuffer2, PictureIdJumpBack) {
+ uint16_t pid = Rand();
+ uint32_t ts = Rand();
+
+ EXPECT_EQ(pid, InsertFrame(pid, 0, ts, false));
+ EXPECT_EQ(pid + 1, InsertFrame(pid + 1, 0, ts + 1, false, pid));
+ ExtractFrame();
+ CheckFrame(0, pid, 0);
+
+ // Jump back in pid but increase ts.
+ EXPECT_EQ(pid - 1, InsertFrame(pid - 1, 0, ts + 2, false));
+ ExtractFrame();
+ ExtractFrame();
+ CheckFrame(1, pid - 1, 0);
+ CheckNoFrame(2);
+}
+
} // namespace video_coding
} // namespace webrtc
« 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