Index: webrtc/modules/video_coding/rtp_frame_reference_finder.h |
diff --git a/webrtc/modules/video_coding/rtp_frame_reference_finder.h b/webrtc/modules/video_coding/rtp_frame_reference_finder.h |
index 5fd67ab2a4a69216db043cb296bbab902e2774bf..c9d3c1e7f426969108eaeca8a3de51e9eb90c645 100644 |
--- a/webrtc/modules/video_coding/rtp_frame_reference_finder.h |
+++ b/webrtc/modules/video_coding/rtp_frame_reference_finder.h |
@@ -33,6 +33,7 @@ class RtpFrameReferenceFinder { |
public: |
explicit RtpFrameReferenceFinder(OnCompleteFrameCallback* frame_callback); |
void ManageFrame(std::unique_ptr<RtpFrameObject> frame); |
+ void PaddingReceived(uint16_t seq_num); |
private: |
static const uint16_t kPicIdLength = 1 << 7; |
@@ -41,9 +42,15 @@ class RtpFrameReferenceFinder { |
static const int kMaxStashedFrames = 10; |
static const int kMaxNotYetReceivedFrames = 20; |
static const int kMaxGofSaved = 15; |
+ static const int kMaxPaddingAge = 100; |
rtc::CriticalSection crit_; |
+ // Find the relevant group of pictures and update its "last-picture-id-with |
+ // padding" sequence number. |
+ void UpdateLastPictureIdWithPadding(uint16_t seq_num) |
+ EXCLUSIVE_LOCKS_REQUIRED(crit_); |
+ |
// Retry finding references for all frames that previously didn't have |
// all information needed. |
void RetryStashedFrames() EXCLUSIVE_LOCKS_REQUIRED(crit_); |
@@ -93,15 +100,25 @@ class RtpFrameReferenceFinder { |
// All picture ids are unwrapped to 16 bits. |
uint16_t UnwrapPictureId(uint16_t picture_id) EXCLUSIVE_LOCKS_REQUIRED(crit_); |
- // Holds the last sequence number of the last frame that has been created |
- // given the last sequence number of a given keyframe. |
- std::map<uint16_t, uint16_t, DescendingSeqNumComp<uint16_t>> last_seq_num_gop_ |
- GUARDED_BY(crit_); |
+ |
+ // For every group of pictures, holds the last sequence number and the |
+ // last sequence number with padding included. |
+ // first = last sequence number |
terelius
2016/06/08 18:52:51
last sequence number of non-padding packets?
philipel
2016/06/09 08:36:32
Kind of, it is not the last sequence number of the
|
+ // second = last sequence number with padding included |
terelius
2016/06/08 18:52:51
last sequence number including padding packets?
philipel
2016/06/09 08:36:32
And this is the last packet sequence number but ad
|
+ std::map<uint16_t, |
+ std::pair<uint16_t, uint16_t>, |
+ DescendingSeqNumComp<uint16_t>> |
+ last_seq_num_gop_ GUARDED_BY(crit_); |
// Save the last picture id in order to detect when there is a gap in frames |
// that have not yet been fully received. |
int last_picture_id_ GUARDED_BY(crit_); |
+ // Padding packets that have been received but that is not yet continuous with |
terelius
2016/06/08 18:52:51
contiguous?
philipel
2016/06/09 08:36:32
I think continuous is the right word to use here.
|
+ // any group of pictures. |
+ std::set<uint16_t, DescendingSeqNumComp<uint16_t>> received_padding_ |
+ GUARDED_BY(crit_); |
+ |
// The last unwrapped picture id. Used to unwrap the picture id from a length |
// of |kPicIdLength| to 16 bits. |
int last_unwrap_ GUARDED_BY(crit_); |