From fdd487f3c5401798177e64b352b316aa13847d39 Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Sat, 7 Aug 2021 16:08:29 +0200 Subject: [PATCH] rename "record" source value into "publisher" --- internal/conf/path.go | 28 ++++++++++++++-------------- rtsp-simple-server.yml | 8 ++++---- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/internal/conf/path.go b/internal/conf/path.go index 5da8eb01..11709f54 100644 --- a/internal/conf/path.go +++ b/internal/conf/path.go @@ -126,11 +126,11 @@ func (pconf *PathConf) checkAndFillMissing(name string) error { } if pconf.Source == "" { - pconf.Source = "record" + pconf.Source = "publisher" } switch { - case pconf.Source == "record": + case pconf.Source == "publisher": case strings.HasPrefix(pconf.Source, "rtsp://") || strings.HasPrefix(pconf.Source, "rtsps://"): @@ -207,8 +207,8 @@ func (pconf *PathConf) checkAndFillMissing(name string) error { } if pconf.SourceOnDemand { - if pconf.Source == "record" { - return fmt.Errorf("'sourceOnDemand' is useless when source is 'record'") + if pconf.Source == "publisher" { + return fmt.Errorf("'sourceOnDemand' is useless when source is 'publisher'") } } @@ -239,8 +239,8 @@ func (pconf *PathConf) checkAndFillMissing(name string) error { return fmt.Errorf("read username and password must be both filled") } if pconf.PublishUser != "" { - if pconf.Source != "record" { - return fmt.Errorf("'publishUser' is useless when source is not 'record'") + if pconf.Source != "publisher" { + return fmt.Errorf("'publishUser' is useless when source is not 'publisher'") } if !strings.HasPrefix(pconf.PublishUser, "sha256:") && !reUserPass.MatchString(pconf.PublishUser) { @@ -248,8 +248,8 @@ func (pconf *PathConf) checkAndFillMissing(name string) error { } } if pconf.PublishPass != "" { - if pconf.Source != "record" { - return fmt.Errorf("'publishPass' is useless when source is not 'record', since the stream is not provided by a publisher, but by a fixed source") + if pconf.Source != "publisher" { + return fmt.Errorf("'publishPass' is useless when source is not 'publisher', since the stream is not provided by a publisher, but by a fixed source") } if !strings.HasPrefix(pconf.PublishPass, "sha256:") && !reUserPass.MatchString(pconf.PublishPass) { @@ -265,8 +265,8 @@ func (pconf *PathConf) checkAndFillMissing(name string) error { return nil, nil } - if pconf.Source != "record" { - return nil, fmt.Errorf("'publishIPs' is useless when source is not 'record', since the stream is not provided by a publisher, but by a fixed source") + if pconf.Source != "publisher" { + return nil, fmt.Errorf("'publishIPs' is useless when source is not 'publisher', since the stream is not provided by a publisher, but by a fixed source") } return parseIPCidrList(pconf.PublishIPs) @@ -302,12 +302,12 @@ func (pconf *PathConf) checkAndFillMissing(name string) error { return fmt.Errorf("a path with a regular expression does not support option 'runOnInit'; use another path") } - if pconf.RunOnPublish != "" && pconf.Source != "record" { - return fmt.Errorf("'runOnPublish' is useless when source is not 'record', since the stream is not provided by a publisher, but by a fixed source") + if pconf.RunOnPublish != "" && pconf.Source != "publisher" { + return fmt.Errorf("'runOnPublish' is useless when source is not 'publisher', since the stream is not provided by a publisher, but by a fixed source") } - if pconf.RunOnDemand != "" && pconf.Source != "record" { - return fmt.Errorf("'runOnDemand' can be used only when source is 'record'") + if pconf.RunOnDemand != "" && pconf.Source != "publisher" { + return fmt.Errorf("'runOnDemand' can be used only when source is 'publisher'") } if pconf.RunOnDemandStartTimeout == 0 { diff --git a/rtsp-simple-server.yml b/rtsp-simple-server.yml index 48e07762..b4acd13d 100644 --- a/rtsp-simple-server.yml +++ b/rtsp-simple-server.yml @@ -125,12 +125,12 @@ hlsAllowOrigin: '*' paths: all: # source of the stream - this can be: - # * record -> the stream is published by a RTSP or RTMP client + # * publisher -> the stream is published by a RTSP or RTMP client # * rtsp://existing-url -> the stream is pulled from another RTSP server # * rtsps://existing-url -> the stream is pulled from another RTSP server, with RTSPS # * rtmp://existing-url -> the stream is pulled from a RTMP server # * redirect -> the stream is provided by another path or server - source: record + source: publisher # if the source is an RTSP or RTSPS URL, this is the protocol that will be used to # pull the stream. available values are "automatic", "udp", "multicast", "tcp". @@ -163,11 +163,11 @@ paths: # redirected to. sourceRedirect: - # if the source is "record" and a client is publishing, do not allow another + # if the source is "publisher" and a client is publishing, do not allow another # client to disconnect the former and publish in its place. disablePublisherOverride: no - # if the source is "record" and no one is publishing, redirect readers to this + # if the source is "publisher" and no one is publishing, redirect readers to this # path. It can be can be a relative path (i.e. /otherstream) or an absolute RTSP URL. fallback: