You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed in issue #1366 (this comment by @penguinol: #1366 (comment)) we may use uint64_t in C++ maps and sets in which the key is a RTP seq number or similar. This would allow us to use our SeqManager compare functions into those containers without violating transitivity, i.e. comp(a,b) && comp(b,c) -> comp(a,c), which currently we are violating (see the referenced issue for details).
libwebrtc uses uint64_t for seq nums, it takes more memory and cpu usage, but it's easier to understand and more reliable. uint64_t is big enougth to avoid wrap around. When receiving a packet, unwrap uint16_t seq num to uint64_t by roc * 65535 + seq (where roc is the cycle number), and then store and use the uint64_t value as in https://webrtc.googlesource.com/src/+/refs/heads/main/rtc_base/numerics/sequence_number_unwrapper.h. libwebrtc creates a SeqNumUnwrapper object for every stream which stores the uint64_t value of the last packet. When a new packet arrives, it calculates the distance between the seq of the packet and the last seq in SeqNumUnwrapper by something like our SeqManager::SeqLowerThan to determine which cycle does the packet belongs to.
The text was updated successfully, but these errors were encountered:
As discussed in issue #1366 (this comment by @penguinol: #1366 (comment)) we may use
uint64_t
in C++ maps and sets in which the key is a RTP seq number or similar. This would allow us to use ourSeqManager
compare functions into those containers without violating transitivity, i.e.comp(a,b) && comp(b,c) -> comp(a,c)
, which currently we are violating (see the referenced issue for details).libwebrtc uses
uint64_t
for seq nums, it takes more memory and cpu usage, but it's easier to understand and more reliable.uint64_t
is big enougth to avoid wrap around. When receiving a packet, unwrapuint16_t
seq num touint64_t
byroc * 65535 + seq
(whereroc
is the cycle number), and then store and use theuint64_t
value as in https://webrtc.googlesource.com/src/+/refs/heads/main/rtc_base/numerics/sequence_number_unwrapper.h. libwebrtc creates aSeqNumUnwrapper
object for every stream which stores theuint64_t
value of the last packet. When a new packet arrives, it calculates the distance between the seq of the packet and the last seq inSeqNumUnwrapper
by something like ourSeqManager::SeqLowerThan
to determine which cycle does the packet belongs to.The text was updated successfully, but these errors were encountered: