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

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

Issue 2304723004: Added ClearTo(seq_num) to RtpFrameReferenceFinder. (Closed)
Patch Set: Nit fix Created 4 years, 3 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
« no previous file with comments | « no previous file | webrtc/modules/video_coding/rtp_frame_reference_finder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a812303b7ea85eea4e1a02992322f22473743367..e9e7d60a33155764719d992ff44511f8ab2e47c8 100644
--- a/webrtc/modules/video_coding/rtp_frame_reference_finder.h
+++ b/webrtc/modules/video_coding/rtp_frame_reference_finder.h
@@ -14,7 +14,7 @@
#include <array>
#include <map>
#include <memory>
-#include <queue>
+#include <deque>
#include <set>
#include <utility>
@@ -40,9 +40,22 @@ class OnCompleteFrameCallback {
class RtpFrameReferenceFinder {
public:
explicit RtpFrameReferenceFinder(OnCompleteFrameCallback* frame_callback);
+
+ // Manage this frame until:
+ // - We have all information needed to determine its references, after
+ // which |frame_callback_| is called with the completed frame, or
+ // - We have too many stashed frames (determined by |kMaxStashedFrames)
+ // so we drop this frame, or
+ // - It gets cleared by ClearTo, which also means we drop it.
void ManageFrame(std::unique_ptr<RtpFrameObject> frame);
+
+ // Notifies that padding has been received, which the reference finder
+ // might need to calculate the references of a frame.
void PaddingReceived(uint16_t seq_num);
+ // Clear all stashed frames that include packets older than |seq_num|.
+ void ClearTo(uint16_t seq_num);
+
private:
static const uint16_t kPicIdLength = 1 << 7;
static const uint8_t kMaxTemporalLayers = 5;
@@ -146,7 +159,7 @@ class RtpFrameReferenceFinder {
// Frames that have been fully received but didn't have all the information
// needed to determine their references.
- std::queue<std::unique_ptr<RtpFrameObject>> stashed_frames_ GUARDED_BY(crit_);
+ std::deque<std::unique_ptr<RtpFrameObject>> stashed_frames_ GUARDED_BY(crit_);
// Holds the information about the last completed frame for a given temporal
// layer given a Tl0 picture index.
@@ -177,6 +190,11 @@ class RtpFrameReferenceFinder {
kMaxTemporalLayers>
missing_frames_for_layer_ GUARDED_BY(crit_);
+ // How far frames have been cleared by sequence number. A frame will be
+ // cleared if it contains a packet with a sequence number older than
+ // |cleared_to_seq_num_|.
+ int cleared_to_seq_num_ GUARDED_BY(crit_);
+
OnCompleteFrameCallback* frame_callback_;
};
« no previous file with comments | « no previous file | webrtc/modules/video_coding/rtp_frame_reference_finder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698