Unwrap picture ids in the RtpFrameReferencerFinder.

First CL to avoid working with wrapping picture ids. After the references of
a frame has been determined they are then unwrapped.

BUG=webrtc:7874

Review-Url: https://codereview.webrtc.org/2985283002
Cr-Commit-Position: refs/heads/master@{#19663}
This commit is contained in:
philipel
2017-09-04 07:03:46 -07:00
committed by Commit Bot
parent 054b108820
commit d4fac6957e
9 changed files with 399 additions and 391 deletions

View File

@ -91,7 +91,13 @@ class SeqNumUnwrapper {
"Type unwrapped must be an unsigned integer smaller than uint64_t.");
public:
SeqNumUnwrapper() : last_unwrapped_(0) {}
// We want a value that is close to 2^63 for two reasons. Firstly, we
// can unwrap wrapping numbers in either direction, and secondly, we avoid
// causing a crash on bad input. We also want the default value to be somewhat
// human readable, a power of 10 for example.
static constexpr uint64_t kDefaultStartValue = 10000000000000000000UL;
SeqNumUnwrapper() : last_unwrapped_(kDefaultStartValue) {}
explicit SeqNumUnwrapper(uint64_t start_at) : last_unwrapped_(start_at) {}
uint64_t Unwrap(T value) {