Break backwards traversal loop if we have looped around all packets in the PacketBuffer for H264 frames.
BUG=webrtc:7532 Review-Url: https://codereview.webrtc.org/2868723003 Cr-Commit-Position: refs/heads/master@{#18191}
This commit is contained in:
@ -477,5 +477,29 @@ TEST_F(TestPacketBuffer, ContinuousSeqNumDoubleMarkerBit) {
|
||||
EXPECT_EQ(0UL, frames_from_callback_.size());
|
||||
}
|
||||
|
||||
TEST_F(TestPacketBuffer, OneH264FrameFillBuffer) {
|
||||
VCMPacket packet;
|
||||
packet.seqNum = 0;
|
||||
packet.codec = kVideoCodecH264;
|
||||
packet.dataPtr = nullptr;
|
||||
packet.sizeBytes = 0;
|
||||
packet.is_first_packet_in_frame = true;
|
||||
packet.markerBit = false;
|
||||
packet_buffer_->InsertPacket(&packet);
|
||||
|
||||
packet.is_first_packet_in_frame = false;
|
||||
for (int i = 1; i < kStartSize - 1; ++i) {
|
||||
packet.seqNum = i;
|
||||
packet_buffer_->InsertPacket(&packet);
|
||||
}
|
||||
|
||||
packet.seqNum = kStartSize - 1;
|
||||
packet.markerBit = true;
|
||||
packet_buffer_->InsertPacket(&packet);
|
||||
|
||||
EXPECT_EQ(1UL, frames_from_callback_.size());
|
||||
CheckFrame(0);
|
||||
}
|
||||
|
||||
} // namespace video_coding
|
||||
} // namespace webrtc
|
||||
|
||||
Reference in New Issue
Block a user