mirror of
https://github.com/aler9/rtsp-simple-server
synced 2025-10-16 12:40:56 +08:00
update gohlslib (#1583)
This commit is contained in:
4
go.mod
4
go.mod
@@ -5,9 +5,9 @@ go 1.19
|
||||
require (
|
||||
code.cloudfoundry.org/bytefmt v0.0.0
|
||||
github.com/alecthomas/kong v0.7.1
|
||||
github.com/aler9/gortsplib/v2 v2.1.7
|
||||
github.com/aler9/gortsplib/v2 v2.2.0
|
||||
github.com/asticode/go-astits v1.11.0
|
||||
github.com/bluenviron/gohlslib v0.0.0-20230314171751-fbd8c7f7e4c8
|
||||
github.com/bluenviron/gohlslib v0.0.0-20230319232056-d55d76265613
|
||||
github.com/fsnotify/fsnotify v1.4.9
|
||||
github.com/gin-gonic/gin v1.9.0
|
||||
github.com/google/uuid v1.3.0
|
||||
|
8
go.sum
8
go.sum
@@ -4,16 +4,16 @@ github.com/alecthomas/assert/v2 v2.1.0 h1:tbredtNcQnoSd3QBhQWI7QZ3XHOVkw1Moklp2o
|
||||
github.com/alecthomas/kong v0.7.1 h1:azoTh0IOfwlAX3qN9sHWTxACE2oV8Bg2gAwBsMwDQY4=
|
||||
github.com/alecthomas/kong v0.7.1/go.mod h1:n1iCIO2xS46oE8ZfYCNDqdR0b0wZNrXAIAqro/2132U=
|
||||
github.com/alecthomas/repr v0.1.0 h1:ENn2e1+J3k09gyj2shc0dHr/yjaWSHRlrJ4DPMevDqE=
|
||||
github.com/aler9/gortsplib/v2 v2.1.7 h1:6KaPKSTjnbo3wzn+r4SdkR61Hmgit0OfrxtJ5yWP1hM=
|
||||
github.com/aler9/gortsplib/v2 v2.1.7/go.mod h1:Eegw8PWa8hNYXiYMlbK3RX1gr7+r25MxniAPGA+kKUE=
|
||||
github.com/aler9/gortsplib/v2 v2.2.0 h1:bM2LZG5owtvA2DZLUvwN15Erv/hN6Kv5KBdjlqHjlVI=
|
||||
github.com/aler9/gortsplib/v2 v2.2.0/go.mod h1:Eegw8PWa8hNYXiYMlbK3RX1gr7+r25MxniAPGA+kKUE=
|
||||
github.com/aler9/writerseeker v0.0.0-20220601075008-6f0e685b9c82 h1:9WgSzBLo3a9ToSVV7sRTBYZ1GGOZUpq4+5H3SN0UZq4=
|
||||
github.com/aler9/writerseeker v0.0.0-20220601075008-6f0e685b9c82/go.mod h1:qsMrZCbeBf/mCLOeF16KDkPu4gktn/pOWyaq1aYQE7U=
|
||||
github.com/asticode/go-astikit v0.30.0 h1:DkBkRQRIxYcknlaU7W7ksNfn4gMFsB0tqMJflxkRsZA=
|
||||
github.com/asticode/go-astikit v0.30.0/go.mod h1:h4ly7idim1tNhaVkdVBeXQZEE3L0xblP7fCWbgwipF0=
|
||||
github.com/asticode/go-astits v1.11.0 h1:GTHUXht0ZXAJXsVbsLIcyfHr1Bchi4QQwMARw2ZWAng=
|
||||
github.com/asticode/go-astits v1.11.0/go.mod h1:QSHmknZ51pf6KJdHKZHJTLlMegIrhega3LPWz3ND/iI=
|
||||
github.com/bluenviron/gohlslib v0.0.0-20230314171751-fbd8c7f7e4c8 h1:OiisEsRRqbmRIjF20NYZfChLtEhTRkn8UGf1IxEWaxU=
|
||||
github.com/bluenviron/gohlslib v0.0.0-20230314171751-fbd8c7f7e4c8/go.mod h1:9cqtfapvZBvgSgjjP8duIr4PbqnbVsyVSsmAl8wUIoU=
|
||||
github.com/bluenviron/gohlslib v0.0.0-20230319232056-d55d76265613 h1:cVRJ6kYz8jRZApBnDMSlu7bJ0vKw9pVrkzsaKmCKwSk=
|
||||
github.com/bluenviron/gohlslib v0.0.0-20230319232056-d55d76265613/go.mod h1:H4tS+00wJHRoeWwykehJ/yrGeHOfQvqc1PSahXKjusk=
|
||||
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
|
||||
github.com/bytedance/sonic v1.8.0 h1:ea0Xadu+sHlu7x5O3gKhRpQ1IKiMrSiHttPF0ybECuA=
|
||||
github.com/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U=
|
||||
|
@@ -11,7 +11,6 @@ import (
|
||||
"github.com/aler9/rtsp-simple-server/internal/formatprocessor"
|
||||
"github.com/aler9/rtsp-simple-server/internal/logger"
|
||||
"github.com/bluenviron/gohlslib"
|
||||
hlslogger "github.com/bluenviron/gohlslib/pkg/logger"
|
||||
)
|
||||
|
||||
type hlsSourceParent interface {
|
||||
@@ -24,12 +23,6 @@ type hlsSource struct {
|
||||
parent hlsSourceParent
|
||||
}
|
||||
|
||||
type hlsLoggerWrapper func(level logger.Level, format string, args ...interface{})
|
||||
|
||||
func (w hlsLoggerWrapper) Log(level hlslogger.Level, format string, args ...interface{}) {
|
||||
w(logger.Level(level), format, args)
|
||||
}
|
||||
|
||||
func newHLSSource(
|
||||
parent hlsSourceParent,
|
||||
) *hlsSource {
|
||||
@@ -55,7 +48,9 @@ func (s *hlsSource) run(ctx context.Context, cnf *conf.PathConf, reloadConf chan
|
||||
c := &gohlslib.Client{
|
||||
URI: cnf.Source,
|
||||
Fingerprint: cnf.SourceFingerprint,
|
||||
Logger: hlsLoggerWrapper(s.Log),
|
||||
Log: func(level gohlslib.LogLevel, format string, args ...interface{}) {
|
||||
s.Log(logger.Level(level), format, args...)
|
||||
},
|
||||
}
|
||||
|
||||
c.OnTracks(func(tracks []format.Format) error {
|
||||
|
@@ -88,8 +88,8 @@ func (s *rtspSource) run(ctx context.Context, cnf *conf.PathConf, reloadConf cha
|
||||
OnResponse: func(res *base.Response) {
|
||||
s.Log(logger.Debug, "s->c %v", res)
|
||||
},
|
||||
OnDecodeError: func(err error) {
|
||||
s.Log(logger.Warn, "%v", err)
|
||||
Log: func(level gortsplib.LogLevel, format string, args ...interface{}) {
|
||||
s.Log(logger.Warn, format, args...)
|
||||
},
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user