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

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

Issue 2841913002: Stashed frames are now retried in a loop rather than recursively. (Closed)
Patch Set: . Created 3 years, 8 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 db1ddf80725b2e638744d467a54ac0e27bad3ad5..46eb984f19384230d26e48a3eec5c0de7a6fc2b8 100644
--- a/webrtc/modules/video_coding/rtp_frame_reference_finder.h
+++ b/webrtc/modules/video_coding/rtp_frame_reference_finder.h
@@ -65,6 +65,7 @@ class RtpFrameReferenceFinder {
static const int kMaxGofSaved = 50;
static const int kMaxPaddingAge = 100;
+ enum FrameDecision { kStash, kSend, kDrop };
stefan-webrtc 2017/04/25 15:27:48 kSend sounds like it means that we will send it ov
philipel 2017/04/26 12:22:27 Agree, change to kHandOff since we don't actually
struct GofInfo {
GofInfo(GofInfoVP9* gof, uint16_t last_picture_id)
@@ -80,34 +81,34 @@ class RtpFrameReferenceFinder {
void UpdateLastPictureIdWithPadding(uint16_t seq_num)
EXCLUSIVE_LOCKS_REQUIRED(crit_);
- // Retry finding references for all frames that previously didn't have
- // all information needed.
+ // Retry stashed frames until no more complete frames are found.
void RetryStashedFrames() EXCLUSIVE_LOCKS_REQUIRED(crit_);
+ FrameDecision ManageFrameInternal(RtpFrameObject* frame)
+ EXCLUSIVE_LOCKS_REQUIRED(crit_);
+
// Find references for generic frames. If |picture_id| is unspecified
// then packet sequence numbers will be used to determine the references
// of the frames.
- void ManageFrameGeneric(std::unique_ptr<RtpFrameObject> frame,
- int picture_id) EXCLUSIVE_LOCKS_REQUIRED(crit_);
+ FrameDecision ManageFrameGeneric(RtpFrameObject* frame, int picture_id)
+ EXCLUSIVE_LOCKS_REQUIRED(crit_);
// Find references for Vp8 frames
- void ManageFrameVp8(std::unique_ptr<RtpFrameObject> frame)
+ FrameDecision ManageFrameVp8(RtpFrameObject* frame)
EXCLUSIVE_LOCKS_REQUIRED(crit_);
// Updates all necessary state used to determine frame references
// for Vp8 and then calls the |frame_callback| callback with the
// completed frame.
- void CompletedFrameVp8(std::unique_ptr<RtpFrameObject> frame)
- EXCLUSIVE_LOCKS_REQUIRED(crit_);
+ void CompletedFrameVp8(RtpFrameObject* frame) EXCLUSIVE_LOCKS_REQUIRED(crit_);
// Find references for Vp9 frames
- void ManageFrameVp9(std::unique_ptr<RtpFrameObject> frame)
+ FrameDecision ManageFrameVp9(RtpFrameObject* frame)
EXCLUSIVE_LOCKS_REQUIRED(crit_);
// Unwrap the picture id and the frame references and then call the
// |frame_callback| callback with the completed frame.
- void CompletedFrameVp9(std::unique_ptr<RtpFrameObject> frame)
- EXCLUSIVE_LOCKS_REQUIRED(crit_);
+ void CompletedFrameVp9(RtpFrameObject* frame) EXCLUSIVE_LOCKS_REQUIRED(crit_);
// Check if we are missing a frame necessary to determine the references
// for this frame.

Powered by Google App Engine
This is Rietveld 408576698