Browse Source

reorganize conf

pull/52/head v0.9.5
aler9 5 years ago
parent
commit
fb81ffc930
  1. 18
      conf.go
  2. 26
      rtsp-simple-server.yml

18
conf.go

@ -14,26 +14,26 @@ import (
type confPath struct { type confPath struct {
Source string `yaml:"source"` Source string `yaml:"source"`
sourceUrl *url.URL sourceUrl *url.URL ``
SourceProtocol string `yaml:"sourceProtocol"` SourceProtocol string `yaml:"sourceProtocol"`
sourceProtocolParsed gortsplib.StreamProtocol sourceProtocolParsed gortsplib.StreamProtocol ``
SourceOnDemand bool `yaml:"sourceOnDemand"` SourceOnDemand bool `yaml:"sourceOnDemand"`
RunOnDemand string `yaml:"runOnDemand"`
RunOnPublish string `yaml:"runOnPublish"`
RunOnRead string `yaml:"runOnRead"`
PublishUser string `yaml:"publishUser"` PublishUser string `yaml:"publishUser"`
PublishPass string `yaml:"publishPass"` PublishPass string `yaml:"publishPass"`
PublishIps []string `yaml:"publishIps"` PublishIps []string `yaml:"publishIps"`
publishIpsParsed []interface{} publishIpsParsed []interface{} ``
ReadUser string `yaml:"readUser"` ReadUser string `yaml:"readUser"`
ReadPass string `yaml:"readPass"` ReadPass string `yaml:"readPass"`
ReadIps []string `yaml:"readIps"` ReadIps []string `yaml:"readIps"`
readIpsParsed []interface{} readIpsParsed []interface{} ``
RunOnDemand string `yaml:"runOnDemand"`
RunOnPublish string `yaml:"runOnPublish"`
RunOnRead string `yaml:"runOnRead"`
} }
type conf struct { type conf struct {
Protocols []string `yaml:"protocols"` Protocols []string `yaml:"protocols"`
protocolsParsed map[gortsplib.StreamProtocol]struct{} protocolsParsed map[gortsplib.StreamProtocol]struct{} ``
RtspPort int `yaml:"rtspPort"` RtspPort int `yaml:"rtspPort"`
RtpPort int `yaml:"rtpPort"` RtpPort int `yaml:"rtpPort"`
RtcpPort int `yaml:"rtcpPort"` RtcpPort int `yaml:"rtcpPort"`
@ -41,7 +41,7 @@ type conf struct {
ReadTimeout time.Duration `yaml:"readTimeout"` ReadTimeout time.Duration `yaml:"readTimeout"`
WriteTimeout time.Duration `yaml:"writeTimeout"` WriteTimeout time.Duration `yaml:"writeTimeout"`
AuthMethods []string `yaml:"authMethods"` AuthMethods []string `yaml:"authMethods"`
authMethodsParsed []gortsplib.AuthMethod authMethodsParsed []gortsplib.AuthMethod ``
Pprof bool `yaml:"pprof"` Pprof bool `yaml:"pprof"`
Paths map[string]*confPath `yaml:"paths"` Paths map[string]*confPath `yaml:"paths"`
} }

26
rtsp-simple-server.yml

@ -34,6 +34,19 @@ paths:
# is connected, saving bandwidth # is connected, saving bandwidth
sourceOnDemand: no sourceOnDemand: no
# command to run when this path is requested.
# This can be used, for example, to publish a stream on demand.
# This is terminated with SIGINT when the path is not requested anymore.
runOnDemand:
# command to run when a client starts publishing.
# This is terminated with SIGINT when a client stops publishing.
runOnPublish:
# command to run when a clients starts reading.
# This is terminated with SIGINT when a client stops reading.
runOnRead:
# username required to publish # username required to publish
publishUser: publishUser:
# password required to publish # password required to publish
@ -47,16 +60,3 @@ paths:
readPass: readPass:
# IPs or networks (x.x.x.x/24) allowed to read # IPs or networks (x.x.x.x/24) allowed to read
readIps: [] readIps: []
# command to run when this path is requested.
# This can be used, for example, to publish a stream on demand.
# This is terminated with SIGINT when the path is not requested anymore.
runOnDemand:
# command to run when a client starts publishing.
# This is terminated with SIGINT when a client stops publishing.
runOnPublish:
# command to run when a clients starts reading.
# This is terminated with SIGINT when a client stops reading.
runOnRead:

Loading…
Cancel
Save