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

Unified Diff: webrtc/modules/video_coding/video_packet_buffer_unittest.cc

Issue 2990183002: Revert of Fix off-by-one bugs in video_coding::PacketBuffer when the buffer is filled with a single frame. (Closed)
Patch Set: Created 3 years, 4 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/packet_buffer.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/video_packet_buffer_unittest.cc
diff --git a/webrtc/modules/video_coding/video_packet_buffer_unittest.cc b/webrtc/modules/video_coding/video_packet_buffer_unittest.cc
index 54a1871963c665c848be7d9fa40ce86d4d976ecf..e2537b8dc29b718bfa064b0e24746b4911e141a8 100644
--- a/webrtc/modules/video_coding/video_packet_buffer_unittest.cc
+++ b/webrtc/modules/video_coding/video_packet_buffer_unittest.cc
@@ -98,8 +98,8 @@
<< ".";
}
- static constexpr int kStartSize = 16;
- static constexpr int kMaxSize = 64;
+ const int kStartSize = 16;
+ const int kMaxSize = 64;
Random rand_;
std::unique_ptr<SimulatedClock> clock_;
@@ -374,59 +374,8 @@
ASSERT_EQ(1UL, frames_from_callback_.size());
CheckFrame(seq_num);
- EXPECT_EQ(frames_from_callback_[seq_num]->size(), sizeof(result));
EXPECT_TRUE(frames_from_callback_[seq_num]->GetBitstream(result));
EXPECT_EQ(memcmp(result, "many bitstream, such data", sizeof(result)), 0);
-}
-
-TEST_F(TestPacketBuffer, GetBitstreamOneFrameFullBuffer) {
- uint8_t* data_arr[kStartSize];
- uint8_t expected[kStartSize];
- uint8_t result[kStartSize];
-
- for (uint8_t i = 0; i < kStartSize; ++i) {
- data_arr[i] = new uint8_t[1];
- data_arr[i][0] = i;
- expected[i] = i;
- }
-
- EXPECT_TRUE(Insert(0, kKeyFrame, kFirst, kNotLast, 1, data_arr[0]));
- for (uint8_t i = 1; i < kStartSize - 1; ++i)
- EXPECT_TRUE(Insert(i, kKeyFrame, kNotFirst, kNotLast, 1, data_arr[i]));
- EXPECT_TRUE(Insert(kStartSize - 1, kKeyFrame, kNotFirst, kLast, 1,
- data_arr[kStartSize - 1]));
-
- ASSERT_EQ(1UL, frames_from_callback_.size());
- CheckFrame(0);
- EXPECT_EQ(frames_from_callback_[0]->size(), static_cast<size_t>(kStartSize));
- EXPECT_TRUE(frames_from_callback_[0]->GetBitstream(result));
- EXPECT_EQ(memcmp(result, expected, kStartSize), 0);
-}
-
-TEST_F(TestPacketBuffer, GetBitstreamOneFrameFullBufferH264) {
- uint8_t* data_arr[kStartSize];
- uint8_t expected[kStartSize];
- uint8_t result[kStartSize];
-
- for (uint8_t i = 0; i < kStartSize; ++i) {
- data_arr[i] = new uint8_t[1];
- data_arr[i][0] = i;
- expected[i] = i;
- }
-
- EXPECT_TRUE(InsertH264(0, kKeyFrame, kFirst, kNotLast, 1, 1, data_arr[0]));
- for (uint8_t i = 1; i < kStartSize - 1; ++i) {
- EXPECT_TRUE(
- InsertH264(i, kKeyFrame, kNotFirst, kNotLast, 1, 1, data_arr[i]));
- }
- EXPECT_TRUE(InsertH264(kStartSize - 1, kKeyFrame, kNotFirst, kLast, 1, 1,
- data_arr[kStartSize - 1]));
-
- ASSERT_EQ(1UL, frames_from_callback_.size());
- CheckFrame(0);
- EXPECT_EQ(frames_from_callback_[0]->size(), static_cast<size_t>(kStartSize));
- EXPECT_TRUE(frames_from_callback_[0]->GetBitstream(result));
- EXPECT_EQ(memcmp(result, expected, kStartSize), 0);
}
TEST_F(TestPacketBuffer, GetBitstreamH264BufferPadding) {
@@ -599,23 +548,6 @@
CheckFrame(0);
}
-TEST_F(TestPacketBuffer, CreateFramesAfterFilledBufferH264) {
- InsertH264(kStartSize - 2, kKeyFrame, kFirst, kLast, 0);
- ASSERT_EQ(1UL, frames_from_callback_.size());
- frames_from_callback_.clear();
-
- InsertH264(kStartSize, kDeltaFrame, kFirst, kNotLast, 2000);
- for (int i = 1; i < kStartSize; ++i)
- InsertH264(kStartSize + i, kDeltaFrame, kNotFirst, kNotLast, 2000);
- InsertH264(kStartSize + kStartSize, kDeltaFrame, kNotFirst, kLast, 2000);
- ASSERT_EQ(0UL, frames_from_callback_.size());
-
- InsertH264(kStartSize - 1, kKeyFrame, kFirst, kLast, 1000);
- ASSERT_EQ(2UL, frames_from_callback_.size());
- CheckFrame(kStartSize - 1);
- CheckFrame(kStartSize);
-}
-
TEST_F(TestPacketBuffer, OneFrameMaxSeqNumH264) {
InsertH264(65534, kKeyFrame, kFirst, kNotLast, 1000);
InsertH264(65535, kKeyFrame, kNotFirst, kLast, 1000);
« no previous file with comments | « webrtc/modules/video_coding/packet_buffer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698