mirror of
https://github.com/aler9/gortsplib
synced 2025-10-13 02:43:53 +08:00
remove deprecated entities (#220)
This commit is contained in:
14
client.go
14
client.go
@@ -225,10 +225,6 @@ type Client struct {
|
|||||||
OnRequest func(*base.Request)
|
OnRequest func(*base.Request)
|
||||||
// called after every response.
|
// called after every response.
|
||||||
OnResponse func(*base.Response)
|
OnResponse func(*base.Response)
|
||||||
// Deprecated. replaced by Log.
|
|
||||||
OnWarning func(error)
|
|
||||||
// Deprecated. replaced by Log.
|
|
||||||
OnDecodeError func(error)
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// logging (all optional)
|
// logging (all optional)
|
||||||
@@ -339,16 +335,6 @@ func (c *Client) Start(scheme string, host string) error {
|
|||||||
c.OnResponse = func(*base.Response) {
|
c.OnResponse = func(*base.Response) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if c.OnDecodeError != nil {
|
|
||||||
c.Log = func(level LogLevel, format string, args ...interface{}) {
|
|
||||||
c.OnDecodeError(fmt.Errorf(format, args...))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if c.OnWarning != nil {
|
|
||||||
c.Log = func(level LogLevel, format string, args ...interface{}) {
|
|
||||||
c.OnDecodeError(fmt.Errorf(format, args...))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if c.Log == nil {
|
if c.Log == nil {
|
||||||
c.Log = defaultLog
|
c.Log = defaultLog
|
||||||
|
@@ -205,19 +205,3 @@ type ServerHandlerOnWarning interface {
|
|||||||
// called when there's a non-fatal decoding error of RTP or RTCP packets.
|
// called when there's a non-fatal decoding error of RTP or RTCP packets.
|
||||||
OnWarning(*ServerHandlerOnWarningCtx)
|
OnWarning(*ServerHandlerOnWarningCtx)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServerHandlerOnDecodeErrorCtx is the context of OnDecodeError.
|
|
||||||
//
|
|
||||||
// Deprecated. Replaced by ServerHandlerOnWarningCtx.
|
|
||||||
type ServerHandlerOnDecodeErrorCtx struct {
|
|
||||||
Session *ServerSession
|
|
||||||
Error error
|
|
||||||
}
|
|
||||||
|
|
||||||
// ServerHandlerOnDecodeError can be implemented by a ServerHandler.
|
|
||||||
//
|
|
||||||
// Deprecated. Replaced by ServerHandlerOnWarning.
|
|
||||||
type ServerHandlerOnDecodeError interface {
|
|
||||||
// called when there's a non-fatal decoding error of RTP or RTCP packets.
|
|
||||||
OnDecodeError(*ServerHandlerOnDecodeErrorCtx)
|
|
||||||
}
|
|
||||||
|
@@ -44,11 +44,6 @@ func onWarning(ss *ServerSession, err error) {
|
|||||||
Session: ss,
|
Session: ss,
|
||||||
Error: err,
|
Error: err,
|
||||||
})
|
})
|
||||||
} else if h, ok := ss.s.Handler.(ServerHandlerOnDecodeError); ok {
|
|
||||||
h.OnDecodeError(&ServerHandlerOnDecodeErrorCtx{
|
|
||||||
Session: ss,
|
|
||||||
Error: err,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user