server: split OnFrame into OnPacketRTP and OnPacketRTCP

This commit is contained in:
aler9
2021-10-30 16:03:08 +02:00
committed by Alessandro Ros
parent 62bd19f770
commit 472430f900
8 changed files with 111 additions and 56 deletions

View File

@@ -179,15 +179,26 @@ type ServerHandlerOnSetParameter interface {
OnSetParameter(*ServerHandlerOnSetParameterCtx) (*base.Response, error)
}
// ServerHandlerOnFrameCtx is the context of a frame.
type ServerHandlerOnFrameCtx struct {
// ServerHandlerOnPacketRTPCtx is the context of a RTP packet.
type ServerHandlerOnPacketRTPCtx struct {
Session *ServerSession
TrackID int
StreamType StreamType
Payload []byte
}
// ServerHandlerOnFrame can be implemented by a ServerHandler.
type ServerHandlerOnFrame interface {
OnFrame(*ServerHandlerOnFrameCtx)
// ServerHandlerOnPacketRTP can be implemented by a ServerHandler.
type ServerHandlerOnPacketRTP interface {
OnPacketRTP(*ServerHandlerOnPacketRTPCtx)
}
// ServerHandlerOnPacketRTCPCtx is the context of a RTCP packet.
type ServerHandlerOnPacketRTCPCtx struct {
Session *ServerSession
TrackID int
Payload []byte
}
// ServerHandlerOnPacketRTCP can be implemented by a ServerHandler.
type ServerHandlerOnPacketRTCP interface {
OnPacketRTCP(*ServerHandlerOnPacketRTCPCtx)
}