add OnDecodeError callback to both client and server

This allows to detect decode errors of RTP and RTCP packets
This commit is contained in:
aler9
2022-10-31 12:36:30 +01:00
parent 9b5071f505
commit 30e029011b
7 changed files with 372 additions and 30 deletions

View File

@@ -227,3 +227,15 @@ type ServerHandlerOnPacketRTCP interface {
// called when receiving a RTCP packet.
OnPacketRTCP(*ServerHandlerOnPacketRTCPCtx)
}
// ServerHandlerOnDecodeErrorCtx is the context of OnDecodeError.
type ServerHandlerOnDecodeErrorCtx struct {
Session *ServerSession
Error error
}
// ServerHandlerOnDecodeError can be implemented by a ServerHandler.
type ServerHandlerOnDecodeError interface {
// called when there's a non-fatal decoding error of RTP or RTCP packets.
OnDecodeError(*ServerHandlerOnDecodeErrorCtx)
}