| 68 | #endif |
| 69 | |
| 70 | bool 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 | |
| 79 | void AvgBufSize::update(const steady_clock::time_point& now, int pkts, int bytes, int timespan_ms) |
| 80 | { |
no test coverage detected