rename "record" source value into "publisher"

This commit is contained in:
aler9 2021-08-07 16:08:29 +02:00 committed by Alessandro Ros
parent 0535ab8e9c
commit fdd487f3c5
2 changed files with 18 additions and 18 deletions

View File

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

View File

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