owncast/video/state/state.go
Gabe Kangas b80ccc4966
WIP
2024-03-25 09:04:05 -07:00

36 lines
742 B
Go

package state
import (
"github.com/owncast/owncast/services/chat"
"github.com/owncast/owncast/services/metrics"
"github.com/owncast/owncast/services/status"
"github.com/owncast/owncast/utils"
"github.com/owncast/owncast/video/transcoder"
)
type VideoState struct {
transcoder *transcoder.Transcoder
metrics *metrics.Metrics
status *status.Status
lastNotified utils.NullTime
chatService *chat.Chat
}
func New() *VideoState {
return &VideoState{
transcoder: transcoder.Get(),
metrics: metrics.Get(),
status: status.Get(),
}
}
var temporaryGlobalInstance *VideoState
func Get() *VideoState {
if temporaryGlobalInstance == nil {
temporaryGlobalInstance = New()
}
return temporaryGlobalInstance
}