-
Notifications
You must be signed in to change notification settings - Fork 865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TSBPD logic extracted from CRcvBuffer. #1968
TSBPD logic extracted from CRcvBuffer. #1968
Conversation
Refactoring, no functional changes are expected. New CTsbpdTime class to operate with TSBPD timing.
srtcore/tsbpd_time.h
Outdated
/// @brief Get TSBPD base time considering possible carryover | ||
/// when packet timestamp is overflown and continues from 0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean here. Does this function get the TSBPD base time value in order to compare with the timestamp for a packet to see if it has exceeded the wrap value (and therefore should be re-evaluated to continue from 0 as it should)?
Also, is this inversion in function names intentional?
time_point getPktTsbPdBaseTime(uint32_t usPktTimestamp) const;
time_point getTsbPdTimeBase(uint32_t usPktTimestamp) const;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stevomatthews This naming is something that also looks confusing to me and I would love to improve,
Let us say that Packet TSBPD time is the time when a packet can be extracted from the receiver buffer.
Essentially, it consists of usPktTsbpdTime = usTsbpdTimeBase + usPktTimeStamp + usTsbpdDelay + usDrift
,
where usTsbpdTimeBase
takes possible packet timestamp carryover into account.
Then:
getTsbPdTimeBase(uint32_t usPktTimestamp)
returnsusTsbpdTimeBase
for a packet (with possible carryover).getPktTsbPdBaseTime(uint32_t usPktTimestamp)
returnsusTsbpdTimeBase + usPktTimeStamp
.getPktTsbPdTime(uint32_t usPktTimestamp)
returnsusTsbpdTimeBase + usPktTimeStamp + usTsbpdDelay + usDrift
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor edits to tsbpd_time.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: stevomatthews <smatthews@haivision.com>
Extracted refactoring around
CRcvBuffer
and TSBPD logic from PR #1965. No functional changes are expected.The new
CTsbpdTime
class is now to operate with TSBPD timing.