small optimizations + allow for users to force software H264 since it's not slow as balls
This commit is contained in:
@@ -494,10 +494,11 @@ var (
|
||||
statBlockRegions atomic.Int64
|
||||
statBlockFallbacks atomic.Int64
|
||||
|
||||
overrideQuality atomic.Int64
|
||||
overrideCodec atomic.Value
|
||||
h264WarnOnce sync.Once
|
||||
codecLogOnce sync.Once
|
||||
overrideQuality atomic.Int64
|
||||
overrideCodec atomic.Value
|
||||
desktopSoftwareH264 atomic.Bool
|
||||
h264WarnOnce sync.Once
|
||||
codecLogOnce sync.Once
|
||||
|
||||
prevMu sync.Mutex
|
||||
prevFrame *prevImage
|
||||
@@ -627,6 +628,19 @@ func RequestDesktopFullFrame() {
|
||||
RequestDesktopH264Keyframe()
|
||||
}
|
||||
|
||||
func SetDesktopSoftwareH264(enabled bool) {
|
||||
if desktopSoftwareH264.Swap(enabled) == enabled {
|
||||
return
|
||||
}
|
||||
resetH264Encoder()
|
||||
requestFullFrames(2)
|
||||
log.Printf("capture: desktop software h264 %v", enabled)
|
||||
}
|
||||
|
||||
func useDesktopSoftwareH264() bool {
|
||||
return desktopSoftwareH264.Load()
|
||||
}
|
||||
|
||||
func RequestHVNCFullFrame() {
|
||||
hvncPrevMu.Lock()
|
||||
hvncPrevFrame = nil
|
||||
|
||||
Reference in New Issue
Block a user