Chromium Code Reviews| 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..fd27d4458eed646215aca52e3f1370b67a0dfcf3 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, hold two sequence numbers. The first being |
| + // the sequence number of the last packet of the last completed frame, and |
| + // the second being the sequence number of the last packet of the last |
| + // completed frame advanced by any potential continuous packets of padding. |
| + 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 |
|
stefan-webrtc
2016/07/05 08:00:40
"...but that are not..."
philipel
2016/07/05 08:41:01
Done.
|
| + // any group of pictures. |
| + std::set<uint16_t, DescendingSeqNumComp<uint16_t>> received_padding_ |
|
stefan-webrtc
2016/07/05 08:00:40
Maybe call these stashed_padding_ to make it more
philipel
2016/07/05 08:41:01
Done.
|
| + 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_); |