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/frame_object.h b/modules/video_coding/frame_object.h
index 3ad356f..db5b7c3 100644
--- a/modules/video_coding/frame_object.h
+++ b/modules/video_coding/frame_object.h
@@ -41,13 +41,14 @@
   int64_t ReceivedTime() const override;
   int64_t RenderTime() const override;
   bool delayed_by_retransmission() const override;
-  absl::optional<RTPVideoHeader> GetRtpVideoHeader() const;
-  absl::optional<RtpGenericFrameDescriptor> GetGenericFrameDescriptor() const;
-  absl::optional<FrameMarking> GetFrameMarking() const;
+  const RTPVideoHeader& GetRtpVideoHeader() const;
+  const absl::optional<RtpGenericFrameDescriptor>& GetGenericFrameDescriptor()
+      const;
+  const FrameMarking& GetFrameMarking() const;
 
  private:
-  rtc::scoped_refptr<PacketBuffer> packet_buffer_;
-  VideoFrameType frame_type_;
+  RTPVideoHeader rtp_video_header_;
+  absl::optional<RtpGenericFrameDescriptor> rtp_generic_frame_descriptor_;
   VideoCodecType codec_type_;
   uint16_t first_seq_num_;
   uint16_t last_seq_num_;