Skip to content

Commit

Permalink
preference
Browse files Browse the repository at this point in the history
  • Loading branch information
biglittlebigben committed Nov 26, 2024
1 parent 8219510 commit 0ab9791
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
13 changes: 7 additions & 6 deletions pkg/config/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
35 changes: 19 additions & 16 deletions pkg/config/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}

0 comments on commit 0ab9791

Please sign in to comment.