diff --git a/restream/app/process.go b/restream/app/process.go index 5e301c3..4791871 100644 --- a/restream/app/process.go +++ b/restream/app/process.go @@ -18,6 +18,23 @@ type ConfigIO struct { Cleanup []ConfigIOCleanup `json:"cleanup"` } +// ConfigWebRTC carries per-process WebRTC egress settings. +// +// When Enabled is true the restream manager will (via the app/webrtc +// subsystem) append an additional FFmpeg output leg that emits H.264/Opus +// RTP to a loopback UDP port the subsystem allocates. The subsystem reads +// that RTP and fans it out to WHEP subscribers. +type ConfigWebRTC struct { + Enabled bool `json:"enabled"` + VideoPT uint8 `json:"video_pt"` + AudioPT uint8 `json:"audio_pt"` + ForceTranscode bool `json:"force_transcode"` +} + +// Clone returns a deep copy of the WebRTC config (currently a value copy; +// provided for symmetry with other Clone methods and future-proofing). +func (w ConfigWebRTC) Clone() ConfigWebRTC { return w } + func (io ConfigIO) Clone() ConfigIO { clone := ConfigIO{ ID: io.ID, @@ -47,6 +64,7 @@ type Config struct { LimitCPU float64 `json:"limit_cpu_usage"` // percent LimitMemory uint64 `json:"limit_memory_bytes"` // bytes LimitWaitFor uint64 `json:"limit_waitfor_seconds"` // seconds + WebRTC ConfigWebRTC `json:"webrtc"` } func (config *Config) Clone() *Config { @@ -61,6 +79,7 @@ func (config *Config) Clone() *Config { LimitCPU: config.LimitCPU, LimitMemory: config.LimitMemory, LimitWaitFor: config.LimitWaitFor, + WebRTC: config.WebRTC.Clone(), } clone.Input = make([]ConfigIO, len(config.Input))