|
|
|
@ -11,7 +11,6 @@ import (
@@ -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 {
@@ -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
@@ -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 { |
|
|
|
|