remove deprecated entities (#220)

This commit is contained in:
Alessandro Ros
2023-03-31 12:42:50 +02:00
committed by GitHub
parent 04f5a4041c
commit 71ce818c97
3 changed files with 0 additions and 35 deletions

View File

@@ -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

View File

@@ -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)
}

View File

@@ -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,
})
} }
} }