Haivision / srt

Secure, Reliable, Transport
https://www.srtalliance.org
Mozilla Public License 2.0
3.11k stars 851 forks source link

Perf stats instantenious timespan of the receiver's buffer #900

Open maxsharabayko opened 5 years ago

maxsharabayko commented 5 years ago

CRcvBuffer::getRcvDataSize(…) reports the timespan of acknowledged packets in the receiver's buffer only if TSBPD is enabled. Although the value might be useful in both cases.

Note that the same function is used for TSBPD thread to trigger packet drop.

ethouris commented 8 months ago

@maxsharabayko I'm not sure if this still holds, but maybe it should be rechecked. The fix was applied to the old receiver buffer that is already deleted. Might be that this issue is no longer a problem.

maxsharabayko commented 8 months ago

Still topical for the new receiver buffer. https://github.com/Haivision/srt/blob/09f35c0f1743e23f514cb41444504a7faeacf89e/srtcore/buffer_rcv.cpp#L621

ethouris commented 8 months ago

The problem is that in the file mode time is not important. Timestamps are also not assigned to particular packet, but they are set anew for retransmitted packets (that was the old behavior for UDT that was preserved in file mode in SRT). The "timespan" in case of TSBPD mode means for how long time the stream would have to be played. In file mode, including in the message variant, there's no "time" of the packets - they are available at the earliest time when there is a packet at cell 0 (stream) or there's a completely reassembled message available, no matter their timestamps (which don't represent the sending time anyway).