Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(764)

Unified Diff: webrtc/modules/video_coding/rtp_frame_reference_finder.h

Issue 2051453002: Padding is now used to check for continuity in the packet sequence. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Nit fix. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..23c36c061d9a52f16b0eb8692a5ec7b9ffd9f49d 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 are not yet continuous
+ // with any group of pictures.
+ std::set<uint16_t, DescendingSeqNumComp<uint16_t>> stashed_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_);
« no previous file with comments | « webrtc/modules/video_coding/packet_buffer.cc ('k') | webrtc/modules/video_coding/rtp_frame_reference_finder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698