MCPcopy Create free account
hub / github.com/Haivision/srt / isTimeToUpdate

Method isTimeToUpdate

srtcore/buffer_tools.cpp:70–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68#endif
69
70bool AvgBufSize::isTimeToUpdate(const time_point& now) const
71{
72 const int usMAvgBasePeriod = 1000000; // 1s in microseconds
73 const int us2ms = 1000;
74 const int msMAvgPeriod = (usMAvgBasePeriod / SRT_MAVG_SAMPLING_RATE) / us2ms;
75 const uint64_t elapsed_ms = count_milliseconds(now - m_tsLastSamplingTime); // ms since last sampling
76 return (elapsed_ms >= msMAvgPeriod);
77}
78
79void AvgBufSize::update(const steady_clock::time_point& now, int pkts, int bytes, int timespan_ms)
80{

Callers 2

updRcvAvgDataSizeMethod · 0.80
updAvgBufSizeMethod · 0.80

Calls 1

count_millisecondsFunction · 0.85

Tested by

no test coverage detected