Throttle log message in FrameBuffer.
BUG=webrtc:7551 Review-Url: https://codereview.webrtc.org/2987673002 Cr-Commit-Position: refs/heads/master@{#19123}
This commit is contained in:
@ -32,6 +32,8 @@ constexpr int kMaxFramesBuffered = 600;
|
|||||||
|
|
||||||
// Max number of decoded frame info that will be saved.
|
// Max number of decoded frame info that will be saved.
|
||||||
constexpr int kMaxFramesHistory = 50;
|
constexpr int kMaxFramesHistory = 50;
|
||||||
|
|
||||||
|
constexpr int64_t kLogNonDecodedIntervalMs = 5000;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
FrameBuffer::FrameBuffer(Clock* clock,
|
FrameBuffer::FrameBuffer(Clock* clock,
|
||||||
@ -50,7 +52,8 @@ FrameBuffer::FrameBuffer(Clock* clock,
|
|||||||
num_frames_buffered_(0),
|
num_frames_buffered_(0),
|
||||||
stopped_(false),
|
stopped_(false),
|
||||||
protection_mode_(kProtectionNack),
|
protection_mode_(kProtectionNack),
|
||||||
stats_callback_(stats_callback) {}
|
stats_callback_(stats_callback),
|
||||||
|
last_log_non_decoded_ms_(-kLogNonDecodedIntervalMs) {}
|
||||||
|
|
||||||
FrameBuffer::~FrameBuffer() {}
|
FrameBuffer::~FrameBuffer() {}
|
||||||
|
|
||||||
@ -452,11 +455,15 @@ bool FrameBuffer::UpdateFrameInfoWithIncomingFrame(const FrameObject& frame,
|
|||||||
if (last_decoded_frame_it_ != frames_.end() &&
|
if (last_decoded_frame_it_ != frames_.end() &&
|
||||||
ref_key <= last_decoded_frame_it_->first) {
|
ref_key <= last_decoded_frame_it_->first) {
|
||||||
if (ref_info == frames_.end()) {
|
if (ref_info == frames_.end()) {
|
||||||
LOG(LS_WARNING) << "Frame with (picture_id:spatial_id) ("
|
int64_t now_ms = clock_->TimeInMilliseconds();
|
||||||
<< key.picture_id << ":"
|
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)
|
<< static_cast<int>(key.spatial_layer)
|
||||||
<< " depends on a non-decoded frame more previous than "
|
<< ") depends on a non-decoded frame more previous than"
|
||||||
<< "the last decoded frame, dropping frame.";
|
<< " the last decoded frame, dropping frame.";
|
||||||
|
last_log_non_decoded_ms_ = now_ms;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -177,6 +177,7 @@ class FrameBuffer {
|
|||||||
bool stopped_ GUARDED_BY(crit_);
|
bool stopped_ GUARDED_BY(crit_);
|
||||||
VCMVideoProtection protection_mode_ GUARDED_BY(crit_);
|
VCMVideoProtection protection_mode_ GUARDED_BY(crit_);
|
||||||
VCMReceiveStatisticsCallback* const stats_callback_;
|
VCMReceiveStatisticsCallback* const stats_callback_;
|
||||||
|
int64_t last_log_non_decoded_ms_ GUARDED_BY(crit_);
|
||||||
|
|
||||||
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(FrameBuffer);
|
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(FrameBuffer);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user