diff --git a/pkg/config/base.go b/pkg/config/base.go index b602c132..9677f47c 100644 --- a/pkg/config/base.go +++ b/pkg/config/base.go @@ -36,12 +36,13 @@ type BaseConfig struct { WsUrl string `yaml:"ws_url"` // (env LIVEKIT_WS_URL) // optional - Logging *logger.Config `yaml:"logging"` // logging config - TemplateBase string `yaml:"template_base"` // custom template base url - ClusterID string `yaml:"cluster_id"` // cluster this instance belongs to - EnableChromeSandbox bool `yaml:"enable_chrome_sandbox"` // enable Chrome sandbox, requires extra docker configuration - MaxUploadQueue int `yaml:"max_upload_queue"` // maximum upload queue size, in minutes - DisallowLocalStorage bool `yaml:"disallow_local_storage"` // require an upload config for all requests + Logging *logger.Config `yaml:"logging"` // logging config + TemplateBase string `yaml:"template_base"` // custom template base url + ClusterID string `yaml:"cluster_id"` // cluster this instance belongs to + EnableChromeSandbox bool `yaml:"enable_chrome_sandbox"` // enable Chrome sandbox, requires extra docker configuration + MaxUploadQueue int `yaml:"max_upload_queue"` // maximum upload queue size, in minutes + DisallowLocalStorage bool `yaml:"disallow_local_storage"` // require an upload config for all requests + EnableRoomCompositeSDKSource bool `yaml:"enable_room_composite_sdk_source"` // attempt to render supported audio only room composite use cases using the SDK source instead of Chrome SessionLimits `yaml:"session_limits"` // session duration limits StorageConfig *StorageConfig `yaml:"storage,omitempty"` // storage config diff --git a/pkg/config/pipeline.go b/pkg/config/pipeline.go index e3270a2e..6ff276db 100644 --- a/pkg/config/pipeline.go +++ b/pkg/config/pipeline.go @@ -193,7 +193,7 @@ func (p *PipelineConfig) Update(request *rpc.StartEgressRequest) error { } egress.RedactEncodedOutputs(clone) - p.SourceType = getRoomCompositeRequestType(req.RoomComposite) + p.SourceType = p.getRoomCompositeRequestType(req.RoomComposite) p.AwaitStartSignal = true p.Info.RoomName = req.RoomComposite.RoomName @@ -561,6 +561,24 @@ func (p *PipelineConfig) updateOutputType(compatibleAudioCodecs map[types.MimeTy return nil } +func (p *PipelineConfig) getRoomCompositeRequestType(req *livekit.RoomCompositeEgressRequest) types.SourceType { + // Test for possible chrome-less room composition for audio only + if !p.EnableRoomCompositeSDKSource { + return types.SourceTypeWeb + } + if req.Layout != "" { + return types.SourceTypeWeb + } + if !req.AudioOnly { + return types.SourceTypeWeb + } + if req.CustomBaseUrl != "" { + return types.SourceTypeWeb + } + + return types.SourceTypeSDK +} + // used for sdk input source func (p *PipelineConfig) UpdateInfoFromSDK(identifier string, replacements map[string]string, w, h uint32) error { for egressType, c := range p.Outputs { @@ -625,18 +643,3 @@ func stringReplace(s string, replacements map[string]string) string { } return s } - -func getRoomCompositeRequestType(req *livekit.RoomCompositeEgressRequest) types.SourceType { - // Test for possible chrome-less room composition for audio only - if req.Layout != "" { - return types.SourceTypeWeb - } - if !req.AudioOnly { - return types.SourceTypeWeb - } - if req.CustomBaseUrl != "" { - return types.SourceTypeWeb - } - - return types.SourceTypeSDK -}