mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 07:06:58 +08:00
server: split OnFrame into OnPacketRTP and OnPacketRTCP
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user