mirror of https://bitbucket.org/ausocean/av.git
revid: not setting up pipeline until we start
This commit is contained in:
parent
0fd56675d5
commit
9769a3c4a9
|
@ -119,10 +119,6 @@ type Revid struct {
|
||||||
// an error if construction of the new instance was not successful.
|
// an error if construction of the new instance was not successful.
|
||||||
func New(c Config, ns *netsender.Sender) (*Revid, error) {
|
func New(c Config, ns *netsender.Sender) (*Revid, error) {
|
||||||
r := Revid{ns: ns, err: make(chan error)}
|
r := Revid{ns: ns, err: make(chan error)}
|
||||||
err := r.reset(c)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
go r.handleErrors()
|
go r.handleErrors()
|
||||||
return &r, nil
|
return &r, nil
|
||||||
}
|
}
|
||||||
|
@ -317,12 +313,17 @@ func (r *Revid) Start() error {
|
||||||
}
|
}
|
||||||
r.config.Logger.Log(logger.Info, pkg+"starting Revid")
|
r.config.Logger.Log(logger.Info, pkg+"starting Revid")
|
||||||
r.isRunning = true
|
r.isRunning = true
|
||||||
var err error
|
err := r.reset(r.config)
|
||||||
|
if err != nil {
|
||||||
|
r.Stop()
|
||||||
|
return err
|
||||||
|
}
|
||||||
r.closeInput, err = r.setupInput()
|
r.closeInput, err = r.setupInput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.Stop()
|
r.Stop()
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
return err
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop closes down the pipeline. This closes encoders and sender output routines,
|
// Stop closes down the pipeline. This closes encoders and sender output routines,
|
||||||
|
@ -543,7 +544,7 @@ func (r *Revid) Update(vars map[string]string) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
r.config.Logger.Log(logger.Info, pkg+"revid config changed", "config", fmt.Sprintf("%+v", r.config))
|
r.config.Logger.Log(logger.Info, pkg+"revid config changed", "config", fmt.Sprintf("%+v", r.config))
|
||||||
return r.reset(r.config)
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// startRaspivid sets up things for input from raspivid i.e. starts
|
// startRaspivid sets up things for input from raspivid i.e. starts
|
||||||
|
|
Loading…
Reference in New Issue