1
0
Fork 0
forked from External/mediamtx

allow using MTX_QUERY inside source (#3486)

this allows to pass query parameters to sources, for instance:

source: rtsp://my_host/my_path?$MTX_QUERY
sourceOnDemand: true
This commit is contained in:
Alessandro Ros 2024-06-18 22:10:26 +02:00 committed by GitHub
parent dfa2e81e61
commit 65d90f7cc6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 118 additions and 106 deletions

View file

@ -24,7 +24,11 @@ type SourceTester struct {
}
// NewSourceTester allocates a SourceTester.
func NewSourceTester(createFunc func(defs.StaticSourceParent) defs.StaticSource, conf *conf.Path) *SourceTester {
func NewSourceTester(
createFunc func(defs.StaticSourceParent) defs.StaticSource,
resolvedSource string,
conf *conf.Path,
) *SourceTester {
ctx, ctxCancel := context.WithCancel(context.Background())
t := &SourceTester{
@ -38,8 +42,9 @@ func NewSourceTester(createFunc func(defs.StaticSourceParent) defs.StaticSource,
go func() {
s.Run(defs.StaticSourceRunParams{ //nolint:errcheck
Context: ctx,
Conf: conf,
Context: ctx,
ResolvedSource: resolvedSource,
Conf: conf,
})
close(t.done)
}()