mirror of
https://github.com/datarhei/core.git
synced 2025-10-16 04:50:44 +08:00
Add support for date placeholder in process config
Because it doesn't make sense to replace the date placeholder at process creation, it has to be replaced at every start of the process. On process creation only the static placeholders (such as process ID) are replaced. Dynamic placeholders (so far only "date") are not replaced. On process start, a callback has been introduced that gives the chance to change the command line. This is the point where the restreamer replaces the date placeholders.
This commit is contained in:
@@ -32,9 +32,10 @@ type ProcessConfig struct {
|
||||
Reconnect bool
|
||||
ReconnectDelay time.Duration
|
||||
StaleTimeout time.Duration
|
||||
Command []string
|
||||
Args []string
|
||||
Parser process.Parser
|
||||
Logger log.Logger
|
||||
OnArgs func([]string) []string
|
||||
OnExit func()
|
||||
OnStart func()
|
||||
OnStateChange func(from, to string)
|
||||
@@ -113,12 +114,13 @@ func New(config Config) (FFmpeg, error) {
|
||||
func (f *ffmpeg) New(config ProcessConfig) (process.Process, error) {
|
||||
ffmpeg, err := process.New(process.Config{
|
||||
Binary: f.binary,
|
||||
Args: config.Command,
|
||||
Args: config.Args,
|
||||
Reconnect: config.Reconnect,
|
||||
ReconnectDelay: config.ReconnectDelay,
|
||||
StaleTimeout: config.StaleTimeout,
|
||||
Parser: config.Parser,
|
||||
Logger: config.Logger,
|
||||
OnArgs: config.OnArgs,
|
||||
OnStart: config.OnStart,
|
||||
OnExit: config.OnExit,
|
||||
OnStateChange: func(from, to string) {
|
||||
|
Reference in New Issue
Block a user