add OnTransportSwitch, OnPacketLost, OnDecodeError to server and client (#225)

These new hooks replace the generic hooks Log() and OnWarning().
This commit is contained in:
Alessandro Ros
2023-04-04 17:10:37 +02:00
committed by GitHub
parent f905598d2e
commit 2fbba142cc
15 changed files with 185 additions and 92 deletions

View File

@@ -52,7 +52,7 @@ func (sf *serverSessionFormat) stop() {
func (sf *serverSessionFormat) readRTPUDP(pkt *rtp.Packet, now time.Time) {
packets, missing := sf.udpReorderer.Process(pkt)
if missing != 0 {
onWarning(sf.sm.ss, fmt.Errorf("%d RTP packet(s) lost", missing))
sf.sm.ss.onPacketLost(fmt.Errorf("%d RTP packet(s) lost", missing))
// do not return
}