sipsorcery-org / sipsorcery

A WebRTC, SIP and VoIP library for C# and .NET. Designed for real-time communications apps.
https://sipsorcery-org.github.io/sipsorcery
Other
1.42k stars 431 forks source link

Implement nack for SipSorcery #1018

Open 29654761 opened 10 months ago

29654761 commented 10 months ago

I want to try to Implement nack by myself, but I encountered a problem My current approach is

For receiver:

  1. Call MediaStream.UseBuffer
  2. Handle the OnRtpPacketReceived event
  3. Check the rtp sequence number to determine if packets was lost
  4. Call SendRtcpFeedback This seems feasible

But for sender:

  1. Handle the OnReceiveReport event
  2. Received feedback nack packet
  3. Problem is no temporary sent packets queue, I can't resend the lost packet

Solution: MediaStream.SendRtpRaw can raise a event so we can save the sent packets Because people usually use eg. MediaStream.SendH264Frame to send data

sipsorcery commented 7 months ago

Problem is no temporary sent packets queue, I can't resend the lost packet

Yes, there's a LOT of work to do. The queue would need to be implemented as well.

This library was originally written for SIP signalling. The additional bits to do with RTP, RTCP, devices, encoding, codecs etc. have been bolted on afterwards and there are still lots of gaps.