Fix dropped frames not counted issue

There's been reports of dropped frames that are not counted and
correctly reported by getStats().

If a HW decoder is used and the system is provoked by stressing
the system, I've been able to reproduce this problem. It turns out
that we've missed frames that are dropped because there is no
callback to the Decoded() function.

This CL restructures the code so that dropped frames are counted
even in cases where there's no corresponding callback for some frames.

Bug: webrtc:11229
Change-Id: I0216edba3733399c188649908d459ee86a9093d0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214783
Commit-Queue: Johannes Kron <kron@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33671}
This commit is contained in:
Johannes Kron
2021-04-09 16:03:22 +02:00
committed by Commit Bot
parent 9410217413
commit fc5d2762f5
6 changed files with 166 additions and 15 deletions

View File

@ -69,4 +69,11 @@ size_t VCMTimestampMap::Size() const {
: next_add_idx_ + capacity_ - next_pop_idx_;
}
void VCMTimestampMap::Clear() {
while (!IsEmpty()) {
ring_buffer_[next_pop_idx_].timestamp = 0;
next_pop_idx_ = (next_pop_idx_ + 1) % capacity_;
}
}
} // namespace webrtc