1
0
Fork 0
forked from External/mediamtx

rename 'external commands' into 'hooks' (#2400)

This commit is contained in:
Alessandro Ros 2023-09-23 12:49:08 +02:00 committed by GitHub
parent 3a7d86ec03
commit cadc6b3ea7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 7 deletions

View file

@ -54,7 +54,7 @@ And can be read from the server with:
* Query and control the server through the API
* Reload the configuration without disconnecting existing clients (hot reloading)
* Read Prometheus-compatible metrics
* Run external commands (hooks) when clients connect, disconnect, read or publish streams
* Run hooks (external commands) when clients connect, disconnect, read or publish streams
* Compatible with Linux, Windows and macOS, does not require any dependency or interpreter, it's a single executable
**Note about rtsp-simple-server**

View file

@ -320,7 +320,7 @@ components:
rpiCameraTextOverlay:
type: string
# External commands
# Hooks
runOnInit:
type: string
runOnInitRestart:

View file

@ -107,7 +107,7 @@ type PathConf struct {
RPICameraTextOverlayEnable bool `json:"rpiCameraTextOverlayEnable"`
RPICameraTextOverlay string `json:"rpiCameraTextOverlay"`
// External commands
// Hooks
RunOnInit string `json:"runOnInit"`
RunOnInitRestart bool `json:"runOnInitRestart"`
RunOnDemand string `json:"runOnDemand"`
@ -362,7 +362,7 @@ func (pconf *PathConf) check(conf *Conf, name string) error {
}
}
// External commands
// Hooks
if pconf.RunOnInit != "" && pconf.Regexp != nil {
return fmt.Errorf("a path with a regular expression does not support option 'runOnInit'; use another path")
@ -451,7 +451,7 @@ func (pconf *PathConf) UnmarshalJSON(b []byte) error {
pconf.RPICameraAfSpeed = "normal"
pconf.RPICameraTextOverlay = "%Y-%m-%d %H:%M:%S - MediaMTX"
// External commands
// Hooks
pconf.RunOnDemandStartTimeout = 10 * StringDuration(time.Second)
pconf.RunOnDemandCloseAfter = 10 * StringDuration(time.Second)

View file

@ -769,7 +769,7 @@ func (p *Core) closeResources(newConf *conf.Conf, calledByAPI bool) {
}
if newConf == nil && p.externalCmdPool != nil {
p.Log(logger.Info, "waiting for external commands")
p.Log(logger.Info, "waiting for running hooks")
p.externalCmdPool.Close()
}

View file

@ -448,7 +448,7 @@ paths:
rpiCameraTextOverlay: '%Y-%m-%d %H:%M:%S - MediaMTX'
###############################################
# External commands path settings
# Hooks path settings
# Command to run when this path is initialized.
# This can be used to publish a stream when the server is launched.