mirror of https://bitbucket.org/ausocean/av.git
revid/revid.go: moved revid.mu declaration
. Updated todo owner
This commit is contained in:
parent
d26aa8643a
commit
9bddf343f5
|
@ -120,10 +120,9 @@ type Revid struct {
|
|||
bitrate int
|
||||
|
||||
// isRunning is a loaded and cocked foot-gun.
|
||||
mu sync.Mutex
|
||||
isRunning bool
|
||||
|
||||
mu sync.Mutex
|
||||
|
||||
err chan error
|
||||
}
|
||||
|
||||
|
@ -192,7 +191,7 @@ func New(c Config, ns *netsender.Sender) (*Revid, error) {
|
|||
return &r, nil
|
||||
}
|
||||
|
||||
// TODO: put more thought into error severity
|
||||
// TODO(Saxon): put more thought into error severity.
|
||||
func (r *Revid) handleErrors() {
|
||||
for {
|
||||
err := <-r.err
|
||||
|
@ -319,7 +318,7 @@ func (r *Revid) reset(config Config) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// IsRunning returns whether the receiver is running.
|
||||
// IsRunning returns true if revid is running.
|
||||
func (r *Revid) IsRunning() bool {
|
||||
r.mu.Lock()
|
||||
ret := r.isRunning
|
||||
|
@ -327,6 +326,13 @@ func (r *Revid) IsRunning() bool {
|
|||
return ret
|
||||
}
|
||||
|
||||
// setIsRunning sets revid.isRunning using b.
|
||||
func (r *Revid) setIsRunning(b bool) {
|
||||
r.mu.Lock()
|
||||
r.isRunning = b
|
||||
r.mu.Unlock()
|
||||
}
|
||||
|
||||
// Start invokes a Revid to start processing video from a defined input
|
||||
// and packetising (if theres packetization) to a defined output.
|
||||
func (r *Revid) Start() error {
|
||||
|
@ -505,12 +511,6 @@ func (r *Revid) startRaspivid() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (r *Revid) setIsRunning(b bool) {
|
||||
r.mu.Lock()
|
||||
r.isRunning = b
|
||||
r.mu.Unlock()
|
||||
}
|
||||
|
||||
func (r *Revid) startV4L() error {
|
||||
const defaultVideo = "/dev/video0"
|
||||
|
||||
|
|
Loading…
Reference in New Issue