Refactor to free up PacketBuffer as soon as possible

The packets belonging to a frame were kept in PacketBuffer
until the frame was decoded. This CL clears the dependencies
of an existing RtpFrameObject to PacketBuffer so that we can
free up PacketBuffer as soon as the RtpFrameObject is created.

Bug: none
Change-Id: Ic939be91815519ae1d1c67ada82006417b2d26a3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149818
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28977}
This commit is contained in:
Johannes Kron
2019-08-26 16:37:11 +02:00
committed by Commit Bot
parent caef51e25a
commit a370556270
9 changed files with 80 additions and 107 deletions

View File

@ -123,9 +123,10 @@ class PacketBuffer {
virtual VCMPacket* GetPacket(uint16_t seq_num)
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
// Mark all slots used by |frame| as not used.
// Virtual for testing.
virtual void ReturnFrame(RtpFrameObject* frame);
// Clears the packet buffer from |start_seq_num| to |stop_seq_num| where the
// endpoints are inclusive.
void ClearInterval(uint16_t start_seq_num, uint16_t stop_seq_num)
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
void UpdateMissingPackets(uint16_t seq_num)
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);