mirror of https://bitbucket.org/ausocean/av.git
device/raspivid: implement IsRunning method for raspivid
This commit is contained in:
parent
4c65173604
commit
25d68cf124
|
@ -112,6 +112,7 @@ type Raspivid struct {
|
||||||
out io.ReadCloser
|
out io.ReadCloser
|
||||||
log config.Logger
|
log config.Logger
|
||||||
done chan struct{}
|
done chan struct{}
|
||||||
|
isRunning bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// New returns a new Raspivid.
|
// New returns a new Raspivid.
|
||||||
|
@ -287,6 +288,7 @@ func (r *Raspivid) Start() error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("could not start raspivid command: %w", err)
|
return fmt.Errorf("could not start raspivid command: %w", err)
|
||||||
}
|
}
|
||||||
|
r.isRunning = true
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -310,11 +312,11 @@ func (r *Raspivid) Stop() error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("could not kill raspivid process: %w", err)
|
return fmt.Errorf("could not kill raspivid process: %w", err)
|
||||||
}
|
}
|
||||||
|
r.isRunning = false
|
||||||
return r.out.Close()
|
return r.out.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsRunning is used to determine if the pi's camera is running.
|
// IsRunning is used to determine if the pi's camera is running.
|
||||||
func (r *Raspivid) IsRunning() bool {
|
func (r *Raspivid) IsRunning() bool {
|
||||||
panic("not implemented")
|
return r.isRunning
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue