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}
diff --git a/modules/video_coding/packet_buffer.h b/modules/video_coding/packet_buffer.h
index b5264bc..d193db3 100644
--- a/modules/video_coding/packet_buffer.h
+++ b/modules/video_coding/packet_buffer.h
@@ -123,9 +123,10 @@
   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_);