display video worker status
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package playback
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Unit uint8
|
||||
|
||||
@@ -31,3 +34,35 @@ type Status struct {
|
||||
}
|
||||
|
||||
type StatusObserver func(Status)
|
||||
|
||||
func (u Unit) String() string {
|
||||
switch u {
|
||||
case UnitVideo:
|
||||
return "video"
|
||||
case UnitAudio:
|
||||
return "audio"
|
||||
case UnitSync:
|
||||
return "sync"
|
||||
default:
|
||||
return fmt.Sprintf("Unit(%d)", uint8(u))
|
||||
}
|
||||
}
|
||||
|
||||
func (s State) String() string {
|
||||
switch s {
|
||||
case StateIdle:
|
||||
return "idle"
|
||||
case StateConnecting:
|
||||
return "connecting"
|
||||
case StatePlaying:
|
||||
return "playing"
|
||||
case StateReconnecting:
|
||||
return "reconnecting"
|
||||
case StateFailed:
|
||||
return "failed"
|
||||
case StateStopping:
|
||||
return "stopping"
|
||||
default:
|
||||
return fmt.Sprintf("State(%d)", uint8(s))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user