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

Unified Diff: webrtc/modules/video_coding/main/source/jitter_buffer.h

Issue 1211873004: Request keyframe if too many packets are missing and NACK is disabled. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Updated based on feedback Created 5 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
Index: webrtc/modules/video_coding/main/source/jitter_buffer.h
diff --git a/webrtc/modules/video_coding/main/source/jitter_buffer.h b/webrtc/modules/video_coding/main/source/jitter_buffer.h
index 3961dff46ffaffb2d15fbb568fc311f6a46814cc..af619adc7c8bcf797e3dbe76fb2ae9ad8d380bcd 100644
--- a/webrtc/modules/video_coding/main/source/jitter_buffer.h
+++ b/webrtc/modules/video_coding/main/source/jitter_buffer.h
@@ -206,13 +206,15 @@ class VCMJitterBuffer {
EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
// Returns true if |frame| is continuous in |decoding_state|, not taking
- // decodable frames into account.
+ // decodable frames into account and optionally ignoring |decode_error_mode|.
bool IsContinuousInState(const VCMFrameBuffer& frame,
- const VCMDecodingState& decoding_state) const
+ const VCMDecodingState& decoding_state,
+ bool ignore_error_mode) const
EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
// Returns true if |frame| is continuous in the |last_decoded_state_|, taking
- // all decodable frames into account.
- bool IsContinuous(const VCMFrameBuffer& frame) const
+ // all decodable frames into account and optionally ignoring the
+ // |decode_error_mode|.
+ bool IsContinuous(const VCMFrameBuffer& frame, bool ignore_error_mode) const
EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
// Looks for frames in |incomplete_frames_| which are continuous in the
// provided |decoded_state|. Starts the search from the timestamp of
@@ -225,6 +227,11 @@ class VCMJitterBuffer {
// the search from |new_frame|.
void FindAndInsertContinuousFrames(const VCMFrameBuffer& new_frame)
EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
+ // Returns true if no continuous decodable frame has been received for too
+ // long and NACKs are disabled, so a keyframe should be requested from the
+ // sender. Ensures that keyframes are not requested too often.
+ bool TooManyDiscontinuousFrames(int64_t now_ms)
+ EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
VCMFrameBuffer* NextFrame() const EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
// Returns true if the NACK list was updated to cover sequence numbers up to
// |sequence_number|. If false a key frame is needed to get into a state where
@@ -332,6 +339,8 @@ class VCMJitterBuffer {
int num_duplicated_packets_ GUARDED_BY(crit_sect_);
// Number of packets discarded by the jitter buffer.
int num_discarded_packets_ GUARDED_BY(crit_sect_);
+ // Time when last decodable frame was received.
+ int64_t time_last_decodable_frame_ GUARDED_BY(crit_sect_);
// Time when first packet is received.
int64_t time_first_packet_ms_ GUARDED_BY(crit_sect_);

Powered by Google App Engine
This is Rietveld 408576698