MCPcopy Create free account
hub / github.com/jetkvm/kvm / rpcSetVideoCodecPreference

Function rpcSetVideoCodecPreference

jsonrpc.go:206–216  ·  view source on GitHub ↗
(codec string)

Source from the content-addressed store, hash-verified

204}
205
206func rpcSetVideoCodecPreference(codec string) error {
207 if codec != "auto" && codec != "h265" && codec != "h264" {
208 return fmt.Errorf("invalid codec preference: %s (must be auto, h265, or h264)", codec)
209 }
210 logger.Info().Str("codec", codec).Msg("Setting video codec preference")
211 config.VideoCodecPreference = codec
212 if err := SaveConfig(); err != nil {
213 return fmt.Errorf("failed to save config: %w", err)
214 }
215 return nil
216}
217
218func rpcGetAutoUpdateState() (bool, error) {
219 return config.AutoUpdateEnabled, nil

Callers

nothing calls this directly

Calls 3

SaveConfigFunction · 0.85
ErrorfMethod · 0.80
InfoMethod · 0.80

Tested by

no test coverage detected