Dont request keyframes if the stream is inactive or if we are currently receiving a keyframe.

BUG=webrtc:7520

Review-Url: https://codereview.webrtc.org/2853503002
Cr-Commit-Position: refs/heads/master@{#18199}
diff --git a/webrtc/modules/video_coding/packet_buffer.h b/webrtc/modules/video_coding/packet_buffer.h
index 001f8bd..3d9eb9c 100644
--- a/webrtc/modules/video_coding/packet_buffer.h
+++ b/webrtc/modules/video_coding/packet_buffer.h
@@ -55,6 +55,10 @@
   void ClearTo(uint16_t seq_num);
   void Clear();
 
+  // Timestamp (not RTP timestamp) of the last received packet/keyframe packet.
+  rtc::Optional<int64_t> LastReceivedPacketMs() const;
+  rtc::Optional<int64_t> LastReceivedKeyframePacketMs() const;
+
   int AddRef() const;
   int Release() const;
 
@@ -142,6 +146,10 @@
   // Called when a received frame is found.
   OnReceivedFrameCallback* const received_frame_callback_;
 
+  // Timestamp (not RTP timestamp) of the last received packet/keyframe packet.
+  rtc::Optional<int64_t> last_received_packet_ms_ GUARDED_BY(crit_);
+  rtc::Optional<int64_t> last_received_keyframe_packet_ms_ GUARDED_BY(crit_);
+
   mutable volatile int ref_count_ = 0;
 };