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

Unified Diff: webrtc/modules/video_coding/frame_buffer2.cc

Issue 2987673002: Throttle log message in FrameBuffer. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « webrtc/modules/video_coding/frame_buffer2.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/frame_buffer2.cc
diff --git a/webrtc/modules/video_coding/frame_buffer2.cc b/webrtc/modules/video_coding/frame_buffer2.cc
index 5be20a2bd5e54576b9fbe797569f4796626343ce..b8a80e1f681cc77ae634ef7faf879d3b14ad156d 100644
--- a/webrtc/modules/video_coding/frame_buffer2.cc
+++ b/webrtc/modules/video_coding/frame_buffer2.cc
@@ -32,6 +32,8 @@ constexpr int kMaxFramesBuffered = 600;
// Max number of decoded frame info that will be saved.
constexpr int kMaxFramesHistory = 50;
+
+constexpr int64_t kLogNonDecodedIntervalMs = 5000;
} // namespace
FrameBuffer::FrameBuffer(Clock* clock,
@@ -50,7 +52,8 @@ FrameBuffer::FrameBuffer(Clock* clock,
num_frames_buffered_(0),
stopped_(false),
protection_mode_(kProtectionNack),
- stats_callback_(stats_callback) {}
+ stats_callback_(stats_callback),
+ last_log_non_decoded_ms_(-kLogNonDecodedIntervalMs) {}
FrameBuffer::~FrameBuffer() {}
@@ -452,11 +455,15 @@ bool FrameBuffer::UpdateFrameInfoWithIncomingFrame(const FrameObject& frame,
if (last_decoded_frame_it_ != frames_.end() &&
ref_key <= last_decoded_frame_it_->first) {
if (ref_info == frames_.end()) {
- LOG(LS_WARNING) << "Frame with (picture_id:spatial_id) ("
- << key.picture_id << ":"
- << static_cast<int>(key.spatial_layer)
- << " depends on a non-decoded frame more previous than "
- << "the last decoded frame, dropping frame.";
+ int64_t now_ms = clock_->TimeInMilliseconds();
+ if (last_log_non_decoded_ms_ + kLogNonDecodedIntervalMs < now_ms) {
+ LOG(LS_WARNING)
+ << "Frame with (picture_id:spatial_id) (" << key.picture_id << ":"
+ << static_cast<int>(key.spatial_layer)
+ << ") depends on a non-decoded frame more previous than"
+ << " the last decoded frame, dropping frame.";
+ last_log_non_decoded_ms_ = now_ms;
+ }
return false;
}
« no previous file with comments | « webrtc/modules/video_coding/frame_buffer2.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698